thirdweb 5.69.0 → 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/pack/createNewPack.js +2 -1
- package/dist/cjs/extensions/pack/createNewPack.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/ConnectWallet/screens/Buy/BuyScreen.js +9 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +15 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.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/version.js.map +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/in-app/web/ecosystem.js +7 -17
- package/dist/cjs/wallets/in-app/web/ecosystem.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/in-app.js +2 -17
- 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/passkeys.js +17 -16
- package/dist/cjs/wallets/in-app/web/lib/auth/passkeys.js.map +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/pack/createNewPack.js +2 -1
- package/dist/esm/extensions/pack/createNewPack.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/ConnectWallet/screens/Buy/BuyScreen.js +9 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +15 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.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/version.js.map +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/in-app/web/ecosystem.js +7 -17
- package/dist/esm/wallets/in-app/web/ecosystem.js.map +1 -1
- package/dist/esm/wallets/in-app/web/in-app.js +2 -17
- 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/passkeys.js +18 -17
- package/dist/esm/wallets/in-app/web/lib/auth/passkeys.js.map +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/pack/createNewPack.d.ts +2 -2
- package/dist/types/extensions/pack/createNewPack.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/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.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/version.d.ts.map +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/in-app/web/ecosystem.d.ts +7 -17
- package/dist/types/wallets/in-app/web/ecosystem.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/in-app.d.ts +2 -17
- 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/dist/types/wallets/in-app/web/lib/auth/passkeys.d.ts.map +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 +2 -2
- 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/pack/createNewPack.ts +8 -3
- 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/ConnectWallet/screens/Buy/BuyScreen.tsx +23 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +43 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +2 -3
- 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/in-app/web/ecosystem.ts +7 -17
- package/src/wallets/in-app/web/in-app.ts +2 -17
- package/src/wallets/in-app/web/lib/auth/index.ts +1 -0
- package/src/wallets/in-app/web/lib/auth/passkeys.ts +24 -23
- 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,59 @@
|
|
1
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type { JSX } from "react";
|
3
|
+
import type { NFT } from "../../../../../utils/nft/parseNft.js";
|
4
|
+
export interface NFTDescriptionProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
5
|
+
loadingComponent?: JSX.Element;
|
6
|
+
fallbackComponent?: JSX.Element;
|
7
|
+
/**
|
8
|
+
* Optional `useQuery` params
|
9
|
+
*/
|
10
|
+
queryOptions?: Omit<UseQueryOptions<NFT>, "queryFn" | "queryKey">;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* This component fetches and displays an NFT's description. It inherits all the attributes of a <span>
|
14
|
+
* so you can style it just like how you would style a <span> element.
|
15
|
+
* @returns A <span> element containing the description of the NFT
|
16
|
+
*
|
17
|
+
* @example
|
18
|
+
* ### Basic usage
|
19
|
+
* ```tsx
|
20
|
+
* import { NFTProvider, NFTDescription } from "thirdweb/react";
|
21
|
+
*
|
22
|
+
* <NFTProvider>
|
23
|
+
* <NFTDescription />
|
24
|
+
* </NFTProvider>
|
25
|
+
* ```
|
26
|
+
*
|
27
|
+
* ### Show a loading sign while the description is being fetched
|
28
|
+
* ```tsx
|
29
|
+
* import { NFTProvider, NFTDescription } from "thirdweb/react";
|
30
|
+
*
|
31
|
+
* <NFTProvider>
|
32
|
+
* <NFTDescription loadingComponent={<YourLoadingSign />} />
|
33
|
+
* </NFTProvider>
|
34
|
+
* ```
|
35
|
+
*
|
36
|
+
* ### Show something in case the description failed to resolve
|
37
|
+
* ```tsx
|
38
|
+
* import { NFTProvider, NFTDescription } from "thirdweb/react";
|
39
|
+
*
|
40
|
+
* <NFTProvider>
|
41
|
+
* <NFTDescription fallbackComponent={<span>Failed to load description</span>} />
|
42
|
+
* </NFTProvider>
|
43
|
+
* ```
|
44
|
+
*
|
45
|
+
* ### Custom query options for useQuery (tanstack-query)
|
46
|
+
* ```tsx
|
47
|
+
* import { NFTProvider, NFTDescription } from "thirdweb/react";
|
48
|
+
*
|
49
|
+
* <NFTProvider>
|
50
|
+
* <NFTDescription queryOptions={{ retry: 3, enabled: false, }} />
|
51
|
+
* </NFTProvider>
|
52
|
+
* ```
|
53
|
+
*
|
54
|
+
* @component
|
55
|
+
* @nft
|
56
|
+
* @beta
|
57
|
+
*/
|
58
|
+
export declare function NFTDescription({ loadingComponent, fallbackComponent, queryOptions, ...restProps }: NFTDescriptionProps): import("react/jsx-runtime.js").JSX.Element | null;
|
59
|
+
//# sourceMappingURL=description.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"description.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/description.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAIhE,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,cAAc,CAAC,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,mBAAmB,qDAiBrB"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { type UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type { NFT } from "../../../../../utils/nft/parseNft.js";
|
3
|
+
import type { NFTProviderProps } from "./provider.js";
|
4
|
+
/**
|
5
|
+
* @internal Only used for the NFT prebuilt components
|
6
|
+
*/
|
7
|
+
export declare function useNftInfo(props: NFTProviderProps & {
|
8
|
+
queryOptions?: Omit<UseQueryOptions<NFT>, "queryFn" | "queryKey">;
|
9
|
+
}): import("@tanstack/react-query").UseQueryResult<NFT, Error>;
|
10
|
+
/**
|
11
|
+
* @internal
|
12
|
+
*/
|
13
|
+
export declare function getNFTInfo(options: NFTProviderProps): Promise<NFT>;
|
14
|
+
//# sourceMappingURL=hooks.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AAGvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,gBAAgB,GAAG;IACxB,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACnE,8DAaF;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CAsBxE"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type { JSX } from "react";
|
3
|
+
import type { NFT } from "../../../../../utils/nft/parseNft.js";
|
4
|
+
import type { MediaRendererProps } from "../../MediaRenderer/types.js";
|
5
|
+
/**
|
6
|
+
* @component
|
7
|
+
* The props for the <NFTMedia /> component
|
8
|
+
* It is similar to the [`MediaRendererProps`](https://portal.thirdweb.com/references/typescript/v5/MediaRendererProps)
|
9
|
+
* (excluding `src`, `poster` and `client`) that you can
|
10
|
+
* use to style the NFTMedia
|
11
|
+
*/
|
12
|
+
export type NFTMediaProps = Omit<MediaRendererProps, "src" | "poster" | "client"> & {
|
13
|
+
loadingComponent?: JSX.Element;
|
14
|
+
fallbackComponent?: JSX.Element;
|
15
|
+
/**
|
16
|
+
* Optional `useQuery` params
|
17
|
+
*/
|
18
|
+
queryOptions?: Omit<UseQueryOptions<NFT>, "queryFn" | "queryKey">;
|
19
|
+
};
|
20
|
+
/**
|
21
|
+
* This component fetches and displays an NFT's media. It uses thirdweb [`MediaRenderer`](https://portal.thirdweb.com/refernces/typescript/v5/MediaRenderer) under the hood
|
22
|
+
* so you can style it just like how you would style a MediaRenderer.
|
23
|
+
* @returns A MediaRenderer component
|
24
|
+
*
|
25
|
+
* @component
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* ### Basic usage
|
29
|
+
* ```tsx
|
30
|
+
* import { NFTProvider, NFTMedia } from "thirdweb/react";
|
31
|
+
*
|
32
|
+
* <NFTProvider>
|
33
|
+
* <NFTMedia />
|
34
|
+
* </NFTProvider>
|
35
|
+
* ```
|
36
|
+
*
|
37
|
+
* ### Show a loading sign while the media is being fetched
|
38
|
+
* ```tsx
|
39
|
+
* import { NFTProvider, NFTMedia } from "thirdweb/react";
|
40
|
+
*
|
41
|
+
* <NFTProvider>
|
42
|
+
* <NFTMedia loadingComponent={<YourLoadingSign />} />
|
43
|
+
* </NFTProvider>
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* ### Show something in case the media failed to resolve
|
47
|
+
* ```tsx
|
48
|
+
* import { NFTProvider, NFTMedia } from "thirdweb/react";
|
49
|
+
*
|
50
|
+
* <NFTProvider>
|
51
|
+
* <NFTMedia fallbackComponent={<span>Failed to load media</span>} />
|
52
|
+
* </NFTProvider>
|
53
|
+
* ```
|
54
|
+
*
|
55
|
+
* ### Custom query options for useQuery (tanstack-query)
|
56
|
+
* ```tsx
|
57
|
+
* import { NFTProvider, NFTMedia } from "thirdweb/react";
|
58
|
+
*
|
59
|
+
* <NFTProvider>
|
60
|
+
* <NFTMedia queryOptions={{ retry: 3, enabled: false, }} />
|
61
|
+
* </NFTProvider>
|
62
|
+
* ```
|
63
|
+
*
|
64
|
+
* ### Basic stylings
|
65
|
+
*
|
66
|
+
* You can style NFTMedia with the `style` and `className` props.
|
67
|
+
*
|
68
|
+
* ```tsx
|
69
|
+
* <NFTMedia style={{ borderRadius: "8px" }} className="mx-auto" />
|
70
|
+
* ```
|
71
|
+
* @nft
|
72
|
+
* @beta
|
73
|
+
*/
|
74
|
+
export declare function NFTMedia({ loadingComponent, fallbackComponent, queryOptions, ...mediaRendererProps }: NFTMediaProps): import("react/jsx-runtime.js").JSX.Element | null;
|
75
|
+
//# sourceMappingURL=media.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/media.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,kBAAkB,EAClB,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAC5B,GAAG;IACF,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACnE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,QAAQ,CAAC,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,kBAAkB,EACtB,EAAE,aAAa,qDAgCf"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import type { UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type { JSX } from "react";
|
3
|
+
import type { NFT } from "../../../../../utils/nft/parseNft.js";
|
4
|
+
export interface NFTNameProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
5
|
+
loadingComponent?: JSX.Element;
|
6
|
+
fallbackComponent?: JSX.Element;
|
7
|
+
/**
|
8
|
+
* Optional `useQuery` params
|
9
|
+
*/
|
10
|
+
queryOptions?: Omit<UseQueryOptions<NFT>, "queryFn" | "queryKey">;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* This component fetches and displays an NFT's name. It takes in a `className` and `style` props
|
14
|
+
* so you can style it just like how you would style a <span> element.
|
15
|
+
* @returns A <span> element containing the name of the NFT
|
16
|
+
*
|
17
|
+
* @component
|
18
|
+
* @example
|
19
|
+
* ### Basic usage
|
20
|
+
* ```tsx
|
21
|
+
* import { NFTProvider, NFTName } from "thirdweb/react";
|
22
|
+
*
|
23
|
+
* <NFTProvider>
|
24
|
+
* <NFTName />
|
25
|
+
* </NFTProvider>
|
26
|
+
* ```
|
27
|
+
*
|
28
|
+
* ### Show a loading sign while the name is being fetched
|
29
|
+
* ```tsx
|
30
|
+
* import { NFTProvider, NFTName } from "thirdweb/react";
|
31
|
+
*
|
32
|
+
* <NFTProvider>
|
33
|
+
* <NFTName loadingComponent={<YourLoadingSign />} />
|
34
|
+
* </NFTProvider>
|
35
|
+
* ```
|
36
|
+
*
|
37
|
+
* ### Show something in case the name failed to resolve
|
38
|
+
* ```tsx
|
39
|
+
* import { NFTProvider, NFTName } from "thirdweb/react";
|
40
|
+
*
|
41
|
+
* <NFTProvider>
|
42
|
+
* <NFTName fallbackComponent={<span>Failed to load name</span>} />
|
43
|
+
* </NFTProvider>
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* ### Custom query options for useQuery (tanstack-query)
|
47
|
+
* ```tsx
|
48
|
+
* import { NFTProvider, NFTName } from "thirdweb/react";
|
49
|
+
*
|
50
|
+
* <NFTProvider>
|
51
|
+
* <NFTName queryOptions={{ retry: 3, enabled: false, }} />
|
52
|
+
* </NFTProvider>
|
53
|
+
* ```
|
54
|
+
*
|
55
|
+
* @nft
|
56
|
+
* @beta
|
57
|
+
*/
|
58
|
+
export declare function NFTName({ loadingComponent, fallbackComponent, queryOptions, ...restProps }: NFTNameProps): import("react/jsx-runtime.js").JSX.Element | null;
|
59
|
+
//# sourceMappingURL=name.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/name.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AAIhE,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,OAAO,CAAC,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,YAAY,qDAiBd"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import type { ThirdwebContract } from "../../../../../contract/contract.js";
|
2
|
+
/**
|
3
|
+
* Props for the <NFT> component
|
4
|
+
* @component
|
5
|
+
*/
|
6
|
+
export type NFTProviderProps = {
|
7
|
+
/**
|
8
|
+
* The NFT contract address. Accepts both ERC721 and ERC1155 contracts
|
9
|
+
*/
|
10
|
+
contract: ThirdwebContract;
|
11
|
+
/**
|
12
|
+
* The tokenId whose info you want to display
|
13
|
+
*/
|
14
|
+
tokenId: bigint;
|
15
|
+
};
|
16
|
+
/**
|
17
|
+
* @internal
|
18
|
+
*/
|
19
|
+
export declare const NFTProviderContext: import("react").Context<NFTProviderProps | undefined>;
|
20
|
+
/**
|
21
|
+
* @internal
|
22
|
+
*/
|
23
|
+
export declare function useNFTContext(): NFTProviderProps;
|
24
|
+
/**
|
25
|
+
* A React context provider component that supplies NFT-related data to its child components.
|
26
|
+
*
|
27
|
+
* This component serves as a wrapper around the `NFTProviderContext.Provider` and passes
|
28
|
+
* the provided NFT data down to all of its child components through the context API.
|
29
|
+
*
|
30
|
+
*
|
31
|
+
* @param {React.PropsWithChildren<NFTProviderProps>} props - The props for the NFT provider
|
32
|
+
*
|
33
|
+
* @example
|
34
|
+
* ```tsx
|
35
|
+
* import { getContract } from "thirdweb";
|
36
|
+
* import { NFTProvider, NFTMedia, NFTDescription, NFTName } from "thirdweb/react";
|
37
|
+
*
|
38
|
+
* const contract = getContract({
|
39
|
+
* address: "0x...",
|
40
|
+
* chain: ethereum,
|
41
|
+
* client: yourThirdwebClient,
|
42
|
+
* });
|
43
|
+
*
|
44
|
+
* <NFTProvider contract={contract} tokenId={0n}>
|
45
|
+
* <NFTMedia />
|
46
|
+
* <NFTDescription />
|
47
|
+
* <NFTName />
|
48
|
+
* </NFTProvider>
|
49
|
+
* ```
|
50
|
+
* @component
|
51
|
+
* @nft
|
52
|
+
* @beta
|
53
|
+
*/
|
54
|
+
export declare function NFTProvider(props: React.PropsWithChildren<NFTProviderProps>): import("react/jsx-runtime.js").JSX.Element;
|
55
|
+
//# sourceMappingURL=provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/NFT/provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,uDAEnB,CAAC;AAEb;;GAEG;AACH,wBAAgB,aAAa,qBAQ5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,8CAM3E"}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import { type UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type { JSX } from "react";
|
3
|
+
export interface TokenIconProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> {
|
4
|
+
/**
|
5
|
+
* This prop can be a string or a (async) function that resolves to a string, representing the icon url of the token
|
6
|
+
* This is particularly useful if you already have a way to fetch the token icon.
|
7
|
+
*/
|
8
|
+
iconResolver?: string | (() => string) | (() => Promise<string>);
|
9
|
+
/**
|
10
|
+
* This component will be shown while the avatar of the icon is being fetched
|
11
|
+
* If not passed, the component will return `null`.
|
12
|
+
*
|
13
|
+
* You can pass a loading sign or spinner to this prop.
|
14
|
+
* @example
|
15
|
+
* ```tsx
|
16
|
+
* <TokenIcon loadingComponent={<Spinner />} />
|
17
|
+
* ```
|
18
|
+
*/
|
19
|
+
loadingComponent?: JSX.Element;
|
20
|
+
/**
|
21
|
+
* This component will be shown if the request for fetching the avatar is done
|
22
|
+
* but could not retreive any result.
|
23
|
+
* You can pass a dummy avatar/image to this prop.
|
24
|
+
*
|
25
|
+
* If not passed, the component will return `null`
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* ```tsx
|
29
|
+
* <TokenIcon fallbackComponent={<DummyImage />} />
|
30
|
+
* ```
|
31
|
+
*/
|
32
|
+
fallbackComponent?: JSX.Element;
|
33
|
+
/**
|
34
|
+
* Optional query options for `useQuery`
|
35
|
+
*/
|
36
|
+
queryOptions?: Omit<UseQueryOptions<string>, "queryFn" | "queryKey">;
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* This component tries to resolve the icon of a given token, then return an image.
|
40
|
+
* @returns an <img /> with the src of the token icon
|
41
|
+
*
|
42
|
+
* @example
|
43
|
+
* ### Basic usage
|
44
|
+
* ```tsx
|
45
|
+
* import { TokenProvider, TokenIcon } from "thirdweb/react";
|
46
|
+
*
|
47
|
+
* <TokenProvider address="0x-token-address" chain={chain} client={client}>
|
48
|
+
* <TokenIcon />
|
49
|
+
* </TokenProvider>
|
50
|
+
* ```
|
51
|
+
*
|
52
|
+
* Result: An <img /> component with the src of the icon
|
53
|
+
* ```html
|
54
|
+
* <img src="token-icon.png" />
|
55
|
+
* ```
|
56
|
+
*
|
57
|
+
* ### Override the icon with the `iconResolver` prop
|
58
|
+
* If you already have the icon url, you can skip the network requests and pass it directly to the TokenIcon
|
59
|
+
* ```tsx
|
60
|
+
* <TokenIcon iconResolver="/usdc.png" />
|
61
|
+
* ```
|
62
|
+
*
|
63
|
+
* You can also pass in your own custom (async) function that retrieves the icon url
|
64
|
+
* ```tsx
|
65
|
+
* const getIcon = async () => {
|
66
|
+
* const icon = getIconFromCoinMarketCap(tokenAddress, etc);
|
67
|
+
* return icon;
|
68
|
+
* };
|
69
|
+
*
|
70
|
+
* <TokenIcon iconResolver={getIcon} />
|
71
|
+
* ```
|
72
|
+
*
|
73
|
+
* ### Show a loading sign while the icon is being loaded
|
74
|
+
* ```tsx
|
75
|
+
* <TokenIcon loadingComponent={<Spinner />} />
|
76
|
+
* ```
|
77
|
+
*
|
78
|
+
* ### Fallback to a dummy image if the token icon fails to resolve
|
79
|
+
* ```tsx
|
80
|
+
* <TokenIcon fallbackComponent={<img src="blank-image.png" />} />
|
81
|
+
* ```
|
82
|
+
*
|
83
|
+
* ### Usage with queryOptions
|
84
|
+
* TokenIcon uses useQuery() from tanstack query internally.
|
85
|
+
* It allows you to pass a custom queryOptions of your choice for more control of the internal fetching logic
|
86
|
+
* ```tsx
|
87
|
+
* <TokenIcon queryOptions={{ enabled: someLogic, retry: 3, }} />
|
88
|
+
* ```
|
89
|
+
*
|
90
|
+
* @component
|
91
|
+
* @token
|
92
|
+
* @beta
|
93
|
+
*/
|
94
|
+
export declare function TokenIcon({ iconResolver, loadingComponent, fallbackComponent, queryOptions, ...restProps }: TokenIconProps): import("react/jsx-runtime.js").JSX.Element | null;
|
95
|
+
//# sourceMappingURL=icon.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Token/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjC,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IAC9D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,cAAc,qDAsDhB"}
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import { type UseQueryOptions } from "@tanstack/react-query";
|
2
|
+
import type React from "react";
|
3
|
+
import type { JSX } from "react";
|
4
|
+
/**
|
5
|
+
* Props for the TokenName component
|
6
|
+
* @component
|
7
|
+
* @token
|
8
|
+
*/
|
9
|
+
export interface TokenNameProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
10
|
+
/**
|
11
|
+
* This prop can be a string or a (async) function that resolves to a string, representing the name of the token
|
12
|
+
* This is particularly useful if you already have a way to fetch the token name.
|
13
|
+
*/
|
14
|
+
nameResolver?: string | (() => string) | (() => Promise<string>);
|
15
|
+
/**
|
16
|
+
* A function to format the name's display value
|
17
|
+
* Particularly useful to avoid overflowing-UI issues
|
18
|
+
*
|
19
|
+
* ```tsx
|
20
|
+
* <TokenName formatFn={(str: string) => doSomething()} />
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
formatFn?: (str: string) => string;
|
24
|
+
/**
|
25
|
+
* This component will be shown while the name of the token is being fetched
|
26
|
+
* If not passed, the component will return `null`.
|
27
|
+
*
|
28
|
+
* You can/should pass a loading sign or spinner to this prop.
|
29
|
+
* @example
|
30
|
+
* ```tsx
|
31
|
+
* <TokenName loadingComponent={<Spinner />} />
|
32
|
+
* ```
|
33
|
+
*/
|
34
|
+
loadingComponent?: JSX.Element;
|
35
|
+
/**
|
36
|
+
* This component will be shown if the name fails to be retreived
|
37
|
+
* If not passed, the component will return `null`.
|
38
|
+
*
|
39
|
+
* You can/should pass a descriptive text/component to this prop, indicating that the
|
40
|
+
* name was not fetched succesfully
|
41
|
+
* @example
|
42
|
+
* ```tsx
|
43
|
+
* <TokenName fallbackComponent={"Failed to load"}
|
44
|
+
* />
|
45
|
+
* ```
|
46
|
+
*/
|
47
|
+
fallbackComponent?: JSX.Element;
|
48
|
+
/**
|
49
|
+
* Optional `useQuery` params
|
50
|
+
*/
|
51
|
+
queryOptions?: Omit<UseQueryOptions<string>, "queryFn" | "queryKey">;
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* This component fetches then shows the name of a token. For ERC20 tokens, it calls the `name` function in the ERC20 contract.
|
55
|
+
* It inherits all the attributes of a HTML <span> component, hence you can style it just like how you would style a normal <span>
|
56
|
+
*
|
57
|
+
*
|
58
|
+
* @example
|
59
|
+
* ### Basic usage
|
60
|
+
* ```tsx
|
61
|
+
* import { TokenProvider, TokenName } from "thirdweb/react";
|
62
|
+
* import { ethereum } from "thirdweb/chains";
|
63
|
+
*
|
64
|
+
* <TokenProvider {...props}>
|
65
|
+
* <TokenName />
|
66
|
+
* </TokenProvider>
|
67
|
+
* ```
|
68
|
+
* Result:
|
69
|
+
* ```html
|
70
|
+
* <span>Ether</span>
|
71
|
+
* ```
|
72
|
+
*
|
73
|
+
* ### Custom name resolver
|
74
|
+
* By default TokenName will call the `name` method of the token contract.
|
75
|
+
* However if you have a different way to fetch the name, you can pass the function to the `nameResolver` prop.
|
76
|
+
* Note: nameResolver should either be a string or a function (async) that returns a string.
|
77
|
+
* ```tsx
|
78
|
+
* async function fetchNameMethod() {
|
79
|
+
* // your own fetching logic
|
80
|
+
* return "the token name";
|
81
|
+
* }
|
82
|
+
*
|
83
|
+
* <TokenName nameResolver={fetchNameMethod} />
|
84
|
+
* ```
|
85
|
+
*
|
86
|
+
* Alternatively you can also pass in a string directly:
|
87
|
+
* ```tsx
|
88
|
+
* <TokenName nameResolver="USD Coin Circle" />
|
89
|
+
* ```
|
90
|
+
*
|
91
|
+
*
|
92
|
+
* ### Format the name (capitalize, truncate, etc.)
|
93
|
+
* The TokenName component accepts a `formatFn` which takes in a string and outputs a string
|
94
|
+
* The function is used to modify the name of the token
|
95
|
+
*
|
96
|
+
* ```tsx
|
97
|
+
* const concatStr = (str: string):string => str + "Token"
|
98
|
+
*
|
99
|
+
* <TokenName formatFn={concatStr} />
|
100
|
+
* ```
|
101
|
+
*
|
102
|
+
* Result:
|
103
|
+
* ```html
|
104
|
+
* <span>Ether Token</span>
|
105
|
+
* ```
|
106
|
+
*
|
107
|
+
* ### Show a loading sign when the name is being fetched
|
108
|
+
* ```tsx
|
109
|
+
* import { TokenProvider, TokenName } from "thirdweb/react";
|
110
|
+
*
|
111
|
+
* <TokenProvider address="0x...">
|
112
|
+
* <TokenName loadingComponent={<Spinner />} />
|
113
|
+
* </TokenProvider>
|
114
|
+
* ```
|
115
|
+
*
|
116
|
+
* ### Fallback to something when the name fails to resolve
|
117
|
+
* ```tsx
|
118
|
+
* <TokenProvider address="0x...">
|
119
|
+
* <TokenName fallbackComponent={"Failed to load"} />
|
120
|
+
* </TokenProvider>
|
121
|
+
* ```
|
122
|
+
*
|
123
|
+
* ### Custom query options for useQuery
|
124
|
+
* This component uses `@tanstack-query`'s useQuery internally.
|
125
|
+
* You can use the `queryOptions` prop for more fine-grained control
|
126
|
+
* ```tsx
|
127
|
+
* <TokenName
|
128
|
+
* queryOptions={{
|
129
|
+
* enabled: isEnabled,
|
130
|
+
* retry: 4,
|
131
|
+
* }}
|
132
|
+
* />
|
133
|
+
* ```
|
134
|
+
*
|
135
|
+
* @component
|
136
|
+
* @token
|
137
|
+
* @beta
|
138
|
+
*/
|
139
|
+
export declare function TokenName({ nameResolver, formatFn, loadingComponent, fallbackComponent, queryOptions, ...restProps }: TokenNameProps): import("react/jsx-runtime.js").JSX.Element | null;
|
140
|
+
//# sourceMappingURL=name.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Token/name.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAY,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjC;;;;GAIG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC/B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFG;AACH,wBAAgB,SAAS,CAAC,EACxB,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,cAAc,qDA4ChB"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import type { Address } from "abitype";
|
2
|
+
import type React from "react";
|
3
|
+
import type { Chain } from "../../../../../chains/types.js";
|
4
|
+
import type { ThirdwebClient } from "../../../../../client/client.js";
|
5
|
+
/**
|
6
|
+
* Props for the <TokenProvider /> component
|
7
|
+
* @component
|
8
|
+
* @token
|
9
|
+
*/
|
10
|
+
export type TokenProviderProps = {
|
11
|
+
/**
|
12
|
+
* The token (ERC20) contract address
|
13
|
+
*/
|
14
|
+
address: Address;
|
15
|
+
/**
|
16
|
+
* thirdweb Client
|
17
|
+
*/
|
18
|
+
client: ThirdwebClient;
|
19
|
+
/**
|
20
|
+
* The chain (network) that the token is on
|
21
|
+
*/
|
22
|
+
chain: Chain;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* A React context provider component that supplies Token-related data to its child components.
|
26
|
+
*
|
27
|
+
* This component serves as a wrapper around the `TokenProviderContext.Provider` and passes
|
28
|
+
* the provided token data down to all of its child components through the context API.
|
29
|
+
*
|
30
|
+
* @example
|
31
|
+
* ### Basic usage
|
32
|
+
* ```tsx
|
33
|
+
* import { TokenProvider, TokenIcon, TokenName } from "thirdweb/react";
|
34
|
+
* import { ethereum } from "thirdweb/chains";
|
35
|
+
*
|
36
|
+
* <TokenProvider address="0x..." client={...} chain={ethereum}>
|
37
|
+
* <TokenIcon />
|
38
|
+
* <TokenName />
|
39
|
+
* </TokenProvider>
|
40
|
+
* ```
|
41
|
+
*
|
42
|
+
* ### This component also works with native token!
|
43
|
+
* ```tsx
|
44
|
+
* import { NATIVE_TOKEN_ADDRESS} from "thirdweb";
|
45
|
+
* import { ethereum } from "thirdweb/chains";
|
46
|
+
*
|
47
|
+
* <TokenProvider address={NATIVE_TOKEN_ADDRESS} chain={ethereum} client={client}>
|
48
|
+
* <TokenSymbol /> // "ETH"
|
49
|
+
* </TokenProvider>
|
50
|
+
* ```
|
51
|
+
*
|
52
|
+
* @component
|
53
|
+
* @token
|
54
|
+
* @beta
|
55
|
+
*/
|
56
|
+
export declare function TokenProvider(props: React.PropsWithChildren<TokenProviderProps>): import("react/jsx-runtime.js").JSX.Element;
|
57
|
+
/**
|
58
|
+
* @internal
|
59
|
+
*/
|
60
|
+
export declare function useTokenContext(): TokenProviderProps;
|
61
|
+
//# sourceMappingURL=provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/prebuilt/Token/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,8CAOnD;AAED;;GAEG;AACH,wBAAgB,eAAe,uBAQ9B"}
|