thirdweb 5.47.1-nightly-574ff0295dcbb39f2ddd753c9e8a264498aae99e-20240819000344 → 5.48.0-nightly-cbd6fd87d0120c6013ef354fe8ff22293e4c08e2-20240820000346
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/exports/utils.js +7 -1
- package/dist/cjs/exports/utils.js.map +1 -1
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/transaction-button-utils.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +10 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAddConnectedWallet.js +23 -0
- package/dist/cjs/react/core/hooks/wallets/useAddConnectedWallet.js.map +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js +1 -0
- package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/cjs/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js +23 -37
- package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +8 -6
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +70 -0
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +9 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ErrorState.js +14 -0
- package/dist/cjs/react/web/wallets/shared/ErrorState.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/LoadingState.js +19 -0
- package/dist/cjs/react/web/wallets/shared/LoadingState.js.map +1 -0
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js +6 -20
- package/dist/cjs/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js +2 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/engine.js.map +1 -1
- package/dist/cjs/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/cjs/transaction/prepare-contract-call.js +1 -1
- package/dist/cjs/transaction/read-contract.js +21 -2
- package/dist/cjs/transaction/read-contract.js.map +1 -1
- package/dist/cjs/utils/bigint.js +2 -0
- package/dist/cjs/utils/bigint.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/manager/index.js +0 -1
- package/dist/cjs/wallets/manager/index.js.map +1 -1
- package/dist/cjs/wallets/types.js +0 -1
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/exports/utils.js +4 -0
- package/dist/esm/exports/utils.js.map +1 -1
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/transaction-button-utils.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +10 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAddConnectedWallet.js +20 -0
- package/dist/esm/react/core/hooks/wallets/useAddConnectedWallet.js.map +1 -0
- package/dist/esm/react/native/ui/connect/ConnectModal.js +1 -1
- package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
- package/dist/esm/react/native/ui/transaction/TransactionButton.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js +24 -38
- package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AllWalletsUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +8 -6
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkProfileScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/index.js +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +4 -0
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +67 -0
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +10 -2
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ErrorState.js +11 -0
- package/dist/esm/react/web/wallets/shared/ErrorState.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/LoadingState.js +16 -0
- package/dist/esm/react/web/wallets/shared/LoadingState.js.map +1 -0
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js +4 -18
- package/dist/esm/react/web/wallets/shared/PassKeyLogin.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js +2 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/biconomy.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/engine.js.map +1 -1
- package/dist/esm/transaction/actions/gasless/providers/openzeppelin.js.map +1 -1
- package/dist/esm/transaction/prepare-contract-call.js +1 -1
- package/dist/esm/transaction/read-contract.js +21 -2
- package/dist/esm/transaction/read-contract.js.map +1 -1
- package/dist/esm/utils/bigint.js +2 -0
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/manager/index.js +0 -1
- package/dist/esm/wallets/manager/index.js.map +1 -1
- package/dist/esm/wallets/types.js +0 -1
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/exports/transaction.d.ts +7 -0
- package/dist/types/exports/transaction.d.ts.map +1 -1
- package/dist/types/exports/utils.d.ts +1 -0
- package/dist/types/exports/utils.d.ts.map +1 -1
- package/dist/types/extensions/erc721/read/getOwnedNFTs.d.ts +1 -0
- package/dist/types/extensions/erc721/read/getOwnedNFTs.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/transaction-button-utils.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/transaction-button-utils.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts +16 -0
- package/dist/types/react/core/hooks/wallets/useAddConnectedWallet.d.ts.map +1 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts +3 -0
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.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/AllWalletsUI.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts +3 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +3 -0
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +24 -0
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts +5 -0
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts +7 -0
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts.map +1 -0
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/biconomy.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/biconomy.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/engine.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/engine.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/providers/openzeppelin.d.ts +3 -0
- package/dist/types/transaction/actions/gasless/providers/openzeppelin.d.ts.map +1 -1
- package/dist/types/transaction/actions/gasless/types.d.ts +12 -0
- package/dist/types/transaction/actions/gasless/types.d.ts.map +1 -1
- package/dist/types/transaction/prepare-contract-call.d.ts +1 -1
- package/dist/types/transaction/read-contract.d.ts +21 -2
- package/dist/types/transaction/read-contract.d.ts.map +1 -1
- package/dist/types/utils/bigint.d.ts +2 -0
- package/dist/types/utils/bigint.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -2
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/manager/index.d.ts.map +1 -1
- package/dist/types/wallets/types.d.ts +1 -1
- package/dist/types/wallets/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/exports/transaction.ts +8 -0
- package/src/exports/utils.ts +5 -0
- package/src/extensions/erc721/read/getOwnedNFTs.ts +1 -0
- package/src/extensions/lens/read/resolveAddress.test.ts +1 -1
- package/src/react/core/hooks/transaction/transaction-button-utils.ts +1 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +13 -1
- package/src/react/core/hooks/wallets/useAddConnectedWallet.ts +20 -0
- package/src/react/native/ui/connect/ConnectModal.tsx +1 -1
- package/src/react/native/ui/transaction/TransactionButton.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/Blobbie.tsx +33 -117
- package/src/react/web/ui/ConnectWallet/Details.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +4 -1
- package/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +10 -1
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +3 -3
- package/src/react/web/ui/ConnectWallet/screens/LinkProfileScreen.tsx +2 -0
- package/src/react/web/ui/TransactionButton/index.tsx +1 -1
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +18 -0
- package/src/react/web/wallets/in-app/WalletAuth.tsx +166 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +22 -0
- package/src/react/web/wallets/shared/ErrorState.tsx +29 -0
- package/src/react/web/wallets/shared/LoadingState.tsx +47 -0
- package/src/react/web/wallets/shared/PassKeyLogin.tsx +4 -67
- package/src/react/web/wallets/shared/locale/de.ts +1 -0
- package/src/react/web/wallets/shared/locale/en.ts +2 -1
- package/src/react/web/wallets/shared/locale/es.ts +1 -0
- package/src/react/web/wallets/shared/locale/fr.ts +1 -0
- package/src/react/web/wallets/shared/locale/ja.ts +1 -0
- package/src/react/web/wallets/shared/locale/kr.ts +1 -0
- package/src/react/web/wallets/shared/locale/tl.ts +1 -0
- package/src/react/web/wallets/shared/locale/types.ts +1 -0
- package/src/react/web/wallets/shared/locale/vi.ts +1 -0
- package/src/transaction/actions/gasless/providers/biconomy.ts +3 -0
- package/src/transaction/actions/gasless/providers/engine.ts +3 -0
- package/src/transaction/actions/gasless/providers/openzeppelin.ts +3 -0
- package/src/transaction/actions/gasless/types.ts +12 -0
- package/src/transaction/prepare-contract-call.ts +1 -1
- package/src/transaction/read-contract.ts +21 -2
- package/src/utils/bigint.ts +2 -0
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +4 -4
- package/src/wallets/manager/index.ts +0 -2
- package/src/wallets/types.ts +0 -1
@@ -12,7 +12,7 @@ const connectLocaleEn: ConnectLocale = {
|
|
12
12
|
installed: "Installed",
|
13
13
|
buy: "Buy",
|
14
14
|
continueAsGuest: "Continue as guest",
|
15
|
-
connectAWallet: "Connect a
|
15
|
+
connectAWallet: "Connect a Wallet",
|
16
16
|
newToWallets: "New to wallets?",
|
17
17
|
getStarted: "Get started",
|
18
18
|
guest: "Guest",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CheckIcon,
|
1
|
+
import { CheckIcon, MinusIcon, PlusIcon } from "@radix-ui/react-icons";
|
2
2
|
import { useState } from "react";
|
3
3
|
import type { Chain } from "../../../../../../chains/types.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../../../client/client.js";
|
@@ -187,11 +187,11 @@ function WalletManangerButton(props: {
|
|
187
187
|
disconnect(props.wallet);
|
188
188
|
}}
|
189
189
|
>
|
190
|
-
<
|
190
|
+
<MinusIcon
|
191
191
|
width={iconSize.md}
|
192
192
|
height={iconSize.md}
|
193
193
|
style={{
|
194
|
-
color: theme.colors.
|
194
|
+
color: theme.colors.secondaryText,
|
195
195
|
}}
|
196
196
|
/>
|
197
197
|
</IconButton>
|
@@ -23,6 +23,7 @@ export function LinkProfileScreen(props: {
|
|
23
23
|
onBack: () => void;
|
24
24
|
locale: ConnectLocale;
|
25
25
|
client: ThirdwebClient;
|
26
|
+
walletConnect: { projectId?: string } | undefined;
|
26
27
|
}) {
|
27
28
|
const activeWallet = useActiveWallet();
|
28
29
|
const chain = useActiveWalletChain();
|
@@ -36,6 +37,7 @@ export function LinkProfileScreen(props: {
|
|
36
37
|
return (
|
37
38
|
<Suspense fallback={<LoadingScreen />}>
|
38
39
|
<InAppWalletConnectUI
|
40
|
+
walletConnect={props.walletConnect}
|
39
41
|
wallet={activeWallet as Wallet<"inApp">}
|
40
42
|
done={() => {
|
41
43
|
queryClient.invalidateQueries({ queryKey: ["profiles"] });
|
@@ -11,7 +11,7 @@ import { Button } from "../components/buttons.js";
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* TransactionButton component is used to render a button that triggers a transaction.
|
14
|
-
*
|
14
|
+
* It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction.
|
15
15
|
* @param props - The props for this component.
|
16
16
|
* Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.
|
17
17
|
* @example
|
@@ -14,6 +14,7 @@ import { OTPLoginUI } from "../shared/OTPLoginUI.js";
|
|
14
14
|
import { PassKeyLogin } from "../shared/PassKeyLogin.js";
|
15
15
|
import { SocialLogin } from "../shared/SocialLogin.js";
|
16
16
|
import { InAppWalletFormUIScreen } from "./InAppWalletFormUI.js";
|
17
|
+
import { WalletAuth } from "./WalletAuth.js";
|
17
18
|
import { useInAppWalletLocale } from "./useInAppWalletLocale.js";
|
18
19
|
|
19
20
|
/**
|
@@ -36,6 +37,7 @@ function InAppWalletConnectUI(props: {
|
|
36
37
|
chain: Chain | undefined;
|
37
38
|
connectLocale: ConnectLocale;
|
38
39
|
isLinking?: boolean;
|
40
|
+
walletConnect: { projectId?: string } | undefined;
|
39
41
|
}) {
|
40
42
|
const data = useSelectionData();
|
41
43
|
const setSelectionData = useSetSelectionData();
|
@@ -99,6 +101,22 @@ function InAppWalletConnectUI(props: {
|
|
99
101
|
);
|
100
102
|
}
|
101
103
|
|
104
|
+
if (state?.walletLogin) {
|
105
|
+
return (
|
106
|
+
<WalletAuth
|
107
|
+
meta={props.meta}
|
108
|
+
inAppLocale={locale}
|
109
|
+
walletConnect={props.walletConnect}
|
110
|
+
wallet={props.wallet}
|
111
|
+
client={props.client}
|
112
|
+
size={props.size}
|
113
|
+
done={done}
|
114
|
+
onBack={goBackToMain || (() => setSelectionData({}))}
|
115
|
+
locale={props.connectLocale}
|
116
|
+
/>
|
117
|
+
);
|
118
|
+
}
|
119
|
+
|
102
120
|
if (state?.socialLogin) {
|
103
121
|
return (
|
104
122
|
<SocialLogin
|
@@ -0,0 +1,166 @@
|
|
1
|
+
import { Suspense, useRef, useState } from "react";
|
2
|
+
import { defineChain } from "../../../../chains/utils.js";
|
3
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
4
|
+
import { linkProfile } from "../../../../wallets/in-app/core/wallet/profiles.js";
|
5
|
+
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
6
|
+
import { iconSize } from "../../../core/design-system/index.js";
|
7
|
+
import { useAddConnectedWallet } from "../../../core/hooks/wallets/useAddConnectedWallet.js";
|
8
|
+
import AllWalletsUI from "../../ui/ConnectWallet/Modal/AllWalletsUI.js";
|
9
|
+
import { WalletSelector } from "../../ui/ConnectWallet/WalletSelector.js";
|
10
|
+
import type { ConnectLocale } from "../../ui/ConnectWallet/locale/types.js";
|
11
|
+
import { Spacer } from "../../ui/components/Spacer.js";
|
12
|
+
import { WalletImage } from "../../ui/components/WalletImage.js";
|
13
|
+
import { Container, ModalHeader } from "../../ui/components/basic.js";
|
14
|
+
import { getDefaultWallets } from "../defaultWallets.js";
|
15
|
+
import { ErrorState } from "../shared/ErrorState.js";
|
16
|
+
import { LoadingScreen } from "../shared/LoadingScreen.js";
|
17
|
+
import { LoadingState } from "../shared/LoadingState.js";
|
18
|
+
import type { InAppWalletLocale } from "../shared/locale/types.js";
|
19
|
+
|
20
|
+
export function WalletAuth(props: {
|
21
|
+
wallet: Wallet<"inApp">;
|
22
|
+
client: ThirdwebClient;
|
23
|
+
done: () => void;
|
24
|
+
size: "compact" | "wide";
|
25
|
+
locale: ConnectLocale;
|
26
|
+
inAppLocale: InAppWalletLocale;
|
27
|
+
onBack: () => void;
|
28
|
+
walletConnect: { projectId?: string } | undefined;
|
29
|
+
meta?: {
|
30
|
+
title?: string;
|
31
|
+
titleIconUrl?: string;
|
32
|
+
showThirdwebBranding?: boolean;
|
33
|
+
termsOfServiceUrl?: string;
|
34
|
+
privacyPolicyUrl?: string;
|
35
|
+
};
|
36
|
+
}) {
|
37
|
+
const { wallet, done } = props;
|
38
|
+
const addConnectedWallet = useAddConnectedWallet();
|
39
|
+
const walletToConnect = useRef<Wallet>();
|
40
|
+
const [status, setStatus] = useState<"loading" | "error" | "selecting">(
|
41
|
+
"selecting",
|
42
|
+
);
|
43
|
+
const [error, setError] = useState<string | undefined>();
|
44
|
+
const [showAll, setShowAll] = useState<boolean>(false);
|
45
|
+
|
46
|
+
const back = () => {
|
47
|
+
setStatus("selecting");
|
48
|
+
walletToConnect.current = undefined;
|
49
|
+
props.onBack();
|
50
|
+
};
|
51
|
+
|
52
|
+
async function login(walletToLink: Wallet) {
|
53
|
+
setStatus("loading");
|
54
|
+
walletToConnect.current = walletToLink;
|
55
|
+
try {
|
56
|
+
await linkProfile(wallet as Wallet<"inApp">, {
|
57
|
+
strategy: "wallet",
|
58
|
+
wallet: walletToLink,
|
59
|
+
chain: wallet.getChain() || defineChain(1),
|
60
|
+
}).catch((e) => {
|
61
|
+
setError(e.message);
|
62
|
+
throw e;
|
63
|
+
});
|
64
|
+
addConnectedWallet(walletToLink);
|
65
|
+
done();
|
66
|
+
} catch {
|
67
|
+
setStatus("error");
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
if (!walletToConnect.current) {
|
72
|
+
if (showAll) {
|
73
|
+
return (
|
74
|
+
<Suspense fallback={<LoadingScreen />}>
|
75
|
+
<AllWalletsUI
|
76
|
+
onBack={() => setShowAll(false)}
|
77
|
+
onSelect={async (newWallet) => {
|
78
|
+
login(newWallet);
|
79
|
+
setShowAll(false);
|
80
|
+
}}
|
81
|
+
client={props.client}
|
82
|
+
connectLocale={props.locale}
|
83
|
+
recommendedWallets={undefined}
|
84
|
+
specifiedWallets={[]}
|
85
|
+
size={props.size}
|
86
|
+
disableSelectionDataReset={true}
|
87
|
+
/>
|
88
|
+
</Suspense>
|
89
|
+
);
|
90
|
+
}
|
91
|
+
return (
|
92
|
+
<WalletSelector
|
93
|
+
title={props.locale.connectAWallet}
|
94
|
+
wallets={getDefaultWallets()}
|
95
|
+
selectWallet={async (newWallet) => {
|
96
|
+
login(newWallet);
|
97
|
+
}}
|
98
|
+
onShowAll={() => {
|
99
|
+
setShowAll(true);
|
100
|
+
}}
|
101
|
+
done={() => {}}
|
102
|
+
goBack={back}
|
103
|
+
setModalVisibility={() => {}}
|
104
|
+
client={props.client}
|
105
|
+
connectLocale={props.locale}
|
106
|
+
isEmbed={false}
|
107
|
+
recommendedWallets={undefined}
|
108
|
+
chain={wallet.getChain()}
|
109
|
+
showAllWallets={true}
|
110
|
+
chains={[]}
|
111
|
+
size={props.size}
|
112
|
+
meta={props.meta || {}}
|
113
|
+
walletConnect={props.walletConnect}
|
114
|
+
modalHeader={{ title: props.inAppLocale.linkWallet, onBack: back }}
|
115
|
+
walletIdsToHide={["inApp"]}
|
116
|
+
disableSelectionDataReset={true}
|
117
|
+
/>
|
118
|
+
);
|
119
|
+
}
|
120
|
+
|
121
|
+
return (
|
122
|
+
<Container animate="fadein" fullHeight flex="column">
|
123
|
+
<Container p="lg">
|
124
|
+
<ModalHeader title={props.inAppLocale.linkWallet} onBack={back} />
|
125
|
+
</Container>
|
126
|
+
|
127
|
+
<Container
|
128
|
+
px={props.size === "wide" ? "xxl" : "lg"}
|
129
|
+
expand
|
130
|
+
flex="column"
|
131
|
+
center="y"
|
132
|
+
>
|
133
|
+
<div>
|
134
|
+
{status === "error" ? (
|
135
|
+
<>
|
136
|
+
<ErrorState
|
137
|
+
onTryAgain={() => {
|
138
|
+
if (!walletToConnect.current) {
|
139
|
+
throw new Error("Failed to connect to unknown wallet");
|
140
|
+
}
|
141
|
+
login(walletToConnect.current);
|
142
|
+
}}
|
143
|
+
title={error || "Failed to Login"}
|
144
|
+
/>
|
145
|
+
<Spacer y="lg" />
|
146
|
+
</>
|
147
|
+
) : (
|
148
|
+
<>
|
149
|
+
<LoadingState
|
150
|
+
title="Sign in with your wallet"
|
151
|
+
subtitle="A pop-up prompt will appear to sign-in and verify your wallet"
|
152
|
+
icon={
|
153
|
+
<WalletImage
|
154
|
+
id={walletToConnect.current.id ?? ""}
|
155
|
+
size={iconSize.xl}
|
156
|
+
client={props.client}
|
157
|
+
/>
|
158
|
+
}
|
159
|
+
/>
|
160
|
+
</>
|
161
|
+
)}
|
162
|
+
</div>
|
163
|
+
</Container>
|
164
|
+
</Container>
|
165
|
+
);
|
166
|
+
}
|
@@ -26,6 +26,7 @@ import {
|
|
26
26
|
import { setLastAuthProvider } from "../../../core/utils/storage.js";
|
27
27
|
import {
|
28
28
|
emailIcon,
|
29
|
+
getWalletIcon,
|
29
30
|
passkeyIcon,
|
30
31
|
phoneIcon,
|
31
32
|
socialIcons,
|
@@ -52,6 +53,7 @@ export type ConnectWalletSelectUIState =
|
|
52
53
|
connectionPromise: Promise<Account | Profile[]>;
|
53
54
|
};
|
54
55
|
passkeyLogin?: boolean;
|
56
|
+
walletLogin?: boolean;
|
55
57
|
};
|
56
58
|
|
57
59
|
const defaultAuthOptions: AuthOption[] = [
|
@@ -242,6 +244,13 @@ export const ConnectWalletSocialOptions = (
|
|
242
244
|
props.select();
|
243
245
|
}
|
244
246
|
|
247
|
+
function handleWalletLogin() {
|
248
|
+
setData({
|
249
|
+
walletLogin: true,
|
250
|
+
});
|
251
|
+
props.select();
|
252
|
+
}
|
253
|
+
|
245
254
|
const showOnlyIcons = socialLogins.length > 2;
|
246
255
|
|
247
256
|
return (
|
@@ -390,6 +399,19 @@ export const ConnectWalletSocialOptions = (
|
|
390
399
|
/>
|
391
400
|
</>
|
392
401
|
)}
|
402
|
+
|
403
|
+
{props.isLinking && (
|
404
|
+
<>
|
405
|
+
<WalletTypeRowButton
|
406
|
+
client={props.client}
|
407
|
+
icon={getWalletIcon("")}
|
408
|
+
onClick={() => {
|
409
|
+
handleWalletLogin();
|
410
|
+
}}
|
411
|
+
title={locale.linkWallet}
|
412
|
+
/>
|
413
|
+
</>
|
414
|
+
)}
|
393
415
|
</Container>
|
394
416
|
);
|
395
417
|
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { iconSize } from "../../../../react/core/design-system/index.js";
|
2
|
+
import { AccentFailIcon } from "../../ui/ConnectWallet/icons/AccentFailIcon.js";
|
3
|
+
import { Spacer } from "../../ui/components/Spacer.js";
|
4
|
+
import { Container } from "../../ui/components/basic.js";
|
5
|
+
import { Button } from "../../ui/components/buttons.js";
|
6
|
+
import { Text } from "../../ui/components/text.js";
|
7
|
+
|
8
|
+
export function ErrorState(props: {
|
9
|
+
onTryAgain: () => void;
|
10
|
+
title: string;
|
11
|
+
}) {
|
12
|
+
return (
|
13
|
+
<Container animate="fadein">
|
14
|
+
<Spacer y="xxl" />
|
15
|
+
<Container flex="row" center="x">
|
16
|
+
<AccentFailIcon size={iconSize["3xl"]} />
|
17
|
+
</Container>
|
18
|
+
<Spacer y="lg" />
|
19
|
+
<Text center color="primaryText" size="md">
|
20
|
+
{props.title}
|
21
|
+
</Text>
|
22
|
+
<Spacer y="xl" />
|
23
|
+
<Spacer y="xxl" />
|
24
|
+
<Button variant="accent" fullWidth onClick={props.onTryAgain}>
|
25
|
+
Try Again
|
26
|
+
</Button>
|
27
|
+
</Container>
|
28
|
+
);
|
29
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { ReactNode } from "react";
|
2
|
+
import { Spacer } from "../../ui/components/Spacer.js";
|
3
|
+
import { Spinner } from "../../ui/components/Spinner.js";
|
4
|
+
import { Container } from "../../ui/components/basic.js";
|
5
|
+
import { Text } from "../../ui/components/text.js";
|
6
|
+
|
7
|
+
export function LoadingState(props: {
|
8
|
+
title: string;
|
9
|
+
subtitle: string;
|
10
|
+
icon: ReactNode;
|
11
|
+
}) {
|
12
|
+
return (
|
13
|
+
<Container animate="fadein">
|
14
|
+
<Spacer y="xxl" />
|
15
|
+
<Container
|
16
|
+
flex="row"
|
17
|
+
center="x"
|
18
|
+
style={{
|
19
|
+
position: "relative",
|
20
|
+
}}
|
21
|
+
>
|
22
|
+
<Spinner size="4xl" color="accentText" />
|
23
|
+
<Container
|
24
|
+
color="accentText"
|
25
|
+
style={{
|
26
|
+
position: "absolute",
|
27
|
+
top: "50%",
|
28
|
+
left: "50%",
|
29
|
+
transform: "translate(-50%, -50%)",
|
30
|
+
}}
|
31
|
+
>
|
32
|
+
{props.icon}
|
33
|
+
</Container>
|
34
|
+
</Container>
|
35
|
+
<Spacer y="xl" />
|
36
|
+
<Text center color="primaryText" size="lg">
|
37
|
+
{props.title}
|
38
|
+
</Text>
|
39
|
+
<Spacer y="md" />
|
40
|
+
<Text multiline center>
|
41
|
+
{props.subtitle}
|
42
|
+
</Text>
|
43
|
+
<Spacer y="xxl" />
|
44
|
+
<Spacer y="xxl" />
|
45
|
+
</Container>
|
46
|
+
);
|
47
|
+
}
|
@@ -7,15 +7,14 @@ import { isEcosystemWallet } from "../../../../wallets/ecosystem/is-ecosystem-wa
|
|
7
7
|
import { hasStoredPasskey } from "../../../../wallets/in-app/web/lib/auth/passkeys.js";
|
8
8
|
import { iconSize } from "../../../core/design-system/index.js";
|
9
9
|
import { setLastAuthProvider } from "../../../core/utils/storage.js";
|
10
|
-
import { AccentFailIcon } from "../../ui/ConnectWallet/icons/AccentFailIcon.js";
|
11
10
|
import { FingerPrintIcon } from "../../ui/ConnectWallet/icons/FingerPrintIcon.js";
|
12
11
|
import type { ConnectLocale } from "../../ui/ConnectWallet/locale/types.js";
|
13
12
|
import { Spacer } from "../../ui/components/Spacer.js";
|
14
|
-
import { Spinner } from "../../ui/components/Spinner.js";
|
15
13
|
import { Container, ModalHeader } from "../../ui/components/basic.js";
|
16
14
|
import { Button } from "../../ui/components/buttons.js";
|
17
|
-
import {
|
15
|
+
import { ErrorState } from "./ErrorState.js";
|
18
16
|
import { LoadingScreen } from "./LoadingScreen.js";
|
17
|
+
import { LoadingState } from "./LoadingState.js";
|
19
18
|
|
20
19
|
// is passkey stored?
|
21
20
|
// - login
|
@@ -179,6 +178,7 @@ function LoginScreen(props: {
|
|
179
178
|
<LoadingState
|
180
179
|
title="Requesting Passkey"
|
181
180
|
subtitle="A pop-up prompt will appear to sign-in and verify your passkey"
|
181
|
+
icon={<FingerPrintIcon size={iconSize.xxl} />}
|
182
182
|
/>
|
183
183
|
);
|
184
184
|
}
|
@@ -252,6 +252,7 @@ function SignupScreen(props: {
|
|
252
252
|
<LoadingState
|
253
253
|
title="Creating Passkey"
|
254
254
|
subtitle="A pop-up prompt will appear to sign-in and verify your passkey"
|
255
|
+
icon={<FingerPrintIcon size={iconSize.xxl} />}
|
255
256
|
/>
|
256
257
|
);
|
257
258
|
}
|
@@ -297,67 +298,3 @@ function SelectLoginMethod(props: {
|
|
297
298
|
</Container>
|
298
299
|
);
|
299
300
|
}
|
300
|
-
|
301
|
-
function ErrorState(props: {
|
302
|
-
onTryAgain: () => void;
|
303
|
-
title: string;
|
304
|
-
}) {
|
305
|
-
return (
|
306
|
-
<Container animate="fadein">
|
307
|
-
<Spacer y="xxl" />
|
308
|
-
<Container flex="row" center="x">
|
309
|
-
<AccentFailIcon size={iconSize["3xl"]} />
|
310
|
-
</Container>
|
311
|
-
<Spacer y="lg" />
|
312
|
-
<Text center color="primaryText" size="md">
|
313
|
-
{props.title}
|
314
|
-
</Text>
|
315
|
-
<Spacer y="xl" />
|
316
|
-
<Spacer y="xxl" />
|
317
|
-
<Button variant="accent" fullWidth onClick={props.onTryAgain}>
|
318
|
-
Try Again
|
319
|
-
</Button>
|
320
|
-
</Container>
|
321
|
-
);
|
322
|
-
}
|
323
|
-
|
324
|
-
function LoadingState(props: {
|
325
|
-
title: string;
|
326
|
-
subtitle: string;
|
327
|
-
}) {
|
328
|
-
return (
|
329
|
-
<Container animate="fadein">
|
330
|
-
<Spacer y="xxl" />
|
331
|
-
<Container
|
332
|
-
flex="row"
|
333
|
-
center="x"
|
334
|
-
style={{
|
335
|
-
position: "relative",
|
336
|
-
}}
|
337
|
-
>
|
338
|
-
<Spinner size="4xl" color="accentText" />
|
339
|
-
<Container
|
340
|
-
color="accentText"
|
341
|
-
style={{
|
342
|
-
position: "absolute",
|
343
|
-
top: "50%",
|
344
|
-
left: "50%",
|
345
|
-
transform: "translate(-50%, -50%)",
|
346
|
-
}}
|
347
|
-
>
|
348
|
-
<FingerPrintIcon size={iconSize.xxl} />
|
349
|
-
</Container>
|
350
|
-
</Container>
|
351
|
-
<Spacer y="xl" />
|
352
|
-
<Text center color="primaryText" size="lg">
|
353
|
-
{props.title}
|
354
|
-
</Text>
|
355
|
-
<Spacer y="md" />
|
356
|
-
<Text multiline center>
|
357
|
-
{props.subtitle}
|
358
|
-
</Text>
|
359
|
-
<Spacer y="xxl" />
|
360
|
-
<Spacer y="xxl" />
|
361
|
-
</Container>
|
362
|
-
);
|
363
|
-
}
|
@@ -53,6 +53,7 @@ export default {
|
|
53
53
|
invalidPhone: "Invalid phone number",
|
54
54
|
phonePlaceholder: "Phone number",
|
55
55
|
signInWithPhone: "Sign in with phone number",
|
56
|
-
phoneRequired: "
|
56
|
+
phoneRequired: "Phone number is required",
|
57
57
|
passkey: "Passkey",
|
58
|
+
linkWallet: "Link a Wallet",
|
58
59
|
} satisfies InAppWalletLocale;
|
@@ -10,6 +10,9 @@ import type { PreparedTransaction } from "../../../prepare-transaction.js";
|
|
10
10
|
import { readContract } from "../../../read-contract.js";
|
11
11
|
import type { WaitForReceiptOptions } from "../../wait-for-tx-receipt.js";
|
12
12
|
|
13
|
+
/**
|
14
|
+
* @transaction
|
15
|
+
*/
|
13
16
|
export type BiconomyOptions = {
|
14
17
|
provider: "biconomy";
|
15
18
|
// you can find the correct forwarder for your network here: https://docs-gasless.biconomy.io/misc/contract-addresses
|
@@ -8,6 +8,9 @@ import type { PreparedTransaction } from "../../../prepare-transaction.js";
|
|
8
8
|
import { readContract } from "../../../read-contract.js";
|
9
9
|
import type { WaitForReceiptOptions } from "../../wait-for-tx-receipt.js";
|
10
10
|
|
11
|
+
/**
|
12
|
+
* @transaction
|
13
|
+
*/
|
11
14
|
export type OpenZeppelinOptions = {
|
12
15
|
provider: "openzeppelin";
|
13
16
|
relayerUrl: string;
|
@@ -2,6 +2,18 @@ import type { BiconomyOptions } from "./providers/biconomy.js";
|
|
2
2
|
import type { EngineOptions } from "./providers/engine.js";
|
3
3
|
import type { OpenZeppelinOptions } from "./providers/openzeppelin.js";
|
4
4
|
|
5
|
+
/**
|
6
|
+
* Gasless configs for sending gasless transactions.
|
7
|
+
* This config is used in:
|
8
|
+
* - [`TransactionButton`](https://portal.thirdweb.com/references/typescript/v5/TransactionButton)
|
9
|
+
* - [`sendTransaction`](https://portal.thirdweb.com/references/typescript/v5/sendTransaction)
|
10
|
+
* - [`useSendTransaction`](https://portal.thirdweb.com/references/typescript/v5/useSendTransaction)
|
11
|
+
* - [`sendAndConfirmTransaction`](https://portal.thirdweb.com/references/typescript/v5/sendAndConfirmTransaction)
|
12
|
+
* - [`useSendAndConfirmTransaction`](https://portal.thirdweb.com/references/typescript/v5/useSendAndConfirmTransaction)
|
13
|
+
*
|
14
|
+
* Please refer to the docs of those components above for more info.
|
15
|
+
* @transaction
|
16
|
+
*/
|
5
17
|
export type GaslessOptions =
|
6
18
|
| EngineOptions
|
7
19
|
| OpenZeppelinOptions
|
@@ -113,7 +113,7 @@ export type PrepareContractCallOptions<
|
|
113
113
|
* });
|
114
114
|
* ```
|
115
115
|
*
|
116
|
-
* ### Usage with
|
116
|
+
* ### Usage with the ABI defined on the contract:
|
117
117
|
*
|
118
118
|
* ```ts
|
119
119
|
* import { getContract, prepareContractCall } from "thirdweb";
|
@@ -70,7 +70,7 @@ export type ReadContractOptions<
|
|
70
70
|
>;
|
71
71
|
|
72
72
|
/**
|
73
|
-
* Reads state from a deployed smart contract.
|
73
|
+
* ### Reads state from a deployed smart contract.
|
74
74
|
*
|
75
75
|
* You can use raw read calls or read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) to read from a contract.
|
76
76
|
*
|
@@ -111,7 +111,26 @@ export type ReadContractOptions<
|
|
111
111
|
*
|
112
112
|
* const { data, isLoading } = useReadContract({
|
113
113
|
* contract,
|
114
|
-
* method: "function tokenURI(uint256 tokenId) returns (string)"})
|
114
|
+
* method: "function tokenURI(uint256 tokenId) returns (string)"}),
|
115
|
+
* params: [1n],
|
116
|
+
* });
|
117
|
+
* ```
|
118
|
+
*
|
119
|
+
* ### Using `resolveMethod`
|
120
|
+
* ```ts
|
121
|
+
* import { getContract, resolveMethod } from "thirdweb";
|
122
|
+
* import { sepolia } from "thirdweb/chains";
|
123
|
+
* import { useReadContract } from "thirdweb/react";
|
124
|
+
*
|
125
|
+
* const contract = getContract({
|
126
|
+
* client,
|
127
|
+
* address: "0x...",
|
128
|
+
* chain: sepolia,
|
129
|
+
* });
|
130
|
+
*
|
131
|
+
* const { data, isLoading } = useReadContract({
|
132
|
+
* contract,
|
133
|
+
* method: resolveMethod("tokenURI"),
|
115
134
|
* params: [1n],
|
116
135
|
* });
|
117
136
|
* ```
|