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
@@ -7,20 +7,19 @@ import type { Wallet } from "../../../wallets/interfaces/wallet.js";
|
|
7
7
|
import type { SmartWalletOptions } from "../../../wallets/smart/types.js";
|
8
8
|
import type { AppMetadata } from "../../../wallets/types.js";
|
9
9
|
import { CustomThemeProvider } from "../../core/design-system/CustomThemeProvider.js";
|
10
|
-
import {
|
10
|
+
import type { Theme } from "../../core/design-system/index.js";
|
11
11
|
import type { SiweAuthOptions } from "../../core/hooks/auth/useSiweAuth.js";
|
12
12
|
import type {
|
13
13
|
ConnectButton_connectModalOptions,
|
14
14
|
PayUIOptions,
|
15
15
|
} from "../../core/hooks/connection/ConnectButtonProps.js";
|
16
16
|
import type { SupportedTokens } from "../../core/utils/defaultTokens.js";
|
17
|
-
import {
|
17
|
+
import { EmbedContainer } from "./ConnectWallet/Modal/ConnectEmbed.js";
|
18
18
|
import { useConnectLocale } from "./ConnectWallet/locale/getConnectLocale.js";
|
19
19
|
import BuyScreen from "./ConnectWallet/screens/Buy/BuyScreen.js";
|
20
20
|
import { BuyTxHistory } from "./ConnectWallet/screens/Buy/tx-history/BuyTxHistory.js";
|
21
21
|
import { DynamicHeight } from "./components/DynamicHeight.js";
|
22
22
|
import { Spinner } from "./components/Spinner.js";
|
23
|
-
import { Container } from "./components/basic.js";
|
24
23
|
import type { LocaleId } from "./types.js";
|
25
24
|
|
26
25
|
/**
|
@@ -188,18 +187,9 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
188
187
|
onDone={() => {
|
189
188
|
// noop
|
190
189
|
}}
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
client={props.client}
|
195
|
-
connectButton={{
|
196
|
-
style: {
|
197
|
-
width: "100%",
|
198
|
-
},
|
199
|
-
}}
|
200
|
-
theme={theme}
|
201
|
-
/>
|
202
|
-
}
|
190
|
+
connectOptions={props.connectOptions}
|
191
|
+
buyForTx={undefined}
|
192
|
+
onBack={undefined}
|
203
193
|
/>
|
204
194
|
</div>
|
205
195
|
{/* this does not need to persist so we can just show-hide it with JS */}
|
@@ -222,21 +212,9 @@ export function PayEmbed(props: PayEmbedProps) {
|
|
222
212
|
|
223
213
|
return (
|
224
214
|
<CustomThemeProvider theme={theme}>
|
225
|
-
<
|
226
|
-
bg="modalBg"
|
227
|
-
style={{
|
228
|
-
borderRadius: radius.lg,
|
229
|
-
minWidth: "360px",
|
230
|
-
borderWidth: "1px",
|
231
|
-
borderStyle: "solid",
|
232
|
-
position: "relative",
|
233
|
-
overflow: "hidden",
|
234
|
-
...props.style,
|
235
|
-
}}
|
236
|
-
borderColor="borderColor"
|
237
|
-
>
|
215
|
+
<EmbedContainer modalSize="compact">
|
238
216
|
<DynamicHeight>{content}</DynamicHeight>
|
239
|
-
</
|
217
|
+
</EmbedContainer>
|
240
218
|
</CustomThemeProvider>
|
241
219
|
);
|
242
220
|
}
|
@@ -33,7 +33,11 @@ export const CopyIcon: React.FC<{
|
|
33
33
|
>
|
34
34
|
<ToolTip tip={props.tip} side={props.side} align={props.align}>
|
35
35
|
<div>
|
36
|
-
<Container
|
36
|
+
<Container
|
37
|
+
color={showCheckIcon ? "success" : undefined}
|
38
|
+
flex="row"
|
39
|
+
center="both"
|
40
|
+
>
|
37
41
|
{showCheckIcon ? <CheckIcon /> : <CopyIconSVG />}
|
38
42
|
</Container>
|
39
43
|
</div>
|
@@ -1,16 +1,20 @@
|
|
1
1
|
"use client";
|
2
2
|
import { keyframes } from "@emotion/react";
|
3
3
|
import { Cross2Icon } from "@radix-ui/react-icons";
|
4
|
-
import { forwardRef, useRef } from "react";
|
5
|
-
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
6
4
|
import {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
forwardRef,
|
6
|
+
useCallback,
|
7
|
+
useLayoutEffect,
|
8
|
+
useRef,
|
9
|
+
useState,
|
10
|
+
} from "react";
|
11
|
+
import { useCustomTheme } from "../../../core/design-system/CustomThemeProvider.js";
|
12
|
+
import { iconSize, radius } from "../../../core/design-system/index.js";
|
11
13
|
import { fadeInAnimation } from "../design-system/animations.js";
|
12
14
|
import { StyledDiv } from "../design-system/elements.js";
|
15
|
+
import { DynamicHeight } from "./DynamicHeight.js";
|
13
16
|
import { CrossContainer } from "./Modal.js";
|
17
|
+
import { Container } from "./basic.js";
|
14
18
|
import { IconButton } from "./buttons.js";
|
15
19
|
|
16
20
|
type DrawerProps = {
|
@@ -24,23 +28,29 @@ type DrawerProps = {
|
|
24
28
|
export const Drawer = /* @__PURE__ */ forwardRef<HTMLDivElement, DrawerProps>(
|
25
29
|
function Drawer_(props, ref) {
|
26
30
|
return (
|
27
|
-
|
28
|
-
<
|
29
|
-
<
|
30
|
-
<
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
<DrawerContainer ref={ref}>
|
32
|
+
<DynamicHeight>
|
33
|
+
<Container p="lg">
|
34
|
+
<CrossContainer>
|
35
|
+
<IconButton
|
36
|
+
type="button"
|
37
|
+
aria-label="Close"
|
38
|
+
onClick={props.close}
|
39
|
+
>
|
40
|
+
<Cross2Icon
|
41
|
+
width={iconSize.md}
|
42
|
+
height={iconSize.md}
|
43
|
+
style={{
|
44
|
+
color: "inherit",
|
45
|
+
}}
|
46
|
+
/>
|
47
|
+
</IconButton>
|
48
|
+
</CrossContainer>
|
40
49
|
|
41
|
-
|
42
|
-
|
43
|
-
|
50
|
+
{props.children}
|
51
|
+
</Container>
|
52
|
+
</DynamicHeight>
|
53
|
+
</DrawerContainer>
|
44
54
|
);
|
45
55
|
},
|
46
56
|
);
|
@@ -49,7 +59,6 @@ export const DrawerContainer = /* @__PURE__ */ StyledDiv((_) => {
|
|
49
59
|
const theme = useCustomTheme();
|
50
60
|
return {
|
51
61
|
zIndex: 10000,
|
52
|
-
padding: spacing.lg,
|
53
62
|
borderTopLeftRadius: radius.xl,
|
54
63
|
borderTopRightRadius: radius.xl,
|
55
64
|
background: theme.colors.modalBg,
|
@@ -89,32 +98,74 @@ export const DrawerOverlay = /* @__PURE__ */ StyledDiv((_) => {
|
|
89
98
|
* @internal
|
90
99
|
*/
|
91
100
|
export function useDrawer() {
|
101
|
+
const [isOpen, _setIsOpen] = useState(false);
|
92
102
|
const drawerRef = useRef<HTMLDivElement>(null);
|
93
103
|
const drawerOverlayRef = useRef<HTMLDivElement>(null);
|
94
104
|
|
95
|
-
const
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
105
|
+
const closeDrawerAnimation = useCallback(() => {
|
106
|
+
return new Promise<void>((resolve) => {
|
107
|
+
if (drawerRef.current) {
|
108
|
+
const animOptions = {
|
109
|
+
easing: "cubic-bezier(0.175, 0.885, 0.32, 1.1)",
|
110
|
+
fill: "forwards",
|
111
|
+
duration: 300,
|
112
|
+
} as const;
|
113
|
+
|
114
|
+
const closeAnimation = drawerRef.current.animate(
|
115
|
+
[{ transform: "translateY(100%)", opacity: 0 }],
|
116
|
+
animOptions,
|
117
|
+
);
|
118
|
+
|
119
|
+
drawerOverlayRef.current?.animate([{ opacity: 0 }], animOptions);
|
120
|
+
closeAnimation.onfinish = () => resolve();
|
121
|
+
} else {
|
122
|
+
resolve();
|
123
|
+
}
|
124
|
+
});
|
125
|
+
}, []);
|
102
126
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
127
|
+
const setIsOpen = useCallback(
|
128
|
+
async (value: boolean) => {
|
129
|
+
if (value) {
|
130
|
+
_setIsOpen(true);
|
131
|
+
} else {
|
132
|
+
await closeDrawerAnimation();
|
133
|
+
_setIsOpen(false);
|
134
|
+
}
|
135
|
+
},
|
136
|
+
[closeDrawerAnimation],
|
137
|
+
);
|
107
138
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
139
|
+
// close on outside click
|
140
|
+
useLayoutEffect(() => {
|
141
|
+
if (!isOpen) {
|
142
|
+
return;
|
112
143
|
}
|
113
|
-
|
144
|
+
|
145
|
+
const handleClick = (event: MouseEvent) => {
|
146
|
+
if (
|
147
|
+
drawerRef.current &&
|
148
|
+
event.target instanceof Node &&
|
149
|
+
!drawerRef.current.contains(event.target)
|
150
|
+
) {
|
151
|
+
setIsOpen(false);
|
152
|
+
}
|
153
|
+
};
|
154
|
+
|
155
|
+
// avoid listening to the click event that opened the drawer by adding a frame delay
|
156
|
+
requestAnimationFrame(() => {
|
157
|
+
document.addEventListener("click", handleClick);
|
158
|
+
});
|
159
|
+
|
160
|
+
return () => {
|
161
|
+
document.removeEventListener("click", handleClick);
|
162
|
+
};
|
163
|
+
}, [isOpen, setIsOpen]);
|
114
164
|
|
115
165
|
return {
|
116
166
|
drawerRef,
|
117
167
|
drawerOverlayRef,
|
118
|
-
|
168
|
+
setIsOpen,
|
169
|
+
isOpen,
|
119
170
|
};
|
120
171
|
}
|
@@ -1,17 +1,14 @@
|
|
1
1
|
import { useState } from "react";
|
2
|
-
import type { Chain } from "../../../../chains/types.js";
|
3
|
-
import { useSwitchActiveWalletChain } from "../../hooks/wallets/useSwitchActiveWalletChain.js";
|
4
2
|
import { Spinner } from "./Spinner.js";
|
5
3
|
import { Button, type ButtonProps } from "./buttons.js";
|
6
4
|
|
7
5
|
export function SwitchNetworkButton(
|
8
6
|
props: ButtonProps & {
|
9
|
-
chain: Chain;
|
10
7
|
fullWidth?: boolean;
|
8
|
+
switchChain: () => Promise<void>;
|
11
9
|
},
|
12
10
|
) {
|
13
11
|
const [isSwitching, setIsSwitching] = useState(false);
|
14
|
-
const switchActiveWalletChain = useSwitchActiveWalletChain();
|
15
12
|
|
16
13
|
return (
|
17
14
|
<Button
|
@@ -20,7 +17,7 @@ export function SwitchNetworkButton(
|
|
20
17
|
onClick={async () => {
|
21
18
|
setIsSwitching(true);
|
22
19
|
try {
|
23
|
-
await
|
20
|
+
await props.switchChain();
|
24
21
|
} catch {}
|
25
22
|
setIsSwitching(false);
|
26
23
|
}}
|
@@ -30,6 +30,7 @@ export function WalletImage(props: {
|
|
30
30
|
id: WalletId;
|
31
31
|
size: string;
|
32
32
|
client: ThirdwebClient;
|
33
|
+
style?: React.CSSProperties;
|
33
34
|
}) {
|
34
35
|
const [image, setImage] = useState<string | undefined>(undefined);
|
35
36
|
const activeWallet = useActiveWallet();
|
@@ -102,6 +103,7 @@ export function WalletImage(props: {
|
|
102
103
|
client={props.client}
|
103
104
|
style={{
|
104
105
|
borderRadius: radius.md,
|
106
|
+
...props.style,
|
105
107
|
}}
|
106
108
|
/>
|
107
109
|
);
|
@@ -63,6 +63,7 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
|
|
63
63
|
return theme.colors.accentButtonText;
|
64
64
|
case "secondary":
|
65
65
|
return theme.colors.secondaryButtonText;
|
66
|
+
case "ghost":
|
66
67
|
case "outline":
|
67
68
|
return theme.colors.secondaryButtonText;
|
68
69
|
case "link":
|
@@ -140,7 +141,7 @@ export const IconButton = /* @__PURE__ */ StyledButton((_) => {
|
|
140
141
|
display: "inline-flex",
|
141
142
|
alignItems: "center",
|
142
143
|
justifyContent: "center",
|
143
|
-
borderRadius: radius.
|
144
|
+
borderRadius: radius.md,
|
144
145
|
WebkitTapHighlightColor: "transparent",
|
145
146
|
color: theme.colors.secondaryIconColor,
|
146
147
|
padding: "2px",
|
@@ -149,6 +150,9 @@ export const IconButton = /* @__PURE__ */ StyledButton((_) => {
|
|
149
150
|
background: theme.colors.secondaryIconHoverBg,
|
150
151
|
color: theme.colors.secondaryIconHoverColor,
|
151
152
|
},
|
153
|
+
"&[disabled]": {
|
154
|
+
cursor: "not-allowed",
|
155
|
+
},
|
152
156
|
};
|
153
157
|
});
|
154
158
|
|
@@ -8,7 +8,6 @@ import {
|
|
8
8
|
useSetSelectionData,
|
9
9
|
} from "../../providers/wallet-ui-states-provider.js";
|
10
10
|
import type { ConnectLocale } from "../../ui/ConnectWallet/locale/types.js";
|
11
|
-
import type { LocaleId } from "../../ui/types.js";
|
12
11
|
import { useInAppWalletLocale } from "../in-app/useInAppWalletLocale.js";
|
13
12
|
import type { ConnectWalletSelectUIState } from "../shared/ConnectWalletSocialOptions.js";
|
14
13
|
import { LoadingScreen } from "../shared/LoadingScreen.js";
|
@@ -27,7 +26,6 @@ function EcosystemWalletConnectUI(props: {
|
|
27
26
|
goBack?: () => void;
|
28
27
|
client: ThirdwebClient;
|
29
28
|
chain: Chain | undefined;
|
30
|
-
localeId: LocaleId;
|
31
29
|
connectLocale: ConnectLocale;
|
32
30
|
size: "compact" | "wide";
|
33
31
|
meta: {
|
@@ -41,7 +39,8 @@ function EcosystemWalletConnectUI(props: {
|
|
41
39
|
const data = useSelectionData();
|
42
40
|
const setSelectionData = useSetSelectionData();
|
43
41
|
const state = data as ConnectWalletSelectUIState;
|
44
|
-
const
|
42
|
+
const localeId = props.connectLocale.id;
|
43
|
+
const locale = useInAppWalletLocale(localeId);
|
45
44
|
|
46
45
|
if (!locale) {
|
47
46
|
return <LoadingScreen />;
|
@@ -8,7 +8,6 @@ import {
|
|
8
8
|
} from "../../providers/wallet-ui-states-provider.js";
|
9
9
|
import { useScreenContext } from "../../ui/ConnectWallet/Modal/screen.js";
|
10
10
|
import type { ConnectLocale } from "../../ui/ConnectWallet/locale/types.js";
|
11
|
-
import type { LocaleId } from "../../ui/types.js";
|
12
11
|
import type { ConnectWalletSelectUIState } from "../shared/ConnectWalletSocialOptions.js";
|
13
12
|
import { LoadingScreen } from "../shared/LoadingScreen.js";
|
14
13
|
import { OTPLoginUI } from "../shared/OTPLoginUI.js";
|
@@ -35,13 +34,13 @@ function InAppWalletConnectUI(props: {
|
|
35
34
|
};
|
36
35
|
client: ThirdwebClient;
|
37
36
|
chain: Chain | undefined;
|
38
|
-
localeId: LocaleId;
|
39
37
|
connectLocale: ConnectLocale;
|
40
38
|
}) {
|
41
39
|
const data = useSelectionData();
|
42
40
|
const setSelectionData = useSetSelectionData();
|
43
41
|
const state = data as ConnectWalletSelectUIState;
|
44
|
-
const
|
42
|
+
const localeId = props.connectLocale.id;
|
43
|
+
const locale = useInAppWalletLocale(localeId);
|
45
44
|
const { initialScreen } = useScreenContext();
|
46
45
|
|
47
46
|
if (!locale) {
|
@@ -7,7 +7,6 @@ import { useScreenContext } from "../../ui/ConnectWallet/Modal/screen.js";
|
|
7
7
|
import { WalletEntryButton } from "../../ui/ConnectWallet/WalletEntryButton.js";
|
8
8
|
import { reservedScreens } from "../../ui/ConnectWallet/constants.js";
|
9
9
|
import type { ConnectLocale } from "../../ui/ConnectWallet/locale/types.js";
|
10
|
-
import type { LocaleId } from "../../ui/types.js";
|
11
10
|
import { ConnectWalletSocialOptions } from "../shared/ConnectWalletSocialOptions.js";
|
12
11
|
import { LoadingScreen } from "../shared/LoadingScreen.js";
|
13
12
|
import { useInAppWalletLocale } from "./useInAppWalletLocale.js";
|
@@ -25,12 +24,11 @@ function InAppWalletSelectionUI(props: {
|
|
25
24
|
client: ThirdwebClient;
|
26
25
|
recommendedWallets: Wallet[] | undefined;
|
27
26
|
chain: Chain | undefined;
|
28
|
-
localeId: LocaleId;
|
29
27
|
size: "compact" | "wide";
|
30
28
|
}) {
|
31
29
|
const { screen } = useScreenContext();
|
32
30
|
const setData = useSetSelectionData();
|
33
|
-
const locale = useInAppWalletLocale(props.
|
31
|
+
const locale = useInAppWalletLocale(props.connectLocale.id);
|
34
32
|
|
35
33
|
// do not show the "selectUI" if
|
36
34
|
// modal is compact or
|
@@ -49,6 +47,8 @@ function InAppWalletSelectionUI(props: {
|
|
49
47
|
client={props.client}
|
50
48
|
connectLocale={props.connectLocale}
|
51
49
|
recommendedWallets={props.recommendedWallets}
|
50
|
+
isActive={screen === props.wallet}
|
51
|
+
badge={undefined}
|
52
52
|
/>
|
53
53
|
);
|
54
54
|
}
|
@@ -1,12 +1,27 @@
|
|
1
|
-
import {
|
1
|
+
import { expect, test } from "vitest";
|
2
2
|
import { formatNumber } from "./formatNumber.js";
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
test("formatNumber", () => {
|
5
|
+
// no decimals
|
6
|
+
expect(formatNumber(10, 1)).toEqual(10);
|
7
|
+
expect(formatNumber(10, 3)).toEqual(10);
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
// no change
|
10
|
+
expect(formatNumber(0.002, 3)).toEqual(0.002);
|
11
|
+
expect(formatNumber(0.007, 3)).toEqual(0.007);
|
12
|
+
expect(formatNumber(10.123, 3)).toEqual(10.123);
|
13
|
+
|
14
|
+
// rounded
|
15
|
+
expect(formatNumber(10.12345, 1)).toEqual(10.1);
|
16
|
+
expect(formatNumber(10.49, 1)).toEqual(10.5);
|
17
|
+
expect(formatNumber(0.12345, 1)).toEqual(0.1);
|
18
|
+
expect(formatNumber(0.16345, 1)).toEqual(0.2);
|
19
|
+
expect(formatNumber(0.16345, 3)).toEqual(0.163);
|
20
|
+
expect(formatNumber(0.16395, 3)).toEqual(0.164);
|
21
|
+
expect(formatNumber(1.0000000005, 3)).toEqual(1);
|
22
|
+
|
23
|
+
// ceil-ed to avoid making value zero
|
24
|
+
expect(formatNumber(0.0004, 3)).toEqual(0.001);
|
25
|
+
expect(formatNumber(0.00000000000009, 3)).toEqual(0.001);
|
26
|
+
expect(formatNumber(0.00000000000001, 3)).toEqual(0.001);
|
12
27
|
});
|
@@ -2,5 +2,8 @@
|
|
2
2
|
* @internal
|
3
3
|
*/
|
4
4
|
export function formatNumber(value: number, decimalPlaces: number) {
|
5
|
-
|
5
|
+
const precision = 10 ** decimalPlaces;
|
6
|
+
const threshold = 1 / 10 ** decimalPlaces; // anything below this if rounded will result in zero - so use ceil instead
|
7
|
+
const fn: "ceil" | "round" = value < threshold ? "ceil" : "round";
|
8
|
+
return Math[fn]((value + Number.EPSILON) * precision) / precision;
|
6
9
|
}
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.32.2
|
1
|
+
export const version = "5.32.2";
|