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,10 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import
|
|
3
|
-
import type { PaymentMethod } from "../../react/
|
|
4
|
-
import {
|
|
5
|
-
PaymentDetails,
|
|
6
|
-
type PaymentDetailsProps,
|
|
7
|
-
} from "../../react/web/ui/Bridge/payment-details/PaymentDetails.js";
|
|
2
|
+
import { PaymentDetails } from "../../react/web/ui/Bridge/payment-details/PaymentDetails.js";
|
|
3
|
+
import type { PaymentMethod } from "../../react/web/ui/Bridge/types.js";
|
|
8
4
|
import { stringify } from "../../utils/json.js";
|
|
9
5
|
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
|
10
6
|
import {
|
|
@@ -17,7 +13,6 @@ import {
|
|
|
17
13
|
simpleBuyQuote,
|
|
18
14
|
simpleOnrampQuote,
|
|
19
15
|
TRANSACTION_UI_OPTIONS,
|
|
20
|
-
USDC,
|
|
21
16
|
} from "./fixtures.js";
|
|
22
17
|
|
|
23
18
|
const fiatPaymentMethod: PaymentMethod = {
|
|
@@ -63,324 +58,92 @@ const ethCryptoPaymentMethod: PaymentMethod = JSON.parse(
|
|
|
63
58
|
}),
|
|
64
59
|
);
|
|
65
60
|
|
|
66
|
-
|
|
67
|
-
interface PaymentDetailsWithThemeProps extends PaymentDetailsProps {
|
|
68
|
-
theme: "light" | "dark" | Theme;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Wrapper component to provide theme context
|
|
72
|
-
const PaymentDetailsWithTheme = (props: PaymentDetailsWithThemeProps) => {
|
|
73
|
-
const { theme, ...componentProps } = props;
|
|
74
|
-
return (
|
|
75
|
-
<ModalThemeWrapper theme={theme}>
|
|
76
|
-
<PaymentDetails {...componentProps} />
|
|
77
|
-
</ModalThemeWrapper>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const meta = {
|
|
61
|
+
const meta: Meta<typeof PaymentDetails> = {
|
|
82
62
|
args: {
|
|
83
63
|
onBack: () => {},
|
|
84
64
|
onConfirm: () => {},
|
|
85
65
|
onError: (error) => console.error("Error:", error),
|
|
86
66
|
preparedQuote: simpleOnrampQuote,
|
|
87
|
-
|
|
88
|
-
uiOptions: {
|
|
89
|
-
destinationToken: USDC,
|
|
67
|
+
modeInfo: {
|
|
90
68
|
mode: "fund_wallet",
|
|
91
69
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
onError: { action: "error occurred" },
|
|
97
|
-
theme: {
|
|
98
|
-
control: "select",
|
|
99
|
-
description: "Theme for the component",
|
|
100
|
-
options: ["light", "dark"],
|
|
70
|
+
currency: "USD",
|
|
71
|
+
metadata: {
|
|
72
|
+
title: undefined,
|
|
73
|
+
description: undefined,
|
|
101
74
|
},
|
|
75
|
+
client: storyClient,
|
|
76
|
+
confirmButtonLabel: undefined,
|
|
102
77
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
tags: ["autodocs"],
|
|
114
|
-
title: "Bridge/PaymentDetails",
|
|
115
|
-
} satisfies Meta<typeof PaymentDetailsWithTheme>;
|
|
78
|
+
decorators: [
|
|
79
|
+
(Story) => (
|
|
80
|
+
<ModalThemeWrapper>
|
|
81
|
+
<Story />
|
|
82
|
+
</ModalThemeWrapper>
|
|
83
|
+
),
|
|
84
|
+
],
|
|
85
|
+
component: PaymentDetails,
|
|
86
|
+
title: "Bridge/screens/PaymentDetails",
|
|
87
|
+
};
|
|
116
88
|
|
|
117
89
|
export default meta;
|
|
118
90
|
type Story = StoryObj<typeof meta>;
|
|
119
91
|
|
|
120
92
|
export const OnrampSimple: Story = {
|
|
121
93
|
args: {
|
|
122
|
-
client: storyClient,
|
|
123
94
|
paymentMethod: fiatPaymentMethod,
|
|
124
95
|
preparedQuote: simpleOnrampQuote,
|
|
125
|
-
theme: "dark",
|
|
126
|
-
},
|
|
127
|
-
parameters: {
|
|
128
|
-
backgrounds: { default: "dark" },
|
|
129
|
-
docs: {
|
|
130
|
-
description: {
|
|
131
|
-
story:
|
|
132
|
-
"Simple onramp quote with no extra steps - direct fiat to crypto.",
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
export const OnrampSimpleLight: Story = {
|
|
139
|
-
args: {
|
|
140
|
-
client: storyClient,
|
|
141
|
-
paymentMethod: fiatPaymentMethod,
|
|
142
|
-
preparedQuote: simpleOnrampQuote,
|
|
143
|
-
theme: "light",
|
|
144
|
-
},
|
|
145
|
-
parameters: {
|
|
146
|
-
backgrounds: { default: "light" },
|
|
147
|
-
docs: {
|
|
148
|
-
description: {
|
|
149
|
-
story: "Simple onramp quote with no extra steps (light theme).",
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
96
|
},
|
|
153
97
|
};
|
|
154
98
|
|
|
155
99
|
export const OnrampSimpleDirectPayment: Story = {
|
|
156
100
|
args: {
|
|
157
|
-
client: storyClient,
|
|
158
|
-
paymentMethod: fiatPaymentMethod,
|
|
159
|
-
preparedQuote: simpleOnrampQuote,
|
|
160
|
-
theme: "dark",
|
|
161
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.credits,
|
|
162
|
-
},
|
|
163
|
-
parameters: {
|
|
164
|
-
backgrounds: { default: "dark" },
|
|
165
|
-
docs: {
|
|
166
|
-
description: {
|
|
167
|
-
story:
|
|
168
|
-
"Simple onramp quote with no extra steps - direct fiat to crypto.",
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
export const OnrampSimpleLightDirectPayment: Story = {
|
|
175
|
-
args: {
|
|
176
|
-
client: storyClient,
|
|
177
101
|
paymentMethod: fiatPaymentMethod,
|
|
178
102
|
preparedQuote: simpleOnrampQuote,
|
|
179
|
-
|
|
180
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.concertTicket,
|
|
181
|
-
},
|
|
182
|
-
parameters: {
|
|
183
|
-
backgrounds: { default: "light" },
|
|
184
|
-
docs: {
|
|
185
|
-
description: {
|
|
186
|
-
story: "Simple onramp quote with no extra steps (light theme).",
|
|
187
|
-
},
|
|
188
|
-
},
|
|
103
|
+
...DIRECT_PAYMENT_UI_OPTIONS.credits,
|
|
189
104
|
},
|
|
190
105
|
};
|
|
191
106
|
|
|
192
107
|
export const OnrampWithSwaps: Story = {
|
|
193
108
|
args: {
|
|
194
|
-
client: storyClient,
|
|
195
|
-
paymentMethod: fiatPaymentMethod,
|
|
196
|
-
preparedQuote: onrampWithSwapsQuote,
|
|
197
|
-
theme: "dark",
|
|
198
|
-
},
|
|
199
|
-
parameters: {
|
|
200
|
-
backgrounds: { default: "dark" },
|
|
201
|
-
docs: {
|
|
202
|
-
description: {
|
|
203
|
-
story:
|
|
204
|
-
"Onramp quote with 2 additional swap steps after the fiat purchase.",
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export const OnrampWithSwapsLight: Story = {
|
|
211
|
-
args: {
|
|
212
|
-
client: storyClient,
|
|
213
109
|
paymentMethod: fiatPaymentMethod,
|
|
214
110
|
preparedQuote: onrampWithSwapsQuote,
|
|
215
|
-
theme: "light",
|
|
216
|
-
},
|
|
217
|
-
parameters: {
|
|
218
|
-
backgrounds: { default: "light" },
|
|
219
|
-
docs: {
|
|
220
|
-
description: {
|
|
221
|
-
story: "Onramp quote with 2 additional swap steps (light theme).",
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
111
|
},
|
|
225
112
|
};
|
|
226
113
|
|
|
227
114
|
export const BuySimple: Story = {
|
|
228
115
|
args: {
|
|
229
|
-
client: storyClient,
|
|
230
|
-
paymentMethod: ethCryptoPaymentMethod,
|
|
231
|
-
preparedQuote: simpleBuyQuote,
|
|
232
|
-
theme: "dark",
|
|
233
|
-
},
|
|
234
|
-
parameters: {
|
|
235
|
-
backgrounds: { default: "dark" },
|
|
236
|
-
docs: {
|
|
237
|
-
description: {
|
|
238
|
-
story:
|
|
239
|
-
"Simple buy quote with a single transaction (no approval needed).",
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export const BuySimpleLight: Story = {
|
|
246
|
-
args: {
|
|
247
|
-
client: storyClient,
|
|
248
116
|
paymentMethod: ethCryptoPaymentMethod,
|
|
249
117
|
preparedQuote: simpleBuyQuote,
|
|
250
|
-
theme: "light",
|
|
251
|
-
},
|
|
252
|
-
parameters: {
|
|
253
|
-
backgrounds: { default: "light" },
|
|
254
|
-
docs: {
|
|
255
|
-
description: {
|
|
256
|
-
story: "Simple buy quote with a single transaction (light theme).",
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
118
|
},
|
|
260
119
|
};
|
|
261
120
|
|
|
262
121
|
export const BuySimpleDirectPayment: Story = {
|
|
263
122
|
args: {
|
|
264
|
-
client: storyClient,
|
|
265
123
|
paymentMethod: ethCryptoPaymentMethod,
|
|
266
124
|
preparedQuote: simpleBuyQuote,
|
|
267
|
-
|
|
268
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
269
|
-
},
|
|
270
|
-
parameters: {
|
|
271
|
-
backgrounds: { default: "dark" },
|
|
272
|
-
docs: {
|
|
273
|
-
description: {
|
|
274
|
-
story:
|
|
275
|
-
"Simple buy quote with a single transaction (no approval needed).",
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
export const BuySimpleLightDirectPayment: Story = {
|
|
282
|
-
args: {
|
|
283
|
-
client: storyClient,
|
|
284
|
-
paymentMethod: ethCryptoPaymentMethod,
|
|
285
|
-
preparedQuote: simpleBuyQuote,
|
|
286
|
-
theme: "light",
|
|
287
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.subscription,
|
|
288
|
-
},
|
|
289
|
-
parameters: {
|
|
290
|
-
backgrounds: { default: "light" },
|
|
291
|
-
docs: {
|
|
292
|
-
description: {
|
|
293
|
-
story: "Simple buy quote with a single transaction (light theme).",
|
|
294
|
-
},
|
|
295
|
-
},
|
|
125
|
+
...DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
296
126
|
},
|
|
297
127
|
};
|
|
298
128
|
|
|
299
129
|
export const BuyWithLongText: Story = {
|
|
300
130
|
args: {
|
|
301
|
-
client: storyClient,
|
|
302
131
|
paymentMethod: ethCryptoPaymentMethod,
|
|
303
132
|
preparedQuote: longTextBuyQuote,
|
|
304
|
-
theme: "dark",
|
|
305
|
-
},
|
|
306
|
-
parameters: {
|
|
307
|
-
backgrounds: { default: "dark" },
|
|
308
|
-
docs: {
|
|
309
|
-
description: {
|
|
310
|
-
story: "Simple buy quote with a single transaction (light theme).",
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
133
|
},
|
|
314
134
|
};
|
|
315
135
|
|
|
316
136
|
export const BuyWithApproval: Story = {
|
|
317
137
|
args: {
|
|
318
|
-
client: storyClient,
|
|
319
|
-
paymentMethod: cryptoPaymentMethod,
|
|
320
|
-
preparedQuote: buyWithApprovalQuote,
|
|
321
|
-
theme: "dark",
|
|
322
|
-
},
|
|
323
|
-
parameters: {
|
|
324
|
-
backgrounds: { default: "dark" },
|
|
325
|
-
docs: {
|
|
326
|
-
description: {
|
|
327
|
-
story:
|
|
328
|
-
"Buy quote requiring both approval and buy transactions in a single step.",
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
export const BuyWithApprovalLight: Story = {
|
|
335
|
-
args: {
|
|
336
|
-
client: storyClient,
|
|
337
138
|
paymentMethod: cryptoPaymentMethod,
|
|
338
139
|
preparedQuote: buyWithApprovalQuote,
|
|
339
|
-
theme: "light",
|
|
340
|
-
},
|
|
341
|
-
parameters: {
|
|
342
|
-
backgrounds: { default: "light" },
|
|
343
|
-
docs: {
|
|
344
|
-
description: {
|
|
345
|
-
story: "Buy quote with approval and buy transactions (light theme).",
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
140
|
},
|
|
349
141
|
};
|
|
350
142
|
|
|
351
143
|
export const BuyComplex: Story = {
|
|
352
144
|
args: {
|
|
353
|
-
client: storyClient,
|
|
354
|
-
paymentMethod: ethCryptoPaymentMethod,
|
|
355
|
-
preparedQuote: complexBuyQuote,
|
|
356
|
-
theme: "dark",
|
|
357
|
-
},
|
|
358
|
-
parameters: {
|
|
359
|
-
backgrounds: { default: "dark" },
|
|
360
|
-
docs: {
|
|
361
|
-
description: {
|
|
362
|
-
story:
|
|
363
|
-
"Complex buy quote with 3 steps, each requiring approval and execution transactions across multiple chains.",
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
export const BuyComplexLight: Story = {
|
|
370
|
-
args: {
|
|
371
|
-
client: storyClient,
|
|
372
145
|
paymentMethod: ethCryptoPaymentMethod,
|
|
373
146
|
preparedQuote: complexBuyQuote,
|
|
374
|
-
theme: "light",
|
|
375
|
-
},
|
|
376
|
-
parameters: {
|
|
377
|
-
backgrounds: { default: "light" },
|
|
378
|
-
docs: {
|
|
379
|
-
description: {
|
|
380
|
-
story:
|
|
381
|
-
"Complex multi-step buy quote spanning multiple chains (light theme).",
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
147
|
},
|
|
385
148
|
};
|
|
386
149
|
|
|
@@ -388,114 +151,36 @@ export const BuyComplexLight: Story = {
|
|
|
388
151
|
|
|
389
152
|
export const TransactionEthTransfer: Story = {
|
|
390
153
|
args: {
|
|
391
|
-
client: storyClient,
|
|
392
|
-
paymentMethod: ethCryptoPaymentMethod,
|
|
393
|
-
preparedQuote: simpleBuyQuote,
|
|
394
|
-
theme: "dark",
|
|
395
|
-
uiOptions: TRANSACTION_UI_OPTIONS.ethTransfer,
|
|
396
|
-
},
|
|
397
|
-
parameters: {
|
|
398
|
-
backgrounds: { default: "dark" },
|
|
399
|
-
docs: {
|
|
400
|
-
description: {
|
|
401
|
-
story:
|
|
402
|
-
"Transaction mode showing ETH transfer payment details with function name and contract information displayed in the PaymentDetails screen.",
|
|
403
|
-
},
|
|
404
|
-
},
|
|
405
|
-
},
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
export const TransactionEthTransferLight: Story = {
|
|
409
|
-
args: {
|
|
410
|
-
client: storyClient,
|
|
411
154
|
paymentMethod: ethCryptoPaymentMethod,
|
|
412
155
|
preparedQuote: simpleBuyQuote,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
parameters: {
|
|
417
|
-
backgrounds: { default: "light" },
|
|
418
|
-
docs: {
|
|
419
|
-
description: {
|
|
420
|
-
story:
|
|
421
|
-
"Light theme version of transaction mode for ETH transfer with detailed payment overview.",
|
|
422
|
-
},
|
|
156
|
+
modeInfo: {
|
|
157
|
+
mode: "transaction",
|
|
158
|
+
transaction: TRANSACTION_UI_OPTIONS.ethTransfer.transaction,
|
|
423
159
|
},
|
|
160
|
+
...TRANSACTION_UI_OPTIONS.ethTransfer,
|
|
424
161
|
},
|
|
425
162
|
};
|
|
426
163
|
|
|
427
164
|
export const TransactionERC20Transfer: Story = {
|
|
428
165
|
args: {
|
|
429
|
-
client: storyClient,
|
|
430
|
-
paymentMethod: cryptoPaymentMethod,
|
|
431
|
-
preparedQuote: simpleBuyQuote,
|
|
432
|
-
theme: "dark",
|
|
433
|
-
uiOptions: TRANSACTION_UI_OPTIONS.erc20Transfer,
|
|
434
|
-
},
|
|
435
|
-
parameters: {
|
|
436
|
-
backgrounds: { default: "dark" },
|
|
437
|
-
docs: {
|
|
438
|
-
description: {
|
|
439
|
-
story:
|
|
440
|
-
"Transaction mode for ERC20 token transfer showing token details and transfer function in payment preview.",
|
|
441
|
-
},
|
|
442
|
-
},
|
|
443
|
-
},
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
export const TransactionERC20TransferLight: Story = {
|
|
447
|
-
args: {
|
|
448
|
-
client: storyClient,
|
|
449
166
|
paymentMethod: cryptoPaymentMethod,
|
|
450
167
|
preparedQuote: simpleBuyQuote,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
parameters: {
|
|
455
|
-
backgrounds: { default: "light" },
|
|
456
|
-
docs: {
|
|
457
|
-
description: {
|
|
458
|
-
story:
|
|
459
|
-
"Light theme version of ERC20 token transfer transaction mode with payment details.",
|
|
460
|
-
},
|
|
168
|
+
modeInfo: {
|
|
169
|
+
mode: "transaction",
|
|
170
|
+
transaction: TRANSACTION_UI_OPTIONS.erc20Transfer.transaction,
|
|
461
171
|
},
|
|
172
|
+
...TRANSACTION_UI_OPTIONS.erc20Transfer,
|
|
462
173
|
},
|
|
463
174
|
};
|
|
464
175
|
|
|
465
176
|
export const TransactionContractInteraction: Story = {
|
|
466
177
|
args: {
|
|
467
|
-
client: storyClient,
|
|
468
|
-
paymentMethod: ethCryptoPaymentMethod,
|
|
469
|
-
preparedQuote: simpleBuyQuote,
|
|
470
|
-
theme: "dark",
|
|
471
|
-
uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
|
|
472
|
-
},
|
|
473
|
-
parameters: {
|
|
474
|
-
backgrounds: { default: "dark" },
|
|
475
|
-
docs: {
|
|
476
|
-
description: {
|
|
477
|
-
story:
|
|
478
|
-
"Transaction mode for complex contract interaction (claimTo function) showing detailed contract information and function details in payment preview.",
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
export const TransactionContractInteractionLight: Story = {
|
|
485
|
-
args: {
|
|
486
|
-
client: storyClient,
|
|
487
178
|
paymentMethod: ethCryptoPaymentMethod,
|
|
488
179
|
preparedQuote: simpleBuyQuote,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
parameters: {
|
|
493
|
-
backgrounds: { default: "light" },
|
|
494
|
-
docs: {
|
|
495
|
-
description: {
|
|
496
|
-
story:
|
|
497
|
-
"Light theme version of contract interaction transaction mode with comprehensive payment details.",
|
|
498
|
-
},
|
|
180
|
+
modeInfo: {
|
|
181
|
+
mode: "transaction",
|
|
182
|
+
transaction: TRANSACTION_UI_OPTIONS.contractInteraction.transaction,
|
|
499
183
|
},
|
|
184
|
+
...TRANSACTION_UI_OPTIONS.contractInteraction,
|
|
500
185
|
},
|
|
501
186
|
};
|
|
@@ -1,178 +1,50 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
PaymentSelection,
|
|
5
|
-
type PaymentSelectionProps,
|
|
6
|
-
} from "../../react/web/ui/Bridge/payment-selection/PaymentSelection.js";
|
|
2
|
+
import { PaymentSelection } from "../../react/web/ui/Bridge/payment-selection/PaymentSelection.js";
|
|
7
3
|
import en from "../../react/web/ui/ConnectWallet/locale/en.js";
|
|
8
4
|
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
|
9
|
-
import {
|
|
5
|
+
import { USDC } from "./fixtures.js";
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
interface PaymentSelectionWithThemeProps extends PaymentSelectionProps {
|
|
13
|
-
theme: "light" | "dark" | Theme;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Wrapper component to provide theme context
|
|
17
|
-
const PaymentSelectionWithTheme = (props: PaymentSelectionWithThemeProps) => {
|
|
18
|
-
const { theme, ...componentProps } = props;
|
|
19
|
-
return (
|
|
20
|
-
<ModalThemeWrapper theme={theme}>
|
|
21
|
-
<PaymentSelection {...componentProps} />
|
|
22
|
-
</ModalThemeWrapper>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const meta = {
|
|
7
|
+
const meta: Meta<typeof PaymentSelection> = {
|
|
27
8
|
args: {
|
|
28
9
|
client: storyClient,
|
|
10
|
+
onBack: () => {
|
|
11
|
+
alert("Back");
|
|
12
|
+
},
|
|
29
13
|
connectLocale: en,
|
|
30
14
|
destinationAmount: "1",
|
|
31
15
|
destinationToken: USDC,
|
|
32
16
|
onError: (error) => console.error("Error:", error),
|
|
33
|
-
onPaymentMethodSelected: (
|
|
34
|
-
theme: "dark",
|
|
17
|
+
onPaymentMethodSelected: () => {},
|
|
35
18
|
country: "US",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
description: "Called when an error occurs during the flow",
|
|
54
|
-
},
|
|
55
|
-
onPaymentMethodSelected: {
|
|
56
|
-
action: "payment method selected",
|
|
57
|
-
description: "Called when user selects a wallet token or fiat provider",
|
|
58
|
-
},
|
|
59
|
-
theme: {
|
|
60
|
-
control: "select",
|
|
61
|
-
description: "Theme for the component",
|
|
62
|
-
options: ["light", "dark"],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
component: PaymentSelectionWithTheme,
|
|
66
|
-
parameters: {
|
|
67
|
-
docs: {
|
|
68
|
-
description: {
|
|
69
|
-
component:
|
|
70
|
-
"Payment method selection screen with a 2-step flow:\n\n" +
|
|
71
|
-
"**Step 1:** Choose payment method - shows connected wallets, connect wallet option, and pay with fiat option\n\n" +
|
|
72
|
-
"**Step 2a:** If wallet selected - shows available origin tokens for bridging to the destination token (fetches real routes data from the Bridge API)\n\n" +
|
|
73
|
-
"**Step 2b:** If fiat selected - shows onramp provider options (Coinbase, Stripe, Transak)\n\n" +
|
|
74
|
-
"The component intelligently manages wallet context and provides proper error handling for each step.",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
layout: "centered",
|
|
78
|
-
},
|
|
79
|
-
tags: ["autodocs"],
|
|
80
|
-
title: "Bridge/PaymentSelection",
|
|
81
|
-
} satisfies Meta<typeof PaymentSelectionWithTheme>;
|
|
19
|
+
connectOptions: undefined,
|
|
20
|
+
currency: "USD",
|
|
21
|
+
paymentMethods: ["crypto", "card"],
|
|
22
|
+
receiverAddress: "0x0000000000000000000000000000000000000000",
|
|
23
|
+
feePayer: undefined,
|
|
24
|
+
supportedTokens: undefined,
|
|
25
|
+
},
|
|
26
|
+
decorators: [
|
|
27
|
+
(Story) => (
|
|
28
|
+
<ModalThemeWrapper>
|
|
29
|
+
<Story />
|
|
30
|
+
</ModalThemeWrapper>
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
component: PaymentSelection,
|
|
34
|
+
title: "Bridge/screens/PaymentSelection",
|
|
35
|
+
};
|
|
82
36
|
|
|
83
37
|
export default meta;
|
|
84
38
|
type Story = StoryObj<typeof meta>;
|
|
85
39
|
|
|
86
|
-
export const
|
|
87
|
-
args: {
|
|
88
|
-
theme: "light",
|
|
89
|
-
},
|
|
90
|
-
parameters: {
|
|
91
|
-
backgrounds: { default: "light" },
|
|
92
|
-
docs: {
|
|
93
|
-
description: {
|
|
94
|
-
story:
|
|
95
|
-
"Light theme version showing the initial wallet selection step. Click on a connected wallet to see token selection, or click 'Pay with Fiat' to see provider selection.",
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export const Dark: Story = {
|
|
40
|
+
export const OnlyCryptoMethodEnabled: Story = {
|
|
102
41
|
args: {
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
parameters: {
|
|
106
|
-
backgrounds: { default: "dark" },
|
|
107
|
-
docs: {
|
|
108
|
-
description: {
|
|
109
|
-
story:
|
|
110
|
-
"Dark theme version of the payment selection flow. The component starts with wallet selection and provides navigation through the 2-step process.",
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const WithBackButton: Story = {
|
|
117
|
-
args: {
|
|
118
|
-
onBack: () => {},
|
|
119
|
-
theme: "dark",
|
|
120
|
-
},
|
|
121
|
-
parameters: {
|
|
122
|
-
backgrounds: { default: "dark" },
|
|
123
|
-
docs: {
|
|
124
|
-
description: {
|
|
125
|
-
story:
|
|
126
|
-
"Version with a back button in the header. The back behavior changes based on the current step - Step 1 calls onBack, Steps 2a/2b return to Step 1.",
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const WithBackButtonLight: Story = {
|
|
133
|
-
args: {
|
|
134
|
-
onBack: () => {},
|
|
135
|
-
theme: "light",
|
|
136
|
-
},
|
|
137
|
-
parameters: {
|
|
138
|
-
backgrounds: { default: "light" },
|
|
139
|
-
docs: {
|
|
140
|
-
description: {
|
|
141
|
-
story:
|
|
142
|
-
"Light theme version with back button functionality. Demonstrates the navigation flow between steps.",
|
|
143
|
-
},
|
|
144
|
-
},
|
|
42
|
+
paymentMethods: ["crypto"],
|
|
145
43
|
},
|
|
146
44
|
};
|
|
147
45
|
|
|
148
|
-
export const
|
|
46
|
+
export const OnlyFiatMethodEnabled: Story = {
|
|
149
47
|
args: {
|
|
150
|
-
|
|
151
|
-
theme: "dark",
|
|
152
|
-
},
|
|
153
|
-
parameters: {
|
|
154
|
-
backgrounds: { default: "dark" },
|
|
155
|
-
docs: {
|
|
156
|
-
description: {
|
|
157
|
-
story:
|
|
158
|
-
"Example with a different destination token (UNI). This will show different available origin tokens in Step 2a when a wallet is selected.",
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
export const LargeAmount: Story = {
|
|
165
|
-
args: {
|
|
166
|
-
destinationAmount: "1000",
|
|
167
|
-
theme: "dark",
|
|
168
|
-
},
|
|
169
|
-
parameters: {
|
|
170
|
-
backgrounds: { default: "dark" },
|
|
171
|
-
docs: {
|
|
172
|
-
description: {
|
|
173
|
-
story:
|
|
174
|
-
"Example with a larger destination amount (1000 USDC). This may affect which origin tokens are available based on user balances.",
|
|
175
|
-
},
|
|
176
|
-
},
|
|
48
|
+
paymentMethods: ["card"],
|
|
177
49
|
},
|
|
178
50
|
};
|