thirdweb 5.32.2-nightly-229561e1a79fe2ab3f010c5a8659c7e0fc497ec3-20240703090013 → 5.32.2
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/adapters/ethers5.js +2 -2
- package/dist/cjs/adapters/ethers5.js.map +1 -1
- package/dist/cjs/contract/verification/index.js +52 -28
- package/dist/cjs/contract/verification/index.js.map +1 -1
- package/dist/cjs/gas/fee-data.js +13 -6
- package/dist/cjs/gas/fee-data.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +1 -0
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js +5 -0
- package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/cjs/react/core/hooks/auth/useSiweAuth.js +4 -1
- package/dist/cjs/react/core/hooks/auth/useSiweAuth.js.map +1 -1
- package/dist/cjs/react/native/ui/components/Header.js +1 -1
- package/dist/cjs/react/native/ui/components/Header.js.map +1 -1
- package/dist/cjs/react/native/ui/components/button.js +1 -1
- package/dist/cjs/react/native/ui/components/button.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectButton.js +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +7 -8
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +1 -1
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/cjs/react/native/ui/icons/svgs.js +5 -5
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +2 -2
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +12 -2
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +19 -5
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +5 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +5 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +11 -7
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +12 -12
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js +3 -5
- package/dist/cjs/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +24 -14
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +144 -87
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +49 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +32 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +1 -1
- 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 +1 -1
- 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/FiatTxDetailsTable.js +6 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -4
- 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/swap/ConfirmationScreen.js +18 -17
- 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/PayWithCrypto.js +2 -6
- 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/WalletSwitcherDrawerContent.js +26 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +12 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +8 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/types.js +3 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/types.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +55 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +78 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js +3 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +31 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/PayEmbed.js +3 -17
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Drawer.js +51 -17
- package/dist/cjs/react/web/ui/components/Drawer.js.map +1 -1
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js +1 -3
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +1 -0
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +5 -1
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +2 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +2 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js +2 -2
- package/dist/cjs/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
- package/dist/cjs/utils/formatNumber.js +4 -1
- package/dist/cjs/utils/formatNumber.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/adapters/ethers5.js +2 -2
- package/dist/esm/adapters/ethers5.js.map +1 -1
- package/dist/esm/contract/verification/index.js +52 -28
- package/dist/esm/contract/verification/index.js.map +1 -1
- package/dist/esm/gas/fee-data.js +13 -6
- package/dist/esm/gas/fee-data.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js +1 -0
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js +5 -0
- package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/esm/react/core/hooks/auth/useSiweAuth.js +4 -1
- package/dist/esm/react/core/hooks/auth/useSiweAuth.js.map +1 -1
- package/dist/esm/react/native/ui/components/Header.js +1 -1
- package/dist/esm/react/native/ui/components/Header.js.map +1 -1
- package/dist/esm/react/native/ui/components/button.js +1 -1
- package/dist/esm/react/native/ui/components/button.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectButton.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectButton.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js +8 -9
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js +1 -1
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/esm/react/native/ui/icons/svgs.js +5 -5
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +2 -2
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +12 -2
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +20 -6
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +5 -4
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModal.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js +11 -7
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectModalInline.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js +12 -12
- package/dist/esm/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js +2 -4
- package/dist/esm/react/web/ui/ConnectWallet/WalletEntryButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +25 -15
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/es.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +145 -88
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js +46 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +29 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +1 -1
- 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 +1 -1
- 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/FiatTxDetailsTable.js +6 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +2 -4
- 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/swap/ConfirmationScreen.js +18 -17
- 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/PayWithCrypto.js +3 -7
- 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/WalletSwitcherDrawerContent.js +23 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js +12 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js +8 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/types.js +2 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/types.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +52 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +75 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js +4 -5
- package/dist/esm/react/web/ui/ConnectWallet/screens/SendFunds.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/SignatureScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js +28 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.js.map +1 -0
- package/dist/esm/react/web/ui/PayEmbed.js +3 -17
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/Drawer.js +54 -20
- package/dist/esm/react/web/ui/components/Drawer.js.map +1 -1
- package/dist/esm/react/web/ui/components/SwitchNetwork.js +1 -3
- package/dist/esm/react/web/ui/components/SwitchNetwork.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +1 -0
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +5 -1
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +2 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +2 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js +2 -2
- package/dist/esm/react/web/wallets/in-app/InAppWalletSelectionUI.js.map +1 -1
- package/dist/esm/utils/formatNumber.js +4 -1
- package/dist/esm/utils/formatNumber.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/contract/verification/index.d.ts +1 -0
- package/dist/types/contract/verification/index.d.ts.map +1 -1
- package/dist/types/gas/fee-data.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts +5 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getPostOnRampQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts +4 -0
- package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
- package/dist/types/react/core/hooks/auth/useSiweAuth.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/Header.d.ts +1 -1
- package/dist/types/react/native/ui/components/Header.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
- package/dist/types/react/native/ui/icons/svgs.d.ts +3 -3
- package/dist/types/react/native/ui/icons/svgs.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +21 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +0 -2
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +7 -3
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +0 -2
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +3 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +7 -5
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +5 -4
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.d.ts +8 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts +13 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts +2 -0
- 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/FiatTxDetailsTable.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +2 -0
- 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 +2 -0
- 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 +12 -3
- 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/swap/ConfirmationScreen.d.ts +2 -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/PayWithCrypto.d.ts +2 -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 +2 -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/WalletSwitcherDrawerContent.d.ts +12 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/types.d.ts +9 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/types.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts +9 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SignatureScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts +25 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Drawer.d.ts +2 -1
- package/dist/types/react/web/ui/components/Drawer.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +1 -2
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts +1 -0
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +0 -2
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +0 -2
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +0 -2
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
- package/dist/types/utils/formatNumber.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 +1 -1
- package/src/adapters/ethers5.ts +2 -2
- package/src/contract/verification/index.ts +63 -30
- package/src/gas/fee-data.ts +14 -6
- package/src/pay/buyWithCrypto/getQuote.ts +7 -3
- package/src/pay/buyWithFiat/getPostOnRampQuote.ts +5 -0
- package/src/pay/buyWithFiat/getQuote.ts +4 -0
- package/src/react/core/hooks/auth/useSiweAuth.ts +4 -1
- package/src/react/native/ui/components/Header.tsx +2 -2
- package/src/react/native/ui/components/button.tsx +6 -1
- package/src/react/native/ui/connect/ConnectButton.tsx +1 -1
- package/src/react/native/ui/connect/ConnectModal.tsx +9 -4
- package/src/react/native/ui/connect/InAppWalletUI.tsx +24 -20
- package/src/react/native/ui/icons/svgs.ts +5 -5
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +30 -17
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +12 -1
- package/src/react/web/ui/ConnectWallet/Details.tsx +73 -2
- package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +2 -0
- package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +3 -6
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +3 -2
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +17 -10
- package/src/react/web/ui/ConnectWallet/Modal/ConnectModalInline.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.tsx +14 -15
- package/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx +12 -13
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +35 -20
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -0
- package/src/react/web/ui/ConnectWallet/locale/es.ts +1 -0
- package/src/react/web/ui/ConnectWallet/locale/ja.ts +1 -0
- package/src/react/web/ui/ConnectWallet/locale/tl.ts +1 -0
- package/src/react/web/ui/ConnectWallet/locale/types.ts +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +435 -266
- package/src/react/web/ui/ConnectWallet/screens/Buy/ReceiverWalletSelectionScreen.tsx +118 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +86 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +2 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +23 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +4 -5
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +15 -4
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +43 -32
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +4 -7
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +3 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletSwitcherDrawerContent.tsx +66 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.tsx +16 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/SwapDetailsScreen.tsx +27 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/TxDetailsScreen.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/types.ts +9 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +63 -0
- package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +203 -0
- package/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx +1 -13
- package/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx +83 -0
- package/src/react/web/ui/ConnectWallet/screens/types.ts +2 -1
- package/src/react/web/ui/PayEmbed.tsx +7 -29
- package/src/react/web/ui/components/CopyIcon.tsx +5 -1
- package/src/react/web/ui/components/Drawer.tsx +91 -40
- package/src/react/web/ui/components/SwitchNetwork.tsx +2 -5
- package/src/react/web/ui/components/WalletImage.tsx +2 -0
- package/src/react/web/ui/components/buttons.tsx +5 -1
- package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +2 -3
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +2 -3
- package/src/react/web/wallets/in-app/InAppWalletSelectionUI.tsx +3 -3
- package/src/utils/format-number.test.ts +23 -8
- package/src/utils/formatNumber.ts +4 -1
- package/src/version.ts +1 -1
@@ -0,0 +1,118 @@
|
|
1
|
+
import { ArrowRightIcon } from "@radix-ui/react-icons";
|
2
|
+
import { useMemo, useState, useSyncExternalStore } from "react";
|
3
|
+
import type { ThirdwebClient } from "../../../../../../client/client.js";
|
4
|
+
import { isAddress } from "../../../../../../utils/address.js";
|
5
|
+
import { iconSize } from "../../../../../core/design-system/index.js";
|
6
|
+
import { connectionManager } from "../../../../index.js";
|
7
|
+
import { Spacer } from "../../../components/Spacer.js";
|
8
|
+
import { TextDivider } from "../../../components/TextDivider.js";
|
9
|
+
import { ToolTip } from "../../../components/Tooltip.js";
|
10
|
+
import { Container } from "../../../components/basic.js";
|
11
|
+
import { IconButton } from "../../../components/buttons.js";
|
12
|
+
import { Input } from "../../../components/formElements.js";
|
13
|
+
import { Text } from "../../../components/text.js";
|
14
|
+
import { WalletSelectorButton } from "./WalletSelectorButton.js";
|
15
|
+
|
16
|
+
export function ReceiverWalletDrawerScreen(props: {
|
17
|
+
receiverAddress: string;
|
18
|
+
onSelect: (address: string) => void;
|
19
|
+
client: ThirdwebClient;
|
20
|
+
onBack: () => void;
|
21
|
+
}) {
|
22
|
+
const [address, setAddress] = useState<string>("");
|
23
|
+
const isValidAddress = useMemo(() => isAddress(address), [address]);
|
24
|
+
const showError = !!address && !isValidAddress;
|
25
|
+
const connectedWallets = useSyncExternalStore(
|
26
|
+
connectionManager.connectedWallets.subscribe,
|
27
|
+
connectionManager.connectedWallets.getValue,
|
28
|
+
);
|
29
|
+
|
30
|
+
function handleSubmit() {
|
31
|
+
props.onSelect(address);
|
32
|
+
props.onBack();
|
33
|
+
}
|
34
|
+
|
35
|
+
return (
|
36
|
+
<div>
|
37
|
+
<Text size="lg" color="primaryText">
|
38
|
+
Send to
|
39
|
+
</Text>
|
40
|
+
<Spacer y="lg" />
|
41
|
+
|
42
|
+
<div
|
43
|
+
style={{
|
44
|
+
position: "relative",
|
45
|
+
}}
|
46
|
+
>
|
47
|
+
<Input
|
48
|
+
data-error={showError}
|
49
|
+
value={address}
|
50
|
+
placeholder="Enter wallet address"
|
51
|
+
variant="outline"
|
52
|
+
onChange={(e) => setAddress(e.target.value)}
|
53
|
+
style={{
|
54
|
+
paddingRight: "50px",
|
55
|
+
}}
|
56
|
+
onKeyDown={(e) => {
|
57
|
+
if (isValidAddress && e.key === "Enter") {
|
58
|
+
handleSubmit();
|
59
|
+
}
|
60
|
+
}}
|
61
|
+
/>
|
62
|
+
|
63
|
+
<ToolTip tip="Confirm">
|
64
|
+
<IconButton
|
65
|
+
disabled={!isValidAddress}
|
66
|
+
style={{
|
67
|
+
position: "absolute",
|
68
|
+
right: 0,
|
69
|
+
top: 0,
|
70
|
+
bottom: 0,
|
71
|
+
width: "40px",
|
72
|
+
}}
|
73
|
+
onClick={handleSubmit}
|
74
|
+
aria-label="Confirm"
|
75
|
+
>
|
76
|
+
<ArrowRightIcon width={iconSize.md} height={iconSize.md} />
|
77
|
+
</IconButton>
|
78
|
+
</ToolTip>
|
79
|
+
</div>
|
80
|
+
|
81
|
+
{showError && (
|
82
|
+
<>
|
83
|
+
<Spacer y="xs" />
|
84
|
+
<Text color="danger" size="sm">
|
85
|
+
Invalid address
|
86
|
+
</Text>
|
87
|
+
</>
|
88
|
+
)}
|
89
|
+
|
90
|
+
<Spacer y="lg" />
|
91
|
+
<TextDivider text="OR" />
|
92
|
+
<Spacer y="md" />
|
93
|
+
|
94
|
+
<Text size="sm">Connected</Text>
|
95
|
+
<Spacer y="xs" />
|
96
|
+
|
97
|
+
<Container flex="column" gap="sm">
|
98
|
+
{connectedWallets.map((w) => {
|
99
|
+
const address = (w.getAccount()?.address || "").toLowerCase();
|
100
|
+
return (
|
101
|
+
<WalletSelectorButton
|
102
|
+
address={address}
|
103
|
+
client={props.client}
|
104
|
+
onClick={() => {
|
105
|
+
props.onSelect(address);
|
106
|
+
props.onBack();
|
107
|
+
}}
|
108
|
+
key={w.id}
|
109
|
+
disableChevron
|
110
|
+
checked={address === props.receiverAddress.toLowerCase()}
|
111
|
+
walletId={w.id}
|
112
|
+
/>
|
113
|
+
);
|
114
|
+
})}
|
115
|
+
</Container>
|
116
|
+
</div>
|
117
|
+
);
|
118
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { CheckIcon, ChevronDownIcon } from "@radix-ui/react-icons";
|
2
|
+
import type { ThirdwebClient } from "../../../../../../client/client.js";
|
3
|
+
import { shortenAddress } from "../../../../../../utils/address.js";
|
4
|
+
import type { WalletId } from "../../../../../../wallets/wallet-types.js";
|
5
|
+
import { useCustomTheme } from "../../../../../core/design-system/CustomThemeProvider.js";
|
6
|
+
import {
|
7
|
+
iconSize,
|
8
|
+
radius,
|
9
|
+
spacing,
|
10
|
+
} from "../../../../../core/design-system/index.js";
|
11
|
+
import { useConnectedWallets } from "../../../../hooks/wallets/useConnectedWallets.js";
|
12
|
+
import { WalletImage } from "../../../components/WalletImage.js";
|
13
|
+
import { Container } from "../../../components/basic.js";
|
14
|
+
import { Button } from "../../../components/buttons.js";
|
15
|
+
import { Text } from "../../../components/text.js";
|
16
|
+
import { GenericWalletIcon } from "../../icons/GenericWalletIcon.js";
|
17
|
+
|
18
|
+
export function WalletSelectorButton(props: {
|
19
|
+
address: string;
|
20
|
+
walletId: WalletId | undefined;
|
21
|
+
onClick: () => void;
|
22
|
+
client: ThirdwebClient;
|
23
|
+
containerStyle?: React.CSSProperties;
|
24
|
+
disableChevron?: boolean;
|
25
|
+
disabled?: boolean;
|
26
|
+
checked?: boolean;
|
27
|
+
}) {
|
28
|
+
const theme = useCustomTheme();
|
29
|
+
const connectedWallets = useConnectedWallets();
|
30
|
+
const walletId =
|
31
|
+
props.walletId ||
|
32
|
+
connectedWallets.find((x) => x.getAccount()?.address === props.address)?.id;
|
33
|
+
|
34
|
+
return (
|
35
|
+
<Container
|
36
|
+
bg="tertiaryBg"
|
37
|
+
style={{
|
38
|
+
borderRadius: radius.lg,
|
39
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
40
|
+
...props.containerStyle,
|
41
|
+
}}
|
42
|
+
>
|
43
|
+
<Button
|
44
|
+
fullWidth
|
45
|
+
disabled={props.disabled}
|
46
|
+
onClick={props.onClick}
|
47
|
+
variant="ghost"
|
48
|
+
style={{
|
49
|
+
justifyContent: "space-between",
|
50
|
+
padding: spacing.sm,
|
51
|
+
backgroundColor: theme.colors.tertiaryBg,
|
52
|
+
}}
|
53
|
+
gap="sm"
|
54
|
+
>
|
55
|
+
<Container flex="row" center="y" gap="sm" color="secondaryText">
|
56
|
+
{walletId ? (
|
57
|
+
<WalletImage
|
58
|
+
id={walletId}
|
59
|
+
size={iconSize.md}
|
60
|
+
client={props.client}
|
61
|
+
/>
|
62
|
+
) : (
|
63
|
+
<GenericWalletIcon size={iconSize.md} />
|
64
|
+
)}
|
65
|
+
|
66
|
+
<Text size="sm" color="primaryText">
|
67
|
+
{shortenAddress(props.address)}
|
68
|
+
</Text>
|
69
|
+
</Container>
|
70
|
+
{!props.disableChevron && (
|
71
|
+
<ChevronDownIcon
|
72
|
+
width={iconSize.sm}
|
73
|
+
height={iconSize.sm}
|
74
|
+
style={{
|
75
|
+
color: theme.colors.secondaryText,
|
76
|
+
}}
|
77
|
+
/>
|
78
|
+
)}
|
79
|
+
|
80
|
+
{props.checked && (
|
81
|
+
<CheckIcon width={iconSize.md} height={iconSize.md} />
|
82
|
+
)}
|
83
|
+
</Button>
|
84
|
+
</Container>
|
85
|
+
);
|
86
|
+
}
|
@@ -5,6 +5,7 @@ import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/get
|
|
5
5
|
import { isSwapRequiredPostOnramp } from "../../../../../../../pay/buyWithFiat/isSwapRequiredPostOnramp.js";
|
6
6
|
import { openOnrampPopup } from "../openOnRamppopup.js";
|
7
7
|
import { addPendingTx } from "../swap/pendingSwapTx.js";
|
8
|
+
import type { PayerInfo } from "../types.js";
|
8
9
|
import { OnrampStatusScreen } from "./FiatStatusScreen.js";
|
9
10
|
import { FiatSteps, fiatQuoteToPartialQuote } from "./FiatSteps.js";
|
10
11
|
import { PostOnRampSwapFlow } from "./PostOnRampSwapFlow.js";
|
@@ -46,6 +47,7 @@ export function FiatFlow(props: {
|
|
46
47
|
onDone: () => void;
|
47
48
|
isBuyForTx: boolean;
|
48
49
|
isEmbed: boolean;
|
50
|
+
payer: PayerInfo;
|
49
51
|
}) {
|
50
52
|
const hasTwoSteps = isSwapRequiredPostOnramp(props.quote);
|
51
53
|
const [screen, setScreen] = useState<Screen>(
|
@@ -116,6 +118,7 @@ export function FiatFlow(props: {
|
|
116
118
|
}}
|
117
119
|
isBuyForTx={props.isBuyForTx}
|
118
120
|
isEmbed={props.isEmbed}
|
121
|
+
payer={props.payer}
|
119
122
|
/>
|
120
123
|
);
|
121
124
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { ExternalLinkIcon } from "@radix-ui/react-icons";
|
2
2
|
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
+
import { shortenAddress } from "../../../../../../../utils/address.js";
|
4
5
|
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
6
|
import {
|
6
7
|
fontSize,
|
@@ -37,6 +38,8 @@ export function OnRampTxDetailsTable(props: {
|
|
37
38
|
text: FiatStatusMeta["status"];
|
38
39
|
txHash?: string;
|
39
40
|
};
|
41
|
+
fromAddress?: string;
|
42
|
+
toAddress?: string;
|
40
43
|
}) {
|
41
44
|
const onRampExplorers = useChainExplorers(
|
42
45
|
getCachedChain(props.token.chainId),
|
@@ -112,6 +115,26 @@ export function OnRampTxDetailsTable(props: {
|
|
112
115
|
</>
|
113
116
|
)}
|
114
117
|
|
118
|
+
{props.fromAddress &&
|
119
|
+
props.toAddress &&
|
120
|
+
props.fromAddress !== props.toAddress && (
|
121
|
+
<>
|
122
|
+
{lineSpacer}
|
123
|
+
<Container
|
124
|
+
flex="row"
|
125
|
+
center="y"
|
126
|
+
style={{
|
127
|
+
justifyContent: "space-between",
|
128
|
+
}}
|
129
|
+
>
|
130
|
+
<Text>Send to</Text>
|
131
|
+
<Container flex="row" gap="xs" center="y">
|
132
|
+
<Text>{shortenAddress(props.toAddress)}</Text>
|
133
|
+
</Container>
|
134
|
+
</Container>
|
135
|
+
</>
|
136
|
+
)}
|
137
|
+
|
115
138
|
{lineSpacer}
|
116
139
|
|
117
140
|
{/* Transaction Hash link */}
|
@@ -5,7 +5,6 @@ import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/
|
|
5
5
|
import { getPostOnRampQuote } from "../../../../../../../pay/buyWithFiat/getPostOnRampQuote.js";
|
6
6
|
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
7
7
|
import { iconSize } from "../../../../../../core/design-system/index.js";
|
8
|
-
import { useActiveAccount } from "../../../../../hooks/wallets/useActiveAccount.js";
|
9
8
|
import { Spacer } from "../../../../components/Spacer.js";
|
10
9
|
import { Spinner } from "../../../../components/Spinner.js";
|
11
10
|
import { Container, ModalHeader } from "../../../../components/basic.js";
|
@@ -13,6 +12,7 @@ import { Button } from "../../../../components/buttons.js";
|
|
13
12
|
import { Text } from "../../../../components/text.js";
|
14
13
|
import { AccentFailIcon } from "../../../icons/AccentFailIcon.js";
|
15
14
|
import { SwapFlow } from "../swap/SwapFlow.js";
|
15
|
+
import type { PayerInfo } from "../types.js";
|
16
16
|
|
17
17
|
export function PostOnRampSwap(props: {
|
18
18
|
client: ThirdwebClient;
|
@@ -22,9 +22,8 @@ export function PostOnRampSwap(props: {
|
|
22
22
|
onDone: () => void;
|
23
23
|
isBuyForTx: boolean;
|
24
24
|
isEmbed: boolean;
|
25
|
+
payer: PayerInfo;
|
25
26
|
}) {
|
26
|
-
const account = useActiveAccount();
|
27
|
-
|
28
27
|
const [lockedOnRampQuote, setLockedOnRampQuote] = useState<
|
29
28
|
BuyWithCryptoQuote | undefined
|
30
29
|
>(undefined);
|
@@ -92,7 +91,7 @@ export function PostOnRampSwap(props: {
|
|
92
91
|
);
|
93
92
|
}
|
94
93
|
|
95
|
-
if (!lockedOnRampQuote
|
94
|
+
if (!lockedOnRampQuote) {
|
96
95
|
return (
|
97
96
|
<Container fullHeight>
|
98
97
|
<Container p="lg">
|
@@ -118,7 +117,7 @@ export function PostOnRampSwap(props: {
|
|
118
117
|
|
119
118
|
return (
|
120
119
|
<SwapFlow
|
121
|
-
|
120
|
+
payer={props.payer}
|
122
121
|
buyWithCryptoQuote={lockedOnRampQuote}
|
123
122
|
client={props.client}
|
124
123
|
onBack={props.onBack}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useState } from "react";
|
2
2
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
3
3
|
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
4
|
+
import type { PayerInfo } from "../types.js";
|
4
5
|
import { type BuyWithFiatPartialQuote, FiatSteps } from "./FiatSteps.js";
|
5
6
|
import { PostOnRampSwap } from "./PostOnRampSwap.js";
|
6
7
|
|
@@ -20,6 +21,7 @@ export function PostOnRampSwapFlow(props: {
|
|
20
21
|
onSwapFlowStarted: () => void;
|
21
22
|
isBuyForTx: boolean;
|
22
23
|
isEmbed: boolean;
|
24
|
+
payer: PayerInfo;
|
23
25
|
}) {
|
24
26
|
const [statusForSwap, setStatusForSwap] = useState<
|
25
27
|
BuyWithFiatStatus | undefined
|
@@ -35,6 +37,7 @@ export function PostOnRampSwapFlow(props: {
|
|
35
37
|
onDone={props.onDone}
|
36
38
|
isBuyForTx={props.isBuyForTx}
|
37
39
|
isEmbed={props.isEmbed}
|
40
|
+
payer={props.payer}
|
38
41
|
/>
|
39
42
|
);
|
40
43
|
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
2
|
+
import type { BuyWithFiatQuote } from "../../../../../../../pay/buyWithFiat/getQuote.js";
|
1
3
|
import type { PreparedTransaction } from "../../../../../../../transaction/prepare-transaction.js";
|
2
4
|
|
3
5
|
export type BuyForTx = {
|
@@ -8,10 +10,6 @@ export type BuyForTx = {
|
|
8
10
|
};
|
9
11
|
|
10
12
|
export type SelectedScreen =
|
11
|
-
| {
|
12
|
-
id: "node";
|
13
|
-
node: React.ReactNode;
|
14
|
-
}
|
15
13
|
| {
|
16
14
|
id:
|
17
15
|
| "main"
|
@@ -30,4 +28,17 @@ export type SelectedScreen =
|
|
30
28
|
| {
|
31
29
|
id: "select-currency";
|
32
30
|
backScreen: SelectedScreen;
|
31
|
+
}
|
32
|
+
| {
|
33
|
+
id: "swap-flow";
|
34
|
+
quote: BuyWithCryptoQuote;
|
35
|
+
}
|
36
|
+
| {
|
37
|
+
id: "fiat-flow";
|
38
|
+
quote: BuyWithFiatQuote;
|
39
|
+
openedWindow: Window | null;
|
40
|
+
}
|
41
|
+
| {
|
42
|
+
id: "connect-payer-wallet";
|
43
|
+
backScreen: SelectedScreen;
|
33
44
|
};
|
@@ -3,7 +3,9 @@ import { useState } from "react";
|
|
3
3
|
import type { Chain } from "../../../../../../../chains/types.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
5
5
|
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
6
|
+
import { sendTransaction } from "../../../../../../../transaction/actions/send-transaction.js";
|
6
7
|
import { waitForReceipt } from "../../../../../../../transaction/actions/wait-for-tx-receipt.js";
|
8
|
+
import { shortenAddress } from "../../../../../../../utils/address.js";
|
7
9
|
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
8
10
|
import { useCustomTheme } from "../../../../../../core/design-system/CustomThemeProvider.js";
|
9
11
|
import {
|
@@ -11,10 +13,6 @@ import {
|
|
11
13
|
iconSize,
|
12
14
|
} from "../../../../../../core/design-system/index.js";
|
13
15
|
import { useChainName } from "../../../../../../core/hooks/others/useChainQuery.js";
|
14
|
-
import { useSendTransactionCore } from "../../../../../../core/hooks/transaction/useSendTransaction.js";
|
15
|
-
import { useActiveWallet } from "../../../../../hooks/wallets/useActiveWallet.js";
|
16
|
-
import { useActiveWalletChain } from "../../../../../hooks/wallets/useActiveWalletChain.js";
|
17
|
-
import { useSwitchActiveWalletChain } from "../../../../../hooks/wallets/useSwitchActiveWalletChain.js";
|
18
16
|
import { Skeleton } from "../../../../components/Skeleton.js";
|
19
17
|
import { Spacer } from "../../../../components/Spacer.js";
|
20
18
|
import { Spinner } from "../../../../components/Spinner.js";
|
@@ -27,6 +25,7 @@ import { StyledDiv } from "../../../../design-system/elements.js";
|
|
27
25
|
import type { ERC20OrNativeToken } from "../../nativeToken.js";
|
28
26
|
import { PayTokenIcon } from "../PayTokenIcon.js";
|
29
27
|
import { Step } from "../Stepper.js";
|
28
|
+
import type { PayerInfo } from "../types.js";
|
30
29
|
import { SwapFees } from "./Fees.js";
|
31
30
|
import { formatSeconds } from "./formatSeconds.js";
|
32
31
|
import { addPendingTx } from "./pendingSwapTx.js";
|
@@ -49,15 +48,8 @@ export function SwapConfirmationScreen(props: {
|
|
49
48
|
fromToken: ERC20OrNativeToken;
|
50
49
|
fromTokenSymbol: string;
|
51
50
|
isFiatFlow: boolean;
|
51
|
+
payer: PayerInfo;
|
52
52
|
}) {
|
53
|
-
const activeChain = useActiveWalletChain();
|
54
|
-
const activeWallet = useActiveWallet();
|
55
|
-
const switchChain = useSwitchActiveWalletChain();
|
56
|
-
const sendTransactionMutation = useSendTransactionCore({
|
57
|
-
wallet: activeWallet,
|
58
|
-
switchChain,
|
59
|
-
});
|
60
|
-
|
61
53
|
const isApprovalRequired = props.quote.approval !== undefined;
|
62
54
|
const initialStep = isApprovalRequired ? "approval" : "swap";
|
63
55
|
|
@@ -66,6 +58,9 @@ export function SwapConfirmationScreen(props: {
|
|
66
58
|
"pending" | "success" | "error" | "idle"
|
67
59
|
>("idle");
|
68
60
|
|
61
|
+
const receiver = props.quote.swapDetails.toAddress;
|
62
|
+
const sender = props.quote.swapDetails.fromAddress;
|
63
|
+
|
69
64
|
return (
|
70
65
|
<Container p="lg">
|
71
66
|
<ModalHeader title="Buy" onBack={props.onBack} />
|
@@ -85,17 +80,6 @@ export function SwapConfirmationScreen(props: {
|
|
85
80
|
<Spacer y="lg" />
|
86
81
|
)}
|
87
82
|
|
88
|
-
{/* Receive */}
|
89
|
-
<ConfirmItem label="Receive">
|
90
|
-
<RenderTokenInfo
|
91
|
-
chain={props.toChain}
|
92
|
-
amount={String(formatNumber(Number(props.toAmount), 4))}
|
93
|
-
symbol={props.toTokenSymbol}
|
94
|
-
token={props.toToken}
|
95
|
-
client={props.client}
|
96
|
-
/>
|
97
|
-
</ConfirmItem>
|
98
|
-
|
99
83
|
{/* Pay */}
|
100
84
|
<ConfirmItem label="Pay">
|
101
85
|
<RenderTokenInfo
|
@@ -107,6 +91,17 @@ export function SwapConfirmationScreen(props: {
|
|
107
91
|
/>
|
108
92
|
</ConfirmItem>
|
109
93
|
|
94
|
+
{/* Receive */}
|
95
|
+
<ConfirmItem label="Receive">
|
96
|
+
<RenderTokenInfo
|
97
|
+
chain={props.toChain}
|
98
|
+
amount={String(formatNumber(Number(props.toAmount), 4))}
|
99
|
+
symbol={props.toTokenSymbol}
|
100
|
+
token={props.toToken}
|
101
|
+
client={props.client}
|
102
|
+
/>
|
103
|
+
</ConfirmItem>
|
104
|
+
|
110
105
|
{/* Fees */}
|
111
106
|
<ConfirmItem label="Fees">
|
112
107
|
<SwapFees quote={props.quote} align="right" />
|
@@ -122,6 +117,13 @@ export function SwapConfirmationScreen(props: {
|
|
122
117
|
</Text>
|
123
118
|
</ConfirmItem>
|
124
119
|
|
120
|
+
{/* Send to */}
|
121
|
+
{receiver !== sender && (
|
122
|
+
<ConfirmItem label="Send to">
|
123
|
+
<Text color="primaryText">{shortenAddress(receiver)}</Text>
|
124
|
+
</ConfirmItem>
|
125
|
+
)}
|
126
|
+
|
125
127
|
<Spacer y="xl" />
|
126
128
|
|
127
129
|
{/* Show 2 steps - Approve and confirm */}
|
@@ -162,11 +164,13 @@ export function SwapConfirmationScreen(props: {
|
|
162
164
|
</>
|
163
165
|
)}
|
164
166
|
|
165
|
-
{
|
167
|
+
{props.payer.chain.id !== props.fromChain.id ? (
|
166
168
|
<SwitchNetworkButton
|
167
169
|
fullWidth
|
168
|
-
chain={props.fromChain}
|
169
170
|
variant="accent"
|
171
|
+
switchChain={async () => {
|
172
|
+
await props.payer.wallet.switchChain(props.fromChain);
|
173
|
+
}}
|
170
174
|
/>
|
171
175
|
) : (
|
172
176
|
<Button
|
@@ -178,9 +182,10 @@ export function SwapConfirmationScreen(props: {
|
|
178
182
|
try {
|
179
183
|
setStatus("pending");
|
180
184
|
|
181
|
-
const tx = await
|
182
|
-
props.
|
183
|
-
|
185
|
+
const tx = await sendTransaction({
|
186
|
+
account: props.payer.account,
|
187
|
+
transaction: props.quote.approval,
|
188
|
+
});
|
184
189
|
|
185
190
|
await waitForReceipt({ ...tx, maxBlocksWaitTime: 50 });
|
186
191
|
// props.onQuoteFinalized(props.quote);
|
@@ -201,8 +206,8 @@ export function SwapConfirmationScreen(props: {
|
|
201
206
|
// Fix for inApp wallet
|
202
207
|
// Ideally - the pay server sends a non-legacy transaction to avoid this issue
|
203
208
|
if (
|
204
|
-
|
205
|
-
|
209
|
+
props.payer.wallet.id === "inApp" ||
|
210
|
+
props.payer.wallet.id === "embedded"
|
206
211
|
) {
|
207
212
|
tx = {
|
208
213
|
...props.quote.transactionRequest,
|
@@ -210,7 +215,10 @@ export function SwapConfirmationScreen(props: {
|
|
210
215
|
};
|
211
216
|
}
|
212
217
|
|
213
|
-
const _swapTx = await
|
218
|
+
const _swapTx = await sendTransaction({
|
219
|
+
account: props.payer.account,
|
220
|
+
transaction: tx,
|
221
|
+
});
|
214
222
|
|
215
223
|
await waitForReceipt({ ..._swapTx, maxBlocksWaitTime: 50 });
|
216
224
|
|
@@ -289,7 +297,10 @@ function RenderTokenInfo(props: {
|
|
289
297
|
);
|
290
298
|
}
|
291
299
|
|
292
|
-
function ConfirmItem(props: {
|
300
|
+
function ConfirmItem(props: {
|
301
|
+
label: string;
|
302
|
+
children: React.ReactNode;
|
303
|
+
}) {
|
293
304
|
return (
|
294
305
|
<>
|
295
306
|
<Container
|
@@ -2,16 +2,15 @@ import { ChevronDownIcon } from "@radix-ui/react-icons";
|
|
2
2
|
import type { Chain } from "../../../../../../../chains/types.js";
|
3
3
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
4
|
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
|
+
import type { Account } from "../../../../../../../wallets/interfaces/wallet.js";
|
5
6
|
import {
|
6
7
|
fontSize,
|
7
8
|
iconSize,
|
8
|
-
radius,
|
9
9
|
spacing,
|
10
10
|
} from "../../../../../../core/design-system/index.js";
|
11
11
|
import { useChainName } from "../../../../../../core/hooks/others/useChainQuery.js";
|
12
12
|
import { useWalletBalance } from "../../../../../../core/hooks/others/useWalletBalance.js";
|
13
13
|
import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
|
14
|
-
import { useActiveAccount } from "../../../../../hooks/wallets/useActiveAccount.js";
|
15
14
|
import { Skeleton } from "../../../../components/Skeleton.js";
|
16
15
|
import { Container } from "../../../../components/basic.js";
|
17
16
|
import { Button } from "../../../../components/buttons.js";
|
@@ -36,12 +35,12 @@ export function PayWithCrypto(props: {
|
|
36
35
|
isLoading: boolean;
|
37
36
|
client: ThirdwebClient;
|
38
37
|
freezeChainAndTokenSelection?: boolean;
|
38
|
+
payerAccount: Account;
|
39
39
|
}) {
|
40
40
|
const { name } = useChainName(props.chain);
|
41
|
-
const activeAccount = useActiveAccount();
|
42
41
|
|
43
42
|
const balanceQuery = useWalletBalance({
|
44
|
-
address:
|
43
|
+
address: props.payerAccount.address,
|
45
44
|
chain: props.chain,
|
46
45
|
tokenAddress: isNativeToken(props.token) ? undefined : props.token.address,
|
47
46
|
client: props.client,
|
@@ -53,10 +52,8 @@ export function PayWithCrypto(props: {
|
|
53
52
|
borderColor="borderColor"
|
54
53
|
flex="row"
|
55
54
|
style={{
|
56
|
-
borderRadius: radius.md,
|
57
|
-
borderBottomRightRadius: 0,
|
58
|
-
borderBottomLeftRadius: 0,
|
59
55
|
borderWidth: "1px",
|
56
|
+
borderTopWidth: 0,
|
60
57
|
borderStyle: "solid",
|
61
58
|
borderBottom: "none",
|
62
59
|
flexWrap: "nowrap",
|
@@ -3,16 +3,16 @@ import { getCachedChain } from "../../../../../../../chains/utils.js";
|
|
3
3
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
4
|
import { NATIVE_TOKEN_ADDRESS } from "../../../../../../../constants/addresses.js";
|
5
5
|
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
6
|
-
import type { Account } from "../../../../../../../wallets/interfaces/wallet.js";
|
7
6
|
import type { TokenInfo } from "../../../../../../core/utils/defaultTokens.js";
|
8
7
|
import { type ERC20OrNativeToken, NATIVE_TOKEN } from "../../nativeToken.js";
|
8
|
+
import type { PayerInfo } from "../types.js";
|
9
9
|
import { SwapConfirmationScreen } from "./ConfirmationScreen.js";
|
10
10
|
import { SwapStatusScreen } from "./SwapStatusScreen.js";
|
11
11
|
|
12
12
|
type SwapFlowProps = {
|
13
13
|
onBack?: () => void;
|
14
14
|
buyWithCryptoQuote: BuyWithCryptoQuote;
|
15
|
-
|
15
|
+
payer: PayerInfo;
|
16
16
|
onViewPendingTx: () => void;
|
17
17
|
client: ThirdwebClient;
|
18
18
|
isFiatFlow: boolean;
|
@@ -104,6 +104,7 @@ export function SwapFlow(props: SwapFlowProps) {
|
|
104
104
|
onTryAgain={props.onTryAgain}
|
105
105
|
quote={quote}
|
106
106
|
isFiatFlow={props.isFiatFlow}
|
107
|
+
payer={props.payer}
|
107
108
|
/>
|
108
109
|
);
|
109
110
|
}
|