thirdweb 5.108.6 → 5.108.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +185 -99
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +210 -56
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js +233 -105
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +199 -36
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js +52 -0
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js +36 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js +58 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js +20 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js +34 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js +19 -147
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/types.js +3 -0
- package/dist/cjs/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js +115 -0
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +27 -306
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +21 -128
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/StepRunner.stories.js +13 -39
- package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +13 -101
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js +49 -0
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js +53 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +11 -79
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/fixtures.js +21 -62
- package/dist/cjs/stories/Bridge/fixtures.js.map +1 -1
- package/dist/cjs/stories/BuyWidget.stories.js +44 -8
- package/dist/cjs/stories/BuyWidget.stories.js.map +1 -1
- package/dist/cjs/stories/utils.js +5 -2
- package/dist/cjs/stories/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/x402/common.js +3 -5
- package/dist/cjs/x402/common.js.map +1 -1
- package/dist/cjs/x402/facilitator.js +3 -4
- package/dist/cjs/x402/facilitator.js.map +1 -1
- package/dist/cjs/x402/schemas.js +4 -0
- package/dist/cjs/x402/schemas.js.map +1 -1
- package/dist/cjs/x402/settle-payment.js +6 -5
- package/dist/cjs/x402/settle-payment.js.map +1 -1
- package/dist/cjs/x402/sign.js +2 -6
- package/dist/cjs/x402/sign.js.map +1 -1
- package/dist/cjs/x402/types.js.map +1 -1
- package/dist/cjs/x402/verify-payment.js +6 -5
- package/dist/cjs/x402/verify-payment.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +185 -99
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +211 -57
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/FundWallet.js +237 -109
- package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +198 -36
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js +49 -0
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js +33 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js +55 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js +17 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js +31 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js +16 -144
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/types.js +2 -0
- package/dist/esm/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js +112 -0
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js +28 -307
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +22 -129
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/StepRunner.stories.js +12 -38
- package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +14 -102
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js +46 -0
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js +50 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +12 -80
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/fixtures.js +15 -56
- package/dist/esm/stories/Bridge/fixtures.js.map +1 -1
- package/dist/esm/stories/BuyWidget.stories.js +37 -9
- package/dist/esm/stories/BuyWidget.stories.js.map +1 -1
- package/dist/esm/stories/utils.js +6 -3
- package/dist/esm/stories/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/x402/common.js +3 -5
- package/dist/esm/x402/common.js.map +1 -1
- package/dist/esm/x402/facilitator.js +3 -4
- package/dist/esm/x402/facilitator.js.map +1 -1
- package/dist/esm/x402/schemas.js +5 -1
- package/dist/esm/x402/schemas.js.map +1 -1
- package/dist/esm/x402/settle-payment.js +6 -5
- package/dist/esm/x402/settle-payment.js.map +1 -1
- package/dist/esm/x402/sign.js +2 -6
- package/dist/esm/x402/sign.js.map +1 -1
- package/dist/esm/x402/types.js.map +1 -1
- package/dist/esm/x402/verify-payment.js +6 -5
- package/dist/esm/x402/verify-payment.js.map +1 -1
- package/dist/scripts/bridge-widget.d.ts +3 -3
- package/dist/scripts/bridge-widget.js +113 -150
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +6 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts +1 -2
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +7 -12
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +5 -8
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +15 -12
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +33 -15
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +9 -12
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +7 -7
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +14 -7
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +3 -5
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +4 -3
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts +3 -3
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +4 -4
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts +6 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts +13 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +13 -11
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +8 -3
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +12 -16
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +6 -6
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/types.d.ts +39 -0
- package/dist/types/react/web/ui/Bridge/types.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +0 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +3 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyIcon.d.ts +1 -0
- package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/script-exports/bridge-widget-script.d.ts +3 -3
- package/dist/types/script-exports/bridge-widget-script.d.ts.map +1 -1
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts +25 -0
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +3 -47
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +3 -56
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +5 -63
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts +4 -52
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +4 -54
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts +11 -0
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts +18 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +3 -34
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/fixtures.d.ts +19 -17
- package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -1
- package/dist/types/stories/BuyWidget.stories.d.ts +9 -1
- package/dist/types/stories/BuyWidget.stories.d.ts.map +1 -1
- package/dist/types/stories/utils.d.ts +0 -2
- package/dist/types/stories/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/x402/common.d.ts.map +1 -1
- package/dist/types/x402/facilitator.d.ts +4 -5
- package/dist/types/x402/facilitator.d.ts.map +1 -1
- package/dist/types/x402/schemas.d.ts +21 -0
- package/dist/types/x402/schemas.d.ts.map +1 -1
- package/dist/types/x402/settle-payment.d.ts.map +1 -1
- package/dist/types/x402/types.d.ts +5 -4
- package/dist/types/x402/types.d.ts.map +1 -1
- package/dist/types/x402/verify-payment.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/react/core/hooks/transaction/useSendTransaction.ts +6 -0
- package/src/react/core/hooks/usePaymentMethods.ts +1 -4
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +355 -160
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +384 -107
- package/src/react/web/ui/Bridge/DirectPayment.tsx +34 -26
- package/src/react/web/ui/Bridge/FundWallet.tsx +610 -266
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +10 -20
- package/src/react/web/ui/Bridge/StepRunner.tsx +7 -7
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +35 -25
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +395 -71
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +3 -3
- package/src/react/web/ui/Bridge/bridge-widget/bridge-widget.tsx +16 -14
- package/src/react/web/ui/Bridge/common/WithHeader.tsx +13 -19
- package/src/react/web/ui/Bridge/common/active-wallet-details.tsx +103 -0
- package/src/react/web/ui/Bridge/common/decimal-input.tsx +61 -0
- package/src/react/web/ui/Bridge/common/selected-token-button.tsx +168 -0
- package/src/react/web/ui/Bridge/common/token-balance.tsx +23 -0
- package/src/react/web/ui/Bridge/common/token-query.ts +49 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +23 -14
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +36 -22
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +11 -22
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +1 -1
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +7 -8
- package/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +14 -12
- package/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx +19 -332
- package/src/react/web/ui/Bridge/types.ts +47 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +1 -5
- package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +5 -1
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +1 -2
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +44 -27
- package/src/react/web/ui/components/CopyIcon.tsx +11 -2
- package/src/script-exports/bridge-widget-script.tsx +3 -3
- package/src/script-exports/readme.md +1 -8
- package/src/stories/Bridge/CheckoutWidget.stories.tsx +147 -0
- package/src/stories/Bridge/ErrorBanner.stories.tsx +13 -138
- package/src/stories/Bridge/PaymentDetails.stories.tsx +34 -349
- package/src/stories/Bridge/PaymentSelection.stories.tsx +28 -156
- package/src/stories/Bridge/StepRunner.stories.tsx +18 -65
- package/src/stories/Bridge/SuccessScreen.stories.tsx +21 -130
- package/src/stories/Bridge/Transaction/TransactionWidget.stories.tsx +63 -0
- package/src/stories/Bridge/Transaction/useSendTransactionModal.stories.tsx +68 -0
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +19 -108
- package/src/stories/Bridge/fixtures.ts +36 -63
- package/src/stories/BuyWidget.stories.tsx +103 -8
- package/src/stories/utils.tsx +16 -9
- package/src/version.ts +1 -1
- package/src/x402/common.ts +2 -5
- package/src/x402/facilitator.ts +8 -8
- package/src/x402/schemas.ts +10 -0
- package/src/x402/settle-payment.ts +7 -6
- package/src/x402/sign.ts +3 -8
- package/src/x402/types.ts +5 -4
- package/src/x402/verify-payment.ts +7 -6
- package/dist/cjs/react/core/machines/paymentMachine.js +0 -191
- package/dist/cjs/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +0 -129
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +0 -258
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js +0 -222
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/FundWallet.stories.js +0 -201
- package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +0 -168
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/esm/react/core/machines/paymentMachine.js +0 -188
- package/dist/esm/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +0 -126
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +0 -255
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/DirectPayment.stories.js +0 -219
- package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/FundWallet.stories.js +0 -198
- package/dist/esm/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js +0 -165
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/types/react/core/machines/paymentMachine.d.ts +0 -89
- package/dist/types/react/core/machines/paymentMachine.d.ts.map +0 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +0 -99
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +0 -1
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +0 -97
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +0 -69
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts +0 -67
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +0 -60
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +0 -1
- package/src/react/core/machines/paymentMachine.test.ts +0 -519
- package/src/react/core/machines/paymentMachine.ts +0 -295
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +0 -425
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +0 -298
- package/src/stories/Bridge/DirectPayment.stories.tsx +0 -256
- package/src/stories/Bridge/FundWallet.stories.tsx +0 -227
- package/src/stories/Bridge/TransactionPayment.stories.tsx +0 -202
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useCallback, useMemo } from "react";
|
|
3
|
-
import type { TokenWithPrices } from "../../../../bridge/types/Token.js";
|
|
4
|
-
import type { ThirdwebClient } from "../../../../client/client.js";
|
|
5
|
-
import type { SupportedFiatCurrency } from "../../../../pay/convert/type.js";
|
|
6
|
-
import type { PurchaseData } from "../../../../pay/types.js";
|
|
7
|
-
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
|
8
|
-
import type { Address } from "../../../../utils/address.js";
|
|
9
|
-
import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
|
|
10
|
-
import type { Prettify } from "../../../../utils/type-utils.js";
|
|
11
|
-
import type {
|
|
12
|
-
BridgePrepareRequest,
|
|
13
|
-
BridgePrepareResult,
|
|
14
|
-
} from "../../../core/hooks/useBridgePrepare.js";
|
|
15
|
-
import type { CompletedStatusResult } from "../../../core/hooks/useStepExecutor.js";
|
|
16
|
-
import {
|
|
17
|
-
type PaymentMethod,
|
|
18
|
-
usePaymentMachine,
|
|
19
|
-
} from "../../../core/machines/paymentMachine.js";
|
|
20
|
-
import type { SupportedTokens } from "../../../core/utils/defaultTokens.js";
|
|
21
|
-
import { webWindowAdapter } from "../../adapters/WindowAdapter.js";
|
|
22
|
-
import en from "../ConnectWallet/locale/en.js";
|
|
23
|
-
import type { ConnectLocale } from "../ConnectWallet/locale/types.js";
|
|
24
|
-
import { Container } from "../components/basic.js";
|
|
25
|
-
import type { PayEmbedConnectOptions } from "../PayEmbed.js";
|
|
26
|
-
import { ExecutingTxScreen } from "../TransactionButton/ExecutingScreen.js";
|
|
27
|
-
import { DirectPayment } from "./DirectPayment.js";
|
|
28
|
-
import { ErrorBanner } from "./ErrorBanner.js";
|
|
29
|
-
import { FundWallet } from "./FundWallet.js";
|
|
30
|
-
import { PaymentDetails } from "./payment-details/PaymentDetails.js";
|
|
31
|
-
import { PaymentSelection } from "./payment-selection/PaymentSelection.js";
|
|
32
|
-
import { SuccessScreen } from "./payment-success/SuccessScreen.js";
|
|
33
|
-
import { QuoteLoader } from "./QuoteLoader.js";
|
|
34
|
-
import { StepRunner } from "./StepRunner.js";
|
|
35
|
-
import { TransactionPayment } from "./TransactionPayment.js";
|
|
36
|
-
|
|
37
|
-
export type UIOptions = Prettify<
|
|
38
|
-
{
|
|
39
|
-
metadata?: {
|
|
40
|
-
title?: string;
|
|
41
|
-
description?: string;
|
|
42
|
-
image?: string;
|
|
43
|
-
};
|
|
44
|
-
currency?: SupportedFiatCurrency;
|
|
45
|
-
buttonLabel?: string;
|
|
46
|
-
} & (
|
|
47
|
-
| {
|
|
48
|
-
mode: "fund_wallet";
|
|
49
|
-
destinationToken: TokenWithPrices;
|
|
50
|
-
initialAmount?: string;
|
|
51
|
-
presetOptions?: [number, number, number];
|
|
52
|
-
}
|
|
53
|
-
| {
|
|
54
|
-
mode: "direct_payment";
|
|
55
|
-
paymentInfo: {
|
|
56
|
-
sellerAddress: Address;
|
|
57
|
-
token: TokenWithPrices;
|
|
58
|
-
amount: string;
|
|
59
|
-
feePayer?: "sender" | "receiver";
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
| { mode: "transaction"; transaction: PreparedTransaction }
|
|
63
|
-
)
|
|
64
|
-
>;
|
|
65
|
-
|
|
66
|
-
export interface BridgeOrchestratorProps {
|
|
67
|
-
/**
|
|
68
|
-
* UI configuration and mode
|
|
69
|
-
*/
|
|
70
|
-
uiOptions: UIOptions;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* The receiver address, defaults to the connected wallet address
|
|
74
|
-
*/
|
|
75
|
-
receiverAddress: Address | undefined;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* ThirdwebClient for blockchain interactions
|
|
79
|
-
*/
|
|
80
|
-
client: ThirdwebClient;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Called when the flow is completed successfully
|
|
84
|
-
*/
|
|
85
|
-
onComplete: (quote: BridgePrepareResult) => void;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Called when the flow encounters an error
|
|
89
|
-
*/
|
|
90
|
-
onError: (error: Error, quote: BridgePrepareResult | undefined) => void;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Called when the user cancels the flow
|
|
94
|
-
*/
|
|
95
|
-
onCancel: (quote: BridgePrepareResult | undefined) => void;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Connect options for wallet connection
|
|
99
|
-
*/
|
|
100
|
-
connectOptions: PayEmbedConnectOptions | undefined;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Locale for connect UI
|
|
104
|
-
*/
|
|
105
|
-
connectLocale: ConnectLocale | undefined;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Optional purchase data for the payment
|
|
109
|
-
*/
|
|
110
|
-
purchaseData?: PurchaseData;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Optional payment link ID for the payment
|
|
114
|
-
*/
|
|
115
|
-
paymentLinkId: string | undefined;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Quick buy amounts
|
|
119
|
-
*/
|
|
120
|
-
presetOptions: [number, number, number] | undefined;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Allowed payment methods
|
|
124
|
-
* @default ["crypto", "card"]
|
|
125
|
-
*/
|
|
126
|
-
paymentMethods?: ("crypto" | "card")[];
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
|
|
130
|
-
*/
|
|
131
|
-
country: string | undefined;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Whether to show thirdweb branding in the widget.
|
|
135
|
-
* @default true
|
|
136
|
-
*/
|
|
137
|
-
showThirdwebBranding?: boolean;
|
|
138
|
-
supportedTokens?: SupportedTokens;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export function BridgeOrchestrator({
|
|
142
|
-
client,
|
|
143
|
-
uiOptions,
|
|
144
|
-
receiverAddress,
|
|
145
|
-
onComplete,
|
|
146
|
-
onError,
|
|
147
|
-
onCancel,
|
|
148
|
-
connectOptions,
|
|
149
|
-
connectLocale,
|
|
150
|
-
purchaseData,
|
|
151
|
-
paymentLinkId,
|
|
152
|
-
presetOptions,
|
|
153
|
-
paymentMethods = ["crypto", "card"],
|
|
154
|
-
showThirdwebBranding = true,
|
|
155
|
-
supportedTokens,
|
|
156
|
-
country = "US",
|
|
157
|
-
}: BridgeOrchestratorProps) {
|
|
158
|
-
// Initialize adapters
|
|
159
|
-
const adapters = useMemo(
|
|
160
|
-
() => ({
|
|
161
|
-
storage: webLocalStorage,
|
|
162
|
-
window: webWindowAdapter,
|
|
163
|
-
}),
|
|
164
|
-
[],
|
|
165
|
-
);
|
|
166
|
-
|
|
167
|
-
// Create modified connect options with branding setting
|
|
168
|
-
const modifiedConnectOptions = useMemo(() => {
|
|
169
|
-
if (!connectOptions) return undefined;
|
|
170
|
-
return {
|
|
171
|
-
...connectOptions,
|
|
172
|
-
connectModal: {
|
|
173
|
-
...connectOptions.connectModal,
|
|
174
|
-
showThirdwebBranding,
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
}, [connectOptions, showThirdwebBranding]);
|
|
178
|
-
|
|
179
|
-
// Use the payment machine hook
|
|
180
|
-
const [state, send] = usePaymentMachine(adapters, uiOptions.mode);
|
|
181
|
-
|
|
182
|
-
// Handle buy completion
|
|
183
|
-
const handleDoneOrContinueClick = useCallback(() => {
|
|
184
|
-
if (uiOptions.mode === "transaction") {
|
|
185
|
-
send({ type: "CONTINUE_TO_TRANSACTION" });
|
|
186
|
-
} else {
|
|
187
|
-
send({ type: "RESET" });
|
|
188
|
-
}
|
|
189
|
-
}, [send, uiOptions.mode]);
|
|
190
|
-
|
|
191
|
-
// Handle post-buy transaction completion
|
|
192
|
-
const handlePostBuyTransactionComplete = useCallback(() => {
|
|
193
|
-
send({ type: "RESET" });
|
|
194
|
-
}, [send]);
|
|
195
|
-
|
|
196
|
-
// Handle errors
|
|
197
|
-
const handleError = useCallback(
|
|
198
|
-
(error: Error) => {
|
|
199
|
-
console.error(error);
|
|
200
|
-
onError?.(error, state.context.quote);
|
|
201
|
-
send({ error, type: "ERROR_OCCURRED" });
|
|
202
|
-
},
|
|
203
|
-
[onError, send, state.context.quote],
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
// Handle payment method selection
|
|
207
|
-
const handlePaymentMethodSelected = useCallback(
|
|
208
|
-
(paymentMethod: PaymentMethod) => {
|
|
209
|
-
send({ paymentMethod, type: "PAYMENT_METHOD_SELECTED" });
|
|
210
|
-
},
|
|
211
|
-
[send],
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
// Handle quote received
|
|
215
|
-
const handleQuoteReceived = useCallback(
|
|
216
|
-
(quote: BridgePrepareResult, request: BridgePrepareRequest) => {
|
|
217
|
-
send({ quote, request, type: "QUOTE_RECEIVED" });
|
|
218
|
-
},
|
|
219
|
-
[send],
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
// Handle route confirmation
|
|
223
|
-
const handleRouteConfirmed = useCallback(() => {
|
|
224
|
-
send({ type: "ROUTE_CONFIRMED" });
|
|
225
|
-
}, [send]);
|
|
226
|
-
|
|
227
|
-
// Handle execution complete
|
|
228
|
-
const handleExecutionComplete = useCallback(
|
|
229
|
-
(
|
|
230
|
-
completedStatuses: CompletedStatusResult[],
|
|
231
|
-
quote: BridgePrepareResult,
|
|
232
|
-
) => {
|
|
233
|
-
send({ completedStatuses, type: "EXECUTION_COMPLETE" });
|
|
234
|
-
if (uiOptions.mode !== "transaction") {
|
|
235
|
-
onComplete?.(quote);
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
[send, onComplete, uiOptions.mode],
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
// Handle retry
|
|
242
|
-
const handleRetry = useCallback(() => {
|
|
243
|
-
send({ type: "RETRY" });
|
|
244
|
-
}, [send]);
|
|
245
|
-
|
|
246
|
-
const quote = state.context.quote;
|
|
247
|
-
|
|
248
|
-
// Handle requirements resolved from FundWallet and DirectPayment
|
|
249
|
-
const handleRequirementsResolved = useCallback(
|
|
250
|
-
(amount: string, token: TokenWithPrices, receiverAddress: Address) => {
|
|
251
|
-
send({
|
|
252
|
-
destinationAmount: amount,
|
|
253
|
-
destinationToken: token,
|
|
254
|
-
receiverAddress,
|
|
255
|
-
type: "DESTINATION_CONFIRMED",
|
|
256
|
-
});
|
|
257
|
-
},
|
|
258
|
-
[send],
|
|
259
|
-
);
|
|
260
|
-
|
|
261
|
-
return (
|
|
262
|
-
<Container flex="column" fullHeight>
|
|
263
|
-
{/* Error Banner */}
|
|
264
|
-
{state.value === "error" && state.context.currentError && (
|
|
265
|
-
<ErrorBanner
|
|
266
|
-
client={client}
|
|
267
|
-
error={state.context.currentError}
|
|
268
|
-
onCancel={() => {
|
|
269
|
-
send({ type: "RESET" });
|
|
270
|
-
onCancel?.(quote);
|
|
271
|
-
}}
|
|
272
|
-
onRetry={handleRetry}
|
|
273
|
-
/>
|
|
274
|
-
)}
|
|
275
|
-
|
|
276
|
-
{/* Render current screen based on state */}
|
|
277
|
-
{state.value === "init" && uiOptions.mode === "fund_wallet" && (
|
|
278
|
-
<FundWallet
|
|
279
|
-
client={client}
|
|
280
|
-
connectOptions={modifiedConnectOptions}
|
|
281
|
-
onContinue={handleRequirementsResolved}
|
|
282
|
-
presetOptions={presetOptions}
|
|
283
|
-
receiverAddress={receiverAddress}
|
|
284
|
-
showThirdwebBranding={showThirdwebBranding}
|
|
285
|
-
uiOptions={uiOptions}
|
|
286
|
-
/>
|
|
287
|
-
)}
|
|
288
|
-
|
|
289
|
-
{state.value === "init" && uiOptions.mode === "direct_payment" && (
|
|
290
|
-
<DirectPayment
|
|
291
|
-
client={client}
|
|
292
|
-
onContinue={handleRequirementsResolved}
|
|
293
|
-
showThirdwebBranding={showThirdwebBranding}
|
|
294
|
-
uiOptions={uiOptions}
|
|
295
|
-
/>
|
|
296
|
-
)}
|
|
297
|
-
|
|
298
|
-
{state.value === "init" && uiOptions.mode === "transaction" && (
|
|
299
|
-
<TransactionPayment
|
|
300
|
-
client={client}
|
|
301
|
-
connectOptions={modifiedConnectOptions}
|
|
302
|
-
onContinue={handleRequirementsResolved}
|
|
303
|
-
onExecuteTransaction={() => send({ type: "CONTINUE_TO_TRANSACTION" })}
|
|
304
|
-
showThirdwebBranding={showThirdwebBranding}
|
|
305
|
-
uiOptions={uiOptions}
|
|
306
|
-
/>
|
|
307
|
-
)}
|
|
308
|
-
|
|
309
|
-
{state.value === "methodSelection" &&
|
|
310
|
-
state.context.destinationToken &&
|
|
311
|
-
state.context.destinationAmount &&
|
|
312
|
-
state.context.receiverAddress && (
|
|
313
|
-
<PaymentSelection
|
|
314
|
-
client={client}
|
|
315
|
-
connectLocale={connectLocale || en}
|
|
316
|
-
connectOptions={modifiedConnectOptions}
|
|
317
|
-
destinationAmount={state.context.destinationAmount}
|
|
318
|
-
destinationToken={state.context.destinationToken}
|
|
319
|
-
feePayer={
|
|
320
|
-
uiOptions.mode === "direct_payment"
|
|
321
|
-
? uiOptions.paymentInfo.feePayer
|
|
322
|
-
: undefined
|
|
323
|
-
}
|
|
324
|
-
includeDestinationToken={uiOptions.mode !== "fund_wallet"}
|
|
325
|
-
onBack={() => {
|
|
326
|
-
send({ type: "BACK" });
|
|
327
|
-
}}
|
|
328
|
-
onError={handleError}
|
|
329
|
-
onPaymentMethodSelected={handlePaymentMethodSelected}
|
|
330
|
-
paymentMethods={paymentMethods}
|
|
331
|
-
receiverAddress={state.context.receiverAddress}
|
|
332
|
-
currency={uiOptions.currency}
|
|
333
|
-
supportedTokens={supportedTokens}
|
|
334
|
-
country={country}
|
|
335
|
-
/>
|
|
336
|
-
)}
|
|
337
|
-
|
|
338
|
-
{state.value === "quote" &&
|
|
339
|
-
state.context.selectedPaymentMethod &&
|
|
340
|
-
state.context.receiverAddress &&
|
|
341
|
-
state.context.destinationToken &&
|
|
342
|
-
state.context.destinationAmount && (
|
|
343
|
-
<QuoteLoader
|
|
344
|
-
amount={state.context.destinationAmount}
|
|
345
|
-
client={client}
|
|
346
|
-
destinationToken={state.context.destinationToken}
|
|
347
|
-
onBack={() => {
|
|
348
|
-
send({ type: "BACK" });
|
|
349
|
-
}}
|
|
350
|
-
onError={handleError}
|
|
351
|
-
onQuoteReceived={handleQuoteReceived}
|
|
352
|
-
paymentLinkId={paymentLinkId}
|
|
353
|
-
paymentMethod={state.context.selectedPaymentMethod}
|
|
354
|
-
purchaseData={purchaseData}
|
|
355
|
-
receiver={state.context.receiverAddress}
|
|
356
|
-
uiOptions={uiOptions}
|
|
357
|
-
/>
|
|
358
|
-
)}
|
|
359
|
-
|
|
360
|
-
{state.value === "preview" &&
|
|
361
|
-
state.context.selectedPaymentMethod &&
|
|
362
|
-
state.context.quote && (
|
|
363
|
-
<PaymentDetails
|
|
364
|
-
client={client}
|
|
365
|
-
onBack={() => {
|
|
366
|
-
send({ type: "BACK" });
|
|
367
|
-
}}
|
|
368
|
-
onConfirm={handleRouteConfirmed}
|
|
369
|
-
onError={handleError}
|
|
370
|
-
paymentMethod={state.context.selectedPaymentMethod}
|
|
371
|
-
preparedQuote={state.context.quote}
|
|
372
|
-
uiOptions={uiOptions}
|
|
373
|
-
/>
|
|
374
|
-
)}
|
|
375
|
-
|
|
376
|
-
{state.value === "execute" && quote && state.context.request && (
|
|
377
|
-
<StepRunner
|
|
378
|
-
preparedQuote={quote}
|
|
379
|
-
autoStart={true}
|
|
380
|
-
client={client}
|
|
381
|
-
onBack={() => {
|
|
382
|
-
send({ type: "BACK" });
|
|
383
|
-
}}
|
|
384
|
-
onCancel={() => {
|
|
385
|
-
onCancel(quote);
|
|
386
|
-
}}
|
|
387
|
-
onComplete={(completedStatuses) => {
|
|
388
|
-
handleExecutionComplete(completedStatuses, quote);
|
|
389
|
-
}}
|
|
390
|
-
request={state.context.request}
|
|
391
|
-
wallet={state.context.selectedPaymentMethod?.payerWallet}
|
|
392
|
-
windowAdapter={webWindowAdapter}
|
|
393
|
-
/>
|
|
394
|
-
)}
|
|
395
|
-
|
|
396
|
-
{state.value === "success" &&
|
|
397
|
-
quote &&
|
|
398
|
-
state.context.completedStatuses && (
|
|
399
|
-
<SuccessScreen
|
|
400
|
-
client={client}
|
|
401
|
-
completedStatuses={state.context.completedStatuses}
|
|
402
|
-
onDone={handleDoneOrContinueClick}
|
|
403
|
-
preparedQuote={quote}
|
|
404
|
-
uiOptions={uiOptions}
|
|
405
|
-
windowAdapter={webWindowAdapter}
|
|
406
|
-
hasPaymentId={!!paymentLinkId}
|
|
407
|
-
/>
|
|
408
|
-
)}
|
|
409
|
-
|
|
410
|
-
{state.value === "post-buy-transaction" &&
|
|
411
|
-
uiOptions.mode === "transaction" &&
|
|
412
|
-
quote &&
|
|
413
|
-
uiOptions.transaction && (
|
|
414
|
-
<ExecutingTxScreen
|
|
415
|
-
closeModal={handlePostBuyTransactionComplete}
|
|
416
|
-
onTxSent={() => {
|
|
417
|
-
onComplete?.(quote);
|
|
418
|
-
}}
|
|
419
|
-
tx={uiOptions.transaction}
|
|
420
|
-
windowAdapter={webWindowAdapter}
|
|
421
|
-
/>
|
|
422
|
-
)}
|
|
423
|
-
</Container>
|
|
424
|
-
);
|
|
425
|
-
}
|