Skip to content

Commit c570dd9

Browse files
committed
fix: adds onExecuteTransaction to TransactionPayment
1 parent 52d1ba3 commit c570dd9

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export type UIOptions = Prettify<
6363
)
6464
>;
6565

66-
export interface BridgeOrchestratorProps {
66+
interface BridgeOrchestratorProps {
6767
/**
6868
* UI configuration and mode
6969
*/
@@ -288,7 +288,7 @@ export function BridgeOrchestrator({
288288
client={client}
289289
connectOptions={modifiedConnectOptions}
290290
onContinue={handleRequirementsResolved}
291-
sendEvent={send}
291+
onExecuteTransaction={() => send({ type: "CONTINUE_TO_TRANSACTION" })}
292292
showThirdwebBranding={showThirdwebBranding}
293293
uiOptions={uiOptions}
294294
/>

packages/thirdweb/src/react/web/ui/Bridge/TransactionPayment.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { useChainMetadata } from "../../../core/hooks/others/useChainQuery.js";
2020
import { useTransactionDetails } from "../../../core/hooks/useTransactionDetails.js";
2121
import { useActiveAccount } from "../../../core/hooks/wallets/useActiveAccount.js";
2222
import { useActiveWallet } from "../../../core/hooks/wallets/useActiveWallet.js";
23-
import type { PaymentMachineEvent } from "../../../core/machines/paymentMachine.js";
2423
import { ConnectButton } from "../ConnectWallet/ConnectButton.js";
2524
import { PoweredByThirdweb } from "../ConnectWallet/PoweredByTW.js";
2625
import { Container, Line } from "../components/basic.js";
@@ -50,9 +49,9 @@ export interface TransactionPaymentProps {
5049
onContinue: (amount: string, token: Token, receiverAddress: Address) => void;
5150

5251
/**
53-
* Send arbitrary payment events for UI flow control
52+
* Request to execute the transaction immediately (skips funding flow)
5453
*/
55-
sendEvent: (event: PaymentMachineEvent) => void;
54+
onExecuteTransaction: () => void;
5655

5756
/**
5857
* Connect options for wallet connection
@@ -70,7 +69,7 @@ export function TransactionPayment({
7069
uiOptions,
7170
client,
7271
onContinue,
73-
sendEvent,
72+
onExecuteTransaction,
7473
connectOptions,
7574
showThirdwebBranding = true,
7675
}: TransactionPaymentProps) {
@@ -391,9 +390,7 @@ export function TransactionPayment({
391390
Number(userBalance) >=
392391
Number(transactionDataQuery.data.totalCost)
393392
) {
394-
sendEvent({
395-
type: "CONTINUE_TO_TRANSACTION",
396-
});
393+
onExecuteTransaction();
397394
return;
398395
}
399396

0 commit comments

Comments
 (0)