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,298 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import type { Theme } from "../../react/core/design-system/index.js";
|
|
3
|
-
import {
|
|
4
|
-
BridgeOrchestrator,
|
|
5
|
-
type BridgeOrchestratorProps,
|
|
6
|
-
} from "../../react/web/ui/Bridge/BridgeOrchestrator.js";
|
|
7
|
-
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
|
8
|
-
import {
|
|
9
|
-
DIRECT_PAYMENT_UI_OPTIONS,
|
|
10
|
-
FUND_WALLET_UI_OPTIONS,
|
|
11
|
-
TRANSACTION_UI_OPTIONS,
|
|
12
|
-
} from "./fixtures.js";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* BridgeOrchestrator is the main orchestrator component for the Bridge payment flow.
|
|
16
|
-
* It manages the complete state machine navigation between different screens and
|
|
17
|
-
* handles the coordination of payment methods, routes, and execution.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
// Props interface for the wrapper component
|
|
21
|
-
interface BridgeOrchestratorWithThemeProps extends BridgeOrchestratorProps {
|
|
22
|
-
theme: "light" | "dark" | Theme;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Wrapper component to provide theme context
|
|
26
|
-
const BridgeOrchestratorWithTheme = (
|
|
27
|
-
props: BridgeOrchestratorWithThemeProps,
|
|
28
|
-
) => {
|
|
29
|
-
const { theme, ...componentProps } = props;
|
|
30
|
-
return (
|
|
31
|
-
<ModalThemeWrapper theme={theme}>
|
|
32
|
-
<BridgeOrchestrator {...componentProps} />
|
|
33
|
-
</ModalThemeWrapper>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const meta = {
|
|
38
|
-
args: {
|
|
39
|
-
client: storyClient,
|
|
40
|
-
onCancel: () => {},
|
|
41
|
-
onComplete: () => {},
|
|
42
|
-
onError: (error) => console.error("Bridge error:", error),
|
|
43
|
-
theme: "dark",
|
|
44
|
-
uiOptions: FUND_WALLET_UI_OPTIONS.usdcDefault,
|
|
45
|
-
country: "US",
|
|
46
|
-
},
|
|
47
|
-
argTypes: {
|
|
48
|
-
onCancel: { action: "flow cancelled" },
|
|
49
|
-
onComplete: { action: "flow completed" },
|
|
50
|
-
onError: { action: "error occurred" },
|
|
51
|
-
presetOptions: {
|
|
52
|
-
control: "object",
|
|
53
|
-
description: "Quick buy options",
|
|
54
|
-
},
|
|
55
|
-
theme: {
|
|
56
|
-
control: "select",
|
|
57
|
-
description: "Theme for the component",
|
|
58
|
-
options: ["light", "dark"],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
component: BridgeOrchestratorWithTheme,
|
|
62
|
-
parameters: {
|
|
63
|
-
docs: {
|
|
64
|
-
description: {
|
|
65
|
-
component:
|
|
66
|
-
"**BridgeOrchestrator** is the main orchestrator component that manages the complete Bridge payment flow using XState FSM.\n\n" +
|
|
67
|
-
"## Features\n" +
|
|
68
|
-
"- **State Machine Navigation**: Uses XState v5 for predictable state transitions\n" +
|
|
69
|
-
"- **Payment Method Selection**: Supports wallet and fiat payment methods\n" +
|
|
70
|
-
"- **Route Preview**: Shows detailed transaction steps and fees\n" +
|
|
71
|
-
"- **Step Execution**: Real-time progress tracking\n" +
|
|
72
|
-
"- **Error Handling**: Comprehensive error states with retry functionality\n" +
|
|
73
|
-
"- **Theme Support**: Works with both light and dark themes\n\n" +
|
|
74
|
-
"## State Flow\n" +
|
|
75
|
-
"1. **Resolve Requirements** → 2. **Method Selection** → 3. **Quote** → 4. **Preview** → 5. **Prepare** → 6. **Execute** → 7. **Success**\n\n" +
|
|
76
|
-
"Each state can transition to the **Error** state, which provides retry functionality.",
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
layout: "fullscreen",
|
|
80
|
-
},
|
|
81
|
-
tags: ["autodocs"],
|
|
82
|
-
title: "Bridge/BridgeOrchestrator",
|
|
83
|
-
} satisfies Meta<typeof BridgeOrchestratorWithTheme>;
|
|
84
|
-
|
|
85
|
-
export default meta;
|
|
86
|
-
type Story = StoryObj<typeof meta>;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Default BridgeOrchestrator in light theme.
|
|
90
|
-
*/
|
|
91
|
-
export const Light: Story = {
|
|
92
|
-
args: {
|
|
93
|
-
connectLocale: undefined,
|
|
94
|
-
connectOptions: undefined,
|
|
95
|
-
onCancel: undefined,
|
|
96
|
-
onComplete: undefined,
|
|
97
|
-
onError: undefined,
|
|
98
|
-
paymentLinkId: undefined,
|
|
99
|
-
presetOptions: undefined,
|
|
100
|
-
purchaseData: undefined,
|
|
101
|
-
receiverAddress: undefined,
|
|
102
|
-
theme: "light",
|
|
103
|
-
uiOptions: FUND_WALLET_UI_OPTIONS.usdcDefault,
|
|
104
|
-
},
|
|
105
|
-
parameters: {
|
|
106
|
-
backgrounds: { default: "light" },
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* BridgeOrchestrator in dark theme.
|
|
112
|
-
*/
|
|
113
|
-
export const Dark: Story = {
|
|
114
|
-
args: {
|
|
115
|
-
connectLocale: undefined,
|
|
116
|
-
connectOptions: undefined,
|
|
117
|
-
onCancel: undefined,
|
|
118
|
-
onComplete: undefined,
|
|
119
|
-
onError: undefined,
|
|
120
|
-
paymentLinkId: undefined,
|
|
121
|
-
presetOptions: undefined,
|
|
122
|
-
purchaseData: undefined,
|
|
123
|
-
receiverAddress: undefined,
|
|
124
|
-
theme: "dark",
|
|
125
|
-
uiOptions: FUND_WALLET_UI_OPTIONS.usdcDefault,
|
|
126
|
-
},
|
|
127
|
-
parameters: {
|
|
128
|
-
backgrounds: { default: "dark" },
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Direct payment mode for purchasing a specific product/service.
|
|
134
|
-
*/
|
|
135
|
-
export const DirectPayment: Story = {
|
|
136
|
-
args: {
|
|
137
|
-
connectLocale: undefined,
|
|
138
|
-
connectOptions: undefined,
|
|
139
|
-
onCancel: undefined,
|
|
140
|
-
onComplete: undefined,
|
|
141
|
-
onError: undefined,
|
|
142
|
-
paymentLinkId: undefined,
|
|
143
|
-
presetOptions: undefined,
|
|
144
|
-
purchaseData: undefined,
|
|
145
|
-
receiverAddress: undefined,
|
|
146
|
-
theme: "dark",
|
|
147
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
148
|
-
},
|
|
149
|
-
parameters: {
|
|
150
|
-
backgrounds: { default: "dark" },
|
|
151
|
-
docs: {
|
|
152
|
-
description: {
|
|
153
|
-
story:
|
|
154
|
-
"Direct payment mode shows a product purchase interface with the item image, price, seller address, and network information. The user can connect their wallet and proceed with the payment.",
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Direct payment mode in light theme.
|
|
162
|
-
*/
|
|
163
|
-
export const DirectPaymentLight: Story = {
|
|
164
|
-
args: {
|
|
165
|
-
connectLocale: undefined,
|
|
166
|
-
connectOptions: undefined,
|
|
167
|
-
onCancel: undefined,
|
|
168
|
-
onComplete: undefined,
|
|
169
|
-
onError: undefined,
|
|
170
|
-
paymentLinkId: undefined,
|
|
171
|
-
presetOptions: undefined,
|
|
172
|
-
purchaseData: undefined,
|
|
173
|
-
receiverAddress: undefined,
|
|
174
|
-
theme: "light",
|
|
175
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.concertTicket,
|
|
176
|
-
},
|
|
177
|
-
parameters: {
|
|
178
|
-
backgrounds: { default: "light" },
|
|
179
|
-
docs: {
|
|
180
|
-
description: {
|
|
181
|
-
story:
|
|
182
|
-
"Light theme version of direct payment mode, showing a different product example with USDC payment.",
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Transaction mode showing a complex contract interaction.
|
|
190
|
-
*/
|
|
191
|
-
export const Transaction: Story = {
|
|
192
|
-
args: {
|
|
193
|
-
connectLocale: undefined,
|
|
194
|
-
connectOptions: undefined,
|
|
195
|
-
onCancel: undefined,
|
|
196
|
-
onComplete: undefined,
|
|
197
|
-
onError: undefined,
|
|
198
|
-
paymentLinkId: undefined,
|
|
199
|
-
presetOptions: undefined,
|
|
200
|
-
purchaseData: undefined,
|
|
201
|
-
receiverAddress: undefined,
|
|
202
|
-
theme: "dark",
|
|
203
|
-
uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
|
|
204
|
-
},
|
|
205
|
-
parameters: {
|
|
206
|
-
backgrounds: { default: "dark" },
|
|
207
|
-
docs: {
|
|
208
|
-
description: {
|
|
209
|
-
story:
|
|
210
|
-
"Transaction mode showing a complex contract interaction (claimTo function) with function name extraction from contract ABI and detailed cost breakdown.",
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Transaction mode in light theme showing an ERC20 token transfer.
|
|
218
|
-
*/
|
|
219
|
-
export const TransactionLight: Story = {
|
|
220
|
-
args: {
|
|
221
|
-
connectLocale: undefined,
|
|
222
|
-
connectOptions: undefined,
|
|
223
|
-
onCancel: undefined,
|
|
224
|
-
onComplete: undefined,
|
|
225
|
-
onError: undefined,
|
|
226
|
-
paymentLinkId: undefined,
|
|
227
|
-
presetOptions: undefined,
|
|
228
|
-
purchaseData: undefined,
|
|
229
|
-
receiverAddress: undefined,
|
|
230
|
-
theme: "light",
|
|
231
|
-
uiOptions: TRANSACTION_UI_OPTIONS.erc20Transfer,
|
|
232
|
-
},
|
|
233
|
-
parameters: {
|
|
234
|
-
backgrounds: { default: "light" },
|
|
235
|
-
docs: {
|
|
236
|
-
description: {
|
|
237
|
-
story:
|
|
238
|
-
"Light theme version of transaction mode showing an ERC20 token transfer with proper token amount formatting and USD conversion.",
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Transaction mode in light theme showing an ERC20 token transfer.
|
|
246
|
-
*/
|
|
247
|
-
export const TransactionJPYCurrency: Story = {
|
|
248
|
-
args: {
|
|
249
|
-
connectLocale: undefined,
|
|
250
|
-
connectOptions: undefined,
|
|
251
|
-
onCancel: undefined,
|
|
252
|
-
onComplete: undefined,
|
|
253
|
-
onError: undefined,
|
|
254
|
-
paymentLinkId: undefined,
|
|
255
|
-
presetOptions: undefined,
|
|
256
|
-
purchaseData: undefined,
|
|
257
|
-
receiverAddress: undefined,
|
|
258
|
-
theme: "light",
|
|
259
|
-
uiOptions: {
|
|
260
|
-
...TRANSACTION_UI_OPTIONS.erc20Transfer,
|
|
261
|
-
currency: "JPY",
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
parameters: {
|
|
265
|
-
backgrounds: { default: "light" },
|
|
266
|
-
docs: {
|
|
267
|
-
description: {
|
|
268
|
-
story:
|
|
269
|
-
"Light theme version of transaction mode showing an ERC20 token transfer with proper token amount formatting and USD conversion.",
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export const CustompresetOptions: Story = {
|
|
276
|
-
args: {
|
|
277
|
-
connectLocale: undefined,
|
|
278
|
-
connectOptions: undefined,
|
|
279
|
-
onCancel: undefined,
|
|
280
|
-
onComplete: undefined,
|
|
281
|
-
onError: undefined,
|
|
282
|
-
paymentLinkId: undefined,
|
|
283
|
-
presetOptions: [1, 2, 3],
|
|
284
|
-
purchaseData: undefined,
|
|
285
|
-
receiverAddress: undefined,
|
|
286
|
-
theme: "dark",
|
|
287
|
-
uiOptions: FUND_WALLET_UI_OPTIONS.ethDefault,
|
|
288
|
-
},
|
|
289
|
-
parameters: {
|
|
290
|
-
backgrounds: { default: "dark" },
|
|
291
|
-
docs: {
|
|
292
|
-
description: {
|
|
293
|
-
story:
|
|
294
|
-
"Fund wallet mode with custom quick options showing ETH with [1, 2, 3] preset amounts.",
|
|
295
|
-
},
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
};
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import type { Theme } from "../../react/core/design-system/index.js";
|
|
3
|
-
import {
|
|
4
|
-
DirectPayment,
|
|
5
|
-
type DirectPaymentProps,
|
|
6
|
-
} from "../../react/web/ui/Bridge/DirectPayment.js";
|
|
7
|
-
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
|
8
|
-
import { DIRECT_PAYMENT_UI_OPTIONS } from "./fixtures.js";
|
|
9
|
-
|
|
10
|
-
// Props interface for the wrapper component
|
|
11
|
-
interface DirectPaymentWithThemeProps extends DirectPaymentProps {
|
|
12
|
-
theme: "light" | "dark" | Theme;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Wrapper component to provide theme context
|
|
16
|
-
const DirectPaymentWithTheme = (props: DirectPaymentWithThemeProps) => {
|
|
17
|
-
const { theme, ...componentProps } = props;
|
|
18
|
-
return (
|
|
19
|
-
<ModalThemeWrapper theme={theme}>
|
|
20
|
-
<DirectPayment {...componentProps} />
|
|
21
|
-
</ModalThemeWrapper>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const meta = {
|
|
26
|
-
args: {
|
|
27
|
-
client: storyClient,
|
|
28
|
-
onContinue: (_amount, _token, _receiverAddress) => {},
|
|
29
|
-
theme: "dark",
|
|
30
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
31
|
-
},
|
|
32
|
-
argTypes: {
|
|
33
|
-
onContinue: {
|
|
34
|
-
action: "continue clicked",
|
|
35
|
-
description: "Called when user continues with the payment",
|
|
36
|
-
},
|
|
37
|
-
theme: {
|
|
38
|
-
control: "select",
|
|
39
|
-
description: "Theme for the component",
|
|
40
|
-
options: ["light", "dark"],
|
|
41
|
-
},
|
|
42
|
-
uiOptions: {
|
|
43
|
-
description:
|
|
44
|
-
"UI configuration for direct payment mode including payment info and metadata",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
component: DirectPaymentWithTheme,
|
|
48
|
-
parameters: {
|
|
49
|
-
docs: {
|
|
50
|
-
description: {
|
|
51
|
-
component:
|
|
52
|
-
"DirectPayment component displays a product/service purchase interface with payment details.\n\n" +
|
|
53
|
-
"## Features\n" +
|
|
54
|
-
"- **Product Display**: Shows product name, image, and pricing\n" +
|
|
55
|
-
"- **Payment Details**: Token amount, network information, and seller address\n" +
|
|
56
|
-
"- **Wallet Integration**: Connect button or continue with active wallet\n" +
|
|
57
|
-
"- **Responsive Design**: Adapts to different screen sizes and themes\n" +
|
|
58
|
-
"- **Fee Configuration**: Support for sender or receiver paying fees\n\n" +
|
|
59
|
-
"This component is used in the 'direct_payment' mode of BridgeOrchestrator for purchasing specific items or services. It now accepts uiOptions directly to configure payment info and metadata.",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
layout: "centered",
|
|
63
|
-
},
|
|
64
|
-
tags: ["autodocs"],
|
|
65
|
-
title: "Bridge/DirectPayment",
|
|
66
|
-
} satisfies Meta<typeof DirectPaymentWithTheme>;
|
|
67
|
-
|
|
68
|
-
export default meta;
|
|
69
|
-
type Story = StoryObj<typeof meta>;
|
|
70
|
-
|
|
71
|
-
export const DigitalArt: Story = {
|
|
72
|
-
args: {
|
|
73
|
-
theme: "dark",
|
|
74
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
75
|
-
},
|
|
76
|
-
parameters: {
|
|
77
|
-
backgrounds: { default: "dark" },
|
|
78
|
-
docs: {
|
|
79
|
-
description: {
|
|
80
|
-
story:
|
|
81
|
-
"Example of purchasing a digital art NFT with ETH payment. Shows the product image, pricing in ETH, and seller information with sender paying fees.",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export const DigitalArtLight: Story = {
|
|
88
|
-
args: {
|
|
89
|
-
theme: "light",
|
|
90
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.digitalArt,
|
|
91
|
-
},
|
|
92
|
-
parameters: {
|
|
93
|
-
backgrounds: { default: "light" },
|
|
94
|
-
docs: {
|
|
95
|
-
description: {
|
|
96
|
-
story: "Light theme version of the digital art purchase interface.",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const ConcertTicket: Story = {
|
|
103
|
-
args: {
|
|
104
|
-
theme: "dark",
|
|
105
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.concertTicket,
|
|
106
|
-
},
|
|
107
|
-
parameters: {
|
|
108
|
-
backgrounds: { default: "dark" },
|
|
109
|
-
docs: {
|
|
110
|
-
description: {
|
|
111
|
-
story:
|
|
112
|
-
"Example of purchasing a concert ticket with USDC payment. Shows different product type, stable token pricing, and receiver paying fees.",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const ConcertTicketLight: Story = {
|
|
119
|
-
args: {
|
|
120
|
-
theme: "light",
|
|
121
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.concertTicket,
|
|
122
|
-
},
|
|
123
|
-
parameters: {
|
|
124
|
-
backgrounds: { default: "light" },
|
|
125
|
-
docs: {
|
|
126
|
-
description: {
|
|
127
|
-
story: "Light theme version of the concert ticket purchase.",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export const SubscriptionService: Story = {
|
|
134
|
-
args: {
|
|
135
|
-
theme: "dark",
|
|
136
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.subscription,
|
|
137
|
-
},
|
|
138
|
-
parameters: {
|
|
139
|
-
backgrounds: { default: "dark" },
|
|
140
|
-
docs: {
|
|
141
|
-
description: {
|
|
142
|
-
story:
|
|
143
|
-
"Example of a subscription service payment with detailed description. Shows how the component works for recurring service payments with comprehensive product information.",
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const SubscriptionServiceLight: Story = {
|
|
150
|
-
args: {
|
|
151
|
-
theme: "light",
|
|
152
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.subscription,
|
|
153
|
-
},
|
|
154
|
-
parameters: {
|
|
155
|
-
backgrounds: { default: "light" },
|
|
156
|
-
docs: {
|
|
157
|
-
description: {
|
|
158
|
-
story:
|
|
159
|
-
"Light theme version of subscription service payment with full description text.",
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export const PhysicalProduct: Story = {
|
|
166
|
-
args: {
|
|
167
|
-
theme: "dark",
|
|
168
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.sneakers,
|
|
169
|
-
},
|
|
170
|
-
parameters: {
|
|
171
|
-
backgrounds: { default: "dark" },
|
|
172
|
-
docs: {
|
|
173
|
-
description: {
|
|
174
|
-
story:
|
|
175
|
-
"Example of purchasing physical products with crypto payments. Shows how the component adapts to different product types with ETH payment.",
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export const PhysicalProductLight: Story = {
|
|
182
|
-
args: {
|
|
183
|
-
theme: "light",
|
|
184
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.sneakers,
|
|
185
|
-
},
|
|
186
|
-
parameters: {
|
|
187
|
-
backgrounds: { default: "light" },
|
|
188
|
-
docs: {
|
|
189
|
-
description: {
|
|
190
|
-
story: "Light theme version of physical product purchase.",
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const NoImage: Story = {
|
|
197
|
-
args: {
|
|
198
|
-
theme: "dark",
|
|
199
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.credits,
|
|
200
|
-
},
|
|
201
|
-
parameters: {
|
|
202
|
-
backgrounds: { default: "dark" },
|
|
203
|
-
docs: {
|
|
204
|
-
description: {
|
|
205
|
-
story:
|
|
206
|
-
"Example of purchasing digital credits without product image. Shows how the component handles text-only products with description fallback.",
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export const NoImageLight: Story = {
|
|
213
|
-
args: {
|
|
214
|
-
theme: "light",
|
|
215
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.credits,
|
|
216
|
-
},
|
|
217
|
-
parameters: {
|
|
218
|
-
backgrounds: { default: "light" },
|
|
219
|
-
docs: {
|
|
220
|
-
description: {
|
|
221
|
-
story: "Light theme version of credits purchase without image.",
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
export const CustomButtonLabel: Story = {
|
|
228
|
-
args: {
|
|
229
|
-
theme: "dark",
|
|
230
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.customButton,
|
|
231
|
-
},
|
|
232
|
-
parameters: {
|
|
233
|
-
backgrounds: { default: "dark" },
|
|
234
|
-
docs: {
|
|
235
|
-
description: {
|
|
236
|
-
story:
|
|
237
|
-
"Example showcasing custom button label functionality. The button shows 'Purchase Now' instead of the default 'Buy Now' text.",
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export const CustomButtonLabelLight: Story = {
|
|
244
|
-
args: {
|
|
245
|
-
theme: "light",
|
|
246
|
-
uiOptions: DIRECT_PAYMENT_UI_OPTIONS.customButton,
|
|
247
|
-
},
|
|
248
|
-
parameters: {
|
|
249
|
-
backgrounds: { default: "light" },
|
|
250
|
-
docs: {
|
|
251
|
-
description: {
|
|
252
|
-
story: "Light theme version with custom button label 'Purchase Now'.",
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
};
|