thirdweb 5.43.1 → 5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841
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/extensions/marketplace/direct-listings/utils.js +1 -0
- package/dist/cjs/extensions/marketplace/direct-listings/utils.js.map +1 -1
- package/dist/cjs/extensions/marketplace/english-auctions/utils.js +1 -0
- package/dist/cjs/extensions/marketplace/english-auctions/utils.js.map +1 -1
- package/dist/cjs/gas/fee-data.js +1 -1
- package/dist/cjs/gas/fee-data.js.map +1 -1
- package/dist/cjs/react/core/hooks/contract/useContractEvents.js +32 -2
- package/dist/cjs/react/core/hooks/contract/useContractEvents.js.map +1 -1
- package/dist/cjs/react/core/hooks/contract/useReadContract.js.map +1 -1
- package/dist/cjs/react/core/hooks/others/useWalletBalance.js +17 -2
- package/dist/cjs/react/core/hooks/others/useWalletBalance.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +1 -0
- package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +19 -1
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +74 -4
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js +8 -8
- package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js +114 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js +6 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js +12 -12
- package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js +114 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js +12 -12
- package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +8 -9
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/wallets/injected/locale/fr.js +27 -0
- package/dist/cjs/react/web/wallets/injected/locale/fr.js.map +1 -0
- package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js +4 -0
- package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/injected/locale/ja.js +8 -8
- package/dist/cjs/react/web/wallets/injected/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/injected/locale/kr.js +27 -0
- package/dist/cjs/react/web/wallets/injected/locale/kr.js.map +1 -0
- package/dist/cjs/react/web/wallets/local/locale/fr.js +44 -0
- package/dist/cjs/react/web/wallets/local/locale/fr.js.map +1 -0
- package/dist/cjs/react/web/wallets/local/locale/getLocalWalletLocale.js +2 -0
- package/dist/cjs/react/web/wallets/local/locale/getLocalWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/local/locale/ja.js +14 -18
- package/dist/cjs/react/web/wallets/local/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/local/locale/kr.js +44 -0
- package/dist/cjs/react/web/wallets/local/locale/kr.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +3 -9
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.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 +1 -0
- 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 +56 -0
- package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js +4 -0
- package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js +21 -20
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/kr.js +56 -0
- package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -0
- 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/react/web/wallets/smartWallet/locale/fr.js +13 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/fr.js.map +1 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +4 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
- package/dist/cjs/react/web/wallets/smartWallet/locale/ja.js +5 -5
- package/dist/cjs/react/web/wallets/smartWallet/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/smartWallet/locale/kr.js +13 -0
- package/dist/cjs/react/web/wallets/smartWallet/locale/kr.js.map +1 -0
- package/dist/cjs/react/web/wallets/walletConnect/locale.js +8 -0
- package/dist/cjs/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/cjs/transaction/actions/send-transaction.js +76 -5
- package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
- package/dist/cjs/transaction/prepare-contract-call.js +18 -13
- package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
- package/dist/cjs/transaction/read-contract.js +39 -6
- package/dist/cjs/transaction/read-contract.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +4 -1
- package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
- package/dist/esm/extensions/marketplace/direct-listings/utils.js +1 -0
- package/dist/esm/extensions/marketplace/direct-listings/utils.js.map +1 -1
- package/dist/esm/extensions/marketplace/english-auctions/utils.js +1 -0
- package/dist/esm/extensions/marketplace/english-auctions/utils.js.map +1 -1
- package/dist/esm/gas/fee-data.js +1 -1
- package/dist/esm/gas/fee-data.js.map +1 -1
- package/dist/esm/react/core/hooks/contract/useContractEvents.js +32 -2
- package/dist/esm/react/core/hooks/contract/useContractEvents.js.map +1 -1
- package/dist/esm/react/core/hooks/contract/useReadContract.js.map +1 -1
- package/dist/esm/react/core/hooks/others/useWalletBalance.js +17 -2
- package/dist/esm/react/core/hooks/others/useWalletBalance.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +1 -0
- package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +19 -1
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +74 -4
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/es.js +8 -8
- package/dist/esm/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js +112 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js +6 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js +12 -12
- package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js +112 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js +12 -12
- package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +8 -9
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/wallets/injected/locale/fr.js +25 -0
- package/dist/esm/react/web/wallets/injected/locale/fr.js.map +1 -0
- package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js +4 -0
- package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/injected/locale/ja.js +8 -8
- package/dist/esm/react/web/wallets/injected/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/injected/locale/kr.js +25 -0
- package/dist/esm/react/web/wallets/injected/locale/kr.js.map +1 -0
- package/dist/esm/react/web/wallets/local/locale/fr.js +42 -0
- package/dist/esm/react/web/wallets/local/locale/fr.js.map +1 -0
- package/dist/esm/react/web/wallets/local/locale/getLocalWalletLocale.js +2 -0
- package/dist/esm/react/web/wallets/local/locale/getLocalWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/local/locale/ja.js +14 -18
- package/dist/esm/react/web/wallets/local/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/local/locale/kr.js +42 -0
- package/dist/esm/react/web/wallets/local/locale/kr.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +3 -9
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.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 +1 -0
- 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 +54 -0
- package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js +4 -0
- package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js +21 -20
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/kr.js +54 -0
- package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -0
- 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/react/web/wallets/smartWallet/locale/fr.js +11 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/fr.js.map +1 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +4 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
- package/dist/esm/react/web/wallets/smartWallet/locale/ja.js +5 -5
- package/dist/esm/react/web/wallets/smartWallet/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/smartWallet/locale/kr.js +11 -0
- package/dist/esm/react/web/wallets/smartWallet/locale/kr.js.map +1 -0
- package/dist/esm/react/web/wallets/walletConnect/locale.js +8 -0
- package/dist/esm/react/web/wallets/walletConnect/locale.js.map +1 -1
- package/dist/esm/transaction/actions/send-transaction.js +76 -5
- package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
- package/dist/esm/transaction/prepare-contract-call.js +18 -13
- package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
- package/dist/esm/transaction/read-contract.js +39 -6
- package/dist/esm/transaction/read-contract.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +4 -1
- package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/index.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/oauth.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/types.d.ts +1 -0
- package/dist/types/extensions/marketplace/direct-listings/types.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/direct-listings/utils.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/types.d.ts +1 -0
- package/dist/types/extensions/marketplace/english-auctions/types.d.ts.map +1 -1
- package/dist/types/extensions/marketplace/english-auctions/utils.d.ts.map +1 -1
- package/dist/types/react/core/hooks/contract/useContractEvents.d.ts +32 -2
- package/dist/types/react/core/hooks/contract/useContractEvents.d.ts.map +1 -1
- package/dist/types/react/core/hooks/contract/useReadContract.d.ts +28 -6
- package/dist/types/react/core/hooks/contract/useReadContract.d.ts.map +1 -1
- package/dist/types/react/core/hooks/others/useWalletBalance.d.ts +17 -2
- package/dist/types/react/core/hooks/others/useWalletBalance.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -0
- package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +19 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +74 -4
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +17 -2
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +15 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/fr.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/fr.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/getConnectLocale.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/locale/kr.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/locale/kr.d.ts.map +1 -0
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/types.d.ts +1 -1
- package/dist/types/react/web/ui/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/injected/locale/fr.d.ts +7 -0
- package/dist/types/react/web/wallets/injected/locale/fr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/injected/locale/getInjectedWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/injected/locale/ja.d.ts +2 -2
- package/dist/types/react/web/wallets/injected/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/injected/locale/kr.d.ts +7 -0
- package/dist/types/react/web/wallets/injected/locale/kr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/local/locale/fr.d.ts +4 -0
- package/dist/types/react/web/wallets/local/locale/fr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/local/locale/getLocalWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/local/locale/ja.d.ts +2 -2
- package/dist/types/react/web/wallets/local/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/local/locale/kr.d.ts +4 -0
- package/dist/types/react/web/wallets/local/locale/kr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.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 +55 -0
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts +4 -3
- 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 +55 -0
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -0
- 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/react/web/wallets/smartWallet/locale/fr.d.ts +4 -0
- package/dist/types/react/web/wallets/smartWallet/locale/fr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/smartWallet/locale/getSmartWalletLocale.d.ts.map +1 -1
- package/dist/types/react/web/wallets/smartWallet/locale/ja.d.ts +2 -2
- package/dist/types/react/web/wallets/smartWallet/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/smartWallet/locale/kr.d.ts +4 -0
- package/dist/types/react/web/wallets/smartWallet/locale/kr.d.ts.map +1 -0
- package/dist/types/react/web/wallets/walletConnect/locale.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-transaction.d.ts +76 -5
- package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
- package/dist/types/transaction/prepare-contract-call.d.ts +18 -13
- package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
- package/dist/types/transaction/read-contract.d.ts +39 -6
- package/dist/types/transaction/read-contract.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +4 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +1 -0
- package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/extensions/marketplace/direct-listings/types.ts +1 -0
- package/src/extensions/marketplace/direct-listings/utils.ts +1 -0
- package/src/extensions/marketplace/english-auctions/types.ts +1 -0
- package/src/extensions/marketplace/english-auctions/utils.ts +1 -0
- package/src/gas/fee-data.ts +1 -1
- package/src/react/core/hooks/contract/useContractEvents.ts +32 -2
- package/src/react/core/hooks/contract/useReadContract.ts +28 -6
- package/src/react/core/hooks/others/useWalletBalance.ts +17 -2
- package/src/react/core/hooks/wallets/useActiveAccount.ts +1 -0
- package/src/react/core/utils/wallet.ts +19 -1
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +74 -4
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +17 -2
- package/src/react/web/ui/ConnectWallet/Details.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +15 -0
- package/src/react/web/ui/ConnectWallet/locale/es.ts +8 -8
- package/src/react/web/ui/ConnectWallet/locale/fr.ts +118 -0
- package/src/react/web/ui/ConnectWallet/locale/getConnectLocale.ts +6 -0
- package/src/react/web/ui/ConnectWallet/locale/ja.ts +12 -12
- package/src/react/web/ui/ConnectWallet/locale/kr.ts +114 -0
- package/src/react/web/ui/ConnectWallet/locale/tl.ts +12 -12
- package/src/react/web/ui/PayEmbed-disconnected.test.tsx +5 -3
- package/src/react/web/ui/PayEmbed.test.tsx +17 -16
- package/src/react/web/ui/PayEmbed.tsx +9 -4
- package/src/react/web/ui/types.ts +3 -1
- package/src/react/web/wallets/injected/locale/fr.ts +27 -0
- package/src/react/web/wallets/injected/locale/getInjectedWalletLocale.ts +4 -0
- package/src/react/web/wallets/injected/locale/ja.ts +8 -10
- package/src/react/web/wallets/injected/locale/kr.ts +25 -0
- package/src/react/web/wallets/local/locale/fr.ts +51 -0
- package/src/react/web/wallets/local/locale/getLocalWalletLocale.ts +2 -0
- package/src/react/web/wallets/local/locale/ja.ts +14 -20
- package/src/react/web/wallets/local/locale/kr.ts +47 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +3 -6
- package/src/react/web/wallets/shared/locale/de.ts +1 -0
- package/src/react/web/wallets/shared/locale/en.ts +1 -0
- package/src/react/web/wallets/shared/locale/es.ts +1 -0
- package/src/react/web/wallets/shared/locale/fr.ts +59 -0
- package/src/react/web/wallets/shared/locale/getConnectLocale.ts +4 -0
- package/src/react/web/wallets/shared/locale/ja.ts +22 -21
- package/src/react/web/wallets/shared/locale/kr.ts +55 -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/react/web/wallets/smartWallet/locale/fr.ts +13 -0
- package/src/react/web/wallets/smartWallet/locale/getSmartWalletLocale.ts +4 -0
- package/src/react/web/wallets/smartWallet/locale/ja.ts +5 -7
- package/src/react/web/wallets/smartWallet/locale/kr.ts +11 -0
- package/src/react/web/wallets/walletConnect/locale.ts +9 -0
- package/src/transaction/actions/send-transaction.ts +76 -5
- package/src/transaction/prepare-contract-call.ts +18 -13
- package/src/transaction/read-contract.ts +39 -6
- package/src/version.ts +1 -1
- package/src/wallets/in-app/web/in-app.ts +4 -1
- package/src/wallets/in-app/web/lib/auth/index.ts +1 -0
- package/src/wallets/in-app/web/lib/auth/oauth.ts +1 -1
- package/src/wallets/smart/smart-wallet-integration.test.ts +6 -0
@@ -8,18 +8,89 @@ export type SendTransactionOptions = {
|
|
8
8
|
gasless?: GaslessOptions;
|
9
9
|
};
|
10
10
|
/**
|
11
|
-
* Sends a transaction using the provided
|
11
|
+
* Sends a transaction using the provided account.
|
12
|
+
*
|
13
|
+
* You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/typescript/v5/extensions/use).
|
12
14
|
* @param options - The options for sending the transaction.
|
13
|
-
* @returns A promise that resolves to the transaction
|
14
|
-
* @throws An error if the
|
15
|
+
* @returns A promise that resolves to the transaction result.
|
16
|
+
* @throws An error if the transaction reverts.
|
15
17
|
* @transaction
|
16
18
|
* @example
|
19
|
+
*
|
20
|
+
* ### Using a prepared contract call
|
21
|
+
*
|
22
|
+
* ```ts
|
23
|
+
* import { sendTransaction, getContract, prepareContractCall } from "thirdweb";
|
24
|
+
* import { sepolia } from "thirdweb/chains";
|
25
|
+
*
|
26
|
+
* const contract = getContract({
|
27
|
+
* address: "0x...",
|
28
|
+
* chain: sepolia,
|
29
|
+
* client,
|
30
|
+
* });
|
31
|
+
*
|
32
|
+
* const transaction = prepareContractCall({
|
33
|
+
* contract,
|
34
|
+
* method: "function transfer(address to, uint256 value)",
|
35
|
+
* params: [to, value],
|
36
|
+
* });
|
37
|
+
*
|
38
|
+
* const { transactionHash } = await sendTransaction({
|
39
|
+
* account,
|
40
|
+
* transaction,
|
41
|
+
* });
|
42
|
+
* ```
|
43
|
+
*
|
44
|
+
* ### Using a write extension
|
45
|
+
*
|
17
46
|
* ```ts
|
18
|
-
* import { sendTransaction } from "thirdweb";
|
47
|
+
* import { sendTransaction, getContract } from "thirdweb";
|
48
|
+
* import { sepolia } from "thirdweb/chains";
|
49
|
+
* import { mintTo } from "thirdweb/extensions/erc721";
|
50
|
+
*
|
51
|
+
* const contract = getContract({
|
52
|
+
* address: "0x...",
|
53
|
+
* chain: sepolia,
|
54
|
+
* client,
|
55
|
+
* });
|
56
|
+
*
|
57
|
+
* const transaction = mintTo({
|
58
|
+
* contract,
|
59
|
+
* to: "0x...",
|
60
|
+
* nft: {
|
61
|
+
* name: "NFT Name",
|
62
|
+
* description: "NFT Description",
|
63
|
+
* image: "https://example.com/image.png",
|
64
|
+
* },
|
65
|
+
* });
|
66
|
+
*
|
67
|
+
* const { transactionHash } = await sendTransaction({
|
68
|
+
* account,
|
69
|
+
* transaction,
|
70
|
+
* });
|
71
|
+
* ```
|
72
|
+
*
|
73
|
+
* ### Using a prepared transaction
|
74
|
+
*
|
75
|
+
* ```ts
|
76
|
+
* import { sendTransaction, getContract, prepareTransaction } from "thirdweb";
|
77
|
+
* import { sepolia } from "thirdweb/chains";
|
78
|
+
*
|
79
|
+
* const contract = getContract({
|
80
|
+
* address: "0x...",
|
81
|
+
* chain: sepolia,
|
82
|
+
* client,
|
83
|
+
* });
|
84
|
+
*
|
85
|
+
* const transaction = prepareTransaction({
|
86
|
+
* contract,
|
87
|
+
* to: "0x...",
|
88
|
+
* value: toWei("0.1"),
|
89
|
+
* });
|
19
90
|
*
|
20
91
|
* const { transactionHash } = await sendTransaction({
|
21
92
|
* account,
|
22
|
-
* transaction
|
93
|
+
* transaction,
|
23
94
|
* });
|
24
95
|
* ```
|
25
96
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF
|
1
|
+
{"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAkChC"}
|
@@ -16,36 +16,41 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
|
|
16
16
|
* @returns A promise that resolves to the prepared transaction.
|
17
17
|
* @transaction
|
18
18
|
* @example
|
19
|
-
*
|
19
|
+
*
|
20
|
+
* ### Usage with a human-readable method signature:
|
21
|
+
*
|
20
22
|
* ```ts
|
21
23
|
* import { prepareContractCall } from "thirdweb";
|
22
24
|
*
|
23
|
-
* const transaction =
|
25
|
+
* const transaction = prepareContractCall({
|
24
26
|
* contract,
|
25
27
|
* method: "function transfer(address to, uint256 value)",
|
26
28
|
* params: [to, value],
|
27
29
|
* });
|
28
30
|
* ```
|
29
|
-
*
|
30
|
-
* Usage with explicit gas price and/or value:
|
31
|
+
*
|
32
|
+
* ### Usage with explicit gas price and/or value:
|
33
|
+
*
|
31
34
|
* ```ts
|
32
35
|
* import { prepareContractCall } from "thirdweb";
|
36
|
+
* import { toWei } from "thirdweb/utils";
|
33
37
|
*
|
34
|
-
* const transaction =
|
38
|
+
* const transaction = prepareContractCall({
|
35
39
|
* contract,
|
36
40
|
* method: "function transfer(address to, uint256 value)",
|
37
41
|
* params: [to, value],
|
38
42
|
* maxFeePerGas: 30n,
|
39
43
|
* maxPriorityFeePerGas: 1n,
|
40
|
-
* value:
|
44
|
+
* value: toWei("0.01"),
|
41
45
|
* });
|
42
46
|
* ```
|
43
|
-
*
|
44
|
-
* Usage with a JSON ABI function object:
|
47
|
+
*
|
48
|
+
* ### Usage with a JSON ABI function object:
|
49
|
+
*
|
45
50
|
* ```ts
|
46
51
|
* import { prepareContractCall } from "thirdweb";
|
47
52
|
*
|
48
|
-
* const transaction =
|
53
|
+
* const transaction = prepareContractCall({
|
49
54
|
* contract,
|
50
55
|
* method: {
|
51
56
|
* name: "transfer",
|
@@ -60,8 +65,9 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
|
|
60
65
|
* params: [to, value],
|
61
66
|
* });
|
62
67
|
* ```
|
63
|
-
*
|
64
|
-
* Usage with a the ABI defined on the contract:
|
68
|
+
*
|
69
|
+
* ### Usage with a the ABI defined on the contract:
|
70
|
+
*
|
65
71
|
* ```ts
|
66
72
|
* import { getContract, prepareContractCall } from "thirdweb";
|
67
73
|
* const contract = getContract({
|
@@ -75,8 +81,7 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
|
|
75
81
|
* });
|
76
82
|
* ```
|
77
83
|
*
|
78
|
-
*
|
79
|
-
* Passing extra call data to the transaction
|
84
|
+
* ### Passing extra call data to the transaction
|
80
85
|
* ```ts
|
81
86
|
* import { getContract, prepareContractCall } from "thirdweb";
|
82
87
|
* const contract = getContract({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prepare-contract-call.d.ts","sourceRoot":"","sources":["../../../src/transaction/prepare-contract-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,0BAA0B,CACpC,IAAI,SAAS,GAAG,GAAG,EAAE,EACrB,OAAO,SACH,WAAW,GACX,MAAM,GACN,CAAC,CACC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACvD,WAAW,GAAG,MAAM,GACpB,uBAAuB,CAAC,IAAI,CAAC,EACjC,eAAe,SAAS,cAAc,CACpC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAC5C,sBAAsB,CACxB,IAAI,CACF,kBAAkB,EAChB,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,YAAY,GACZ,KAAK,GACL,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,CACV,GAAG;IACF,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,EAAE,OAAO,GAAG,eAAe,CAAC;CACnC,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAClC,IAAI,CAAC,yBAAyB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,EACrE,IAAI,CACL,CAAC;AAEF
|
1
|
+
{"version":3,"file":"prepare-contract-call.d.ts","sourceRoot":"","sources":["../../../src/transaction/prepare-contract-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,0BAA0B,CACpC,IAAI,SAAS,GAAG,GAAG,EAAE,EACrB,OAAO,SACH,WAAW,GACX,MAAM,GACN,CAAC,CACC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACvD,WAAW,GAAG,MAAM,GACpB,uBAAuB,CAAC,IAAI,CAAC,EACjC,eAAe,SAAS,cAAc,CACpC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAC5C,sBAAsB,CACxB,IAAI,CACF,kBAAkB,EAChB,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,YAAY,GACZ,KAAK,GACL,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,CACV,GAAG;IACF,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,EAAE,OAAO,GAAG,eAAe,CAAC;CACnC,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAClC,IAAI,CAAC,yBAAyB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,EACrE,IAAI,CACL,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,IAAI,SAAS,GAAG,EACtB,KAAK,CAAC,OAAO,SAAS,IAAI,SAAS;IACjC,MAAM,EAAE,CAAC,CAAC;CACX,GAEO,WAAW,GACX,YAAY,MAAM,EAAE,GACpB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,GAChE,uBAAuB,CAAC,IAAI,CAAC,EACjC,KAAK,CAAC,eAAe,SAAS,cAAc,CAC1C,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAC9C,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,uHA8EpE"}
|
@@ -16,16 +16,49 @@ export type ReadContractOptions<TAbi extends Abi = [], TMethod extends AbiFuncti
|
|
16
16
|
from?: string;
|
17
17
|
} & ParamsOption<TPreparedMethod[1]> & Omit<PrepareTransactionOptions, "to" | "data" | "chain" | "client">, TAbi>;
|
18
18
|
/**
|
19
|
-
* Reads
|
19
|
+
* Reads state from a deployed smart contract.
|
20
|
+
*
|
21
|
+
* You can use raw read calls or read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) to read from a contract.
|
22
|
+
*
|
20
23
|
* @param options - The transaction options.
|
21
|
-
* @returns A promise that resolves with the result of the read
|
24
|
+
* @returns A promise that resolves with the result of the read call.
|
22
25
|
* @transaction
|
23
26
|
* @example
|
27
|
+
*
|
28
|
+
* ### Using a contract read extension
|
29
|
+
*
|
24
30
|
* ```ts
|
25
|
-
* import {
|
26
|
-
*
|
27
|
-
*
|
28
|
-
*
|
31
|
+
* import { getContract } from "thirdweb";
|
32
|
+
* import { sepolia } from "thirdweb/chains";
|
33
|
+
* import { useReadContract } from "thirdweb/react";
|
34
|
+
* import { getOwnedNFTs } form "thirdweb/extensions/erc721";
|
35
|
+
*
|
36
|
+
* const contract = getContract({
|
37
|
+
* client,
|
38
|
+
* address: "0x...",
|
39
|
+
* chain: sepolia,
|
40
|
+
* });
|
41
|
+
*
|
42
|
+
* const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
|
43
|
+
* ```
|
44
|
+
*
|
45
|
+
* ### Using a raw contract call
|
46
|
+
*
|
47
|
+
* ```ts
|
48
|
+
* import { getContract } from "thirdweb";
|
49
|
+
* import { sepolia } from "thirdweb/chains";
|
50
|
+
* import { useReadContract } from "thirdweb/react";
|
51
|
+
*
|
52
|
+
* const contract = getContract({
|
53
|
+
* client,
|
54
|
+
* address: "0x...",
|
55
|
+
* chain: sepolia,
|
56
|
+
* });
|
57
|
+
*
|
58
|
+
* const { data, isLoading } = useReadContract({
|
59
|
+
* contract,
|
60
|
+
* method: "function tokenURI(uint256 tokenId) returns (string)"});
|
61
|
+
* params: [1n],
|
29
62
|
* });
|
30
63
|
* ```
|
31
64
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"read-contract.d.ts","sourceRoot":"","sources":["../../../src/transaction/read-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,kBAAkB,EAAuB,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAGxC,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,YAAY,EAAE,IACpE,OAAO,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACzB,KAAK,GACL,OAAO,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GAE3B,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAEzC,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAE/C,MAAM,MAAM,mBAAmB,CAC7B,IAAI,SAAS,GAAG,GAAG,EAAE,EACrB,OAAO,SACH,WAAW,GACX,MAAM,GACN,CAAC,CACC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACvD,WAAW,GAAG,MAAM,GACpB,uBAAuB,CAAC,IAAI,CAAC,EACjC,eAAe,SAAS,cAAc,CACpC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAC5C,sBAAsB,CACxB,IAAI,CACF,kBAAkB,EAChB,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,YAAY,GACZ,KAAK,GACL,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,CACV,GAAG;IACF,MAAM,EAAE,OAAO,GAAG,eAAe,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAClC,IAAI,CAAC,yBAAyB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,EACrE,IAAI,CACL,CAAC;AAEF
|
1
|
+
{"version":3,"file":"read-contract.d.ts","sourceRoot":"","sources":["../../../src/transaction/read-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,kBAAkB,EAAuB,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAGxC,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,YAAY,EAAE,IACpE,OAAO,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACzB,KAAK,GACL,OAAO,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GAE3B,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAEzC,6BAA6B,CAAC,OAAO,CAAC,CAAC;AAE/C,MAAM,MAAM,mBAAmB,CAC7B,IAAI,SAAS,GAAG,GAAG,EAAE,EACrB,OAAO,SACH,WAAW,GACX,MAAM,GACN,CAAC,CACC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACvD,WAAW,GAAG,MAAM,GACpB,uBAAuB,CAAC,IAAI,CAAC,EACjC,eAAe,SAAS,cAAc,CACpC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAC5C,sBAAsB,CACxB,IAAI,CACF,kBAAkB,EAChB,MAAM,GACN,IAAI,GACJ,MAAM,GACN,OAAO,GACP,YAAY,GACZ,KAAK,GACL,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,CACV,GAAG;IACF,MAAM,EAAE,OAAO,GAAG,eAAe,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAClC,IAAI,CAAC,yBAAyB,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,EACrE,IAAI,CACL,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,YAAY,CAChC,KAAK,CAAC,IAAI,SAAS,GAAG,EACtB,KAAK,CAAC,OAAO,SAAS,IAAI,SAAS;IACjC,MAAM,EAAE,CAAC,CAAC;CACX,GAEO,WAAW,GACX,YAAY,MAAM,EAAE,GACpB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,GAChE,uBAAuB,CAAC,IAAI,CAAC,EACjC,KAAK,CAAC,eAAe,SAAS,cAAc,CAC1C,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAE9C,OAAO,EAAE,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,GAC3D,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAiFjD"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.43.
|
1
|
+
export declare const version = "5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2EAA2E,CAAC"}
|
@@ -36,7 +36,7 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
36
36
|
*
|
37
37
|
* [View all available social auth methods](https://portal.thirdweb.com/references/typescript/v5/InAppWalletSocialAuth)
|
38
38
|
*
|
39
|
-
*
|
39
|
+
* ### Login with email
|
40
40
|
*
|
41
41
|
* ```ts
|
42
42
|
* import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
|
@@ -55,6 +55,7 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
55
55
|
* client,
|
56
56
|
* chain,
|
57
57
|
* strategy: "email",
|
58
|
+
* email: "example@example.com",
|
58
59
|
* verificationCode: "123456",
|
59
60
|
* });
|
60
61
|
* ```
|
@@ -77,8 +78,10 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
|
|
77
78
|
* client,
|
78
79
|
* chain,
|
79
80
|
* strategy: "phone",
|
81
|
+
* honeNumber: "+1234567890",
|
80
82
|
* verificationCode: "123456",
|
81
83
|
* });
|
84
|
+
* ```
|
82
85
|
*
|
83
86
|
* ### Login with passkey
|
84
87
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D
|
1
|
+
{"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+JG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
|
@@ -49,6 +49,7 @@ export declare function getUserEmail(options: GetAuthenticatedUserParams): Promi
|
|
49
49
|
export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams): Promise<string | undefined>;
|
50
50
|
/**
|
51
51
|
* Pre-authenticates the user based on the provided authentication strategy.
|
52
|
+
* Use this function to send a verification code to the user's email or phone number.
|
52
53
|
* @param args - The arguments required for pre-authentication.
|
53
54
|
* @returns A promise that resolves to the pre-authentication result.
|
54
55
|
* @throws An error if the provided authentication strategy doesn't require pre-authentication.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyBhD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,uFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyBhD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,uFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,kFAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,KAAK,CACP,YAAY,GACZ;IACE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CACJ,sFAMF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.43.
|
3
|
+
"version": "5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -296,12 +296,13 @@
|
|
296
296
|
"expo-linking": "6.3.1",
|
297
297
|
"expo-web-browser": "13.0.3",
|
298
298
|
"happy-dom": "^14.12.0",
|
299
|
+
"msw": "^2.3.4",
|
299
300
|
"react-native": "0.74.2",
|
300
301
|
"react-native-aes-gcm-crypto": "0.2.2",
|
301
302
|
"react-native-quick-crypto": "0.7.0-rc.6",
|
302
303
|
"react-native-svg": "15.3.0",
|
303
|
-
"
|
304
|
-
"
|
304
|
+
"typescript": "5.5.2",
|
305
|
+
"vitest": "1.6.0"
|
305
306
|
},
|
306
307
|
"scripts": {
|
307
308
|
"bench:compare": "bun run ./benchmarks/run.ts",
|
package/src/gas/fee-data.ts
CHANGED
@@ -143,7 +143,7 @@ async function getDynamicFeeData(
|
|
143
143
|
eth_maxPriorityFeePerGas(rpcRequest).catch(() => null),
|
144
144
|
]);
|
145
145
|
|
146
|
-
const baseBlockFee = block?.baseFeePerGas
|
146
|
+
const baseBlockFee = block?.baseFeePerGas ?? 0n;
|
147
147
|
|
148
148
|
const chainId = chain.id;
|
149
149
|
// flag chain testnet & flag chain
|
@@ -25,10 +25,21 @@ type UseContractEventsOptions<
|
|
25
25
|
};
|
26
26
|
|
27
27
|
/**
|
28
|
-
* Watches contract events and returns the logs.
|
29
|
-
* @param options - The
|
28
|
+
* Watches contract events and returns the parsed logs.
|
29
|
+
* @param options - The options for watching contract events.
|
30
|
+
* @param options.contract - The contract to watch events for.
|
31
|
+
* @param options.events - The events to watch. Shuould be an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent).
|
32
|
+
* @param options.blockRange - The number of blocks to search for events.
|
33
|
+
* @param options.enabled - Whether to enable the query.
|
34
|
+
* @param options.watch - Whether to watch for new events.
|
30
35
|
* @returns The contract events of the watched contract events.
|
31
36
|
* @example
|
37
|
+
*
|
38
|
+
* ### Using event extensions
|
39
|
+
*
|
40
|
+
* The `thirdweb/extesions` export contains event definitions for many popular contracts.
|
41
|
+
* You can use these event definitions to watch for specific events with a type-safe API.
|
42
|
+
*
|
32
43
|
* ```jsx
|
33
44
|
* import { useContractEvents } from "thirdweb/react";
|
34
45
|
* import { tokensClaimedEvent } from "thirdweb/extensions/erc721";
|
@@ -39,6 +50,25 @@ type UseContractEventsOptions<
|
|
39
50
|
* events: [tokensClaimedEvent({ claimer: account?.address })],
|
40
51
|
* });
|
41
52
|
* ```
|
53
|
+
*
|
54
|
+
* ### Using custom events
|
55
|
+
*
|
56
|
+
* You can also watch for custom events by passing an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent).
|
57
|
+
*
|
58
|
+
* ```jsx
|
59
|
+
* import { useContractEvents } from "thirdweb/react";
|
60
|
+
* import { prepareEvent } from "thirdweb";
|
61
|
+
*
|
62
|
+
* const myEvent = prepareEvent({
|
63
|
+
* signature: "event MyEvent(uint256 myArg)",
|
64
|
+
* });
|
65
|
+
*
|
66
|
+
* const contractEvents = useContractEvents({
|
67
|
+
* contract,
|
68
|
+
* events: [myEvent],
|
69
|
+
* });
|
70
|
+
* ```
|
71
|
+
*
|
42
72
|
* @contract
|
43
73
|
*/
|
44
74
|
export function useContractEvents<
|
@@ -28,13 +28,29 @@ type PickedQueryOptions = Prettify<
|
|
28
28
|
>;
|
29
29
|
|
30
30
|
/**
|
31
|
-
* A hook to read from a contract.
|
31
|
+
* A hook to read state from a contract that automatically updates when the contract changes.
|
32
|
+
*
|
33
|
+
* You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.
|
34
|
+
*
|
32
35
|
* @param options - The options for reading from a contract
|
33
|
-
* @returns a
|
36
|
+
* @returns a UseQueryResult object.
|
34
37
|
* @example
|
35
38
|
* ```jsx
|
39
|
+
* import { getContract } from "thirdweb";
|
40
|
+
* import { sepolia } from "thirdweb/chains";
|
36
41
|
* import { useReadContract } from "thirdweb/react";
|
37
|
-
*
|
42
|
+
*
|
43
|
+
* const contract = getContract({
|
44
|
+
* client,
|
45
|
+
* address: "0x...",
|
46
|
+
* chain: sepolia,
|
47
|
+
* });
|
48
|
+
*
|
49
|
+
* const { data, isLoading } = useReadContract({
|
50
|
+
* contract,
|
51
|
+
* method: "function tokenURI(uint256 tokenId) returns (string)"});
|
52
|
+
* params: [1n],
|
53
|
+
* });
|
38
54
|
* ```
|
39
55
|
* @contract
|
40
56
|
*/
|
@@ -51,14 +67,20 @@ export function useReadContract<
|
|
51
67
|
ReadContractResult<PreparedMethod<ParseMethod<abi, method>>[2]>
|
52
68
|
>;
|
53
69
|
/**
|
54
|
-
* A hook to read from a contract.
|
70
|
+
* A hook to read state from a contract that automatically updates when the contract changes.
|
71
|
+
* You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.
|
72
|
+
*
|
55
73
|
* @param extension - An extension to call.
|
56
74
|
* @param options - The read extension params.
|
57
|
-
* @returns a
|
75
|
+
* @returns a UseQueryResult object.
|
58
76
|
* @example
|
77
|
+
*
|
78
|
+
* Read a contract extension let you do complex contract queries with less code.
|
79
|
+
*
|
59
80
|
* ```jsx
|
60
81
|
* import { useReadContract } from "thirdweb/react";
|
61
|
-
* import { getOwnedNFTs } form "thirdweb/extensions/erc721"
|
82
|
+
* import { getOwnedNFTs } form "thirdweb/extensions/erc721";
|
83
|
+
*
|
62
84
|
* const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
|
63
85
|
* ```
|
64
86
|
*/
|
@@ -23,8 +23,8 @@ export type UseWalletBalanceQueryOptions = Omit<
|
|
23
23
|
>;
|
24
24
|
|
25
25
|
/**
|
26
|
-
* Fetch the balance of a wallet for a specific token.
|
27
|
-
*
|
26
|
+
* Fetch the balance of a wallet in native currency or for a specific token.
|
27
|
+
* Leave `tokenAddress` undefined to fetch the native token balance.
|
28
28
|
* @param options {@link GetWalletBalanceOptions} - The options for fetching the wallet balance.
|
29
29
|
* @param options.chain - The chain to fetch the wallet balance from.
|
30
30
|
* @param options.address - The address of the wallet to fetch the balance from.
|
@@ -33,10 +33,25 @@ export type UseWalletBalanceQueryOptions = Omit<
|
|
33
33
|
* @returns {@link GetWalletBalanceResult} The result of the query.
|
34
34
|
*
|
35
35
|
* @example
|
36
|
+
*
|
37
|
+
* ### Fetching the native token balance
|
38
|
+
*
|
36
39
|
* ```ts
|
37
40
|
* import { useWalletBalance } from "thirdweb/react";
|
38
41
|
*
|
42
|
+
* const { data, isLoading, isError } = useWalletBalance({ chain, address, client });
|
43
|
+
* console.log("balance", data?.displayValue, data?.symbol);
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* ### Fetching a specific token balance
|
47
|
+
*
|
48
|
+
* ```ts
|
49
|
+
* import { useWalletBalance } from "thirdweb/react";
|
50
|
+
*
|
51
|
+
* const tokenAddress = "0x..."; // the ERC20 token address
|
52
|
+
*
|
39
53
|
* const { data, isLoading, isError } = useWalletBalance({ chain, address, client, tokenAddress });
|
54
|
+
* console.log("balance", data?.displayValue, data?.symbol);
|
40
55
|
* ```
|
41
56
|
* @wallet
|
42
57
|
*/
|
@@ -9,6 +9,7 @@ import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
|
|
9
9
|
* import { useActiveAccount } from "thirdweb/react";
|
10
10
|
*
|
11
11
|
* const activeAccount = useActiveAccount();
|
12
|
+
* console.log("address", activeAccount?.address);
|
12
13
|
* ```
|
13
14
|
* @walletConnection
|
14
15
|
*/
|
@@ -122,6 +122,14 @@ export function useConnectedWalletDetails(
|
|
122
122
|
|
123
123
|
/**
|
124
124
|
* Returns the wallet info for the provided wallet id.
|
125
|
+
*
|
126
|
+
* @example
|
127
|
+
* ```tsx
|
128
|
+
* import { useWalletInfo } from "thirdweb/react";
|
129
|
+
*
|
130
|
+
* const { data: walletInfo } = useWalletInfo("io.metamask");
|
131
|
+
* console.log("Walelt name", walletInfo?.name);
|
132
|
+
* ```
|
125
133
|
* @wallet
|
126
134
|
*/
|
127
135
|
export function useWalletInfo(id: WalletId | undefined) {
|
@@ -141,7 +149,17 @@ export function useWalletInfo(id: WalletId | undefined) {
|
|
141
149
|
}
|
142
150
|
|
143
151
|
/**
|
144
|
-
* Returns the wallet
|
152
|
+
* Returns the wallet icon for the provided wallet id.
|
153
|
+
*
|
154
|
+
* @example
|
155
|
+
* ```tsx
|
156
|
+
* import { useWalletImage } from "thirdweb/react";
|
157
|
+
*
|
158
|
+
* const { data: walletImage } = useWalletImage("io.metamask");
|
159
|
+
*
|
160
|
+
* return <img src={walletImage} alt="MetaMask logo" />;
|
161
|
+
* ```
|
162
|
+
*
|
145
163
|
* @wallet
|
146
164
|
*/
|
147
165
|
export function useWalletImage(id: WalletId | undefined) {
|
@@ -10,17 +10,87 @@ import { SetRootElementContext } from "../../../core/providers/RootElementContex
|
|
10
10
|
import { TransactionModal } from "../../ui/TransactionButton/TransactionModal.js";
|
11
11
|
|
12
12
|
/**
|
13
|
-
* A hook to send a transaction.
|
14
|
-
*
|
13
|
+
* A hook to send a transaction with from the user's connected wallet.
|
14
|
+
*
|
15
|
+
* You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/react/v5/extensions).
|
16
|
+
*
|
17
|
+
* @returns A UseMutationResult object to send a transaction.
|
15
18
|
* @param config Configuration for the `useSendTransaction` hook.
|
16
19
|
* Refer to [`SendTransactionConfig`](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details.
|
17
20
|
* @example
|
21
|
+
*
|
22
|
+
* ### Using a prepared contract call
|
23
|
+
*
|
18
24
|
* ```tsx
|
19
25
|
* import { useSendTransaction } from "thirdweb/react";
|
26
|
+
* import { getContract, prepareContractCall } from "thirdweb";
|
27
|
+
* import { sepolia } from "thirdweb/chains";
|
28
|
+
*
|
29
|
+
* const contract = getContract({
|
30
|
+
* address: "0x...",
|
31
|
+
* chain: sepolia,
|
32
|
+
* client,
|
33
|
+
* });
|
34
|
+
*
|
35
|
+
* const { mutate: sendTx, data: transactionResult } = useSendTransaction();
|
36
|
+
*
|
37
|
+
* const onClick = () => {
|
38
|
+
* const transaction = prepareContractCall({
|
39
|
+
* contract,
|
40
|
+
* method: "function transfer(address to, uint256 value)",
|
41
|
+
* params: [to, value],
|
42
|
+
* }),
|
43
|
+
* });
|
44
|
+
* sendTx(transaction);
|
45
|
+
* };
|
46
|
+
* ```
|
47
|
+
*
|
48
|
+
* ### Using a write extension
|
49
|
+
*
|
50
|
+
* ```tsx
|
51
|
+
* import { useSendTransaction } from "thirdweb/react";
|
52
|
+
* import { mintTo } from "thirdweb/extensions/erc721";
|
53
|
+
*
|
54
|
+
* const { mutate: sendTx, data: transactionResult } = useSendTransaction();
|
55
|
+
*
|
56
|
+
* const onClick = () => {
|
57
|
+
* const transaction = mintTo({
|
58
|
+
* contract,
|
59
|
+
* to: "0x...",
|
60
|
+
* nft: {
|
61
|
+
* name: "NFT Name",
|
62
|
+
* description: "NFT Description",
|
63
|
+
* image: "https://example.com/image.png",
|
64
|
+
* },
|
65
|
+
* });
|
66
|
+
* sendTx(transaction);
|
67
|
+
* };
|
68
|
+
* ```
|
69
|
+
*
|
70
|
+
* ### Sending a prepared transaction
|
71
|
+
*
|
72
|
+
* ```tsx
|
73
|
+
* import { useSendTransaction } from "thirdweb/react";
|
74
|
+
* import { getContract, prepareTransaction } from "thirdweb";
|
75
|
+
* import { sepolia } from "thirdweb/chains";
|
76
|
+
*
|
77
|
+
* const contract = getContract({
|
78
|
+
* address: "0x...",
|
79
|
+
* chain: sepolia,
|
80
|
+
* client,
|
81
|
+
* });
|
82
|
+
*
|
20
83
|
* const { mutate: sendTx, data: transactionResult } = useSendTransaction();
|
21
84
|
*
|
22
|
-
*
|
23
|
-
*
|
85
|
+
* const onClick = () => {
|
86
|
+
* const transaction = prepareTransaction({
|
87
|
+
* contract,
|
88
|
+
* to: "0x...",
|
89
|
+
* value: toWei("0.1"),
|
90
|
+
* }),
|
91
|
+
* });
|
92
|
+
* sendTx(transaction);
|
93
|
+
* };
|
24
94
|
* ```
|
25
95
|
*
|
26
96
|
* @transaction
|