thirdweb 5.47.1 → 5.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/ethers5.js +87 -1
- package/dist/cjs/adapters/ethers5.js.map +1 -1
- package/dist/cjs/adapters/ethers6.js +85 -15
- package/dist/cjs/adapters/ethers6.js.map +1 -1
- package/dist/cjs/adapters/viem.js +117 -43
- package/dist/cjs/adapters/viem.js.map +1 -1
- package/dist/cjs/contract/actions/compiler-metadata.js.map +1 -1
- package/dist/cjs/exports/utils.js +7 -1
- package/dist/cjs/exports/utils.js.map +1 -1
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/cjs/react/core/design-system/index.js +1 -0
- package/dist/cjs/react/core/design-system/index.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/transaction-button-utils.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +58 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAddConnectedWallet.js +23 -0
- package/dist/cjs/react/core/hooks/wallets/useAddConnectedWallet.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +62 -53
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +8 -6
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +1 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +9 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +3 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +7 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/cjs/react/web/ui/components/ChainIcon.js +3 -2
- package/dist/cjs/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyAddress.js +22 -0
- package/dist/cjs/react/web/ui/components/CopyAddress.js.map +1 -0
- package/dist/cjs/react/web/ui/components/IconContainer.js +25 -0
- package/dist/cjs/react/web/ui/components/IconContainer.js.map +1 -0
- package/dist/cjs/react/web/ui/components/Modal.js +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +4 -11
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/ui/components/formElements.js +3 -3
- package/dist/cjs/react/web/ui/components/formElements.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js +1 -3
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +70 -0
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +9 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ErrorState.js +14 -0
- package/dist/cjs/react/web/wallets/shared/ErrorState.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/LoadingState.js +19 -0
- package/dist/cjs/react/web/wallets/shared/LoadingState.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +6 -20
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js +2 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/engine.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/cjs/transaction/prepare-contract-call.js +1 -1
- package/dist/cjs/transaction/read-contract.js +21 -2
- package/dist/cjs/transaction/read-contract.js.map +1 -1
- package/dist/cjs/utils/bigint.js +2 -0
- package/dist/cjs/utils/bigint.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/custom/smart/image.js +1 -1
- package/dist/cjs/wallets/custom/smart/image.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/manager/index.js +0 -1
- package/dist/cjs/wallets/manager/index.js.map +1 -1
- package/dist/cjs/wallets/types.js +0 -1
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/adapters/ethers5.js +87 -1
- package/dist/esm/adapters/ethers5.js.map +1 -1
- package/dist/esm/adapters/ethers6.js +85 -15
- package/dist/esm/adapters/ethers6.js.map +1 -1
- package/dist/esm/adapters/viem.js +117 -43
- package/dist/esm/adapters/viem.js.map +1 -1
- package/dist/esm/contract/actions/compiler-metadata.js.map +1 -1
- package/dist/esm/exports/utils.js +4 -0
- package/dist/esm/exports/utils.js.map +1 -1
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/esm/react/core/design-system/index.js +1 -0
- package/dist/esm/react/core/design-system/index.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/transaction-button-utils.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +57 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAddConnectedWallet.js +20 -0
- package/dist/esm/react/core/hooks/wallets/useAddConnectedWallet.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectModal.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +64 -55
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +8 -6
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +1 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +9 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +7 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/esm/react/web/ui/components/ChainIcon.js +3 -2
- package/dist/esm/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyAddress.js +18 -0
- package/dist/esm/react/web/ui/components/CopyAddress.js.map +1 -0
- package/dist/esm/react/web/ui/components/IconContainer.js +21 -0
- package/dist/esm/react/web/ui/components/IconContainer.js.map +1 -0
- package/dist/esm/react/web/ui/components/Modal.js +1 -1
- package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +1 -8
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/ui/components/formElements.js +3 -3
- package/dist/esm/react/web/ui/components/formElements.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js +2 -4
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +67 -0
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +10 -2
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ErrorState.js +11 -0
- package/dist/esm/react/web/wallets/shared/ErrorState.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/LoadingState.js +16 -0
- package/dist/esm/react/web/wallets/shared/LoadingState.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +4 -18
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js +2 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/engine.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/esm/transaction/prepare-contract-call.js +1 -1
- package/dist/esm/transaction/read-contract.js +21 -2
- package/dist/esm/transaction/read-contract.js.map +1 -1
- package/dist/esm/utils/bigint.js +2 -0
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/custom/smart/image.js +1 -1
- package/dist/esm/wallets/custom/smart/image.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/manager/index.js +0 -1
- package/dist/esm/wallets/manager/index.js.map +1 -1
- package/dist/esm/wallets/types.js +0 -1
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/adapters/ethers5.d.ts +87 -1
- package/dist/types/adapters/ethers5.d.ts.map +1 -1
- package/dist/types/adapters/ethers6.d.ts +85 -15
- package/dist/types/adapters/ethers6.d.ts.map +1 -1
- package/dist/types/adapters/viem.d.ts +117 -43
- package/dist/types/adapters/viem.d.ts.map +1 -1
- package/dist/types/contract/actions/compiler-metadata.d.ts +7 -1
- package/dist/types/contract/actions/compiler-metadata.d.ts.map +1 -1
- package/dist/types/exports/transaction.d.ts +7 -0
- package/dist/types/exports/transaction.d.ts.map +1 -1
- package/dist/types/exports/utils.d.ts +1 -0
- package/dist/types/exports/utils.d.ts.map +1 -1
- package/dist/types/extensions/erc721/read/getOwnedNFTs.d.ts +1 -0
- package/dist/types/extensions/erc721/read/getOwnedNFTs.d.ts.map +1 -1
- package/dist/types/react/core/design-system/index.d.ts +1 -0
- package/dist/types/react/core/design-system/index.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/transaction-button-utils.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/transaction-button-utils.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts +16 -0
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts +3 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts +1 -0
- 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.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts +3 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -1
- package/dist/types/react/web/ui/components/ChainIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyAddress.d.ts +7 -0
- package/dist/types/react/web/ui/components/CopyAddress.d.ts.map +1 -0
- package/dist/types/react/web/ui/components/IconContainer.d.ts +10 -0
- package/dist/types/react/web/ui/components/IconContainer.d.ts.map +1 -0
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +3 -0
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +24 -0
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts +5 -0
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts +7 -0
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/biconomy.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/biconomy.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/engine.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/engine.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/openzeppelin.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/openzeppelin.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/types.d.ts +12 -0
- package/dist/types/transaction/actions/gasless/types.d.ts.map +1 -1
- package/dist/types/transaction/prepare-contract-call.d.ts +1 -1
- package/dist/types/transaction/read-contract.d.ts +21 -2
- package/dist/types/transaction/read-contract.d.ts.map +1 -1
- package/dist/types/utils/bigint.d.ts +2 -0
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/custom/smart/image.d.ts +1 -1
- package/dist/types/wallets/custom/smart/image.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -2
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/manager/index.d.ts.map +1 -1
- package/dist/types/wallets/types.d.ts +1 -1
- package/dist/types/wallets/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/ethers5.ts +87 -1
- package/src/adapters/ethers6.ts +85 -15
- package/src/adapters/viem.ts +117 -44
- package/src/contract/actions/compiler-metadata.ts +4 -2
- package/src/exports/transaction.ts +8 -0
- package/src/exports/utils.ts +5 -0
- package/src/extensions/erc721/read/getOwnedNFTs.ts +1 -0
- package/src/extensions/lens/read/resolveAddress.test.ts +1 -1
- package/src/react/core/design-system/index.ts +1 -0
- package/src/react/core/hooks/transaction/transaction-button-utils.ts +1 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +70 -1
- package/src/react/core/hooks/wallets/useAddConnectedWallet.ts +20 -0
- package/src/react/native/ui/connect/ConnectModal.tsx +1 -1
- package/src/react/native/ui/transaction/TransactionButton.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Details.tsx +158 -157
- package/src/react/web/ui/ConnectWallet/MenuButton.tsx +0 -1
- package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +10 -1
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +0 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +10 -10
- package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +8 -9
- package/src/react/web/ui/ConnectWallet/screens/LinkProfileScreen.tsx +2 -0
- package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +21 -7
- package/src/react/web/ui/TransactionButton/index.tsx +1 -1
- package/src/react/web/ui/components/ChainIcon.tsx +4 -3
- package/src/react/web/ui/components/CopyAddress.tsx +34 -0
- package/src/react/web/ui/components/IconContainer.tsx +31 -0
- package/src/react/web/ui/components/Modal.tsx +1 -1
- package/src/react/web/ui/components/WalletImage.tsx +1 -8
- package/src/react/web/ui/components/formElements.tsx +3 -3
- package/src/react/web/wallets/in-app/CountrySelector.tsx +2 -8
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +18 -0
- package/src/react/web/wallets/in-app/WalletAuth.tsx +166 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +22 -0
- package/src/react/web/wallets/shared/ErrorState.tsx +29 -0
- package/src/react/web/wallets/shared/LoadingState.tsx +47 -0
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +4 -67
- package/src/react/web/wallets/shared/locale/de.ts +1 -0
- package/src/react/web/wallets/shared/locale/en.ts +2 -1
- package/src/react/web/wallets/shared/locale/es.ts +1 -0
- package/src/react/web/wallets/shared/locale/fr.ts +1 -0
- package/src/react/web/wallets/shared/locale/ja.ts +1 -0
- package/src/react/web/wallets/shared/locale/kr.ts +1 -0
- package/src/react/web/wallets/shared/locale/tl.ts +1 -0
- package/src/react/web/wallets/shared/locale/types.ts +1 -0
- package/src/react/web/wallets/shared/locale/vi.ts +1 -0
- package/src/transaction/actions/gasless/providers/biconomy.ts +3 -0
- package/src/transaction/actions/gasless/providers/engine.ts +3 -0
- package/src/transaction/actions/gasless/providers/openzeppelin.ts +3 -0
- package/src/transaction/actions/gasless/types.ts +12 -0
- package/src/transaction/prepare-contract-call.ts +1 -1
- package/src/transaction/read-contract.ts +21 -2
- package/src/utils/bigint.ts +2 -0
- package/src/version.ts +1 -1
- package/src/wallets/custom/smart/image.ts +1 -1
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +4 -4
- package/src/wallets/in-app/core/authentication/types.ts +1 -1
- package/src/wallets/manager/index.ts +0 -2
- package/src/wallets/types.ts +0 -1
@@ -69,3 +69,11 @@ export {
|
|
69
69
|
export type { WaitForReceiptOptions } from "../transaction/actions/wait-for-tx-receipt.js";
|
70
70
|
|
71
71
|
export type { TransactionReceipt } from "viem";
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Gasless types
|
75
|
+
*/
|
76
|
+
export type { GaslessOptions } from "../transaction/actions/gasless/types.js";
|
77
|
+
export type { EngineOptions } from "../transaction/actions/gasless/providers/engine.js";
|
78
|
+
export type { OpenZeppelinOptions } from "../transaction/actions/gasless/providers/openzeppelin.js";
|
79
|
+
export type { BiconomyOptions } from "../transaction/actions/gasless/providers/biconomy.js";
|
package/src/exports/utils.ts
CHANGED
@@ -176,3 +176,8 @@ export {
|
|
176
176
|
export type { NFTMetadata, NFTInput } from "../utils/nft/parseNft.js";
|
177
177
|
|
178
178
|
export { parseAbiParams } from "../utils/contract/parse-abi-params.js";
|
179
|
+
|
180
|
+
// ------------------------------------------------
|
181
|
+
// bigint
|
182
|
+
// ------------------------------------------------
|
183
|
+
export { max, min } from "../utils/bigint.js";
|
@@ -13,6 +13,7 @@ export type GetOwnedNFTsParams = GetOwnedTokenIdsParams;
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* Retrieves the owned NFTs for a given owner.
|
16
|
+
* This extension only works with ERC721 contracts that support the [`tokenOfOwnerByIndex`](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method
|
16
17
|
* @param options - The options for retrieving the owned NFTs.
|
17
18
|
* @returns A promise that resolves to an array of NFTs owned by the specified owner.
|
18
19
|
* @extension ERC721
|
@@ -3,7 +3,7 @@ import { TEST_CLIENT } from "~test/test-clients.js";
|
|
3
3
|
import { isAddress } from "../../../utils/address.js";
|
4
4
|
import { resolveAddress } from "./resolveAddress.js";
|
5
5
|
|
6
|
-
describe("resolve lens address", () => {
|
6
|
+
describe.runIf(process.env.TW_SECRET_KEY)("resolve lens address", () => {
|
7
7
|
it("should resolve to correct address", async () => {
|
8
8
|
const address = await resolveAddress({
|
9
9
|
client: TEST_CLIENT,
|
@@ -1,16 +1,20 @@
|
|
1
1
|
import { type UseMutationResult, useMutation } from "@tanstack/react-query";
|
2
2
|
import type { Chain } from "../../../../chains/types.js";
|
3
|
+
import { getGasPrice } from "../../../../gas/get-gas-price.js";
|
3
4
|
import type { BuyWithCryptoStatus } from "../../../../pay/buyWithCrypto/getStatus.js";
|
4
5
|
import type { BuyWithFiatStatus } from "../../../../pay/buyWithFiat/getStatus.js";
|
6
|
+
import { estimateGasCost } from "../../../../transaction/actions/estimate-gas-cost.js";
|
5
7
|
import type { GaslessOptions } from "../../../../transaction/actions/gasless/types.js";
|
6
8
|
import { sendTransaction } from "../../../../transaction/actions/send-transaction.js";
|
7
9
|
import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait-for-tx-receipt.js";
|
8
10
|
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
9
11
|
import { resolvePromisedValue } from "../../../../utils/promise/resolve-promised-value.js";
|
10
12
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
13
|
+
import { getWalletBalance } from "../../../../wallets/utils/getWalletBalance.js";
|
11
14
|
import type { LocaleId } from "../../../web/ui/types.js";
|
12
15
|
import type { Theme } from "../../design-system/index.js";
|
13
16
|
import type { SupportedTokens } from "../../utils/defaultTokens.js";
|
17
|
+
import { hasSponsoredTransactionsEnabled } from "../../utils/wallet.js";
|
14
18
|
|
15
19
|
/**
|
16
20
|
* Configuration for the "Pay Modal" that opens when the user doesn't have enough funds to send a transaction.
|
@@ -157,7 +161,33 @@ export function useSendTransactionCore(args: {
|
|
157
161
|
const nativeValue = _nativeValue || 0n;
|
158
162
|
const erc20Value = _erc20Value?.amountWei || 0n;
|
159
163
|
|
160
|
-
|
164
|
+
const [nativeBalance, erc20Balance, gasCost] = await Promise.all([
|
165
|
+
getWalletBalance({
|
166
|
+
client: tx.client,
|
167
|
+
address: account.address,
|
168
|
+
chain: tx.chain,
|
169
|
+
}),
|
170
|
+
_erc20Value?.tokenAddress
|
171
|
+
? getWalletBalance({
|
172
|
+
client: tx.client,
|
173
|
+
address: account.address,
|
174
|
+
chain: tx.chain,
|
175
|
+
})
|
176
|
+
: undefined,
|
177
|
+
getTotalTxCostForBuy(tx, account.address),
|
178
|
+
]);
|
179
|
+
|
180
|
+
const gasSponsored = hasSponsoredTransactionsEnabled(wallet);
|
181
|
+
const txGasCost = gasSponsored ? 0n : gasCost;
|
182
|
+
const nativeCost = nativeValue + txGasCost;
|
183
|
+
|
184
|
+
const shouldShowModal =
|
185
|
+
(erc20Value > 0n &&
|
186
|
+
erc20Balance &&
|
187
|
+
erc20Balance.value < erc20Value) ||
|
188
|
+
(nativeCost > 0n && nativeBalance.value < nativeCost);
|
189
|
+
|
190
|
+
if (shouldShowModal) {
|
161
191
|
showPayModal({
|
162
192
|
tx,
|
163
193
|
sendTx,
|
@@ -177,3 +207,42 @@ export function useSendTransactionCore(args: {
|
|
177
207
|
},
|
178
208
|
});
|
179
209
|
}
|
210
|
+
|
211
|
+
export async function getTotalTxCostForBuy(
|
212
|
+
tx: PreparedTransaction,
|
213
|
+
from?: string,
|
214
|
+
) {
|
215
|
+
try {
|
216
|
+
const gasCost = await estimateGasCost({
|
217
|
+
transaction: tx,
|
218
|
+
from,
|
219
|
+
});
|
220
|
+
|
221
|
+
const bufferCost = gasCost.wei / 10n;
|
222
|
+
|
223
|
+
// Note: get tx.value AFTER estimateGasCost
|
224
|
+
const txValue = await resolvePromisedValue(tx.value);
|
225
|
+
|
226
|
+
// add 10% extra gas cost to the estimate to ensure user buys enough to cover the tx cost
|
227
|
+
return gasCost.wei + bufferCost + (txValue || 0n);
|
228
|
+
} catch (e) {
|
229
|
+
if (from) {
|
230
|
+
// try again without passing from
|
231
|
+
return await getTotalTxCostForBuy(tx);
|
232
|
+
}
|
233
|
+
// fallback if both fail, use the tx value + 2M * gas price
|
234
|
+
const value = await resolvePromisedValue(tx.value);
|
235
|
+
|
236
|
+
const gasPrice = await getGasPrice({
|
237
|
+
client: tx.client,
|
238
|
+
chain: tx.chain,
|
239
|
+
});
|
240
|
+
|
241
|
+
const buffer = 2_000_000n * gasPrice;
|
242
|
+
|
243
|
+
if (!value) {
|
244
|
+
return 0n + buffer;
|
245
|
+
}
|
246
|
+
return value + buffer;
|
247
|
+
}
|
248
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* A hook to add a connected wallet without setting the active wallet.
|
5
|
+
* @returns A function that lets you add a connected wallet.
|
6
|
+
* @example
|
7
|
+
* ```jsx
|
8
|
+
* import { useAddConnectedWallet } from "thirdweb/react";
|
9
|
+
*
|
10
|
+
* const addConnectedWallet = useAddConnectedWallet();
|
11
|
+
*
|
12
|
+
* // later in your code
|
13
|
+
* await addConnectedWallet(wallet);
|
14
|
+
* ```
|
15
|
+
* @walletConnection
|
16
|
+
*/
|
17
|
+
export function useAddConnectedWallet() {
|
18
|
+
const manager = useConnectionManagerCtx("useAddConnectedWallet");
|
19
|
+
return manager.handleConnection;
|
20
|
+
}
|
@@ -11,7 +11,7 @@ import { ThemedSpinner } from "../components/spinner.js";
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* TransactionButton component is used to render a button that triggers a transaction.
|
14
|
-
*
|
14
|
+
* It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction.
|
15
15
|
* @param props - The props for this component.
|
16
16
|
* Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.
|
17
17
|
* @example
|
@@ -19,6 +19,7 @@ import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
|
|
19
19
|
import type { AppMetadata } from "../../../../wallets/types.js";
|
20
20
|
import {
|
21
21
|
CustomThemeProvider,
|
22
|
+
parseTheme,
|
22
23
|
useCustomTheme,
|
23
24
|
} from "../../../core/design-system/CustomThemeProvider.js";
|
24
25
|
import {
|
@@ -51,15 +52,20 @@ import type {
|
|
51
52
|
SupportedTokens,
|
52
53
|
} from "../../../core/utils/defaultTokens.js";
|
53
54
|
import { hasSmartAccount } from "../../../core/utils/isSmartWallet.js";
|
54
|
-
import {
|
55
|
+
import {
|
56
|
+
useConnectedWalletDetails,
|
57
|
+
useWalletInfo,
|
58
|
+
} from "../../../core/utils/wallet.js";
|
55
59
|
import { WalletUIStatesProvider } from "../../providers/wallet-ui-states-provider.js";
|
56
60
|
import { ChainIcon } from "../components/ChainIcon.js";
|
57
61
|
import { CopyIcon } from "../components/CopyIcon.js";
|
58
|
-
import {
|
62
|
+
import { IconContainer } from "../components/IconContainer.js";
|
59
63
|
import { Modal } from "../components/Modal.js";
|
60
64
|
import { Skeleton } from "../components/Skeleton.js";
|
61
65
|
import { Spacer } from "../components/Spacer.js";
|
62
66
|
import { Spinner } from "../components/Spinner.js";
|
67
|
+
import { ToolTip } from "../components/Tooltip.js";
|
68
|
+
import { WalletImage } from "../components/WalletImage.js";
|
63
69
|
import { Container, Line } from "../components/basic.js";
|
64
70
|
import { Button, IconButton } from "../components/buttons.js";
|
65
71
|
import { Link, Text } from "../components/text.js";
|
@@ -78,8 +84,6 @@ import { onModalUnmount } from "./constants.js";
|
|
78
84
|
import { CoinsIcon } from "./icons/CoinsIcon.js";
|
79
85
|
import { FundsIcon } from "./icons/FundsIcon.js";
|
80
86
|
import { OutlineWalletIcon } from "./icons/OutlineWalletIcon.js";
|
81
|
-
import { ShuffleIconLucide } from "./icons/ShuffleIconLucide.js";
|
82
|
-
import { SmartWalletBadgeIcon } from "./icons/SmartAccountBadgeIcon.js";
|
83
87
|
import { getConnectLocale } from "./locale/getConnectLocale.js";
|
84
88
|
import type { ConnectLocale } from "./locale/types.js";
|
85
89
|
import { LazyBuyScreen } from "./screens/Buy/LazyBuyScreen.js";
|
@@ -125,7 +129,6 @@ export const ConnectedWalletDetails: React.FC<{
|
|
125
129
|
const setRootEl = useContext(SetRootElementContext);
|
126
130
|
const activeAccount = useActiveAccount();
|
127
131
|
const walletChain = useActiveWalletChain();
|
128
|
-
const theme = useCustomTheme();
|
129
132
|
|
130
133
|
const { ensAvatarQuery, addressOrENS, balanceQuery } =
|
131
134
|
useConnectedWalletDetails(
|
@@ -191,36 +194,37 @@ export const ConnectedWalletDetails: React.FC<{
|
|
191
194
|
data-test="connected-wallet-details"
|
192
195
|
onClick={openModal}
|
193
196
|
>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
197
|
+
<Container
|
198
|
+
style={{
|
199
|
+
borderRadius: "100%",
|
200
|
+
overflow: "hidden",
|
201
|
+
width: "35px",
|
202
|
+
height: "35px",
|
203
|
+
}}
|
204
|
+
>
|
205
|
+
{ensAvatarQuery.data ? (
|
206
|
+
<img
|
207
|
+
alt=""
|
208
|
+
src={ensAvatarQuery.data}
|
209
|
+
style={{
|
210
|
+
width: "100%",
|
211
|
+
height: "100%",
|
212
|
+
}}
|
213
|
+
/>
|
214
|
+
) : (
|
215
|
+
activeAccount && <Blobbie address={activeAccount.address} size={35} />
|
216
|
+
)}
|
217
|
+
</Container>
|
208
218
|
<Container
|
209
219
|
flex="column"
|
210
|
-
gap="
|
211
|
-
px="sm"
|
212
|
-
py="xs"
|
220
|
+
gap="4xs"
|
213
221
|
style={{
|
214
|
-
border: `1px solid ${theme.colors.borderColor}`,
|
215
222
|
textOverflow: "ellipsis",
|
216
|
-
minWidth: "115px",
|
217
|
-
height: "50px",
|
218
223
|
whiteSpace: "nowrap",
|
219
224
|
borderRadius: `0 ${radius.md} ${radius.md} 0`,
|
220
225
|
}}
|
221
226
|
>
|
222
227
|
{/* Address */}
|
223
|
-
|
224
228
|
{addressOrENS ? (
|
225
229
|
<Text
|
226
230
|
size="xs"
|
@@ -231,7 +235,7 @@ export const ConnectedWalletDetails: React.FC<{
|
|
231
235
|
{addressOrENS}
|
232
236
|
</Text>
|
233
237
|
) : (
|
234
|
-
<Skeleton height={fontSize.
|
238
|
+
<Skeleton height={fontSize.xs} width="80px" />
|
235
239
|
)}
|
236
240
|
|
237
241
|
{/* Balance */}
|
@@ -239,9 +243,12 @@ export const ConnectedWalletDetails: React.FC<{
|
|
239
243
|
<Text
|
240
244
|
className={`${TW_CONNECTED_WALLET}__balance`}
|
241
245
|
size="xs"
|
242
|
-
|
246
|
+
color="secondaryText"
|
247
|
+
weight={400}
|
243
248
|
>
|
244
|
-
{Number
|
249
|
+
{Number.parseFloat(
|
250
|
+
Number(balanceQuery.data.displayValue).toFixed(3),
|
251
|
+
)}{" "}
|
245
252
|
{balanceQuery.data.symbol}
|
246
253
|
</Text>
|
247
254
|
) : (
|
@@ -282,6 +289,7 @@ function DetailsModal(props: {
|
|
282
289
|
activeAccount,
|
283
290
|
props.displayBalanceToken,
|
284
291
|
);
|
292
|
+
const theme = parseTheme(props.theme);
|
285
293
|
|
286
294
|
const activeWallet = useActiveWallet();
|
287
295
|
const chainIconQuery = useChainIconUrl(walletChain);
|
@@ -340,8 +348,18 @@ function DetailsModal(props: {
|
|
340
348
|
{chainNameQuery.isLoading ? (
|
341
349
|
<Skeleton height={"16px"} width={"150px"} />
|
342
350
|
) : (
|
343
|
-
<Text color="primaryText" multiline>
|
351
|
+
<Text color="primaryText" size="md" multiline>
|
344
352
|
{chainNameQuery.name || `Unknown chain #${walletChain?.id}`}
|
353
|
+
<Text color="secondaryText" size="xs">
|
354
|
+
{balanceQuery.data ? (
|
355
|
+
Number.parseFloat(
|
356
|
+
Number(balanceQuery.data.displayValue).toFixed(3),
|
357
|
+
)
|
358
|
+
) : (
|
359
|
+
<Skeleton height="1em" width="100px" />
|
360
|
+
)}{" "}
|
361
|
+
{balanceQuery.data?.symbol}
|
362
|
+
</Text>
|
345
363
|
</Text>
|
346
364
|
)}
|
347
365
|
|
@@ -358,114 +376,103 @@ function DetailsModal(props: {
|
|
358
376
|
|
359
377
|
let content = (
|
360
378
|
<div>
|
361
|
-
<Spacer y="
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
display: "flex",
|
379
|
-
alignItems: "center",
|
380
|
-
justifyContent: "center",
|
381
|
-
}}
|
382
|
-
>
|
383
|
-
<ShuffleIconLucide size="20" />
|
384
|
-
</div>
|
385
|
-
</IconButton>
|
386
|
-
|
387
|
-
<Container px="lg" flex="column" center="x">
|
388
|
-
<Container
|
389
|
-
style={{
|
390
|
-
position: "relative",
|
391
|
-
height: `${iconSize.xxl}px`,
|
392
|
-
width: `${iconSize.xxl}px`,
|
393
|
-
overflow: "visible",
|
394
|
-
}}
|
395
|
-
>
|
396
|
-
{ensAvatarQuery.data ? (
|
397
|
-
<Img
|
398
|
-
src={ensAvatarQuery.data}
|
399
|
-
width={iconSize.xxl}
|
400
|
-
height={iconSize.xxl}
|
379
|
+
<Spacer y="xs" />
|
380
|
+
<Container p="lg" gap="sm" flex="row" center="y">
|
381
|
+
<ToolTip tip="Switch wallet">
|
382
|
+
<div
|
383
|
+
style={{
|
384
|
+
cursor: "pointer",
|
385
|
+
}}
|
386
|
+
onKeyDown={(e) => {
|
387
|
+
if (e.key === "w") {
|
388
|
+
setScreen("wallet-manager");
|
389
|
+
}
|
390
|
+
}}
|
391
|
+
onClick={() => {
|
392
|
+
setScreen("wallet-manager");
|
393
|
+
}}
|
394
|
+
>
|
395
|
+
<Container
|
401
396
|
style={{
|
402
|
-
|
397
|
+
position: "relative",
|
398
|
+
height: `${iconSize.xl}px`,
|
399
|
+
width: `${iconSize.xl}px`,
|
403
400
|
}}
|
404
|
-
|
405
|
-
/>
|
406
|
-
) : (
|
407
|
-
activeAccount && (
|
401
|
+
>
|
408
402
|
<Container
|
409
|
-
style={{
|
403
|
+
style={{
|
404
|
+
width: "100%",
|
405
|
+
height: "100%",
|
406
|
+
borderRadius: "100%",
|
407
|
+
overflow: "hidden",
|
408
|
+
}}
|
410
409
|
>
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
410
|
+
{ensAvatarQuery.data ? (
|
411
|
+
<img
|
412
|
+
src={ensAvatarQuery.data}
|
413
|
+
style={{
|
414
|
+
width: iconSize.xxl,
|
415
|
+
height: iconSize.xxl,
|
416
|
+
}}
|
417
|
+
alt=""
|
418
|
+
/>
|
419
|
+
) : (
|
420
|
+
activeAccount && (
|
421
|
+
<Blobbie
|
422
|
+
address={activeAccount.address}
|
423
|
+
size={Number(iconSize.xxl)}
|
424
|
+
/>
|
425
|
+
)
|
426
|
+
)}
|
415
427
|
</Container>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
428
|
+
<Container
|
429
|
+
style={{
|
430
|
+
position: "absolute",
|
431
|
+
bottom: -2,
|
432
|
+
right: -2,
|
433
|
+
}}
|
434
|
+
>
|
435
|
+
<IconContainer
|
436
|
+
style={{
|
437
|
+
background: theme.colors.modalBg,
|
438
|
+
}}
|
439
|
+
padding="4px"
|
440
|
+
>
|
441
|
+
{activeWallet && (
|
442
|
+
<WalletImage
|
443
|
+
style={{ borderRadius: 0 }}
|
444
|
+
id={activeWallet.id}
|
445
|
+
client={client}
|
446
|
+
size="12"
|
447
|
+
/>
|
448
|
+
)}
|
449
|
+
</IconContainer>
|
450
|
+
</Container>
|
451
|
+
</Container>
|
452
|
+
</div>
|
453
|
+
</ToolTip>
|
427
454
|
|
428
|
-
|
429
|
-
|
430
|
-
style={{
|
431
|
-
display: "flex",
|
432
|
-
gap: spacing.xxs,
|
433
|
-
alignItems: "center",
|
434
|
-
transform: "translateX(10px)",
|
435
|
-
}}
|
436
|
-
data-test="connected-wallet-address"
|
437
|
-
data-address={activeAccount?.address}
|
438
|
-
>
|
439
|
-
<Text color="primaryText" weight={500} size="md">
|
440
|
-
{addressOrENS}
|
441
|
-
</Text>
|
442
|
-
<IconButton
|
455
|
+
<Container flex="column" gap="3xs">
|
456
|
+
<div
|
443
457
|
style={{
|
444
|
-
|
458
|
+
display: "flex",
|
459
|
+
gap: spacing.xxs,
|
460
|
+
alignItems: "center",
|
445
461
|
}}
|
446
|
-
data-test="copy-address"
|
447
462
|
>
|
448
|
-
<
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
{balanceQuery.data ? (
|
461
|
-
Number(balanceQuery.data.displayValue).toFixed(3)
|
462
|
-
) : (
|
463
|
-
<Skeleton height="1em" width="100px" />
|
464
|
-
)}{" "}
|
465
|
-
{balanceQuery.data?.symbol}{" "}
|
466
|
-
</Text>
|
463
|
+
<Text color="primaryText" weight={500} size="md">
|
464
|
+
{addressOrENS}
|
465
|
+
</Text>
|
466
|
+
<IconButton>
|
467
|
+
<CopyIcon
|
468
|
+
text={activeAccount?.address || ""}
|
469
|
+
tip={locale.copyAddress}
|
470
|
+
/>
|
471
|
+
</IconButton>
|
472
|
+
</div>
|
473
|
+
<InAppWalletUserInfo client={client} locale={locale} />
|
474
|
+
</Container>
|
467
475
|
</Container>
|
468
|
-
<Spacer y="lg" />
|
469
476
|
<Container px="lg">
|
470
477
|
{/* Send, Receive, Swap */}
|
471
478
|
<Container
|
@@ -826,6 +833,7 @@ function DetailsModal(props: {
|
|
826
833
|
}}
|
827
834
|
client={client}
|
828
835
|
locale={locale}
|
836
|
+
walletConnect={props.connectOptions?.walletConnect}
|
829
837
|
/>
|
830
838
|
);
|
831
839
|
}
|
@@ -910,10 +918,13 @@ const WalletInfoButton = /* @__PURE__ */ StyledButton((_) => {
|
|
910
918
|
borderRadius: radius.md,
|
911
919
|
cursor: "pointer",
|
912
920
|
display: "inline-flex",
|
921
|
+
gap: spacing.xs,
|
922
|
+
padding: spacing.xs,
|
913
923
|
alignItems: "center",
|
914
924
|
minWidth: "165px",
|
915
925
|
height: "50px",
|
916
926
|
boxSizing: "border-box",
|
927
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
917
928
|
WebkitTapHighlightColor: "transparent",
|
918
929
|
lineHeight: "normal",
|
919
930
|
animation: `${fadeInAnimation} 300ms ease`,
|
@@ -962,20 +973,8 @@ function ConnectedToSmartWallet(props: {
|
|
962
973
|
}, [activeAccount, chain, client, isSmartWallet]);
|
963
974
|
|
964
975
|
const content = (
|
965
|
-
<Container
|
966
|
-
|
967
|
-
bg="secondaryButtonBg"
|
968
|
-
gap="xxs"
|
969
|
-
style={{
|
970
|
-
borderRadius: radius.md,
|
971
|
-
padding: `${spacing.xxs} ${spacing.sm} ${spacing.xxs} ${spacing.xs}`,
|
972
|
-
}}
|
973
|
-
center="y"
|
974
|
-
>
|
975
|
-
<Container flex="row" color="accentText" center="both">
|
976
|
-
<SmartWalletBadgeIcon size={iconSize.xs} />
|
977
|
-
</Container>
|
978
|
-
<Text size="xs" color="secondaryButtonText">
|
976
|
+
<Container flex="row" gap="3xs" center="y">
|
977
|
+
<Text size="xs" weight={400} color="secondaryText">
|
979
978
|
{locale.connectedToSmartWallet}
|
980
979
|
</Text>
|
981
980
|
</Container>
|
@@ -997,8 +996,6 @@ function ConnectedToSmartWallet(props: {
|
|
997
996
|
) : (
|
998
997
|
<Text size="sm"> {content}</Text>
|
999
998
|
)}
|
1000
|
-
|
1001
|
-
<Spacer y="xs" />
|
1002
999
|
</>
|
1003
1000
|
);
|
1004
1001
|
}
|
@@ -1006,9 +1003,15 @@ function ConnectedToSmartWallet(props: {
|
|
1006
1003
|
return null;
|
1007
1004
|
}
|
1008
1005
|
|
1009
|
-
function InAppWalletUserInfo(props: {
|
1010
|
-
|
1006
|
+
function InAppWalletUserInfo(props: {
|
1007
|
+
client: ThirdwebClient;
|
1008
|
+
locale: ConnectLocale;
|
1009
|
+
}) {
|
1010
|
+
const { client, locale } = props;
|
1011
1011
|
const account = useActiveAccount();
|
1012
|
+
const activeWallet = useActiveWallet();
|
1013
|
+
const { data: walletInfo } = useWalletInfo(activeWallet?.id);
|
1014
|
+
const isSmartWallet = hasSmartAccount(activeWallet);
|
1012
1015
|
|
1013
1016
|
const userInfoQuery = useQuery({
|
1014
1017
|
queryKey: ["in-app-wallet-user", client, account?.address],
|
@@ -1030,21 +1033,19 @@ function InAppWalletUserInfo(props: { client: ThirdwebClient }) {
|
|
1030
1033
|
},
|
1031
1034
|
});
|
1032
1035
|
|
1033
|
-
if (
|
1036
|
+
if (isSmartWallet) {
|
1037
|
+
return <ConnectedToSmartWallet client={client} connectLocale={locale} />;
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
if (userInfoQuery.data || walletInfo) {
|
1034
1041
|
return (
|
1035
|
-
<
|
1036
|
-
|
1037
|
-
|
1038
|
-
style={{
|
1039
|
-
paddingBottom: spacing.xs,
|
1040
|
-
}}
|
1041
|
-
>
|
1042
|
-
<Text size="sm">{userInfoQuery.data}</Text>
|
1043
|
-
</Container>
|
1042
|
+
<Text size="xs" weight={400}>
|
1043
|
+
{userInfoQuery.data || walletInfo?.name}
|
1044
|
+
</Text>
|
1044
1045
|
);
|
1045
1046
|
}
|
1046
1047
|
|
1047
|
-
return
|
1048
|
+
return <Skeleton width="50px" height="10px" />;
|
1048
1049
|
}
|
1049
1050
|
|
1050
1051
|
/**
|
@@ -28,7 +28,6 @@ export const MenuButton = /* @__PURE__ */ StyledButton((_) => {
|
|
28
28
|
transition: "background-color 200ms ease, transform 200ms ease",
|
29
29
|
"&:hover": {
|
30
30
|
backgroundColor: theme.colors.tertiaryBg,
|
31
|
-
transform: "scale(1.01)",
|
32
31
|
svg: {
|
33
32
|
color: theme.colors.accentText,
|
34
33
|
},
|