thirdweb 5.102.7-nightly-3f747601135809eedf86a150752f4b5f12c99776-20250617000426 → 5.103.0
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/bridge/Routes.js +4 -1
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Token.js +57 -0
- package/dist/cjs/bridge/Token.js.map +1 -1
- package/dist/cjs/bridge/types/Errors.js +9 -0
- package/dist/cjs/bridge/types/Errors.js.map +1 -1
- package/dist/cjs/exports/react.js +9 -1
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +2 -2
- package/dist/cjs/pay/convert/cryptoToFiat.js +3 -3
- package/dist/cjs/pay/convert/cryptoToFiat.js.map +1 -1
- package/dist/cjs/pay/convert/fiatToCrypto.js +3 -3
- package/dist/cjs/pay/convert/fiatToCrypto.js.map +1 -1
- package/dist/cjs/pay/convert/get-token.js +15 -3
- package/dist/cjs/pay/convert/get-token.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -1
- package/dist/cjs/react/core/adapters/WindowAdapter.js +3 -0
- package/dist/cjs/react/core/adapters/WindowAdapter.js.map +1 -0
- package/dist/cjs/react/core/errors/mapBridgeError.js +27 -0
- package/dist/cjs/react/core/errors/mapBridgeError.js.map +1 -0
- package/dist/cjs/react/core/hooks/others/useChainQuery.js +1 -1
- package/dist/cjs/react/core/hooks/others/useChainQuery.js.map +1 -1
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +40 -0
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeError.js +94 -0
- package/dist/cjs/react/core/hooks/useBridgeError.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgePrepare.js +90 -0
- package/dist/cjs/react/core/hooks/useBridgePrepare.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeQuote.js +50 -0
- package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeRoutes.js +61 -0
- package/dist/cjs/react/core/hooks/useBridgeRoutes.js.map +1 -0
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +154 -0
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -0
- package/dist/cjs/react/core/hooks/useStepExecutor.js +408 -0
- package/dist/cjs/react/core/hooks/useStepExecutor.js.map +1 -0
- package/dist/cjs/react/core/hooks/useTransactionDetails.js +126 -0
- package/dist/cjs/react/core/hooks/useTransactionDetails.js.map +1 -0
- package/dist/cjs/react/core/machines/paymentMachine.js +189 -0
- package/dist/cjs/react/core/machines/paymentMachine.js.map +1 -0
- package/dist/cjs/react/web/adapters/WindowAdapter.js +25 -0
- package/dist/cjs/react/web/adapters/WindowAdapter.js.map +1 -0
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +5 -0
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +107 -0
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +177 -0
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +154 -0
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +62 -0
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js +26 -0
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js +122 -0
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +99 -0
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/StepRunner.js +179 -0
- package/dist/cjs/react/web/ui/Bridge/StepRunner.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +117 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +179 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js +23 -0
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js +101 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js +57 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +27 -0
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +121 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +80 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +83 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +111 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +71 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +54 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js +140 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +61 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/constants.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +12 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +4 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.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 +11 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +2 -1
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +6 -5
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +43 -4
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +8 -4
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainName.js +2 -1
- package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/cjs/react/web/ui/components/TokenIcon.js +6 -3
- package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +1 -5
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +228 -0
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js +194 -0
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +153 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/FundWallet.stories.js +173 -0
- package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +430 -0
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +151 -0
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/StepRunner.stories.js +82 -0
- package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +180 -0
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +139 -0
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +94 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/fixtures.js +731 -0
- package/dist/cjs/stories/Bridge/fixtures.js.map +1 -0
- package/dist/cjs/stories/TokenBalanceRow.stories.js +81 -0
- package/dist/cjs/stories/TokenBalanceRow.stories.js.map +1 -0
- package/dist/cjs/stories/WalletRow.stories.js +120 -0
- package/dist/cjs/stories/WalletRow.stories.js.map +1 -0
- package/dist/cjs/stories/utils.js +19 -1
- package/dist/cjs/stories/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Routes.js +4 -1
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Token.js +56 -0
- package/dist/esm/bridge/Token.js.map +1 -1
- package/dist/esm/bridge/types/Errors.js +9 -0
- package/dist/esm/bridge/types/Errors.js.map +1 -1
- package/dist/esm/exports/react.js +4 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +2 -2
- package/dist/esm/pay/convert/cryptoToFiat.js +4 -4
- package/dist/esm/pay/convert/cryptoToFiat.js.map +1 -1
- package/dist/esm/pay/convert/fiatToCrypto.js +4 -4
- package/dist/esm/pay/convert/fiatToCrypto.js.map +1 -1
- package/dist/esm/pay/convert/get-token.js +15 -3
- package/dist/esm/pay/convert/get-token.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +1 -1
- package/dist/esm/react/core/adapters/WindowAdapter.js +2 -0
- package/dist/esm/react/core/adapters/WindowAdapter.js.map +1 -0
- package/dist/esm/react/core/errors/mapBridgeError.js +23 -0
- package/dist/esm/react/core/errors/mapBridgeError.js.map +1 -0
- package/dist/esm/react/core/hooks/others/useChainQuery.js +1 -1
- package/dist/esm/react/core/hooks/others/useChainQuery.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +37 -0
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeError.js +91 -0
- package/dist/esm/react/core/hooks/useBridgeError.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgePrepare.js +87 -0
- package/dist/esm/react/core/hooks/useBridgePrepare.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeQuote.js +47 -0
- package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeRoutes.js +58 -0
- package/dist/esm/react/core/hooks/useBridgeRoutes.js.map +1 -0
- package/dist/esm/react/core/hooks/usePaymentMethods.js +151 -0
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -0
- package/dist/esm/react/core/hooks/useStepExecutor.js +405 -0
- package/dist/esm/react/core/hooks/useStepExecutor.js.map +1 -0
- package/dist/esm/react/core/hooks/useTransactionDetails.js +123 -0
- package/dist/esm/react/core/hooks/useTransactionDetails.js.map +1 -0
- package/dist/esm/react/core/machines/paymentMachine.js +186 -0
- package/dist/esm/react/core/machines/paymentMachine.js.map +1 -0
- package/dist/esm/react/web/adapters/WindowAdapter.js +21 -0
- package/dist/esm/react/web/adapters/WindowAdapter.js.map +1 -0
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +5 -0
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +104 -0
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +174 -0
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +151 -0
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +59 -0
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js +23 -0
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/FundWallet.js +119 -0
- package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +96 -0
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/StepRunner.js +176 -0
- package/dist/esm/react/web/ui/Bridge/StepRunner.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +114 -0
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +176 -0
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js +20 -0
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js +96 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js +54 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +24 -0
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +119 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +77 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +80 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +108 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +68 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +51 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js +137 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +58 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/constants.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +3 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.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 +9 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +2 -1
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +6 -5
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +45 -6
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +8 -4
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainName.js +2 -2
- package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/esm/react/web/ui/components/TokenIcon.js +7 -4
- package/dist/esm/react/web/ui/components/TokenIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +1 -5
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +226 -0
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/DirectPayment.stories.js +191 -0
- package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +150 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/FundWallet.stories.js +170 -0
- package/dist/esm/stories/Bridge/FundWallet.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js +427 -0
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +148 -0
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/StepRunner.stories.js +79 -0
- package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +177 -0
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js +136 -0
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +91 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/fixtures.js +728 -0
- package/dist/esm/stories/Bridge/fixtures.js.map +1 -0
- package/dist/esm/stories/TokenBalanceRow.stories.js +78 -0
- package/dist/esm/stories/TokenBalanceRow.stories.js.map +1 -0
- package/dist/esm/stories/WalletRow.stories.js +117 -0
- package/dist/esm/stories/WalletRow.stories.js.map +1 -0
- package/dist/esm/stories/utils.js +17 -0
- package/dist/esm/stories/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/bridge/Routes.d.ts +1 -0
- package/dist/types/bridge/Routes.d.ts.map +1 -1
- package/dist/types/bridge/Token.d.ts +48 -1
- package/dist/types/bridge/Token.d.ts.map +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -1
- package/dist/types/bridge/types/Errors.d.ts +1 -0
- package/dist/types/bridge/types/Errors.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +4 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/pay/convert/get-token.d.ts +2 -1
- package/dist/types/pay/convert/get-token.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +1 -1
- package/dist/types/react/core/adapters/WindowAdapter.d.ts +14 -0
- package/dist/types/react/core/adapters/WindowAdapter.d.ts.map +1 -0
- package/dist/types/react/core/errors/mapBridgeError.d.ts +17 -0
- package/dist/types/react/core/errors/mapBridgeError.d.ts.map +1 -0
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +14 -6
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts +54 -0
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts.map +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/useBridgeError.d.ts +72 -0
- package/dist/types/react/core/hooks/useBridgeError.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgePrepare.d.ts +75 -0
- package/dist/types/react/core/hooks/useBridgePrepare.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts +14 -0
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgeRoutes.d.ts +30 -0
- package/dist/types/react/core/hooks/useBridgeRoutes.d.ts.map +1 -0
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts +36 -0
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useStepExecutor.d.ts +67 -0
- package/dist/types/react/core/hooks/useStepExecutor.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useTransactionDetails.d.ts +31 -0
- package/dist/types/react/core/hooks/useTransactionDetails.d.ts.map +1 -0
- package/dist/types/react/core/machines/paymentMachine.d.ts +86 -0
- package/dist/types/react/core/machines/paymentMachine.d.ts.map +1 -0
- package/dist/types/react/web/adapters/WindowAdapter.d.ts +19 -0
- package/dist/types/react/web/adapters/WindowAdapter.d.ts.map +1 -0
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +5 -0
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +78 -0
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +325 -0
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +328 -0
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +27 -0
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts +17 -0
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +35 -0
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +57 -0
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +39 -0
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +27 -0
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +355 -0
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +13 -0
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts +16 -0
- package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts +10 -0
- package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +9 -0
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +36 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts +12 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +50 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts +12 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts +24 -0
- package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +28 -0
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/constants.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +4 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.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 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +2 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/ChainName.d.ts +3 -0
- package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/TokenIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +90 -0
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +65 -0
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +55 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts +63 -0
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +70 -0
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +65 -0
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts +61 -0
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +58 -0
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +55 -0
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +39 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/fixtures.d.ts +37 -0
- package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -0
- package/dist/types/stories/TokenBalanceRow.stories.d.ts +53 -0
- package/dist/types/stories/TokenBalanceRow.stories.d.ts.map +1 -0
- package/dist/types/stories/WalletRow.stories.d.ts +63 -0
- package/dist/types/stories/WalletRow.stories.d.ts.map +1 -0
- package/dist/types/stories/utils.d.ts +5 -0
- package/dist/types/stories/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/bridge/Routes.ts +5 -0
- package/src/bridge/Token.ts +82 -1
- package/src/bridge/types/BridgeAction.ts +1 -1
- package/src/bridge/types/Errors.ts +11 -0
- package/src/exports/react.ts +16 -0
- package/src/pay/buyWithFiat/getQuote.ts +2 -2
- package/src/pay/convert/cryptoToFiat.ts +4 -4
- package/src/pay/convert/fiatToCrypto.ts +4 -4
- package/src/pay/convert/get-token.ts +17 -4
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/react/components.md +134 -0
- package/src/react/core/adapters/.keep +2 -0
- package/src/react/core/adapters/WindowAdapter.ts +13 -0
- package/src/react/core/errors/.keep +2 -0
- package/src/react/core/errors/mapBridgeError.test.ts +98 -0
- package/src/react/core/errors/mapBridgeError.ts +25 -0
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +42 -37
- package/src/react/core/hooks/others/useChainQuery.ts +1 -1
- package/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts +100 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +1 -1
- package/src/react/core/hooks/useBridgeError.test.ts +172 -0
- package/src/react/core/hooks/useBridgeError.ts +149 -0
- package/src/react/core/hooks/useBridgePrepare.test.ts +161 -0
- package/src/react/core/hooks/useBridgePrepare.ts +133 -0
- package/src/react/core/hooks/useBridgeQuote.ts +67 -0
- package/src/react/core/hooks/useBridgeRoutes.test.ts +137 -0
- package/src/react/core/hooks/useBridgeRoutes.ts +75 -0
- package/src/react/core/hooks/usePaymentMethods.test.ts +336 -0
- package/src/react/core/hooks/usePaymentMethods.ts +203 -0
- package/src/react/core/hooks/useStepExecutor.ts +606 -0
- package/src/react/core/hooks/useTransactionDetails.ts +177 -0
- package/src/react/core/hooks/wallets/useAutoConnectCore.test.tsx +1 -57
- package/src/react/core/machines/.keep +2 -0
- package/src/react/core/machines/paymentMachine.test.ts +691 -0
- package/src/react/core/machines/paymentMachine.ts +290 -0
- package/src/react/core/types/.keep +2 -0
- package/src/react/core/utils/wallet.test.ts +77 -0
- package/src/react/native/flows/.keep +2 -0
- package/src/react/web/adapters/WindowAdapter.ts +23 -0
- package/src/react/web/adapters/adapters.test.ts +38 -0
- package/src/react/web/flows/.keep +2 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +5 -0
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +357 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +494 -0
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +484 -0
- package/src/react/web/ui/Bridge/DirectPayment.tsx +234 -0
- package/src/react/web/ui/Bridge/ErrorBanner.tsx +86 -0
- package/src/react/web/ui/Bridge/FundWallet.tsx +341 -0
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +219 -0
- package/src/react/web/ui/Bridge/StepRunner.tsx +417 -0
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +403 -0
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +502 -0
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +84 -0
- package/src/react/web/ui/Bridge/common/TokenAndChain.tsx +203 -0
- package/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx +112 -0
- package/src/react/web/ui/Bridge/common/WithHeader.tsx +65 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +318 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +301 -0
- package/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx +186 -0
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +268 -0
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +282 -0
- package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +172 -0
- package/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx +392 -0
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +155 -0
- package/src/react/web/ui/ConnectWallet/Details.test.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/constants.ts +1 -1
- package/src/react/web/ui/ConnectWallet/icons/CreditCardIcon.tsx +24 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +5 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +8 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +3 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx +7 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +7 -3
- package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +22 -0
- package/src/react/web/ui/PayEmbed.tsx +2 -0
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +10 -5
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +78 -25
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +15 -9
- package/src/react/web/ui/components/ChainName.tsx +4 -2
- package/src/react/web/ui/components/TokenIcon.tsx +7 -4
- package/src/react/web/ui/components/buttons.tsx +1 -5
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +267 -0
- package/src/stories/Bridge/DirectPayment.stories.tsx +225 -0
- package/src/stories/Bridge/ErrorBanner.stories.tsx +184 -0
- package/src/stories/Bridge/FundWallet.stories.tsx +196 -0
- package/src/stories/Bridge/PaymentDetails.stories.tsx +501 -0
- package/src/stories/Bridge/PaymentSelection.stories.tsx +177 -0
- package/src/stories/Bridge/StepRunner.stories.tsx +109 -0
- package/src/stories/Bridge/SuccessScreen.stories.tsx +217 -0
- package/src/stories/Bridge/TransactionPayment.stories.tsx +170 -0
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +119 -0
- package/src/stories/Bridge/fixtures.ts +802 -0
- package/src/stories/TokenBalanceRow.stories.tsx +169 -0
- package/src/stories/WalletRow.stories.tsx +166 -0
- package/src/stories/utils.tsx +35 -0
- package/src/version.ts +1 -1
- package/src/wallets/connection/autoConnectCore.test.ts +0 -53
@@ -0,0 +1,501 @@
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
2
|
+
import type { Theme } from "../../react/core/design-system/index.js";
|
3
|
+
import type { PaymentMethod } from "../../react/core/machines/paymentMachine.js";
|
4
|
+
import {
|
5
|
+
PaymentDetails,
|
6
|
+
type PaymentDetailsProps,
|
7
|
+
} from "../../react/web/ui/Bridge/payment-details/PaymentDetails.js";
|
8
|
+
import { stringify } from "../../utils/json.js";
|
9
|
+
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
10
|
+
import {
|
11
|
+
DIRECT_PAYMENT_UI_OPTIONS,
|
12
|
+
STORY_MOCK_WALLET,
|
13
|
+
TRANSACTION_UI_OPTIONS,
|
14
|
+
USDC,
|
15
|
+
buyWithApprovalQuote,
|
16
|
+
complexBuyQuote,
|
17
|
+
longTextBuyQuote,
|
18
|
+
onrampWithSwapsQuote,
|
19
|
+
simpleBuyQuote,
|
20
|
+
simpleOnrampQuote,
|
21
|
+
} from "./fixtures.js";
|
22
|
+
|
23
|
+
const fiatPaymentMethod: PaymentMethod = {
|
24
|
+
type: "fiat",
|
25
|
+
currency: "USD",
|
26
|
+
onramp: "coinbase",
|
27
|
+
payerWallet: STORY_MOCK_WALLET,
|
28
|
+
};
|
29
|
+
|
30
|
+
const cryptoPaymentMethod: PaymentMethod = JSON.parse(
|
31
|
+
stringify({
|
32
|
+
type: "wallet",
|
33
|
+
payerWallet: STORY_MOCK_WALLET,
|
34
|
+
balance: 100000000n,
|
35
|
+
originToken: {
|
36
|
+
chainId: 1,
|
37
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
38
|
+
name: "USD Coin",
|
39
|
+
symbol: "USDC",
|
40
|
+
decimals: 6,
|
41
|
+
priceUsd: 1.0,
|
42
|
+
iconUri:
|
43
|
+
"https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
44
|
+
},
|
45
|
+
}),
|
46
|
+
);
|
47
|
+
|
48
|
+
const ethCryptoPaymentMethod: PaymentMethod = JSON.parse(
|
49
|
+
stringify({
|
50
|
+
type: "wallet",
|
51
|
+
payerWallet: STORY_MOCK_WALLET,
|
52
|
+
balance: 1000000000000000000n,
|
53
|
+
originToken: {
|
54
|
+
chainId: 1,
|
55
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
56
|
+
name: "Ethereum",
|
57
|
+
symbol: "ETH",
|
58
|
+
decimals: 18,
|
59
|
+
priceUsd: 2500.0,
|
60
|
+
iconUri:
|
61
|
+
"https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
62
|
+
},
|
63
|
+
}),
|
64
|
+
);
|
65
|
+
|
66
|
+
// Props interface for the wrapper component
|
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 = {
|
82
|
+
title: "Bridge/PaymentDetails",
|
83
|
+
component: PaymentDetailsWithTheme,
|
84
|
+
parameters: {
|
85
|
+
layout: "centered",
|
86
|
+
docs: {
|
87
|
+
description: {
|
88
|
+
component:
|
89
|
+
"Route preview screen that displays prepared quote details, fees, estimated time, and transaction steps for user confirmation.",
|
90
|
+
},
|
91
|
+
},
|
92
|
+
},
|
93
|
+
tags: ["autodocs"],
|
94
|
+
args: {
|
95
|
+
preparedQuote: simpleOnrampQuote,
|
96
|
+
onConfirm: () => {},
|
97
|
+
onBack: () => {},
|
98
|
+
onError: (error) => console.error("Error:", error),
|
99
|
+
theme: "dark",
|
100
|
+
uiOptions: {
|
101
|
+
mode: "fund_wallet",
|
102
|
+
destinationToken: USDC,
|
103
|
+
},
|
104
|
+
},
|
105
|
+
argTypes: {
|
106
|
+
theme: {
|
107
|
+
control: "select",
|
108
|
+
options: ["light", "dark"],
|
109
|
+
description: "Theme for the component",
|
110
|
+
},
|
111
|
+
onConfirm: { action: "route confirmed" },
|
112
|
+
onBack: { action: "back clicked" },
|
113
|
+
onError: { action: "error occurred" },
|
114
|
+
},
|
115
|
+
} satisfies Meta<typeof PaymentDetailsWithTheme>;
|
116
|
+
|
117
|
+
export default meta;
|
118
|
+
type Story = StoryObj<typeof meta>;
|
119
|
+
|
120
|
+
export const OnrampSimple: Story = {
|
121
|
+
args: {
|
122
|
+
theme: "dark",
|
123
|
+
preparedQuote: simpleOnrampQuote,
|
124
|
+
paymentMethod: fiatPaymentMethod,
|
125
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
141
|
+
preparedQuote: simpleOnrampQuote,
|
142
|
+
paymentMethod: fiatPaymentMethod,
|
143
|
+
client: storyClient,
|
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
|
+
},
|
153
|
+
};
|
154
|
+
|
155
|
+
export const OnrampSimpleDirectPayment: Story = {
|
156
|
+
args: {
|
157
|
+
theme: "dark",
|
158
|
+
preparedQuote: simpleOnrampQuote,
|
159
|
+
paymentMethod: fiatPaymentMethod,
|
160
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
177
|
+
preparedQuote: simpleOnrampQuote,
|
178
|
+
paymentMethod: fiatPaymentMethod,
|
179
|
+
client: storyClient,
|
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
|
+
},
|
189
|
+
},
|
190
|
+
};
|
191
|
+
|
192
|
+
export const OnrampWithSwaps: Story = {
|
193
|
+
args: {
|
194
|
+
theme: "dark",
|
195
|
+
preparedQuote: onrampWithSwapsQuote,
|
196
|
+
paymentMethod: fiatPaymentMethod,
|
197
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
213
|
+
preparedQuote: onrampWithSwapsQuote,
|
214
|
+
paymentMethod: fiatPaymentMethod,
|
215
|
+
client: storyClient,
|
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
|
+
},
|
225
|
+
};
|
226
|
+
|
227
|
+
export const BuySimple: Story = {
|
228
|
+
args: {
|
229
|
+
theme: "dark",
|
230
|
+
preparedQuote: simpleBuyQuote,
|
231
|
+
paymentMethod: ethCryptoPaymentMethod,
|
232
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
248
|
+
preparedQuote: simpleBuyQuote,
|
249
|
+
paymentMethod: ethCryptoPaymentMethod,
|
250
|
+
client: storyClient,
|
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
|
+
},
|
260
|
+
};
|
261
|
+
|
262
|
+
export const BuySimpleDirectPayment: Story = {
|
263
|
+
args: {
|
264
|
+
theme: "dark",
|
265
|
+
preparedQuote: simpleBuyQuote,
|
266
|
+
paymentMethod: ethCryptoPaymentMethod,
|
267
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
284
|
+
preparedQuote: simpleBuyQuote,
|
285
|
+
paymentMethod: ethCryptoPaymentMethod,
|
286
|
+
client: storyClient,
|
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
|
+
},
|
296
|
+
},
|
297
|
+
};
|
298
|
+
|
299
|
+
export const BuyWithLongText: Story = {
|
300
|
+
args: {
|
301
|
+
theme: "dark",
|
302
|
+
preparedQuote: longTextBuyQuote,
|
303
|
+
paymentMethod: ethCryptoPaymentMethod,
|
304
|
+
client: storyClient,
|
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
|
+
},
|
314
|
+
};
|
315
|
+
|
316
|
+
export const BuyWithApproval: Story = {
|
317
|
+
args: {
|
318
|
+
theme: "dark",
|
319
|
+
preparedQuote: buyWithApprovalQuote,
|
320
|
+
paymentMethod: cryptoPaymentMethod,
|
321
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
337
|
+
preparedQuote: buyWithApprovalQuote,
|
338
|
+
paymentMethod: cryptoPaymentMethod,
|
339
|
+
client: storyClient,
|
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
|
+
},
|
349
|
+
};
|
350
|
+
|
351
|
+
export const BuyComplex: Story = {
|
352
|
+
args: {
|
353
|
+
theme: "dark",
|
354
|
+
preparedQuote: complexBuyQuote,
|
355
|
+
paymentMethod: ethCryptoPaymentMethod,
|
356
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
372
|
+
preparedQuote: complexBuyQuote,
|
373
|
+
paymentMethod: ethCryptoPaymentMethod,
|
374
|
+
client: storyClient,
|
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
|
+
},
|
385
|
+
};
|
386
|
+
|
387
|
+
// ========== TRANSACTION MODE STORIES ========== //
|
388
|
+
|
389
|
+
export const TransactionEthTransfer: Story = {
|
390
|
+
args: {
|
391
|
+
theme: "dark",
|
392
|
+
preparedQuote: simpleBuyQuote,
|
393
|
+
paymentMethod: ethCryptoPaymentMethod,
|
394
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
411
|
+
preparedQuote: simpleBuyQuote,
|
412
|
+
paymentMethod: ethCryptoPaymentMethod,
|
413
|
+
client: storyClient,
|
414
|
+
uiOptions: TRANSACTION_UI_OPTIONS.ethTransfer,
|
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
|
+
},
|
423
|
+
},
|
424
|
+
},
|
425
|
+
};
|
426
|
+
|
427
|
+
export const TransactionERC20Transfer: Story = {
|
428
|
+
args: {
|
429
|
+
theme: "dark",
|
430
|
+
preparedQuote: simpleBuyQuote,
|
431
|
+
paymentMethod: cryptoPaymentMethod,
|
432
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
449
|
+
preparedQuote: simpleBuyQuote,
|
450
|
+
paymentMethod: cryptoPaymentMethod,
|
451
|
+
client: storyClient,
|
452
|
+
uiOptions: TRANSACTION_UI_OPTIONS.erc20Transfer,
|
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
|
+
},
|
461
|
+
},
|
462
|
+
},
|
463
|
+
};
|
464
|
+
|
465
|
+
export const TransactionContractInteraction: Story = {
|
466
|
+
args: {
|
467
|
+
theme: "dark",
|
468
|
+
preparedQuote: simpleBuyQuote,
|
469
|
+
paymentMethod: ethCryptoPaymentMethod,
|
470
|
+
client: storyClient,
|
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
|
+
theme: "light",
|
487
|
+
preparedQuote: simpleBuyQuote,
|
488
|
+
paymentMethod: ethCryptoPaymentMethod,
|
489
|
+
client: storyClient,
|
490
|
+
uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
|
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
|
+
},
|
499
|
+
},
|
500
|
+
},
|
501
|
+
};
|
@@ -0,0 +1,177 @@
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
2
|
+
import type { Theme } from "../../react/core/design-system/index.js";
|
3
|
+
import {
|
4
|
+
PaymentSelection,
|
5
|
+
type PaymentSelectionProps,
|
6
|
+
} from "../../react/web/ui/Bridge/payment-selection/PaymentSelection.js";
|
7
|
+
import en from "../../react/web/ui/ConnectWallet/locale/en.js";
|
8
|
+
import { ModalThemeWrapper, storyClient } from "../utils.js";
|
9
|
+
import { UNI, USDC } from "./fixtures.js";
|
10
|
+
|
11
|
+
// Props interface for the wrapper component
|
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 = {
|
27
|
+
title: "Bridge/PaymentSelection",
|
28
|
+
component: PaymentSelectionWithTheme,
|
29
|
+
parameters: {
|
30
|
+
layout: "centered",
|
31
|
+
docs: {
|
32
|
+
description: {
|
33
|
+
component:
|
34
|
+
"Payment method selection screen with a 2-step flow:\n\n" +
|
35
|
+
"**Step 1:** Choose payment method - shows connected wallets, connect wallet option, and pay with fiat option\n\n" +
|
36
|
+
"**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" +
|
37
|
+
"**Step 2b:** If fiat selected - shows onramp provider options (Coinbase, Stripe, Transak)\n\n" +
|
38
|
+
"The component intelligently manages wallet context and provides proper error handling for each step.",
|
39
|
+
},
|
40
|
+
},
|
41
|
+
},
|
42
|
+
tags: ["autodocs"],
|
43
|
+
args: {
|
44
|
+
destinationToken: USDC,
|
45
|
+
client: storyClient,
|
46
|
+
onPaymentMethodSelected: (_paymentMethod) => {},
|
47
|
+
onError: (error) => console.error("Error:", error),
|
48
|
+
theme: "dark",
|
49
|
+
destinationAmount: "1",
|
50
|
+
connectLocale: en,
|
51
|
+
},
|
52
|
+
argTypes: {
|
53
|
+
theme: {
|
54
|
+
control: "select",
|
55
|
+
options: ["light", "dark"],
|
56
|
+
description: "Theme for the component",
|
57
|
+
},
|
58
|
+
destinationToken: {
|
59
|
+
description: "The target token to bridge to",
|
60
|
+
},
|
61
|
+
destinationAmount: {
|
62
|
+
description: "Amount of destination token to bridge",
|
63
|
+
},
|
64
|
+
onPaymentMethodSelected: {
|
65
|
+
action: "payment method selected",
|
66
|
+
description: "Called when user selects a wallet token or fiat provider",
|
67
|
+
},
|
68
|
+
onError: {
|
69
|
+
action: "error occurred",
|
70
|
+
description: "Called when an error occurs during the flow",
|
71
|
+
},
|
72
|
+
onBack: {
|
73
|
+
action: "back clicked",
|
74
|
+
description: "Called when user wants to go back (only shown in Step 1)",
|
75
|
+
},
|
76
|
+
connectLocale: {
|
77
|
+
description: "Locale for connecting wallets",
|
78
|
+
},
|
79
|
+
},
|
80
|
+
} satisfies Meta<typeof PaymentSelectionWithTheme>;
|
81
|
+
|
82
|
+
export default meta;
|
83
|
+
type Story = StoryObj<typeof meta>;
|
84
|
+
|
85
|
+
export const Light: Story = {
|
86
|
+
args: {
|
87
|
+
theme: "light",
|
88
|
+
},
|
89
|
+
parameters: {
|
90
|
+
backgrounds: { default: "light" },
|
91
|
+
docs: {
|
92
|
+
description: {
|
93
|
+
story:
|
94
|
+
"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.",
|
95
|
+
},
|
96
|
+
},
|
97
|
+
},
|
98
|
+
};
|
99
|
+
|
100
|
+
export const Dark: Story = {
|
101
|
+
args: {
|
102
|
+
theme: "dark",
|
103
|
+
},
|
104
|
+
parameters: {
|
105
|
+
backgrounds: { default: "dark" },
|
106
|
+
docs: {
|
107
|
+
description: {
|
108
|
+
story:
|
109
|
+
"Dark theme version of the payment selection flow. The component starts with wallet selection and provides navigation through the 2-step process.",
|
110
|
+
},
|
111
|
+
},
|
112
|
+
},
|
113
|
+
};
|
114
|
+
|
115
|
+
export const WithBackButton: Story = {
|
116
|
+
args: {
|
117
|
+
theme: "dark",
|
118
|
+
onBack: () => {},
|
119
|
+
},
|
120
|
+
parameters: {
|
121
|
+
backgrounds: { default: "dark" },
|
122
|
+
docs: {
|
123
|
+
description: {
|
124
|
+
story:
|
125
|
+
"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.",
|
126
|
+
},
|
127
|
+
},
|
128
|
+
},
|
129
|
+
};
|
130
|
+
|
131
|
+
export const WithBackButtonLight: Story = {
|
132
|
+
args: {
|
133
|
+
theme: "light",
|
134
|
+
onBack: () => {},
|
135
|
+
},
|
136
|
+
parameters: {
|
137
|
+
backgrounds: { default: "light" },
|
138
|
+
docs: {
|
139
|
+
description: {
|
140
|
+
story:
|
141
|
+
"Light theme version with back button functionality. Demonstrates the navigation flow between steps.",
|
142
|
+
},
|
143
|
+
},
|
144
|
+
},
|
145
|
+
};
|
146
|
+
|
147
|
+
export const DifferentDestinationToken: Story = {
|
148
|
+
args: {
|
149
|
+
theme: "dark",
|
150
|
+
destinationToken: UNI,
|
151
|
+
},
|
152
|
+
parameters: {
|
153
|
+
backgrounds: { default: "dark" },
|
154
|
+
docs: {
|
155
|
+
description: {
|
156
|
+
story:
|
157
|
+
"Example with a different destination token (UNI). This will show different available origin tokens in Step 2a when a wallet is selected.",
|
158
|
+
},
|
159
|
+
},
|
160
|
+
},
|
161
|
+
};
|
162
|
+
|
163
|
+
export const LargeAmount: Story = {
|
164
|
+
args: {
|
165
|
+
theme: "dark",
|
166
|
+
destinationAmount: "1000",
|
167
|
+
},
|
168
|
+
parameters: {
|
169
|
+
backgrounds: { default: "dark" },
|
170
|
+
docs: {
|
171
|
+
description: {
|
172
|
+
story:
|
173
|
+
"Example with a larger destination amount (1000 USDC). This may affect which origin tokens are available based on user balances.",
|
174
|
+
},
|
175
|
+
},
|
176
|
+
},
|
177
|
+
};
|