thirdweb 5.69.1-nightly-f368793375d099eec53569330af7a083e558e483-20241120000334 → 5.70.0-nightly-ecaa304a812188da3c81888bb52ca6064093c139-20241121000332
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/client/client.js +1 -0
- package/dist/cjs/client/client.js.map +1 -1
- package/dist/cjs/exports/react.js +32 -3
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +1 -1
- package/dist/cjs/extensions/modules/common/checkModulesCompatibility.js +5 -0
- package/dist/cjs/extensions/modules/common/checkModulesCompatibility.js.map +1 -1
- package/dist/cjs/extensions/prebuilts/deploy-pack.js +1 -0
- package/dist/cjs/extensions/prebuilts/deploy-pack.js.map +1 -1
- package/dist/cjs/extensions/thirdweb/write/publish.js +4 -0
- package/dist/cjs/extensions/thirdweb/write/publish.js.map +1 -1
- package/dist/cjs/react/core/hooks/others/useChainQuery.js +3 -3
- package/dist/cjs/react/core/hooks/rpc/useBlockNumber.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useCapabilities.js +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSendCalls.js +3 -3
- package/dist/cjs/react/core/providers/connection-manager.js +3 -0
- package/dist/cjs/react/core/providers/connection-manager.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +2 -1
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/core/utils/walletIcon.js +2 -0
- package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
- package/dist/cjs/react/native/hooks/wallets/useProfiles.js +1 -1
- package/dist/cjs/react/native/providers/thirdweb-provider.js +1 -0
- package/dist/cjs/react/native/providers/thirdweb-provider.js.map +1 -1
- package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js +1 -0
- package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
- 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 -0
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/cjs/react/web/hooks/wallets/useProfiles.js +1 -1
- package/dist/cjs/react/web/providers/thirdweb-provider.js +1 -0
- package/dist/cjs/react/web/providers/thirdweb-provider.js.map +1 -1
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js +1 -0
- package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js +19 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +21 -19
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +18 -13
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +1 -0
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/SiteEmbed.js +3 -2
- package/dist/cjs/react/web/ui/SiteEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/SiteLink.js +2 -1
- package/dist/cjs/react/web/ui/SiteLink.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/Account/address.js +49 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/address.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js +144 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/balance.js +122 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/balance.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js +16 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/name.js +106 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/name.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/provider.js +43 -0
- package/dist/cjs/react/web/ui/prebuilt/Account/provider.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/description.js +69 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/description.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/hooks.js +45 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/hooks.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/media.js +82 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/media.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/name.js +68 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/name.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/provider.js +55 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/provider.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/icon.js +113 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/icon.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/name.js +137 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/name.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/provider.js +54 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/provider.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/symbol.js +134 -0
- package/dist/cjs/react/web/ui/prebuilt/Token/symbol.js.map +1 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js +1 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +1 -0
- package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -1
- package/dist/cjs/storage/unpin.js +1 -1
- package/dist/cjs/storage/upload.js +1 -0
- package/dist/cjs/storage/upload.js.map +1 -1
- package/dist/cjs/transaction/actions/to-serializable-transaction.js +1 -1
- package/dist/cjs/transaction/actions/zksync/send-eip712-transaction.js +5 -0
- package/dist/cjs/transaction/actions/zksync/send-eip712-transaction.js.map +1 -1
- package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js +5 -0
- package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
- package/dist/cjs/utils/config.js +9 -0
- package/dist/cjs/utils/config.js.map +1 -1
- package/dist/cjs/utils/json.js +7 -4
- package/dist/cjs/utils/json.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/eip5792/get-calls-status.js +1 -1
- package/dist/cjs/wallets/eip5792/get-capabilities.js +1 -1
- package/dist/cjs/wallets/eip5792/send-calls.js +2 -2
- package/dist/cjs/wallets/eip5792/wait-for-bundle.js +1 -1
- package/dist/cjs/wallets/in-app/core/users/getUser.js +1 -1
- package/dist/cjs/wallets/smart/smart-wallet.js +1 -0
- package/dist/cjs/wallets/smart/smart-wallet.js.map +1 -1
- package/dist/esm/client/client.js +1 -0
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/exports/react.js +17 -1
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +1 -1
- package/dist/esm/extensions/modules/common/checkModulesCompatibility.js +5 -0
- package/dist/esm/extensions/modules/common/checkModulesCompatibility.js.map +1 -1
- package/dist/esm/extensions/prebuilts/deploy-pack.js +1 -0
- package/dist/esm/extensions/prebuilts/deploy-pack.js.map +1 -1
- package/dist/esm/extensions/thirdweb/write/publish.js +4 -0
- package/dist/esm/extensions/thirdweb/write/publish.js.map +1 -1
- package/dist/esm/react/core/hooks/others/useChainQuery.js +3 -3
- package/dist/esm/react/core/hooks/rpc/useBlockNumber.js +1 -1
- package/dist/esm/react/core/hooks/wallets/useCapabilities.js +1 -1
- package/dist/esm/react/core/hooks/wallets/useSendCalls.js +3 -3
- package/dist/esm/react/core/providers/connection-manager.js +3 -0
- package/dist/esm/react/core/providers/connection-manager.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +2 -1
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/core/utils/walletIcon.js +2 -0
- package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
- package/dist/esm/react/native/hooks/wallets/useProfiles.js +1 -1
- package/dist/esm/react/native/providers/thirdweb-provider.js +1 -0
- package/dist/esm/react/native/providers/thirdweb-provider.js.map +1 -1
- package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js +1 -0
- package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js +1 -0
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js +1 -0
- package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -1
- package/dist/esm/react/web/hooks/wallets/useProfiles.js +1 -1
- package/dist/esm/react/web/providers/thirdweb-provider.js +1 -0
- package/dist/esm/react/web/providers/thirdweb-provider.js.map +1 -1
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js +1 -0
- package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js +19 -4
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +21 -19
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +19 -14
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +1 -0
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/SiteEmbed.js +3 -2
- package/dist/esm/react/web/ui/SiteEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/SiteLink.js +2 -1
- package/dist/esm/react/web/ui/SiteLink.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js +1 -0
- package/dist/esm/react/web/ui/TransactionButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/Account/address.js +46 -0
- package/dist/esm/react/web/ui/prebuilt/Account/address.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Account/avatar.js +141 -0
- package/dist/esm/react/web/ui/prebuilt/Account/avatar.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Account/balance.js +119 -0
- package/dist/esm/react/web/ui/prebuilt/Account/balance.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js +13 -0
- package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Account/name.js +103 -0
- package/dist/esm/react/web/ui/prebuilt/Account/name.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Account/provider.js +39 -0
- package/dist/esm/react/web/ui/prebuilt/Account/provider.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/description.js +66 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/description.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/hooks.js +41 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/hooks.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/media.js +79 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/media.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/name.js +65 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/name.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/provider.js +50 -0
- package/dist/esm/react/web/ui/prebuilt/NFT/provider.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Token/icon.js +110 -0
- package/dist/esm/react/web/ui/prebuilt/Token/icon.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Token/name.js +134 -0
- package/dist/esm/react/web/ui/prebuilt/Token/name.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Token/provider.js +50 -0
- package/dist/esm/react/web/ui/prebuilt/Token/provider.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/Token/symbol.js +131 -0
- package/dist/esm/react/web/ui/prebuilt/Token/symbol.js.map +1 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js +1 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
- package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +1 -0
- package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -1
- package/dist/esm/storage/unpin.js +1 -1
- package/dist/esm/storage/upload.js +1 -0
- package/dist/esm/storage/upload.js.map +1 -1
- package/dist/esm/transaction/actions/to-serializable-transaction.js +1 -1
- package/dist/esm/transaction/actions/zksync/send-eip712-transaction.js +5 -0
- package/dist/esm/transaction/actions/zksync/send-eip712-transaction.js.map +1 -1
- package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js +5 -0
- package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
- package/dist/esm/utils/config.js +9 -0
- package/dist/esm/utils/config.js.map +1 -1
- package/dist/esm/utils/json.js +6 -2
- package/dist/esm/utils/json.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/eip5792/get-calls-status.js +1 -1
- package/dist/esm/wallets/eip5792/get-capabilities.js +1 -1
- package/dist/esm/wallets/eip5792/send-calls.js +2 -2
- package/dist/esm/wallets/eip5792/wait-for-bundle.js +1 -1
- package/dist/esm/wallets/in-app/core/users/getUser.js +1 -1
- package/dist/esm/wallets/smart/smart-wallet.js +1 -0
- package/dist/esm/wallets/smart/smart-wallet.js.map +1 -1
- package/dist/types/client/client.d.ts +1 -0
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +14 -1
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/extensions/erc721/lazyMinting/read/getBatchesToReveal.d.ts +1 -1
- package/dist/types/extensions/modules/common/checkModulesCompatibility.d.ts +5 -0
- package/dist/types/extensions/modules/common/checkModulesCompatibility.d.ts.map +1 -1
- package/dist/types/extensions/prebuilts/deploy-pack.d.ts +1 -0
- package/dist/types/extensions/prebuilts/deploy-pack.d.ts.map +1 -1
- package/dist/types/extensions/thirdweb/write/publish.d.ts +4 -0
- package/dist/types/extensions/thirdweb/write/publish.d.ts.map +1 -1
- package/dist/types/react/core/hooks/others/useChainQuery.d.ts +3 -3
- package/dist/types/react/core/hooks/rpc/useBlockNumber.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useCapabilities.d.ts +1 -1
- package/dist/types/react/core/hooks/wallets/useSendCalls.d.ts +3 -3
- package/dist/types/react/core/providers/connection-manager.d.ts +3 -0
- package/dist/types/react/core/providers/connection-manager.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts +2 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/core/utils/walletIcon.d.ts +2 -0
- package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
- package/dist/types/react/native/hooks/wallets/useProfiles.d.ts +1 -1
- package/dist/types/react/native/providers/thirdweb-provider.d.ts +1 -0
- package/dist/types/react/native/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts +1 -0
- package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts +1 -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 -0
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -1
- package/dist/types/react/web/hooks/wallets/useProfiles.d.ts +1 -1
- package/dist/types/react/web/providers/thirdweb-provider.d.ts +1 -0
- package/dist/types/react/web/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts +1 -0
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +22 -5
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +2 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +2 -2
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/SiteEmbed.d.ts +3 -2
- package/dist/types/react/web/ui/SiteEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/SiteLink.d.ts +2 -1
- package/dist/types/react/web/ui/SiteLink.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -0
- package/dist/types/react/web/ui/TransactionButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/address.d.ts +52 -0
- package/dist/types/react/web/ui/prebuilt/Account/address.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts +142 -0
- package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts +137 -0
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts +8 -0
- package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Account/name.d.ts +119 -0
- package/dist/types/react/web/ui/prebuilt/Account/name.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Account/provider.d.ts +45 -0
- package/dist/types/react/web/ui/prebuilt/Account/provider.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts +59 -0
- package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/NFT/hooks.d.ts +14 -0
- package/dist/types/react/web/ui/prebuilt/NFT/hooks.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts +75 -0
- package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts +59 -0
- package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts +55 -0
- package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts +95 -0
- package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Token/name.d.ts +140 -0
- package/dist/types/react/web/ui/prebuilt/Token/name.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts +61 -0
- package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts +137 -0
- package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts.map +1 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts +1 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts +1 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts +1 -0
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts.map +1 -1
- package/dist/types/storage/unpin.d.ts +1 -1
- package/dist/types/storage/upload.d.ts +1 -0
- package/dist/types/storage/upload.d.ts.map +1 -1
- package/dist/types/transaction/actions/to-serializable-transaction.d.ts +1 -1
- package/dist/types/transaction/actions/zksync/send-eip712-transaction.d.ts +5 -0
- package/dist/types/transaction/actions/zksync/send-eip712-transaction.d.ts.map +1 -1
- package/dist/types/utils/any-evm/zksync/isZkSyncChain.d.ts +5 -0
- package/dist/types/utils/any-evm/zksync/isZkSyncChain.d.ts.map +1 -1
- package/dist/types/utils/config.d.ts +9 -0
- package/dist/types/utils/config.d.ts.map +1 -1
- package/dist/types/utils/json.d.ts +1 -1
- package/dist/types/utils/json.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/eip5792/get-calls-status.d.ts +1 -1
- package/dist/types/wallets/eip5792/get-capabilities.d.ts +1 -1
- package/dist/types/wallets/eip5792/send-calls.d.ts +2 -2
- package/dist/types/wallets/eip5792/wait-for-bundle.d.ts +1 -1
- package/dist/types/wallets/in-app/core/users/getUser.d.ts +1 -1
- package/dist/types/wallets/smart/smart-wallet.d.ts +1 -0
- package/dist/types/wallets/smart/smart-wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client/client.ts +1 -0
- package/src/exports/react.ts +56 -2
- package/src/extensions/erc721/lazyMinting/read/getBatchesToReveal.ts +1 -1
- package/src/extensions/modules/common/checkModulesCompatibility.ts +5 -0
- package/src/extensions/prebuilts/deploy-pack.ts +1 -0
- package/src/extensions/thirdweb/write/publish.ts +4 -0
- package/src/react/core/hooks/others/useChainQuery.ts +3 -3
- package/src/react/core/hooks/rpc/useBlockNumber.ts +1 -1
- package/src/react/core/hooks/wallets/useCapabilities.ts +1 -1
- package/src/react/core/hooks/wallets/useSendCalls.ts +3 -3
- package/src/react/core/providers/connection-manager.tsx +3 -0
- package/src/react/core/utils/wallet.ts +2 -1
- package/src/react/core/utils/walletIcon.ts +2 -0
- package/src/react/native/hooks/wallets/useProfiles.ts +1 -1
- package/src/react/native/providers/thirdweb-provider.tsx +1 -0
- package/src/react/native/ui/AutoConnect/AutoConnect.tsx +1 -0
- package/src/react/native/ui/connect/ConnectModal.tsx +1 -0
- package/src/react/native/ui/transaction/TransactionButton.tsx +1 -0
- package/src/react/web/hooks/wallets/useProfiles.ts +1 -1
- package/src/react/web/providers/thirdweb-provider.tsx +1 -0
- package/src/react/web/ui/AutoConnect/AutoConnect.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/Blobbie.tsx +31 -4
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +36 -32
- package/src/react/web/ui/ConnectWallet/Details.tsx +91 -58
- package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +1 -0
- package/src/react/web/ui/PayEmbed.tsx +2 -2
- package/src/react/web/ui/SiteEmbed.tsx +3 -2
- package/src/react/web/ui/SiteLink.tsx +2 -1
- package/src/react/web/ui/TransactionButton/index.tsx +1 -0
- package/src/react/web/ui/prebuilt/Account/address.test.tsx +28 -0
- package/src/react/web/ui/prebuilt/Account/address.tsx +64 -0
- package/src/react/web/ui/prebuilt/Account/avatar.test.tsx +48 -0
- package/src/react/web/ui/prebuilt/Account/avatar.tsx +221 -0
- package/src/react/web/ui/prebuilt/Account/balance.test.tsx +54 -0
- package/src/react/web/ui/prebuilt/Account/balance.tsx +202 -0
- package/src/react/web/ui/prebuilt/Account/blobbie.tsx +12 -0
- package/src/react/web/ui/prebuilt/Account/name.test.tsx +62 -0
- package/src/react/web/ui/prebuilt/Account/name.tsx +175 -0
- package/src/react/web/ui/prebuilt/Account/provider.test.tsx +38 -0
- package/src/react/web/ui/prebuilt/Account/provider.tsx +69 -0
- package/src/react/web/ui/prebuilt/NFT/NFT.test.tsx +17 -14
- package/src/react/web/ui/prebuilt/NFT/description.tsx +87 -0
- package/src/react/web/ui/prebuilt/NFT/hooks.tsx +53 -0
- package/src/react/web/ui/prebuilt/NFT/media.tsx +119 -0
- package/src/react/web/ui/prebuilt/NFT/name.tsx +85 -0
- package/src/react/web/ui/prebuilt/NFT/provider.tsx +75 -0
- package/src/react/web/ui/prebuilt/Token/icon.tsx +164 -0
- package/src/react/web/ui/prebuilt/Token/name.tsx +201 -0
- package/src/react/web/ui/prebuilt/Token/provider.tsx +86 -0
- package/src/react/web/ui/prebuilt/Token/symbol.tsx +201 -0
- package/src/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.tsx +1 -0
- package/src/react/web/ui/prebuilt/thirdweb/ClaimButton/index.tsx +1 -0
- package/src/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.tsx +1 -0
- package/src/storage/unpin.ts +1 -1
- package/src/storage/upload.ts +1 -0
- package/src/transaction/actions/to-serializable-transaction.ts +1 -1
- package/src/transaction/actions/zksync/send-eip712-transaction.ts +5 -0
- package/src/utils/any-evm/zksync/isZkSyncChain.ts +5 -0
- package/src/utils/config.ts +9 -0
- package/src/utils/json.ts +8 -2
- package/src/version.ts +1 -1
- package/src/wallets/eip5792/get-calls-status.ts +1 -1
- package/src/wallets/eip5792/get-capabilities.ts +1 -1
- package/src/wallets/eip5792/send-calls.ts +2 -2
- package/src/wallets/eip5792/wait-for-bundle.ts +1 -1
- package/src/wallets/in-app/core/users/getUser.ts +1 -1
- package/src/wallets/smart/smart-wallet.ts +1 -0
- package/dist/cjs/react/web/ui/prebuilt/NFT/NFT.js +0 -217
- package/dist/cjs/react/web/ui/prebuilt/NFT/NFT.js.map +0 -1
- package/dist/esm/react/web/ui/prebuilt/NFT/NFT.js +0 -212
- package/dist/esm/react/web/ui/prebuilt/NFT/NFT.js.map +0 -1
- package/dist/types/react/web/ui/prebuilt/NFT/NFT.d.ts +0 -76
- package/dist/types/react/web/ui/prebuilt/NFT/NFT.d.ts.map +0 -1
- package/src/extensions/prebuilts/deploy-published.test.ts +0 -132
- package/src/react/web/ui/prebuilt/NFT/NFT.tsx +0 -272
- package/src/wallets/smart/smart-wallet-integration-v07.test.ts +0 -270
- package/src/wallets/smart/smart-wallet-integration.test.ts +0 -375
@@ -0,0 +1,201 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { type UseQueryOptions, useQuery } from "@tanstack/react-query";
|
4
|
+
import type React from "react";
|
5
|
+
import type { JSX } from "react";
|
6
|
+
import { getChainMetadata } from "../../../../../chains/utils.js";
|
7
|
+
import { NATIVE_TOKEN_ADDRESS } from "../../../../../constants/addresses.js";
|
8
|
+
import { getContract } from "../../../../../contract/contract.js";
|
9
|
+
import { getContractMetadata } from "../../../../../extensions/common/read/getContractMetadata.js";
|
10
|
+
import { symbol } from "../../../../../extensions/common/read/symbol.js";
|
11
|
+
import { useTokenContext } from "./provider.js";
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Props for the TokenSymbol component
|
15
|
+
* @component
|
16
|
+
* @token
|
17
|
+
*/
|
18
|
+
export interface TokenSymbolProps
|
19
|
+
extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
20
|
+
/**
|
21
|
+
* This prop can be a string or a (async) function that resolves to a string, representing the symbol of the token
|
22
|
+
* This is particularly useful if you already have a way to fetch the token symbol.
|
23
|
+
*/
|
24
|
+
symbolResolver?: string | (() => string) | (() => Promise<string>);
|
25
|
+
/**
|
26
|
+
* A function to format the symbol's value
|
27
|
+
* Particularly useful to avoid overflowing-UI issues
|
28
|
+
*
|
29
|
+
* ```tsx
|
30
|
+
* <TokenSymbol formatFn={(str: string) => doSomething()} />
|
31
|
+
* ```
|
32
|
+
*/
|
33
|
+
formatFn?: (str: string) => string;
|
34
|
+
/**
|
35
|
+
* This component will be shown while the symbol of the token is being fetched
|
36
|
+
* If not passed, the component will return `null`.
|
37
|
+
*
|
38
|
+
* You can/should pass a loading sign or spinner to this prop.
|
39
|
+
* @example
|
40
|
+
* ```tsx
|
41
|
+
* <TokenSymbol loadingComponent={<Spinner />} />
|
42
|
+
* ```
|
43
|
+
*/
|
44
|
+
loadingComponent?: JSX.Element;
|
45
|
+
/**
|
46
|
+
* This component will be shown if the symbol fails to be retreived
|
47
|
+
* If not passed, the component will return `null`.
|
48
|
+
*
|
49
|
+
* You can/should pass a descriptive text/component to this prop, indicating that the
|
50
|
+
* symbol was not fetched succesfully
|
51
|
+
* @example
|
52
|
+
* ```tsx
|
53
|
+
* <TokenSymbol fallbackComponent={"Failed to load"}
|
54
|
+
* />
|
55
|
+
* ```
|
56
|
+
*/
|
57
|
+
fallbackComponent?: JSX.Element;
|
58
|
+
/**
|
59
|
+
* Optional `useQuery` params
|
60
|
+
*/
|
61
|
+
queryOptions?: Omit<UseQueryOptions<string>, "queryFn" | "queryKey">;
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* This component fetches then shows the symbol of a token. For ERC20 tokens, it calls the `symbol` function in the ERC20 contract.
|
66
|
+
* It inherits all the attributes of a HTML <span> component, hence you can style it just like how you would style a normal <span>
|
67
|
+
*
|
68
|
+
*
|
69
|
+
* @example
|
70
|
+
* ### Basic usage
|
71
|
+
* ```tsx
|
72
|
+
* import { TokenProvider, TokenSymbol } from "thirdweb/react";
|
73
|
+
* import { ethereum } from "thirdweb/chains";
|
74
|
+
*
|
75
|
+
* <TokenProvider {...props}>
|
76
|
+
* <TokenSymbol />
|
77
|
+
* </TokenProvider>
|
78
|
+
* ```
|
79
|
+
* Result:
|
80
|
+
* ```html
|
81
|
+
* <span>ETH</span>
|
82
|
+
* ```
|
83
|
+
*
|
84
|
+
* ### Custom symbol resolver
|
85
|
+
* By default, TokenSymbol calls the `symbol` function of your contract,
|
86
|
+
* however, if your token as an unconventional way to fetch the symbol, you can pass the custom logic to the `symbolResolver` prop.
|
87
|
+
* It can either be a string or a function (async) that returns or resolves to a string.
|
88
|
+
* ```tsx
|
89
|
+
* async function getSymbol() {
|
90
|
+
* // your own fetching logic
|
91
|
+
* return "the symbol";
|
92
|
+
* }
|
93
|
+
*
|
94
|
+
* <TokenSymbol symbolResolver={getSymbol} />
|
95
|
+
* ```
|
96
|
+
* Alternatively, you can pass in a string directly:
|
97
|
+
* ```tsx
|
98
|
+
* <TokenSymbol symbolResolver="USDC.e" />
|
99
|
+
* ```
|
100
|
+
*
|
101
|
+
* ### Format the symbol (capitalize, truncate, etc.)
|
102
|
+
* The TokenSymbol component accepts a `formatFn` which takes in a string and outputs a string
|
103
|
+
* The function is used to modify the symbol of the token
|
104
|
+
*
|
105
|
+
* ```tsx
|
106
|
+
* const concatStr = (str: string):string => str + "Token"
|
107
|
+
*
|
108
|
+
* <TokenSymbol formatFn={concatStr} />
|
109
|
+
* ```
|
110
|
+
*
|
111
|
+
* Result:
|
112
|
+
* ```html
|
113
|
+
* <span>Ether Token</span>
|
114
|
+
* ```
|
115
|
+
*
|
116
|
+
* ### Show a loading sign when the symbol is being fetched
|
117
|
+
* ```tsx
|
118
|
+
* import { TokenProvider, TokenSymbol } from "thirdweb/react";
|
119
|
+
*
|
120
|
+
* <TokenProvider address="0x...">
|
121
|
+
* <TokenSymbol loadingComponent={<Spinner />} />
|
122
|
+
* </TokenProvider>
|
123
|
+
* ```
|
124
|
+
*
|
125
|
+
* ### Fallback to something when the symbol fails to resolve
|
126
|
+
* ```tsx
|
127
|
+
* <TokenProvider address="0x...">
|
128
|
+
* <TokenSymbol fallbackComponent={"Failed to load"} />
|
129
|
+
* </TokenProvider>
|
130
|
+
* ```
|
131
|
+
*
|
132
|
+
* ### Custom query options for useQuery
|
133
|
+
* This component uses `@tanstack-query`'s useQuery internally.
|
134
|
+
* You can use the `queryOptions` prop for more fine-grained control
|
135
|
+
* ```tsx
|
136
|
+
* <TokenSymbol queryOptions={{
|
137
|
+
* enabled: isEnabled,
|
138
|
+
* retry: 4,
|
139
|
+
* }}
|
140
|
+
* />
|
141
|
+
* ```
|
142
|
+
*
|
143
|
+
* @component
|
144
|
+
* @token
|
145
|
+
* @beta
|
146
|
+
*/
|
147
|
+
export function TokenSymbol({
|
148
|
+
symbolResolver,
|
149
|
+
formatFn,
|
150
|
+
loadingComponent,
|
151
|
+
fallbackComponent,
|
152
|
+
queryOptions,
|
153
|
+
...restProps
|
154
|
+
}: TokenSymbolProps) {
|
155
|
+
const { address, client, chain } = useTokenContext();
|
156
|
+
const symbolQuery = useQuery({
|
157
|
+
queryKey: ["_internal_token_symbol_", chain.id, address] as const,
|
158
|
+
queryFn: async () => {
|
159
|
+
if (typeof symbolResolver === "string") {
|
160
|
+
return symbolResolver;
|
161
|
+
}
|
162
|
+
if (typeof symbolResolver === "function") {
|
163
|
+
return symbolResolver();
|
164
|
+
}
|
165
|
+
if (address.toLowerCase() === NATIVE_TOKEN_ADDRESS.toLowerCase()) {
|
166
|
+
// Don't wanna use `getChainSymbol` because it has some side effect (it catches error and defaults to "ETH")
|
167
|
+
return getChainMetadata(chain).then(
|
168
|
+
(data) => data.nativeCurrency.symbol,
|
169
|
+
);
|
170
|
+
}
|
171
|
+
|
172
|
+
// Try to fetch the symbol from both the `symbol` function and the contract metadata
|
173
|
+
// then prioritize the `symbol()`
|
174
|
+
const contract = getContract({ address, client, chain });
|
175
|
+
const [_symbol, contractMetadata] = await Promise.all([
|
176
|
+
symbol({ contract }),
|
177
|
+
getContractMetadata({ contract }),
|
178
|
+
]);
|
179
|
+
if (!_symbol && !contractMetadata.symbol) {
|
180
|
+
throw new Error(
|
181
|
+
"Failed to resolve symbol from both symbol() and contract metadata",
|
182
|
+
);
|
183
|
+
}
|
184
|
+
|
185
|
+
return _symbol || contractMetadata.symbol;
|
186
|
+
},
|
187
|
+
...queryOptions,
|
188
|
+
});
|
189
|
+
|
190
|
+
if (symbolQuery.isLoading) {
|
191
|
+
return loadingComponent || null;
|
192
|
+
}
|
193
|
+
|
194
|
+
if (!symbolQuery.data) {
|
195
|
+
return fallbackComponent || null;
|
196
|
+
}
|
197
|
+
|
198
|
+
const displayValue = formatFn ? formatFn(symbolQuery.data) : symbolQuery.data;
|
199
|
+
|
200
|
+
return <span {...restProps}>{displayValue}</span>;
|
201
|
+
}
|
@@ -79,6 +79,7 @@ export type BuyDirectListingButtonProps = Omit<
|
|
79
79
|
* For error handling & callbacks on transaction-sent and transaction-confirmed,
|
80
80
|
* please refer to the TransactionButton docs.
|
81
81
|
* @component
|
82
|
+
* @transaction
|
82
83
|
*/
|
83
84
|
export function BuyDirectListingButton(props: BuyDirectListingButtonProps) {
|
84
85
|
const {
|
@@ -106,6 +106,7 @@ import type {
|
|
106
106
|
*
|
107
107
|
* For error handling & callbacks on transaction-sent and transaction-confirmed,
|
108
108
|
* please refer to the TransactionButton docs.
|
109
|
+
* @transaction
|
109
110
|
*/
|
110
111
|
export function ClaimButton(props: ClaimButtonProps) {
|
111
112
|
const { children, contractAddress, client, chain, claimParams, payModal } =
|
@@ -55,6 +55,7 @@ export type CreateDirectListingButtonProps = Omit<
|
|
55
55
|
* For error handling & callbacks on transaction-sent and transaction-confirmed,
|
56
56
|
* please refer to the TransactionButton docs.
|
57
57
|
* @component
|
58
|
+
* @transaction
|
58
59
|
*/
|
59
60
|
export function CreateDirectListingButton(
|
60
61
|
props: CreateDirectListingButtonProps,
|
package/src/storage/unpin.ts
CHANGED
@@ -9,7 +9,7 @@ export type UnpinOptions = {
|
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Unpins a file from IPFS.
|
12
|
-
*
|
12
|
+
* For security purposes, this method requires a secret key to be set in the ThirdwebClient instance.
|
13
13
|
* @param options - The options for unpinning the file.
|
14
14
|
* @param options.client - The Thirdweb client instance.
|
15
15
|
* @param options.cid - The content identifier (CID) of the file to unpin.
|
package/src/storage/upload.ts
CHANGED
@@ -25,7 +25,7 @@ export type ToSerializableTransactionOptions = {
|
|
25
25
|
* @param options - The transaction and additional options for conversion
|
26
26
|
* @returns A serializable transaction for inspection or submission to an account.
|
27
27
|
*
|
28
|
-
*
|
28
|
+
* For easier transaction sending, {@see sendTransaction}
|
29
29
|
* @example
|
30
30
|
* ```ts
|
31
31
|
* import { prepareTransaction, toSerializableTransaction } from "thirdweb";
|
@@ -84,6 +84,11 @@ export async function signEip712Transaction(options: {
|
|
84
84
|
});
|
85
85
|
}
|
86
86
|
|
87
|
+
/**
|
88
|
+
* Populate a prepared transaction to be serialized as a EIP712 transaction
|
89
|
+
* @param options
|
90
|
+
* @internal
|
91
|
+
*/
|
87
92
|
export async function populateEip712Transaction(
|
88
93
|
options: SendEip712TransactionOptions,
|
89
94
|
): Promise<EIP721TransactionSerializable> {
|
@@ -1,5 +1,10 @@
|
|
1
1
|
import type { Chain } from "../../../chains/types.js";
|
2
2
|
|
3
|
+
/**
|
4
|
+
* Checks whether the given chain is part of the zksync stack
|
5
|
+
* @param chain
|
6
|
+
* @chain
|
7
|
+
*/
|
3
8
|
export async function isZkSyncChain(chain: Chain) {
|
4
9
|
if (chain.id === 1337 || chain.id === 31337) {
|
5
10
|
return false;
|
package/src/utils/config.ts
CHANGED
@@ -8,6 +8,9 @@ let transactionDecorator:
|
|
8
8
|
}) => Promise<{ account: Account; transaction: PreparedTransaction }>)
|
9
9
|
| null = null;
|
10
10
|
|
11
|
+
/**
|
12
|
+
* @internal
|
13
|
+
*/
|
11
14
|
export function setTransactionDecorator(
|
12
15
|
decoratorFunction: (args: {
|
13
16
|
account: Account;
|
@@ -17,10 +20,16 @@ export function setTransactionDecorator(
|
|
17
20
|
transactionDecorator = decoratorFunction;
|
18
21
|
}
|
19
22
|
|
23
|
+
/**
|
24
|
+
* @internal
|
25
|
+
*/
|
20
26
|
export function clearTransactionDecorator() {
|
21
27
|
transactionDecorator = null;
|
22
28
|
}
|
23
29
|
|
30
|
+
/**
|
31
|
+
* @internal
|
32
|
+
*/
|
24
33
|
export function getTransactionDecorator() {
|
25
34
|
return transactionDecorator;
|
26
35
|
}
|
package/src/utils/json.ts
CHANGED
@@ -14,7 +14,13 @@
|
|
14
14
|
* ```
|
15
15
|
* @utils
|
16
16
|
*/
|
17
|
-
export
|
17
|
+
export function stringify(
|
18
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON.stringify signature
|
19
|
+
value: any,
|
20
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON.stringify signature
|
21
|
+
replacer?: ((this: any, key: string, value: any) => any) | null,
|
22
|
+
space?: string | number,
|
23
|
+
) {
|
18
24
|
const res = JSON.stringify(
|
19
25
|
value,
|
20
26
|
(key, value_) => {
|
@@ -24,4 +30,4 @@ export const stringify: typeof JSON.stringify = (value, replacer, space) => {
|
|
24
30
|
space,
|
25
31
|
);
|
26
32
|
return res;
|
27
|
-
}
|
33
|
+
}
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.
|
1
|
+
export const version = "5.70.0-nightly-ecaa304a812188da3c81888bb52ca6064093c139-20241121000332";
|
@@ -16,7 +16,7 @@ export type GetCallsStatusOptions = {
|
|
16
16
|
/**
|
17
17
|
* Get the status of an [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle.
|
18
18
|
*
|
19
|
-
*
|
19
|
+
* This function is dependent on the wallet's support for EIP-5792 and could fail.
|
20
20
|
*
|
21
21
|
* @param {GetCallsStatusOptions} options
|
22
22
|
* @param {Wallet} options.wallet - The wallet that send the original calls.
|
@@ -19,7 +19,7 @@ export type GetCapabilitiesResult = Prettify<
|
|
19
19
|
/**
|
20
20
|
* Get the capabilities of a wallet based on the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) specification.
|
21
21
|
*
|
22
|
-
*
|
22
|
+
* This function is dependent on the wallet's support for EIP-5792, but will not throw.
|
23
23
|
* **The returned object contains a `message` field detailing any issues with the wallet's support for EIP-5792.**
|
24
24
|
*
|
25
25
|
* @param {GetCapabilitiesOptions} options
|
@@ -59,7 +59,7 @@ export type SendCallsResult = WalletSendCallsId;
|
|
59
59
|
* This function works with all Thirdweb wallets (in-app and smart) and certain injected wallets that already support EIP-5792.
|
60
60
|
* Transactions will be bundled and sponsored when those capabilities are supported, otherwise they will be sent as individual transactions.
|
61
61
|
*
|
62
|
-
*
|
62
|
+
* This function is dependent on the wallet's support for EIP-5792 and could fail.
|
63
63
|
*
|
64
64
|
* @param {SendCallsOptions} options
|
65
65
|
* @param {Wallet} options.wallet - The wallet to send the calls to.
|
@@ -109,7 +109,7 @@ export type SendCallsResult = WalletSendCallsId;
|
|
109
109
|
* }
|
110
110
|
* }
|
111
111
|
* });
|
112
|
-
*
|
112
|
+
* We recommend proxying any paymaster calls via an API route you setup and control.
|
113
113
|
* ```
|
114
114
|
* @extension EIP5792
|
115
115
|
*/
|
@@ -21,7 +21,7 @@ export type WaitForBundleOptions = Prettify<{
|
|
21
21
|
/**
|
22
22
|
* Waits for the [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) bundle to be confirmed.
|
23
23
|
*
|
24
|
-
*
|
24
|
+
* This function is dependent on the wallet's support for EIP-5792 and could fail.
|
25
25
|
*
|
26
26
|
* @param options - The options for waiting for the bundle.
|
27
27
|
* By default, the max wait time is 100 blocks.
|
@@ -16,7 +16,7 @@ export type GetUserResult = {
|
|
16
16
|
|
17
17
|
/**
|
18
18
|
* Gets user based on the provided query parameters.
|
19
|
-
*
|
19
|
+
* This function is only available on the server (a secret key is required in the client).
|
20
20
|
*
|
21
21
|
* @param options - The options for the get user function.
|
22
22
|
* @param options.client - The Thirdweb client with a secret key included.
|
@@ -1,217 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
"use client";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.NFTProviderContext = void 0;
|
5
|
-
exports.NFT = NFT;
|
6
|
-
exports.getNFTInfo = getNFTInfo;
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
8
|
-
const react_query_1 = require("@tanstack/react-query");
|
9
|
-
const react_1 = require("react");
|
10
|
-
const getNFT_js_1 = require("../../../../../extensions/erc721/read/getNFT.js");
|
11
|
-
const getNFT_js_2 = require("../../../../../extensions/erc1155/read/getNFT.js");
|
12
|
-
const MediaRenderer_js_1 = require("../../MediaRenderer/MediaRenderer.js");
|
13
|
-
/**
|
14
|
-
* @internal
|
15
|
-
*/
|
16
|
-
exports.NFTProviderContext = (0, react_1.createContext)(undefined);
|
17
|
-
/**
|
18
|
-
* A React context provider component that supplies NFT-related data to its child components.
|
19
|
-
*
|
20
|
-
* This component serves as a wrapper around the `NFTProviderContext.Provider` and passes
|
21
|
-
* the provided NFT data down to all of its child components through the context API.
|
22
|
-
*
|
23
|
-
*
|
24
|
-
* @component
|
25
|
-
* @param {React.PropsWithChildren<NFTProviderProps>} props - The props for the NFT provider
|
26
|
-
*
|
27
|
-
* @example
|
28
|
-
* ```tsx
|
29
|
-
* import { getContract } from "thirdweb";
|
30
|
-
* import { NFT } from "thirdweb/react";
|
31
|
-
*
|
32
|
-
* const contract = getContract({
|
33
|
-
* address: "0x...",
|
34
|
-
* chain: ethereum,
|
35
|
-
* client: yourThirdwebClient,
|
36
|
-
* });
|
37
|
-
*
|
38
|
-
* <NFT contract={contract} tokenId={0n}>
|
39
|
-
* <Suspense fallback={"Loading media..."}>
|
40
|
-
* <NFT.Media />
|
41
|
-
* <NFT.Description />
|
42
|
-
* </Suspense>
|
43
|
-
* </NFT>
|
44
|
-
* ```
|
45
|
-
*/
|
46
|
-
function NFT(props) {
|
47
|
-
return ((0, jsx_runtime_1.jsx)(exports.NFTProviderContext.Provider, { value: props, children: props.children }));
|
48
|
-
}
|
49
|
-
/**
|
50
|
-
* @internal
|
51
|
-
*/
|
52
|
-
function useNFTContext() {
|
53
|
-
const ctx = (0, react_1.useContext)(exports.NFTProviderContext);
|
54
|
-
if (!ctx) {
|
55
|
-
throw new Error("NFTProviderContext not found. Make sure you are using NFT.Media, NFT.Description, etc. inside a <NFT /> component");
|
56
|
-
}
|
57
|
-
return ctx;
|
58
|
-
}
|
59
|
-
/**
|
60
|
-
* This component fetches and displays an NFT's media. It uses thirdweb [`MediaRenderer`](https://portal.thirdweb.com/react/v5/components/MediaRenderer) under the hood
|
61
|
-
* so you can style it just like how you would style a MediaRenderer.
|
62
|
-
* @returns A MediaRenderer component
|
63
|
-
*
|
64
|
-
* Since this component has an internal loading state (for when the NFT media is being fetched),
|
65
|
-
* you must wrap it with React.Suspense to make it work.
|
66
|
-
*
|
67
|
-
* @component
|
68
|
-
* @example
|
69
|
-
* ### Basic usage
|
70
|
-
* ```tsx
|
71
|
-
* import { getContract } from "thirdweb";
|
72
|
-
* import { NFT } from "thirdweb/react";
|
73
|
-
*
|
74
|
-
* const nftContract = getContract({
|
75
|
-
* address: "0x...",
|
76
|
-
* chain: ethereum,
|
77
|
-
* client: yourThirdwebClient,
|
78
|
-
* });
|
79
|
-
*
|
80
|
-
* <NFT contract={nftContract} tokenId={0n}>
|
81
|
-
* This will show the media for tokenId #0 from the `nftContract` collection
|
82
|
-
* <Suspense fallback={"Loading media..."}>
|
83
|
-
* <NFT.Media />
|
84
|
-
* </Suspense>
|
85
|
-
* </NFT>
|
86
|
-
* ```
|
87
|
-
*
|
88
|
-
* ### Basic stylings
|
89
|
-
* You can style NFT.Media with the `style` and `className` props.
|
90
|
-
* ```tsx
|
91
|
-
* <NFT.Media style={{ borderRadius: "8px" }} className="mx-auto" />
|
92
|
-
* ```
|
93
|
-
*/
|
94
|
-
NFT.Media = (props) => {
|
95
|
-
const { contract, tokenId } = useNFTContext();
|
96
|
-
const nftQuery = (0, react_query_1.useSuspenseQuery)({
|
97
|
-
queryKey: [
|
98
|
-
"__nft_info_internal__",
|
99
|
-
contract.chain.id,
|
100
|
-
contract.address,
|
101
|
-
tokenId.toString(),
|
102
|
-
],
|
103
|
-
queryFn: () => getNFTInfo({ contract, tokenId }),
|
104
|
-
});
|
105
|
-
const animation_url = nftQuery.data?.metadata.animation_url;
|
106
|
-
const image = nftQuery.data?.metadata.image || nftQuery.data?.metadata.image_url;
|
107
|
-
return ((0, jsx_runtime_1.jsx)(MediaRenderer_js_1.MediaRenderer, { client: contract.client, src: animation_url || image, poster: image, ...props }));
|
108
|
-
};
|
109
|
-
/**
|
110
|
-
* This component fetches and displays an NFT's name. It takes in a `className` and `style` props
|
111
|
-
* so you can style it just like how you would style a <span> element.
|
112
|
-
* @returns A <span> element containing the name of the NFT
|
113
|
-
*
|
114
|
-
* Since this component has an internal loading state (for when the NFT media is being fetched),
|
115
|
-
* you must wrap it with React.Suspense to make it work.
|
116
|
-
*
|
117
|
-
* @component
|
118
|
-
* @example
|
119
|
-
* ### Basic usage
|
120
|
-
* ```tsx
|
121
|
-
* import { getContract } from "thirdweb";
|
122
|
-
* import { NFT } from "thirdweb/react";
|
123
|
-
*
|
124
|
-
* const nftContract = getContract({
|
125
|
-
* address: "0x...",
|
126
|
-
* chain: ethereum,
|
127
|
-
* client: yourThirdwebClient,
|
128
|
-
* });
|
129
|
-
*
|
130
|
-
* <NFT contract={nftContract} tokenId={0n}>
|
131
|
-
* This will show the name for tokenId #0 from the `nftContract` collection
|
132
|
-
* <Suspense fallback={"Loading nft name..."}>
|
133
|
-
* <NFT.Name className="mx-auto" style={{ color: "red" }} />
|
134
|
-
* </Suspense>
|
135
|
-
* </NFT>
|
136
|
-
* ```
|
137
|
-
*/
|
138
|
-
NFT.Name = (props) => {
|
139
|
-
const { contract, tokenId } = useNFTContext();
|
140
|
-
const nftQuery = (0, react_query_1.useSuspenseQuery)({
|
141
|
-
queryKey: [
|
142
|
-
"__nft_info_internal__",
|
143
|
-
contract.chain.id,
|
144
|
-
contract.address,
|
145
|
-
tokenId.toString(),
|
146
|
-
],
|
147
|
-
queryFn: () => getNFTInfo({ contract, tokenId }),
|
148
|
-
});
|
149
|
-
const name = nftQuery.data?.metadata.name || "";
|
150
|
-
return (0, jsx_runtime_1.jsx)("span", { ...props, children: name });
|
151
|
-
};
|
152
|
-
/**
|
153
|
-
* This component fetches and displays an NFT's description. It takes in a `className` and `style` props
|
154
|
-
* so you can style it just like how you would style a <span> element.
|
155
|
-
* @returns A <span> element containing the description of the NFT
|
156
|
-
*
|
157
|
-
* Since this component has an internal loading state (for when the NFT media is being fetched),
|
158
|
-
* you must wrap it with React.Suspense to make it work.
|
159
|
-
*
|
160
|
-
* @component
|
161
|
-
* @example
|
162
|
-
* ### Basic usage
|
163
|
-
* ```tsx
|
164
|
-
* import { getContract } from "thirdweb";
|
165
|
-
* import { NFT } from "thirdweb/react";
|
166
|
-
*
|
167
|
-
* const nftContract = getContract({
|
168
|
-
* address: "0x...",
|
169
|
-
* chain: ethereum,
|
170
|
-
* client: yourThirdwebClient,
|
171
|
-
* });
|
172
|
-
*
|
173
|
-
* <NFT contract={nftContract} tokenId={0n}>
|
174
|
-
* This will show the description for tokenId #0 from the `nftContract` collection
|
175
|
-
* <Suspense fallback={"Loading description..."}>
|
176
|
-
* <NFT.Description className="mx-auto" style={{ color: "red" }} />
|
177
|
-
* </Suspense>
|
178
|
-
* </NFT>
|
179
|
-
* ```
|
180
|
-
*/
|
181
|
-
NFT.Description = (props) => {
|
182
|
-
const { contract, tokenId } = useNFTContext();
|
183
|
-
const nftQuery = (0, react_query_1.useSuspenseQuery)({
|
184
|
-
queryKey: [
|
185
|
-
"__nft_info_internal__",
|
186
|
-
contract.chain.id,
|
187
|
-
contract.address,
|
188
|
-
tokenId.toString(),
|
189
|
-
],
|
190
|
-
queryFn: () => getNFTInfo({ contract, tokenId }),
|
191
|
-
});
|
192
|
-
const description = nftQuery.data?.metadata.description || "";
|
193
|
-
return (0, jsx_runtime_1.jsx)("span", { ...props, children: description });
|
194
|
-
};
|
195
|
-
/**
|
196
|
-
* @internal
|
197
|
-
*/
|
198
|
-
async function getNFTInfo(options) {
|
199
|
-
const nft = await Promise.allSettled([
|
200
|
-
(0, getNFT_js_1.getNFT)(options),
|
201
|
-
(0, getNFT_js_2.getNFT)(options),
|
202
|
-
]).then(([possibleNFT721, possibleNFT1155]) => {
|
203
|
-
// getNFT extension always return an NFT object
|
204
|
-
// so we need to check if the tokenURI exists
|
205
|
-
if (possibleNFT721.status === "fulfilled" &&
|
206
|
-
possibleNFT721.value.tokenURI) {
|
207
|
-
return possibleNFT721.value;
|
208
|
-
}
|
209
|
-
if (possibleNFT1155.status === "fulfilled" &&
|
210
|
-
possibleNFT1155.value.tokenURI) {
|
211
|
-
return possibleNFT1155.value;
|
212
|
-
}
|
213
|
-
throw new Error("Failed to load NFT metadata");
|
214
|
-
});
|
215
|
-
return nft;
|
216
|
-
}
|
217
|
-
//# sourceMappingURL=NFT.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"NFT.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/NFT.tsx"],"names":[],"mappings":"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"}
|