File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed
packages/thirdweb/src/react/web/ui/Bridge Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Respect feePayer property in Payment widgets
Original file line number Diff line number Diff line change @@ -292,7 +292,6 @@ export function BridgeOrchestrator({
292292 amount = { state . context . destinationAmount }
293293 client = { client }
294294 destinationToken = { state . context . destinationToken }
295- mode = { uiOptions . mode }
296295 onBack = { ( ) => {
297296 send ( { type : "BACK" } ) ;
298297 } }
@@ -302,6 +301,7 @@ export function BridgeOrchestrator({
302301 paymentMethod = { state . context . selectedPaymentMethod }
303302 purchaseData = { purchaseData }
304303 receiver = { state . context . receiverAddress }
304+ uiOptions = { uiOptions }
305305 />
306306 ) }
307307
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { Container } from "../components/basic.js";
1717import { Spacer } from "../components/Spacer.js" ;
1818import { Spinner } from "../components/Spinner.js" ;
1919import { Text } from "../components/text.js" ;
20+ import type { UIOptions } from "./BridgeOrchestrator.js" ;
2021
2122interface QuoteLoaderProps {
2223 /**
@@ -78,14 +79,13 @@ interface QuoteLoaderProps {
7879 paymentLinkId ?: string ;
7980
8081 /**
81- * Fee payer for direct transfers (defaults to sender)
82+ * UI options
8283 */
83- feePayer ?: "sender" | "receiver" ;
84- mode : "fund_wallet" | "direct_payment" | "transaction" ;
84+ uiOptions : UIOptions ;
8585}
8686
8787export function QuoteLoader ( {
88- mode ,
88+ uiOptions ,
8989 destinationToken,
9090 paymentMethod,
9191 amount,
@@ -96,10 +96,14 @@ export function QuoteLoader({
9696 onError,
9797 purchaseData,
9898 paymentLinkId,
99- feePayer,
10099} : QuoteLoaderProps ) {
101100 // For now, we'll use a simple buy operation
102101 // This will be expanded to handle different bridge types based on the payment method
102+ const feePayer =
103+ uiOptions . mode === "direct_payment"
104+ ? uiOptions . paymentInfo . feePayer
105+ : undefined ;
106+ const mode = uiOptions . mode ;
103107 const request : BridgePrepareRequest = getBridgeParams ( {
104108 amount,
105109 client,
You can’t perform that action at this time.
0 commit comments