thirdweb 5.40.0-nightly-3848327373e49aa83c5902e6a16d5b8e96cf1eeb-20240726000343 → 5.40.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/exports/react.js +7 -2
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/react/core/design-system/index.js +2 -0
- package/dist/cjs/react/core/design-system/index.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +13 -94
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/utils/defaultTokens.js +32 -25
- package/dist/cjs/react/core/utils/defaultTokens.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +91 -13
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +18 -127
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +184 -118
- 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 +104 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +69 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +23 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +132 -45
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +2 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +13 -8
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +9 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +8 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +84 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +13 -7
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +16 -9
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +53 -0
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +33 -0
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/exports/react.js +3 -1
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/react/core/design-system/index.js +2 -0
- package/dist/esm/react/core/design-system/index.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +13 -93
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/utils/defaultTokens.js +31 -25
- package/dist/esm/react/core/utils/defaultTokens.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +88 -13
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +20 -129
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +188 -122
- 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 +101 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +66 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +22 -5
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +130 -44
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +2 -5
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +13 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +7 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +9 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +81 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js +14 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/nativeToken.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +16 -9
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +50 -0
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -0
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +29 -0
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/exports/react.d.ts +3 -2
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/react/core/design-system/index.d.ts +2 -0
- package/dist/types/react/core/design-system/index.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +80 -34
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +3 -15
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/utils/defaultTokens.d.ts +222 -0
- package/dist/types/react/core/utils/defaultTokens.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +43 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +2 -4
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +3 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +0 -3
- 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 +18 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +18 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts +5 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +14 -8
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts +19 -9
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +6 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -2
- 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/pay-transactions/BuyTxHistory.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +1 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +19 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/nativeToken.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +0 -6
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +9 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +24 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/exports/react.ts +14 -2
- package/src/react/core/design-system/index.ts +2 -0
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +103 -51
- package/src/react/core/hooks/transaction/useSendTransaction.ts +17 -127
- package/src/react/core/utils/defaultTokens.ts +38 -26
- package/src/react/core/utils/wallet.ts +102 -18
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +34 -278
- package/src/react/web/ui/ConnectWallet/Details.tsx +6 -4
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +347 -383
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +266 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +253 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +52 -21
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +3 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +5 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +16 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +155 -60
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +8 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +17 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx +2 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +27 -19
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +8 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +12 -5
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +2 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +3 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +243 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.tsx +30 -17
- package/src/react/web/ui/ConnectWallet/screens/nativeToken.ts +5 -1
- package/src/react/web/ui/PayEmbed.tsx +31 -32
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +127 -0
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +83 -0
- package/src/version.ts +1 -1
@@ -18,7 +18,7 @@ import type { SupportedTokens } from "../../core/utils/defaultTokens.js";
|
|
18
18
|
import { EmbedContainer } from "./ConnectWallet/Modal/ConnectEmbed.js";
|
19
19
|
import { useConnectLocale } from "./ConnectWallet/locale/getConnectLocale.js";
|
20
20
|
import BuyScreen from "./ConnectWallet/screens/Buy/BuyScreen.js";
|
21
|
-
import {
|
21
|
+
import { ExecutingTxScreen } from "./TransactionButton/ExecutingScreen.js";
|
22
22
|
import { DynamicHeight } from "./components/DynamicHeight.js";
|
23
23
|
import { Spinner } from "./components/Spinner.js";
|
24
24
|
import type { LocaleId } from "./types.js";
|
@@ -125,13 +125,6 @@ export type PayEmbedProps = {
|
|
125
125
|
*/
|
126
126
|
connectOptions?: PayEmbedConnectOptions;
|
127
127
|
|
128
|
-
/**
|
129
|
-
* Customize the display of the PayEmbed UI.
|
130
|
-
*/
|
131
|
-
metadata?: {
|
132
|
-
title?: string;
|
133
|
-
};
|
134
|
-
|
135
128
|
style?: React.CSSProperties;
|
136
129
|
};
|
137
130
|
|
@@ -159,7 +152,7 @@ export type PayEmbedProps = {
|
|
159
152
|
*/
|
160
153
|
export function PayEmbed(props: PayEmbedProps) {
|
161
154
|
const localeQuery = useConnectLocale(props.locale || "en_US");
|
162
|
-
const [screen, setScreen] = useState<"buy" | "tx
|
155
|
+
const [screen, setScreen] = useState<"buy" | "execute-tx">("buy");
|
163
156
|
const theme = props.theme || "dark";
|
164
157
|
|
165
158
|
// to update cached chains ASAP, we skip using useEffect - this does not trigger a re-render so it's fine
|
@@ -172,6 +165,10 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
172
165
|
}
|
173
166
|
|
174
167
|
let content = null;
|
168
|
+
const metadata =
|
169
|
+
props.payOptions && "metadata" in props.payOptions
|
170
|
+
? props.payOptions.metadata
|
171
|
+
: null;
|
175
172
|
|
176
173
|
if (!localeQuery.data) {
|
177
174
|
content = (
|
@@ -190,41 +187,43 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
190
187
|
// show and hide screens with CSS to not lose state when switching between them
|
191
188
|
content = (
|
192
189
|
<>
|
193
|
-
<div style={{ display: screen === "
|
190
|
+
<div style={{ display: screen === "buy" ? "inherit" : "none" }}>
|
194
191
|
<BuyScreen
|
195
|
-
title={
|
192
|
+
title={metadata?.name || "Buy"}
|
196
193
|
isEmbed={true}
|
197
194
|
supportedTokens={props.supportedTokens}
|
198
195
|
theme={theme}
|
199
196
|
client={props.client}
|
200
197
|
connectLocale={localeQuery.data}
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
198
|
+
payOptions={
|
199
|
+
props.payOptions || {
|
200
|
+
mode: "fund_wallet",
|
201
|
+
}
|
202
|
+
}
|
205
203
|
onDone={() => {
|
206
|
-
|
204
|
+
if (props.payOptions?.mode === "transaction") {
|
205
|
+
setScreen("execute-tx");
|
206
|
+
}
|
207
207
|
}}
|
208
208
|
connectOptions={props.connectOptions}
|
209
|
-
buyForTx={undefined}
|
210
209
|
onBack={undefined}
|
211
210
|
/>
|
212
211
|
</div>
|
213
|
-
|
214
|
-
{screen === "tx
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
212
|
+
|
213
|
+
{screen === "execute-tx" &&
|
214
|
+
props.payOptions?.mode === "transaction" &&
|
215
|
+
props.payOptions.transaction && (
|
216
|
+
<ExecutingTxScreen
|
217
|
+
tx={props.payOptions.transaction}
|
218
|
+
closeModal={() => {
|
219
|
+
setScreen("buy");
|
220
|
+
}}
|
221
|
+
onBack={() => {
|
222
|
+
setScreen("buy");
|
223
|
+
}}
|
224
|
+
onTxSent={() => {}}
|
225
|
+
/>
|
226
|
+
)}
|
228
227
|
</>
|
229
228
|
);
|
230
229
|
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
import { CheckCircledIcon, ExternalLinkIcon } from "@radix-ui/react-icons";
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
3
|
+
import type { Hex } from "viem";
|
4
|
+
import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js";
|
5
|
+
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
6
|
+
import { iconSize } from "../../../core/design-system/index.js";
|
7
|
+
import { useChainExplorers } from "../../../core/hooks/others/useChainQuery.js";
|
8
|
+
import { useSendTransaction } from "../../hooks/transaction/useSendTransaction.js";
|
9
|
+
import { AccentFailIcon } from "../ConnectWallet/icons/AccentFailIcon.js";
|
10
|
+
import { Spacer } from "../components/Spacer.js";
|
11
|
+
import { Spinner } from "../components/Spinner.js";
|
12
|
+
import { Container, ModalHeader } from "../components/basic.js";
|
13
|
+
import { Button, ButtonLink } from "../components/buttons.js";
|
14
|
+
import { Text } from "../components/text.js";
|
15
|
+
|
16
|
+
export function ExecutingTxScreen(props: {
|
17
|
+
tx: PreparedTransaction;
|
18
|
+
closeModal: () => void;
|
19
|
+
onTxSent: (data: WaitForReceiptOptions) => void;
|
20
|
+
onBack?: () => void;
|
21
|
+
}) {
|
22
|
+
const sendTxCore = useSendTransaction({
|
23
|
+
payModal: false,
|
24
|
+
});
|
25
|
+
const [txHash, setTxHash] = useState<Hex | undefined>();
|
26
|
+
const chainExplorers = useChainExplorers(props.tx.chain);
|
27
|
+
const [status, setStatus] = useState<"loading" | "failed" | "sent">(
|
28
|
+
"loading",
|
29
|
+
);
|
30
|
+
|
31
|
+
const sendTx = useCallback(async () => {
|
32
|
+
setStatus("loading");
|
33
|
+
try {
|
34
|
+
const txData = await sendTxCore.mutateAsync(props.tx);
|
35
|
+
setTxHash(txData.transactionHash);
|
36
|
+
props.onTxSent(txData);
|
37
|
+
setStatus("sent");
|
38
|
+
} catch (e) {
|
39
|
+
// Do not reject the transaction here, because the user may want to try again
|
40
|
+
// we only reject on modal close
|
41
|
+
console.error(e);
|
42
|
+
setStatus("failed");
|
43
|
+
}
|
44
|
+
}, [sendTxCore, props.tx, props.onTxSent]);
|
45
|
+
|
46
|
+
const done = useRef(false);
|
47
|
+
useEffect(() => {
|
48
|
+
if (done.current) {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
|
52
|
+
done.current = true;
|
53
|
+
sendTx();
|
54
|
+
}, [sendTx]);
|
55
|
+
|
56
|
+
return (
|
57
|
+
<Container p="lg">
|
58
|
+
<ModalHeader title="Transaction" onBack={props.onBack} />
|
59
|
+
|
60
|
+
<Spacer y="xxl" />
|
61
|
+
<Spacer y="xxl" />
|
62
|
+
|
63
|
+
<Container flex="row" center="x">
|
64
|
+
{status === "loading" && <Spinner size="xxl" color="accentText" />}
|
65
|
+
{status === "failed" && <AccentFailIcon size={iconSize["3xl"]} />}
|
66
|
+
{status === "sent" && (
|
67
|
+
<Container color="success" flex="row" center="both">
|
68
|
+
<CheckCircledIcon
|
69
|
+
width={iconSize["3xl"]}
|
70
|
+
height={iconSize["3xl"]}
|
71
|
+
/>
|
72
|
+
</Container>
|
73
|
+
)}
|
74
|
+
</Container>
|
75
|
+
<Spacer y="lg" />
|
76
|
+
|
77
|
+
<Text color="primaryText" center size="lg">
|
78
|
+
{status === "loading" && "Sending transaction"}
|
79
|
+
{status === "failed" && "Transaction failed"}
|
80
|
+
{status === "sent" && "Transaction sent"}
|
81
|
+
</Text>
|
82
|
+
<Spacer y="sm" />
|
83
|
+
<Text color="danger" center size="sm">
|
84
|
+
{status === "failed" && sendTxCore.error
|
85
|
+
? sendTxCore.error.message
|
86
|
+
: ""}
|
87
|
+
</Text>
|
88
|
+
|
89
|
+
<Spacer y="xxl" />
|
90
|
+
<Spacer y="xxl" />
|
91
|
+
|
92
|
+
{status === "failed" && (
|
93
|
+
<Button variant="accent" fullWidth onClick={sendTx}>
|
94
|
+
Try Again
|
95
|
+
</Button>
|
96
|
+
)}
|
97
|
+
|
98
|
+
{status === "sent" && (
|
99
|
+
<>
|
100
|
+
<Button variant="accent" fullWidth onClick={props.closeModal}>
|
101
|
+
Done
|
102
|
+
</Button>
|
103
|
+
{txHash && (
|
104
|
+
<>
|
105
|
+
<Spacer y="sm" />
|
106
|
+
<ButtonLink
|
107
|
+
fullWidth
|
108
|
+
variant="outline"
|
109
|
+
href={`${chainExplorers.explorers[0]?.url}/tx/${txHash}`}
|
110
|
+
target="_blank"
|
111
|
+
as="a"
|
112
|
+
gap="xs"
|
113
|
+
style={{
|
114
|
+
textDecoration: "none",
|
115
|
+
color: "inherit",
|
116
|
+
}}
|
117
|
+
>
|
118
|
+
View on Explorer{" "}
|
119
|
+
<ExternalLinkIcon width={iconSize.sm} height={iconSize.sm} />
|
120
|
+
</ButtonLink>
|
121
|
+
</>
|
122
|
+
)}
|
123
|
+
</>
|
124
|
+
)}
|
125
|
+
</Container>
|
126
|
+
);
|
127
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { useState } from "react";
|
2
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
3
|
+
import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js";
|
4
|
+
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
5
|
+
import { CustomThemeProvider } from "../../../core/design-system/CustomThemeProvider.js";
|
6
|
+
import type { Theme } from "../../../core/design-system/index.js";
|
7
|
+
import type { PayUIOptions } from "../../../core/hooks/connection/ConnectButtonProps.js";
|
8
|
+
import type { SupportedTokens } from "../../../core/utils/defaultTokens.js";
|
9
|
+
import { LoadingScreen } from "../../wallets/shared/LoadingScreen.js";
|
10
|
+
import { useConnectLocale } from "../ConnectWallet/locale/getConnectLocale.js";
|
11
|
+
import { LazyBuyScreen } from "../ConnectWallet/screens/Buy/LazyBuyScreen.js";
|
12
|
+
import { Modal } from "../components/Modal.js";
|
13
|
+
import type { LocaleId } from "../types.js";
|
14
|
+
import { ExecutingTxScreen } from "./ExecutingScreen.js";
|
15
|
+
|
16
|
+
export type ModalProps = {
|
17
|
+
title: string;
|
18
|
+
onComplete: () => void;
|
19
|
+
onClose: () => void;
|
20
|
+
client: ThirdwebClient;
|
21
|
+
localeId: LocaleId;
|
22
|
+
supportedTokens?: SupportedTokens;
|
23
|
+
theme: Theme | "light" | "dark";
|
24
|
+
tx: PreparedTransaction;
|
25
|
+
payOptions: PayUIOptions;
|
26
|
+
onTxSent: (data: WaitForReceiptOptions) => void;
|
27
|
+
};
|
28
|
+
|
29
|
+
export function TransactionModal(props: ModalProps) {
|
30
|
+
return (
|
31
|
+
<CustomThemeProvider theme={props.theme}>
|
32
|
+
<Modal
|
33
|
+
open={true}
|
34
|
+
size="compact"
|
35
|
+
setOpen={(_open) => {
|
36
|
+
if (!_open) {
|
37
|
+
props.onClose();
|
38
|
+
}
|
39
|
+
}}
|
40
|
+
>
|
41
|
+
<TransactionModalContent {...props} />
|
42
|
+
</Modal>
|
43
|
+
</CustomThemeProvider>
|
44
|
+
);
|
45
|
+
}
|
46
|
+
|
47
|
+
export function TransactionModalContent(
|
48
|
+
props: ModalProps & { onBack?: () => void },
|
49
|
+
) {
|
50
|
+
const localeQuery = useConnectLocale(props.localeId);
|
51
|
+
const [screen, setScreen] = useState<"buy" | "execute-tx">("buy");
|
52
|
+
|
53
|
+
if (!localeQuery.data) {
|
54
|
+
return <LoadingScreen />;
|
55
|
+
}
|
56
|
+
|
57
|
+
if (screen === "execute-tx") {
|
58
|
+
return (
|
59
|
+
<ExecutingTxScreen
|
60
|
+
tx={props.tx}
|
61
|
+
closeModal={props.onClose}
|
62
|
+
onTxSent={props.onTxSent}
|
63
|
+
/>
|
64
|
+
);
|
65
|
+
}
|
66
|
+
|
67
|
+
return (
|
68
|
+
<LazyBuyScreen
|
69
|
+
title={props.title}
|
70
|
+
isEmbed={false}
|
71
|
+
client={props.client}
|
72
|
+
onBack={props.onBack}
|
73
|
+
supportedTokens={props.supportedTokens}
|
74
|
+
connectLocale={localeQuery.data}
|
75
|
+
theme={typeof props.theme === "string" ? props.theme : props.theme.type}
|
76
|
+
payOptions={props.payOptions}
|
77
|
+
onDone={() => {
|
78
|
+
setScreen("execute-tx");
|
79
|
+
}}
|
80
|
+
connectOptions={undefined}
|
81
|
+
/>
|
82
|
+
);
|
83
|
+
}
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.40.0
|
1
|
+
export const version = "5.40.0";
|