thirdweb 5.102.7-nightly-3f747601135809eedf86a150752f4b5f12c99776-20250617000426 → 5.103.1-nightly-bb09e20bcb1662c088bf8b61486df7d0d92da8d0-20250618000421
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/cli/bin.js +2 -2
- package/dist/cjs/cli/bin.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/hooks/wallets/useSendToken.js +17 -2
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -1
- 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 +143 -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 +162 -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/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/cli/bin.js +2 -2
- package/dist/esm/cli/bin.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/hooks/wallets/useSendToken.js +17 -2
- package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -1
- 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 +140 -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 +159 -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/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/hooks/wallets/useSendToken.d.ts.map +1 -1
- 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 +317 -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 +338 -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/wallets/utils/getWalletBalance.d.ts +1 -1
- package/dist/types/wallets/utils/getWalletBalance.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/bridge/Routes.ts +5 -0
- package/src/bridge/Status.test.ts +1 -1
- 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/cli/bin.ts +2 -2
- 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.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.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/hooks/wallets/useSendToken.ts +17 -3
- package/src/react/core/machines/.keep +2 -0
- package/src/react/core/machines/paymentMachine.test.ts +519 -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 +30 -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 +473 -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 +485 -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
- package/src/wallets/utils/getWalletBalance.ts +1 -1
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
import type { Token } from "../../../../bridge/index.js";
|
|
5
|
+
import type { Chain } from "../../../../chains/types.js";
|
|
6
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
|
7
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../../../constants/addresses.js";
|
|
8
|
+
import { getToken } from "../../../../pay/convert/get-token.js";
|
|
9
|
+
import {
|
|
10
|
+
type Address,
|
|
11
|
+
checksumAddress,
|
|
12
|
+
isAddress,
|
|
13
|
+
} from "../../../../utils/address.js";
|
|
14
|
+
import { stringify } from "../../../../utils/json.js";
|
|
15
|
+
import { toTokens } from "../../../../utils/units.js";
|
|
16
|
+
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
|
17
|
+
import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
|
|
18
|
+
import type { AppMetadata } from "../../../../wallets/types.js";
|
|
19
|
+
import type { WalletId } from "../../../../wallets/wallet-types.js";
|
|
20
|
+
import { CustomThemeProvider } from "../../../core/design-system/CustomThemeProvider.js";
|
|
21
|
+
import type { Theme } from "../../../core/design-system/index.js";
|
|
22
|
+
import type { SiweAuthOptions } from "../../../core/hooks/auth/useSiweAuth.js";
|
|
23
|
+
import type { ConnectButton_connectModalOptions } from "../../../core/hooks/connection/ConnectButtonProps.js";
|
|
24
|
+
import type { SupportedTokens } from "../../../core/utils/defaultTokens.js";
|
|
25
|
+
import { EmbedContainer } from "../ConnectWallet/Modal/ConnectEmbed.js";
|
|
26
|
+
import { useConnectLocale } from "../ConnectWallet/locale/getConnectLocale.js";
|
|
27
|
+
import { DynamicHeight } from "../components/DynamicHeight.js";
|
|
28
|
+
import { Spinner } from "../components/Spinner.js";
|
|
29
|
+
import type { LocaleId } from "../types.js";
|
|
30
|
+
import { BridgeOrchestrator, type UIOptions } from "./BridgeOrchestrator.js";
|
|
31
|
+
import { UnsupportedTokenScreen } from "./UnsupportedTokenScreen.js";
|
|
32
|
+
|
|
33
|
+
export type BuyWidgetProps = {
|
|
34
|
+
supportedTokens?: SupportedTokens;
|
|
35
|
+
/**
|
|
36
|
+
* A client is the entry point to the thirdweb SDK.
|
|
37
|
+
* It is required for all other actions.
|
|
38
|
+
* You can create a client using the `createThirdwebClient` function. Refer to the [Creating a Client](https://portal.thirdweb.com/typescript/v5/client) documentation for more information.
|
|
39
|
+
*
|
|
40
|
+
* You must provide a `clientId` or `secretKey` in order to initialize a client. Pass `clientId` if you want for client-side usage and `secretKey` for server-side usage.
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { createThirdwebClient } from "thirdweb";
|
|
44
|
+
*
|
|
45
|
+
* const client = createThirdwebClient({
|
|
46
|
+
* clientId: "<your_client_id>",
|
|
47
|
+
* })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
client: ThirdwebClient;
|
|
51
|
+
/**
|
|
52
|
+
* By default - ConnectButton UI uses the `en-US` locale for english language users.
|
|
53
|
+
*
|
|
54
|
+
* You can customize the language used in the ConnectButton UI by setting the `locale` prop.
|
|
55
|
+
*
|
|
56
|
+
* Refer to the [`LocaleId`](https://portal.thirdweb.com/references/typescript/v5/LocaleId) type for supported locales.
|
|
57
|
+
*/
|
|
58
|
+
locale?: LocaleId;
|
|
59
|
+
/**
|
|
60
|
+
* Set the theme for the `BuyWidget` component. By default it is set to `"dark"`
|
|
61
|
+
*
|
|
62
|
+
* theme can be set to either `"dark"`, `"light"` or a custom theme object.
|
|
63
|
+
* You can also import [`lightTheme`](https://portal.thirdweb.com/references/typescript/v5/lightTheme)
|
|
64
|
+
* or [`darkTheme`](https://portal.thirdweb.com/references/typescript/v5/darkTheme)
|
|
65
|
+
* functions from `thirdweb/react` to use the default themes as base and overrides parts of it.
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { lightTheme } from "thirdweb/react";
|
|
69
|
+
*
|
|
70
|
+
* const customTheme = lightTheme({
|
|
71
|
+
* colors: {
|
|
72
|
+
* modalBg: 'red'
|
|
73
|
+
* }
|
|
74
|
+
* })
|
|
75
|
+
*
|
|
76
|
+
* function Example() {
|
|
77
|
+
* return <BuyWidget client={client} theme={customTheme} />
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
theme?: "light" | "dark" | Theme;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Customize the options for "Connect" Button showing in the BuyWidget UI when the user is not connected to a wallet.
|
|
85
|
+
*
|
|
86
|
+
* Refer to the [`BuyWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetConnectOptions) type for more details.
|
|
87
|
+
*/
|
|
88
|
+
connectOptions?: BuyWidgetConnectOptions;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* All wallet IDs included in this array will be hidden from wallet selection when connected.
|
|
92
|
+
*/
|
|
93
|
+
hiddenWallets?: WalletId[];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The wallet that should be pre-selected in the BuyWidget UI.
|
|
97
|
+
*/
|
|
98
|
+
activeWallet?: Wallet;
|
|
99
|
+
|
|
100
|
+
style?: React.CSSProperties;
|
|
101
|
+
|
|
102
|
+
className?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The chain the accepted token is on.
|
|
106
|
+
*/
|
|
107
|
+
chain: Chain;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Address of the token to buy. Leave undefined for the native token, or use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
|
|
111
|
+
*/
|
|
112
|
+
tokenAddress?: Address;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The amount to buy **(in wei)**.
|
|
116
|
+
*/
|
|
117
|
+
amount: bigint;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The title to display in the widget.
|
|
121
|
+
*/
|
|
122
|
+
title?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Preset fiat amounts to display in the UI. Defaults to [5, 10, 20].
|
|
126
|
+
*/
|
|
127
|
+
presetOptions?: [number, number, number];
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Arbitrary data to be included in the returned status and webhook events.
|
|
131
|
+
*/
|
|
132
|
+
purchaseData?: Record<string, unknown>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Callback triggered when the purchase is successful.
|
|
136
|
+
*/
|
|
137
|
+
onSuccess?: () => void;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Callback triggered when the purchase encounters an error.
|
|
141
|
+
*/
|
|
142
|
+
onError?: (error: Error) => void;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Callback triggered when the user cancels the purchase.
|
|
146
|
+
*/
|
|
147
|
+
onCancel?: () => void;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @hidden
|
|
151
|
+
*/
|
|
152
|
+
paymentLinkId?: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// Enhanced UIOptions to handle unsupported token state
|
|
156
|
+
type UIOptionsResult =
|
|
157
|
+
| { type: "success"; data: UIOptions }
|
|
158
|
+
| {
|
|
159
|
+
type: "indexing_token";
|
|
160
|
+
token: Token;
|
|
161
|
+
chain: Chain;
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
type: "unsupported_token";
|
|
165
|
+
tokenAddress: Address;
|
|
166
|
+
chain: Chain;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Widget is a prebuilt UI for purchasing a specific token.
|
|
171
|
+
*
|
|
172
|
+
* @param props - Props of type [`BuyWidgetProps`](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetProps) to configure the BuyWidget component.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ### Basic usage
|
|
176
|
+
*
|
|
177
|
+
* The `BuyWidget` component requires `client`, `chain`, and `amount` props to function.
|
|
178
|
+
*
|
|
179
|
+
* ```tsx
|
|
180
|
+
* import { ethereum } from "thirdweb/chains";
|
|
181
|
+
* import { toWei } from "thirdweb";
|
|
182
|
+
*
|
|
183
|
+
* <BuyWidget
|
|
184
|
+
* client={client}
|
|
185
|
+
* chain={ethereum}
|
|
186
|
+
* amount={toWei("0.1")}
|
|
187
|
+
* />
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* ### Buy a specific token
|
|
191
|
+
*
|
|
192
|
+
* You can specify a token to purchase by passing the `tokenAddress` prop.
|
|
193
|
+
*
|
|
194
|
+
* ```tsx
|
|
195
|
+
* <BuyWidget
|
|
196
|
+
* client={client}
|
|
197
|
+
* chain={ethereum}
|
|
198
|
+
* amount={toWei("100")}
|
|
199
|
+
* tokenAddress="0xA0b86a33E6417E4df2057B2d3C6d9F7cc11b0a70"
|
|
200
|
+
* />
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* ### Customize the UI
|
|
204
|
+
*
|
|
205
|
+
* You can customize the UI of the `BuyWidget` component by passing a custom theme object to the `theme` prop.
|
|
206
|
+
*
|
|
207
|
+
* ```tsx
|
|
208
|
+
* <BuyWidget
|
|
209
|
+
* client={client}
|
|
210
|
+
* chain={ethereum}
|
|
211
|
+
* amount={toWei("0.1")}
|
|
212
|
+
* theme={darkTheme({
|
|
213
|
+
* colors: {
|
|
214
|
+
* modalBg: "red",
|
|
215
|
+
* },
|
|
216
|
+
* })}
|
|
217
|
+
* />
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* Refer to the [`Theme`](https://portal.thirdweb.com/references/typescript/v5/Theme) type for more details.
|
|
221
|
+
*
|
|
222
|
+
* ### Update the Title
|
|
223
|
+
*
|
|
224
|
+
* You can update the title of the widget by passing a `title` prop to the `BuyWidget` component.
|
|
225
|
+
*
|
|
226
|
+
* ```tsx
|
|
227
|
+
* <BuyWidget
|
|
228
|
+
* client={client}
|
|
229
|
+
* chain={ethereum}
|
|
230
|
+
* amount={toWei("0.1")}
|
|
231
|
+
* title="Buy ETH"
|
|
232
|
+
* />
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* ### Configure the wallet connection
|
|
236
|
+
*
|
|
237
|
+
* You can customize the wallet connection flow by passing a `connectOptions` object to the `BuyWidget` component.
|
|
238
|
+
*
|
|
239
|
+
* ```tsx
|
|
240
|
+
* <BuyWidget
|
|
241
|
+
* client={client}
|
|
242
|
+
* chain={ethereum}
|
|
243
|
+
* amount={toWei("0.1")}
|
|
244
|
+
* connectOptions={{
|
|
245
|
+
* connectModal: {
|
|
246
|
+
* size: 'compact',
|
|
247
|
+
* title: "Sign in",
|
|
248
|
+
* }
|
|
249
|
+
* }}
|
|
250
|
+
* />
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* Refer to the [`BuyWidgetConnectOptions`](https://portal.thirdweb.com/references/typescript/v5/BuyWidgetConnectOptions) type for more details.
|
|
254
|
+
*
|
|
255
|
+
* @bridge
|
|
256
|
+
* @beta
|
|
257
|
+
* @react
|
|
258
|
+
*/
|
|
259
|
+
export function BuyWidget(props: BuyWidgetProps) {
|
|
260
|
+
const localeQuery = useConnectLocale(props.locale || "en_US");
|
|
261
|
+
const theme = props.theme || "dark";
|
|
262
|
+
|
|
263
|
+
const bridgeDataQuery = useQuery({
|
|
264
|
+
queryKey: ["bridgeData", stringify(props)],
|
|
265
|
+
queryFn: async (): Promise<UIOptionsResult> => {
|
|
266
|
+
if (
|
|
267
|
+
!props.tokenAddress ||
|
|
268
|
+
(isAddress(props.tokenAddress) &&
|
|
269
|
+
checksumAddress(props.tokenAddress) ===
|
|
270
|
+
checksumAddress(NATIVE_TOKEN_ADDRESS))
|
|
271
|
+
) {
|
|
272
|
+
const ETH = await getToken(
|
|
273
|
+
props.client,
|
|
274
|
+
NATIVE_TOKEN_ADDRESS,
|
|
275
|
+
props.chain.id,
|
|
276
|
+
);
|
|
277
|
+
return {
|
|
278
|
+
type: "success",
|
|
279
|
+
data: {
|
|
280
|
+
mode: "fund_wallet",
|
|
281
|
+
destinationToken: ETH,
|
|
282
|
+
initialAmount: toTokens(props.amount, ETH.decimals),
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const token = await getToken(
|
|
288
|
+
props.client,
|
|
289
|
+
props.tokenAddress,
|
|
290
|
+
props.chain.id,
|
|
291
|
+
).catch((err) => {
|
|
292
|
+
err.message.includes("not supported") ? undefined : Promise.reject(err);
|
|
293
|
+
});
|
|
294
|
+
if (!token) {
|
|
295
|
+
return {
|
|
296
|
+
type: "unsupported_token",
|
|
297
|
+
tokenAddress: props.tokenAddress,
|
|
298
|
+
chain: props.chain,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
type: "success",
|
|
303
|
+
data: {
|
|
304
|
+
mode: "fund_wallet",
|
|
305
|
+
destinationToken: token,
|
|
306
|
+
initialAmount: toTokens(props.amount, token.decimals),
|
|
307
|
+
metadata: {
|
|
308
|
+
title: props.title,
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
let content = null;
|
|
316
|
+
if (!localeQuery.data || bridgeDataQuery.isLoading) {
|
|
317
|
+
content = (
|
|
318
|
+
<div
|
|
319
|
+
style={{
|
|
320
|
+
minHeight: "350px",
|
|
321
|
+
display: "flex",
|
|
322
|
+
justifyContent: "center",
|
|
323
|
+
alignItems: "center",
|
|
324
|
+
}}
|
|
325
|
+
>
|
|
326
|
+
<Spinner size="xl" color="secondaryText" />
|
|
327
|
+
</div>
|
|
328
|
+
);
|
|
329
|
+
} else if (bridgeDataQuery.data?.type === "unsupported_token") {
|
|
330
|
+
// Show unsupported token screen
|
|
331
|
+
content = <UnsupportedTokenScreen chain={bridgeDataQuery.data.chain} />;
|
|
332
|
+
} else if (bridgeDataQuery.data?.type === "success") {
|
|
333
|
+
// Show normal bridge orchestrator
|
|
334
|
+
content = (
|
|
335
|
+
<BridgeOrchestrator
|
|
336
|
+
client={props.client}
|
|
337
|
+
uiOptions={bridgeDataQuery.data.data}
|
|
338
|
+
connectOptions={props.connectOptions}
|
|
339
|
+
connectLocale={localeQuery.data}
|
|
340
|
+
purchaseData={props.purchaseData}
|
|
341
|
+
paymentLinkId={props.paymentLinkId}
|
|
342
|
+
onComplete={() => {
|
|
343
|
+
props.onSuccess?.();
|
|
344
|
+
}}
|
|
345
|
+
onError={(err: Error) => {
|
|
346
|
+
props.onError?.(err);
|
|
347
|
+
}}
|
|
348
|
+
onCancel={() => {
|
|
349
|
+
props.onCancel?.();
|
|
350
|
+
}}
|
|
351
|
+
presetOptions={props.presetOptions}
|
|
352
|
+
receiverAddress={undefined}
|
|
353
|
+
/>
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return (
|
|
358
|
+
<CustomThemeProvider theme={theme}>
|
|
359
|
+
<EmbedContainer
|
|
360
|
+
modalSize="compact"
|
|
361
|
+
style={props.style}
|
|
362
|
+
className={props.className}
|
|
363
|
+
>
|
|
364
|
+
<DynamicHeight>{content}</DynamicHeight>
|
|
365
|
+
</EmbedContainer>
|
|
366
|
+
</CustomThemeProvider>
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Connection options for the `BuyWidget` component
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* ```tsx
|
|
375
|
+
* <BuyWidget client={client} connectOptions={{
|
|
376
|
+
* connectModal: {
|
|
377
|
+
* size: 'compact',
|
|
378
|
+
* title: "Sign in",
|
|
379
|
+
* }
|
|
380
|
+
* }}
|
|
381
|
+
* />
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
type BuyWidgetConnectOptions = {
|
|
385
|
+
/**
|
|
386
|
+
* Configurations for the `ConnectButton`'s Modal that is shown for connecting a wallet
|
|
387
|
+
* Refer to the [`ConnectButton_connectModalOptions`](https://portal.thirdweb.com/references/typescript/v5/ConnectButton_connectModalOptions) type for more details
|
|
388
|
+
*/
|
|
389
|
+
connectModal?: ConnectButton_connectModalOptions;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Configure options for WalletConnect
|
|
393
|
+
*
|
|
394
|
+
* By default WalletConnect uses the thirdweb's default project id.
|
|
395
|
+
* Setting your own project id is recommended.
|
|
396
|
+
*
|
|
397
|
+
* You can create a project id by signing up on [walletconnect.com](https://walletconnect.com/)
|
|
398
|
+
*/
|
|
399
|
+
walletConnect?: {
|
|
400
|
+
projectId?: string;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Enable Account abstraction for all wallets. This will connect to the users's smart account based on the connected personal wallet and the given options.
|
|
405
|
+
*
|
|
406
|
+
* This allows to sponsor gas fees for your user's transaction using the thirdweb account abstraction infrastructure.
|
|
407
|
+
*
|
|
408
|
+
*/
|
|
409
|
+
accountAbstraction?: SmartWalletOptions;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Array of wallets to show in Connect Modal. If not provided, default wallets will be used.
|
|
413
|
+
*/
|
|
414
|
+
wallets?: Wallet[];
|
|
415
|
+
/**
|
|
416
|
+
* When the user has connected their wallet to your site, this configuration determines whether or not you want to automatically connect to the last connected wallet when user visits your site again in the future.
|
|
417
|
+
*
|
|
418
|
+
* By default it is set to `{ timeout: 15000 }` meaning that autoConnect is enabled and if the autoConnection does not succeed within 15 seconds, it will be cancelled.
|
|
419
|
+
*
|
|
420
|
+
* If you want to disable autoConnect, set this prop to `false`.
|
|
421
|
+
*
|
|
422
|
+
* If you want to customize the timeout, you can assign an object with a `timeout` key to this prop.
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
autoConnect?:
|
|
426
|
+
| {
|
|
427
|
+
timeout: number;
|
|
428
|
+
}
|
|
429
|
+
| boolean;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.
|
|
433
|
+
*/
|
|
434
|
+
appMetadata?: AppMetadata;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* The [`Chain`](https://portal.thirdweb.com/references/typescript/v5/Chain) object of the blockchain you want the wallet to connect to
|
|
438
|
+
*
|
|
439
|
+
* If a `chain` is not specified, Wallet will be connected to whatever is the default set in the wallet.
|
|
440
|
+
*
|
|
441
|
+
* If a `chain` is specified, Wallet will be prompted to switch to given chain after connection if it is not already connected to it.
|
|
442
|
+
* This ensures that the wallet is connected to the correct blockchain before interacting with your app.
|
|
443
|
+
*
|
|
444
|
+
* The `ConnectButton` also shows a "Switch Network" button until the wallet is connected to the specified chain. Clicking on the "Switch Network" button triggers the wallet to switch to the specified chain.
|
|
445
|
+
*
|
|
446
|
+
* You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
|
|
447
|
+
* At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
|
|
448
|
+
* ```
|
|
449
|
+
*/
|
|
450
|
+
chain?: Chain;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Array of chains that your app supports.
|
|
454
|
+
*
|
|
455
|
+
* This is only relevant if your app is a multi-chain app and works across multiple blockchains.
|
|
456
|
+
* If your app only works on a single blockchain, you should only specify the `chain` prop.
|
|
457
|
+
*
|
|
458
|
+
* Given list of chains will used in various ways:
|
|
459
|
+
* - They will be displayed in the network selector in the `ConnectButton`'s details modal post connection
|
|
460
|
+
* - They will be sent to wallet at the time of connection if the wallet supports requesting multiple chains ( example: WalletConnect ) so that users can switch between the chains post connection easily
|
|
461
|
+
*
|
|
462
|
+
* You can create a `Chain` object using the [`defineChain`](https://portal.thirdweb.com/references/typescript/v5/defineChain) function.
|
|
463
|
+
* At minimum, you need to pass the `id` of the blockchain to `defineChain` function to create a `Chain` object.
|
|
464
|
+
*
|
|
465
|
+
* ```tsx
|
|
466
|
+
* import { defineChain } from "thirdweb/react";
|
|
467
|
+
*
|
|
468
|
+
* const polygon = defineChain({
|
|
469
|
+
* id: 137,
|
|
470
|
+
* });
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
chains?: Chain[];
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Wallets to show as recommended in the `ConnectButton`'s Modal
|
|
477
|
+
*/
|
|
478
|
+
recommendedWallets?: Wallet[];
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* By default, ConnectButton modal shows a "All Wallets" button that shows a list of 500+ wallets.
|
|
482
|
+
*
|
|
483
|
+
* You can disable this button by setting `showAllWallets` prop to `false`
|
|
484
|
+
*/
|
|
485
|
+
showAllWallets?: boolean;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Enable SIWE (Sign in with Ethererum) by passing an object of type `SiweAuthOptions` to
|
|
489
|
+
* enforce the users to sign a message after connecting their wallet to authenticate themselves.
|
|
490
|
+
*
|
|
491
|
+
* Refer to the [`SiweAuthOptions`](https://portal.thirdweb.com/references/typescript/v5/SiweAuthOptions) for more details
|
|
492
|
+
*/
|
|
493
|
+
auth?: SiweAuthOptions;
|
|
494
|
+
};
|