thirdweb 5.102.7-nightly-9f6c1a4820e37428dec6427cf77a12ab463f119d-20250616000412 → 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/utils/nft/parseNft.d.ts +2 -2
- package/dist/types/utils/nft/parseNft.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/utils/nft/parseNft.ts +2 -2
- package/src/version.ts +1 -1
- package/src/wallets/connection/autoConnectCore.test.ts +0 -53
@@ -0,0 +1,728 @@
|
|
1
|
+
import { stringify } from "viem";
|
2
|
+
import { baseSepolia } from "../../chains/chain-definitions/base-sepolia.js";
|
3
|
+
import { base } from "../../chains/chain-definitions/base.js";
|
4
|
+
import { polygon } from "../../chains/chain-definitions/polygon.js";
|
5
|
+
import { defineChain } from "../../chains/utils.js";
|
6
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../constants/addresses.js";
|
7
|
+
import { getContract } from "../../contract/contract.js";
|
8
|
+
import { claimTo } from "../../extensions/erc20/drops/write/claimTo.js";
|
9
|
+
import { transfer } from "../../extensions/erc20/write/transfer.js";
|
10
|
+
import { getDefaultToken } from "../../react/core/utils/defaultTokens.js";
|
11
|
+
import { prepareTransaction } from "../../transaction/prepare-transaction.js";
|
12
|
+
import { toWei } from "../../utils/units.js";
|
13
|
+
import { storyClient } from "../utils.js";
|
14
|
+
export const ETH = {
|
15
|
+
address: NATIVE_TOKEN_ADDRESS,
|
16
|
+
name: "Ethereum",
|
17
|
+
symbol: "ETH",
|
18
|
+
chainId: 10,
|
19
|
+
decimals: 18,
|
20
|
+
priceUsd: 1000,
|
21
|
+
iconUri: "https://coin-images.coingecko.com/coins/images/279/large/ethereum.png",
|
22
|
+
};
|
23
|
+
export const USDC = {
|
24
|
+
address: getDefaultToken(base, "USDC")?.address ?? "",
|
25
|
+
name: "USD Coin",
|
26
|
+
symbol: "USDC",
|
27
|
+
chainId: base.id,
|
28
|
+
decimals: 6,
|
29
|
+
priceUsd: 1,
|
30
|
+
iconUri: "https://coin-images.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
31
|
+
};
|
32
|
+
export const UNI = {
|
33
|
+
address: "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
|
34
|
+
name: "Uniswap",
|
35
|
+
symbol: "UNI",
|
36
|
+
chainId: 10,
|
37
|
+
decimals: 18,
|
38
|
+
priceUsd: 1000,
|
39
|
+
iconUri: "https://coin-images.coingecko.com/coins/images/12504/large/uniswap-uni.png",
|
40
|
+
};
|
41
|
+
const createStoryMockWallet = () => {
|
42
|
+
const mockAccount = {
|
43
|
+
address: "0x1234567890123456789012345678901234567890",
|
44
|
+
sendTransaction: async () => ({
|
45
|
+
transactionHash: "0xmockhash123",
|
46
|
+
chain: defineChain(1),
|
47
|
+
client: storyClient,
|
48
|
+
}),
|
49
|
+
signMessage: async () => "0xsignature",
|
50
|
+
signTypedData: async () => "0xsignature",
|
51
|
+
};
|
52
|
+
// Simple mock wallet implementation for storybook display only
|
53
|
+
return {
|
54
|
+
id: "inApp",
|
55
|
+
getAccount: () => mockAccount,
|
56
|
+
getChain: async () => defineChain(1),
|
57
|
+
autoConnect: async () => mockAccount,
|
58
|
+
connect: async () => mockAccount,
|
59
|
+
disconnect: async () => { },
|
60
|
+
switchChain: async () => { },
|
61
|
+
subscribe: () => () => { },
|
62
|
+
getConfig: () => ({}),
|
63
|
+
};
|
64
|
+
};
|
65
|
+
export const STORY_MOCK_WALLET = createStoryMockWallet();
|
66
|
+
// Simple onramp quote with no extra steps
|
67
|
+
export const simpleOnrampQuote = JSON.parse(stringify({
|
68
|
+
type: "onramp",
|
69
|
+
id: "onramp-simple-123",
|
70
|
+
link: "https://stripe.com/session/simple",
|
71
|
+
currency: "USD",
|
72
|
+
currencyAmount: 50.0,
|
73
|
+
destinationAmount: 50000000n, // 50 USDC
|
74
|
+
destinationToken: {
|
75
|
+
chainId: 137,
|
76
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
77
|
+
name: "USD Coin (PoS)",
|
78
|
+
symbol: "USDC",
|
79
|
+
decimals: 6,
|
80
|
+
priceUsd: 1.0,
|
81
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
82
|
+
},
|
83
|
+
timestamp: Date.now(),
|
84
|
+
steps: [], // No additional steps needed
|
85
|
+
intent: {
|
86
|
+
onramp: "stripe",
|
87
|
+
chainId: 137,
|
88
|
+
tokenAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
89
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
90
|
+
amount: 50000000n,
|
91
|
+
},
|
92
|
+
}));
|
93
|
+
// Onramp quote with 2 extra swap steps
|
94
|
+
export const onrampWithSwapsQuote = JSON.parse(stringify({
|
95
|
+
type: "onramp",
|
96
|
+
id: "onramp-swaps-456",
|
97
|
+
link: "https://stripe.com/session/swaps",
|
98
|
+
currency: "EUR",
|
99
|
+
currencyAmount: 100.0,
|
100
|
+
destinationAmount: 1000000000000000000n, // 1 ETH
|
101
|
+
destinationToken: {
|
102
|
+
chainId: 1,
|
103
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
104
|
+
name: "Ethereum",
|
105
|
+
symbol: "ETH",
|
106
|
+
decimals: 18,
|
107
|
+
priceUsd: 2500.0,
|
108
|
+
},
|
109
|
+
timestamp: Date.now(),
|
110
|
+
steps: [
|
111
|
+
{
|
112
|
+
originToken: {
|
113
|
+
chainId: 137,
|
114
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
115
|
+
name: "USD Coin (PoS)",
|
116
|
+
symbol: "USDC",
|
117
|
+
decimals: 6,
|
118
|
+
priceUsd: 1.0,
|
119
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
120
|
+
},
|
121
|
+
destinationToken: {
|
122
|
+
chainId: 137,
|
123
|
+
address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
124
|
+
name: "Wrapped Ether",
|
125
|
+
symbol: "WETH",
|
126
|
+
decimals: 18,
|
127
|
+
priceUsd: 2500.0,
|
128
|
+
},
|
129
|
+
originAmount: 110000000n, // 110 USDC
|
130
|
+
destinationAmount: 44000000000000000n, // 0.044 WETH
|
131
|
+
estimatedExecutionTimeMs: 30000,
|
132
|
+
transactions: [
|
133
|
+
{
|
134
|
+
action: "approval",
|
135
|
+
id: "0x1a2b3c",
|
136
|
+
to: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
|
137
|
+
data: "0x095ea7b3",
|
138
|
+
chainId: 137,
|
139
|
+
client: storyClient,
|
140
|
+
chain: defineChain(137),
|
141
|
+
},
|
142
|
+
{
|
143
|
+
action: "buy",
|
144
|
+
id: "0x4d5e6f",
|
145
|
+
to: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
|
146
|
+
data: "0x472b43f3",
|
147
|
+
chainId: 137,
|
148
|
+
client: storyClient,
|
149
|
+
chain: defineChain(137),
|
150
|
+
},
|
151
|
+
],
|
152
|
+
},
|
153
|
+
{
|
154
|
+
originToken: {
|
155
|
+
chainId: 137,
|
156
|
+
address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
157
|
+
name: "Wrapped Ether",
|
158
|
+
symbol: "WETH",
|
159
|
+
decimals: 18,
|
160
|
+
priceUsd: 2500.0,
|
161
|
+
},
|
162
|
+
destinationToken: {
|
163
|
+
chainId: 1,
|
164
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
165
|
+
name: "Ethereum",
|
166
|
+
symbol: "ETH",
|
167
|
+
decimals: 18,
|
168
|
+
priceUsd: 2500.0,
|
169
|
+
},
|
170
|
+
originAmount: 44000000000000000n, // 0.044 WETH
|
171
|
+
destinationAmount: 1000000000000000000n, // 1 ETH
|
172
|
+
estimatedExecutionTimeMs: 180000,
|
173
|
+
transactions: [
|
174
|
+
{
|
175
|
+
action: "approval",
|
176
|
+
id: "0x7g8h9i",
|
177
|
+
to: "0x3fc91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
178
|
+
data: "0x095ea7b3",
|
179
|
+
chainId: 137,
|
180
|
+
client: storyClient,
|
181
|
+
chain: defineChain(137),
|
182
|
+
},
|
183
|
+
{
|
184
|
+
action: "transfer",
|
185
|
+
id: "0xj1k2l3",
|
186
|
+
to: "0x3fc91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
187
|
+
data: "0x3593564c",
|
188
|
+
chainId: 137,
|
189
|
+
client: storyClient,
|
190
|
+
chain: defineChain(137),
|
191
|
+
},
|
192
|
+
],
|
193
|
+
},
|
194
|
+
],
|
195
|
+
intent: {
|
196
|
+
onramp: "stripe",
|
197
|
+
chainId: 1,
|
198
|
+
tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
199
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
200
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
201
|
+
amount: 1000000000000000000n,
|
202
|
+
},
|
203
|
+
}));
|
204
|
+
// Simple buy quote with single step (no approval needed)
|
205
|
+
export const simpleBuyQuote = JSON.parse(stringify({
|
206
|
+
type: "buy",
|
207
|
+
originAmount: 1000000000000000000n, // 1 ETH
|
208
|
+
destinationAmount: 100000000n, // 100 USDC
|
209
|
+
timestamp: Date.now(),
|
210
|
+
estimatedExecutionTimeMs: 60000,
|
211
|
+
steps: [
|
212
|
+
{
|
213
|
+
originToken: {
|
214
|
+
chainId: 1,
|
215
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
216
|
+
name: "Ethereum",
|
217
|
+
symbol: "ETH",
|
218
|
+
decimals: 18,
|
219
|
+
priceUsd: 2500.0,
|
220
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
221
|
+
},
|
222
|
+
destinationToken: {
|
223
|
+
chainId: 1,
|
224
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
225
|
+
name: "USD Coin",
|
226
|
+
symbol: "USDC",
|
227
|
+
decimals: 6,
|
228
|
+
priceUsd: 1.0,
|
229
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
230
|
+
},
|
231
|
+
originAmount: 1000000000000000000n,
|
232
|
+
destinationAmount: 100000000n,
|
233
|
+
estimatedExecutionTimeMs: 60000,
|
234
|
+
transactions: [
|
235
|
+
{
|
236
|
+
action: "buy",
|
237
|
+
id: "0xsingle123",
|
238
|
+
to: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
|
239
|
+
data: "0x472b43f3",
|
240
|
+
value: 1000000000000000000n,
|
241
|
+
chainId: 1,
|
242
|
+
client: storyClient,
|
243
|
+
chain: defineChain(1),
|
244
|
+
},
|
245
|
+
],
|
246
|
+
},
|
247
|
+
],
|
248
|
+
intent: {
|
249
|
+
originChainId: 1,
|
250
|
+
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
251
|
+
destinationChainId: 1,
|
252
|
+
destinationTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
253
|
+
amount: 100000000n,
|
254
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
255
|
+
receiver: "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b",
|
256
|
+
},
|
257
|
+
}));
|
258
|
+
export const longTextBuyQuote = JSON.parse(stringify({
|
259
|
+
type: "buy",
|
260
|
+
originAmount: 1000000000000000000n, // 1 ETH
|
261
|
+
destinationAmount: 1000394284092830482309n,
|
262
|
+
timestamp: Date.now(),
|
263
|
+
estimatedExecutionTimeMs: 60000,
|
264
|
+
steps: [
|
265
|
+
{
|
266
|
+
originToken: {
|
267
|
+
chainId: 1,
|
268
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
269
|
+
name: "Ethereum",
|
270
|
+
symbol: "ETH",
|
271
|
+
decimals: 18,
|
272
|
+
priceUsd: 2500.0,
|
273
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
274
|
+
},
|
275
|
+
destinationToken: {
|
276
|
+
chainId: 42793,
|
277
|
+
address: "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
|
278
|
+
name: "USD Coin (USDC.e on Etherlink)",
|
279
|
+
symbol: "USDC.e",
|
280
|
+
decimals: 6,
|
281
|
+
priceUsd: 1.0,
|
282
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
283
|
+
},
|
284
|
+
originAmount: 1000000000000000000n,
|
285
|
+
destinationAmount: 1000394284092830482309n,
|
286
|
+
estimatedExecutionTimeMs: 60000,
|
287
|
+
transactions: [
|
288
|
+
{
|
289
|
+
action: "buy",
|
290
|
+
id: "0xsingle123",
|
291
|
+
to: "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
|
292
|
+
data: "0x472b43f3",
|
293
|
+
value: 1000000000000000000n,
|
294
|
+
chainId: 1,
|
295
|
+
client: storyClient,
|
296
|
+
chain: defineChain(1),
|
297
|
+
},
|
298
|
+
],
|
299
|
+
},
|
300
|
+
],
|
301
|
+
intent: {
|
302
|
+
originChainId: 1,
|
303
|
+
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
304
|
+
destinationChainId: 1,
|
305
|
+
destinationTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
306
|
+
amount: 100000000n,
|
307
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
308
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
309
|
+
},
|
310
|
+
}));
|
311
|
+
// Buy quote with approval + buy in single step
|
312
|
+
export const buyWithApprovalQuote = JSON.parse(stringify({
|
313
|
+
type: "buy",
|
314
|
+
originAmount: 100000000n, // 100 USDC
|
315
|
+
destinationAmount: 100000000n, // 100 USDC on different chain
|
316
|
+
timestamp: Date.now(),
|
317
|
+
estimatedExecutionTimeMs: 120000,
|
318
|
+
steps: [
|
319
|
+
{
|
320
|
+
originToken: {
|
321
|
+
chainId: 1,
|
322
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
323
|
+
name: "USD Coin",
|
324
|
+
symbol: "USDC",
|
325
|
+
decimals: 6,
|
326
|
+
priceUsd: 1.0,
|
327
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
328
|
+
},
|
329
|
+
destinationToken: {
|
330
|
+
chainId: 137,
|
331
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
332
|
+
name: "USD Coin (PoS)",
|
333
|
+
symbol: "USDC",
|
334
|
+
decimals: 6,
|
335
|
+
priceUsd: 1.0,
|
336
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
337
|
+
},
|
338
|
+
originAmount: 100000000n,
|
339
|
+
destinationAmount: 100000000n,
|
340
|
+
estimatedExecutionTimeMs: 120000,
|
341
|
+
transactions: [
|
342
|
+
{
|
343
|
+
action: "approval",
|
344
|
+
id: "0xapproval789",
|
345
|
+
to: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
346
|
+
data: "0x095ea7b3",
|
347
|
+
chainId: 1,
|
348
|
+
client: storyClient,
|
349
|
+
chain: defineChain(1),
|
350
|
+
},
|
351
|
+
{
|
352
|
+
action: "buy",
|
353
|
+
id: "0xbuy456",
|
354
|
+
to: "0x3fc91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
355
|
+
data: "0x3593564c",
|
356
|
+
chainId: 1,
|
357
|
+
client: storyClient,
|
358
|
+
chain: defineChain(1),
|
359
|
+
},
|
360
|
+
],
|
361
|
+
},
|
362
|
+
],
|
363
|
+
intent: {
|
364
|
+
originChainId: 1,
|
365
|
+
originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
366
|
+
destinationChainId: 137,
|
367
|
+
destinationTokenAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
368
|
+
amount: 100000000n,
|
369
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
370
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
371
|
+
},
|
372
|
+
}));
|
373
|
+
// Complex buy quote with 3 steps, each with approval + buy
|
374
|
+
export const complexBuyQuote = JSON.parse(stringify({
|
375
|
+
type: "buy",
|
376
|
+
originAmount: 1000000000000000000n, // 1 ETH
|
377
|
+
destinationAmount: 1000000000000000000n, // 1 ETH on final chain
|
378
|
+
timestamp: Date.now(),
|
379
|
+
estimatedExecutionTimeMs: 300000,
|
380
|
+
steps: [
|
381
|
+
{
|
382
|
+
originToken: {
|
383
|
+
chainId: 1,
|
384
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
385
|
+
name: "Ethereum",
|
386
|
+
symbol: "ETH",
|
387
|
+
decimals: 18,
|
388
|
+
priceUsd: 2500.0,
|
389
|
+
},
|
390
|
+
destinationToken: {
|
391
|
+
chainId: 1,
|
392
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
393
|
+
name: "USD Coin",
|
394
|
+
symbol: "USDC",
|
395
|
+
decimals: 6,
|
396
|
+
priceUsd: 1.0,
|
397
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
398
|
+
},
|
399
|
+
originAmount: 1000000000000000000n,
|
400
|
+
destinationAmount: 2500000000n, // 2500 USDC
|
401
|
+
estimatedExecutionTimeMs: 60000,
|
402
|
+
transactions: [
|
403
|
+
{
|
404
|
+
action: "approval",
|
405
|
+
id: "0xstep1approval",
|
406
|
+
to: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
407
|
+
data: "0x095ea7b3",
|
408
|
+
chainId: 1,
|
409
|
+
client: storyClient,
|
410
|
+
chain: defineChain(1),
|
411
|
+
},
|
412
|
+
{
|
413
|
+
action: "buy",
|
414
|
+
id: "0xstep1buy",
|
415
|
+
to: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
416
|
+
data: "0x7ff36ab5",
|
417
|
+
value: 1000000000000000000n,
|
418
|
+
chainId: 1,
|
419
|
+
client: storyClient,
|
420
|
+
chain: defineChain(1),
|
421
|
+
},
|
422
|
+
],
|
423
|
+
},
|
424
|
+
{
|
425
|
+
originToken: {
|
426
|
+
chainId: 1,
|
427
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
428
|
+
name: "USD Coin",
|
429
|
+
symbol: "USDC",
|
430
|
+
decimals: 6,
|
431
|
+
priceUsd: 1.0,
|
432
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
433
|
+
},
|
434
|
+
destinationToken: {
|
435
|
+
chainId: 137,
|
436
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
437
|
+
name: "USD Coin (PoS)",
|
438
|
+
symbol: "USDC",
|
439
|
+
decimals: 6,
|
440
|
+
priceUsd: 1.0,
|
441
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
442
|
+
},
|
443
|
+
originAmount: 2500000000n,
|
444
|
+
destinationAmount: 2495000000n, // 2495 USDC (after bridge fees)
|
445
|
+
estimatedExecutionTimeMs: 180000,
|
446
|
+
transactions: [
|
447
|
+
{
|
448
|
+
action: "approval",
|
449
|
+
id: "0xstep2approval",
|
450
|
+
to: "0x3fc91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
451
|
+
data: "0x095ea7b3",
|
452
|
+
chainId: 1,
|
453
|
+
client: storyClient,
|
454
|
+
chain: defineChain(1),
|
455
|
+
},
|
456
|
+
{
|
457
|
+
action: "transfer",
|
458
|
+
id: "0xstep2bridge",
|
459
|
+
to: "0x3fc91A3afd70395Cd496C647d5a6CC9D4B2b7FAD",
|
460
|
+
data: "0x3593564c",
|
461
|
+
chainId: 1,
|
462
|
+
client: storyClient,
|
463
|
+
chain: defineChain(1),
|
464
|
+
},
|
465
|
+
],
|
466
|
+
},
|
467
|
+
{
|
468
|
+
originToken: {
|
469
|
+
chainId: 137,
|
470
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
471
|
+
name: "USD Coin (PoS)",
|
472
|
+
symbol: "USDC",
|
473
|
+
decimals: 6,
|
474
|
+
priceUsd: 1.0,
|
475
|
+
iconUri: "https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",
|
476
|
+
},
|
477
|
+
destinationToken: {
|
478
|
+
chainId: 43114,
|
479
|
+
address: "0x62D0A8458eD7719FDAF978fe5929C6D342B0bFcE",
|
480
|
+
symbol: "BEAM",
|
481
|
+
name: "Beam",
|
482
|
+
decimals: 18,
|
483
|
+
priceUsd: 0.00642458,
|
484
|
+
iconUri: "https://coin-images.coingecko.com/coins/images/32417/small/cgicon.png?1747892021",
|
485
|
+
},
|
486
|
+
originAmount: 2495000000n,
|
487
|
+
destinationAmount: 1000000000000000000n, // 1 BEAM
|
488
|
+
estimatedExecutionTimeMs: 60000,
|
489
|
+
transactions: [
|
490
|
+
{
|
491
|
+
action: "approval",
|
492
|
+
id: "0xstep3approval",
|
493
|
+
to: "0x1111111254fb6c44bAC0beD2854e76F90643097d",
|
494
|
+
data: "0x095ea7b3",
|
495
|
+
chainId: 137,
|
496
|
+
client: storyClient,
|
497
|
+
chain: defineChain(137),
|
498
|
+
},
|
499
|
+
{
|
500
|
+
action: "buy",
|
501
|
+
id: "0xstep3buy",
|
502
|
+
to: "0x1111111254fb6c44bAC0beD2854e76F90643097d",
|
503
|
+
data: "0x12aa3caf",
|
504
|
+
chainId: 137,
|
505
|
+
client: storyClient,
|
506
|
+
chain: defineChain(137),
|
507
|
+
},
|
508
|
+
],
|
509
|
+
},
|
510
|
+
],
|
511
|
+
intent: {
|
512
|
+
originChainId: 1,
|
513
|
+
originTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
514
|
+
destinationChainId: 42161,
|
515
|
+
destinationTokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
516
|
+
amount: 1000000000000000000n,
|
517
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
518
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
519
|
+
},
|
520
|
+
}));
|
521
|
+
export const simpleBuyRequest = {
|
522
|
+
type: "buy",
|
523
|
+
originChainId: 1,
|
524
|
+
originTokenAddress: NATIVE_TOKEN_ADDRESS,
|
525
|
+
destinationChainId: 10,
|
526
|
+
destinationTokenAddress: NATIVE_TOKEN_ADDRESS,
|
527
|
+
amount: toWei("0.01"),
|
528
|
+
sender: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
529
|
+
receiver: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
530
|
+
client: storyClient,
|
531
|
+
};
|
532
|
+
// ========== PREPARED TRANSACTIONS FOR TRANSACTION PAYMENT ========== //
|
533
|
+
// mintTo raw transaction
|
534
|
+
const ethTransferTransaction = prepareTransaction({
|
535
|
+
to: "0x87C52295891f208459F334975a3beE198fE75244",
|
536
|
+
data: "0x449a52f80000000000000000000000008447c7a30d18e9adf2abe362689fc994cc6a340d00000000000000000000000000000000000000000000000000038d7ea4c68000",
|
537
|
+
chain: baseSepolia,
|
538
|
+
client: storyClient,
|
539
|
+
});
|
540
|
+
// ERC20 token transaction with value
|
541
|
+
const erc20Transaction = transfer({
|
542
|
+
contract: getContract({
|
543
|
+
client: storyClient,
|
544
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
545
|
+
chain: base,
|
546
|
+
}),
|
547
|
+
to: "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b",
|
548
|
+
amount: 100,
|
549
|
+
});
|
550
|
+
// claimTo on Polygon
|
551
|
+
const contractInteractionTransaction = claimTo({
|
552
|
+
contract: getContract({
|
553
|
+
client: storyClient,
|
554
|
+
address: "0x683f91F407301b90e501492F8A26A3498D8d9638",
|
555
|
+
chain: polygon,
|
556
|
+
}),
|
557
|
+
to: "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b",
|
558
|
+
quantity: "10",
|
559
|
+
});
|
560
|
+
// ========== COMMON DUMMY DATA FOR STORYBOOK ========== //
|
561
|
+
// Common receiver addresses for testing
|
562
|
+
export const RECEIVER_ADDRESSES = {
|
563
|
+
primary: "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b",
|
564
|
+
secondary: "0xa3841994009B4fEabb01ebcC62062F9E56F701CD",
|
565
|
+
seller: "0x1234567890123456789012345678901234567890",
|
566
|
+
subscription: "0x9876543210987654321098765432109876543210",
|
567
|
+
physical: "0x5555666677778888999900001111222233334444",
|
568
|
+
};
|
569
|
+
// Product metadata for direct payments
|
570
|
+
const PRODUCT_METADATA = {
|
571
|
+
digitalArt: {
|
572
|
+
name: "Premium Digital Art NFT",
|
573
|
+
image: "https://images.unsplash.com/photo-1465101046530-73398c7f28ca?w=500&h=300&fit=crop",
|
574
|
+
description: "This is a premium digital art by a famous artist",
|
575
|
+
},
|
576
|
+
concertTicket: {
|
577
|
+
name: "Concert Ticket - The Midnight Live",
|
578
|
+
image: "https://images.unsplash.com/photo-1501281668745-f7f57925c3b4?w=500&h=300&fit=crop",
|
579
|
+
description: "Concert ticket for the upcoming show",
|
580
|
+
},
|
581
|
+
subscription: {
|
582
|
+
name: "Premium Streaming Service - Monthly",
|
583
|
+
image: "https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=500&h=300&fit=crop",
|
584
|
+
description: "Get unlimited access to our premium streaming service with this monthly subscription. Enjoy ad-free viewing, exclusive content, and the ability to download shows for offline viewing.",
|
585
|
+
},
|
586
|
+
sneakers: {
|
587
|
+
name: "Limited Edition Sneakers",
|
588
|
+
image: "https://images.unsplash.com/photo-1549298916-b41d501d3772?w=500&h=300&fit=crop",
|
589
|
+
},
|
590
|
+
credits: {
|
591
|
+
name: "Thirdweb Credits",
|
592
|
+
description: "Add credits to your account for future billing cycles. Credits are non-refundable and do not expire.",
|
593
|
+
},
|
594
|
+
};
|
595
|
+
// UI Options for FundWallet mode
|
596
|
+
export const FUND_WALLET_UI_OPTIONS = {
|
597
|
+
ethDefault: {
|
598
|
+
mode: "fund_wallet",
|
599
|
+
destinationToken: ETH,
|
600
|
+
metadata: {
|
601
|
+
title: "Fund Wallet",
|
602
|
+
description: "Add funds to your wallet",
|
603
|
+
},
|
604
|
+
},
|
605
|
+
ethWithAmount: {
|
606
|
+
mode: "fund_wallet",
|
607
|
+
destinationToken: ETH,
|
608
|
+
initialAmount: "0.001",
|
609
|
+
metadata: {
|
610
|
+
title: "Fund Wallet",
|
611
|
+
description: "Add funds to your wallet",
|
612
|
+
},
|
613
|
+
},
|
614
|
+
usdcDefault: {
|
615
|
+
mode: "fund_wallet",
|
616
|
+
destinationToken: USDC,
|
617
|
+
initialAmount: "5",
|
618
|
+
},
|
619
|
+
uniLarge: {
|
620
|
+
mode: "fund_wallet",
|
621
|
+
destinationToken: UNI,
|
622
|
+
initialAmount: "150000",
|
623
|
+
metadata: {
|
624
|
+
title: "Fund Wallet",
|
625
|
+
description: "Add UNI tokens to your wallet",
|
626
|
+
},
|
627
|
+
},
|
628
|
+
};
|
629
|
+
// UI Options for DirectPayment mode
|
630
|
+
export const DIRECT_PAYMENT_UI_OPTIONS = {
|
631
|
+
digitalArt: {
|
632
|
+
mode: "direct_payment",
|
633
|
+
paymentInfo: {
|
634
|
+
sellerAddress: RECEIVER_ADDRESSES.seller,
|
635
|
+
token: ETH,
|
636
|
+
amount: "0.1",
|
637
|
+
feePayer: "sender",
|
638
|
+
},
|
639
|
+
metadata: {
|
640
|
+
title: "Purchase Digital Art",
|
641
|
+
description: "Buy premium digital art NFT",
|
642
|
+
image: PRODUCT_METADATA.digitalArt.image,
|
643
|
+
},
|
644
|
+
},
|
645
|
+
concertTicket: {
|
646
|
+
mode: "direct_payment",
|
647
|
+
paymentInfo: {
|
648
|
+
sellerAddress: RECEIVER_ADDRESSES.primary,
|
649
|
+
token: USDC,
|
650
|
+
amount: "25.00",
|
651
|
+
feePayer: "receiver",
|
652
|
+
},
|
653
|
+
metadata: {
|
654
|
+
title: "Buy Concert Ticket",
|
655
|
+
description: "Get your ticket for The Midnight Live",
|
656
|
+
image: PRODUCT_METADATA.concertTicket.image,
|
657
|
+
},
|
658
|
+
},
|
659
|
+
subscription: {
|
660
|
+
mode: "direct_payment",
|
661
|
+
paymentInfo: {
|
662
|
+
sellerAddress: RECEIVER_ADDRESSES.subscription,
|
663
|
+
token: USDC,
|
664
|
+
amount: "9.99",
|
665
|
+
feePayer: "sender",
|
666
|
+
},
|
667
|
+
metadata: {
|
668
|
+
title: "Subscribe to Premium",
|
669
|
+
description: PRODUCT_METADATA.subscription.description,
|
670
|
+
image: PRODUCT_METADATA.subscription.image,
|
671
|
+
},
|
672
|
+
},
|
673
|
+
sneakers: {
|
674
|
+
mode: "direct_payment",
|
675
|
+
paymentInfo: {
|
676
|
+
sellerAddress: RECEIVER_ADDRESSES.physical,
|
677
|
+
token: ETH,
|
678
|
+
amount: "0.05",
|
679
|
+
feePayer: "receiver",
|
680
|
+
},
|
681
|
+
metadata: {
|
682
|
+
title: "Buy Sneakers",
|
683
|
+
description: "Limited edition sneakers",
|
684
|
+
image: PRODUCT_METADATA.sneakers.image,
|
685
|
+
},
|
686
|
+
},
|
687
|
+
credits: {
|
688
|
+
mode: "direct_payment",
|
689
|
+
paymentInfo: {
|
690
|
+
sellerAddress: RECEIVER_ADDRESSES.physical,
|
691
|
+
token: USDC,
|
692
|
+
amount: "25",
|
693
|
+
feePayer: "receiver",
|
694
|
+
},
|
695
|
+
metadata: {
|
696
|
+
title: "Add Credits",
|
697
|
+
description: PRODUCT_METADATA.credits.description,
|
698
|
+
},
|
699
|
+
},
|
700
|
+
};
|
701
|
+
// UI Options for Transaction mode
|
702
|
+
export const TRANSACTION_UI_OPTIONS = {
|
703
|
+
ethTransfer: {
|
704
|
+
mode: "transaction",
|
705
|
+
transaction: ethTransferTransaction,
|
706
|
+
metadata: {
|
707
|
+
title: "Execute Transaction",
|
708
|
+
description: "Review and execute transaction",
|
709
|
+
},
|
710
|
+
},
|
711
|
+
erc20Transfer: {
|
712
|
+
mode: "transaction",
|
713
|
+
transaction: erc20Transaction,
|
714
|
+
metadata: {
|
715
|
+
title: "Token Transfer",
|
716
|
+
description: "Transfer ERC20 tokens",
|
717
|
+
},
|
718
|
+
},
|
719
|
+
contractInteraction: {
|
720
|
+
mode: "transaction",
|
721
|
+
transaction: contractInteractionTransaction,
|
722
|
+
metadata: {
|
723
|
+
title: "Contract Interaction",
|
724
|
+
description: "Interact with smart contract",
|
725
|
+
},
|
726
|
+
},
|
727
|
+
};
|
728
|
+
//# sourceMappingURL=fixtures.js.map
|