thirdweb 5.47.1 → 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/Details.js +1 -1
- 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/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/manager/index.js +0 -1
- package/dist/cjs/wallets/manager/index.js.map +1 -1
- package/dist/cjs/wallets/types.js +0 -1
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/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/Details.js +1 -1
- 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/version.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/manager/index.js +0 -1
- package/dist/esm/wallets/manager/index.js.map +1 -1
- package/dist/esm/wallets/types.js +0 -1
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/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/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/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -2
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/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/Details.tsx +1 -0
- 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
package/src/exports/utils.ts
CHANGED
@@ -176,3 +176,8 @@ export {
|
|
176
176
|
export type { NFTMetadata, NFTInput } from "../utils/nft/parseNft.js";
|
177
177
|
|
178
178
|
export { parseAbiParams } from "../utils/contract/parse-abi-params.js";
|
179
|
+
|
180
|
+
// ------------------------------------------------
|
181
|
+
// bigint
|
182
|
+
// ------------------------------------------------
|
183
|
+
export { max, min } from "../utils/bigint.js";
|
@@ -13,6 +13,7 @@ export type GetOwnedNFTsParams = GetOwnedTokenIdsParams;
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* Retrieves the owned NFTs for a given owner.
|
16
|
+
* This extension only works with ERC721 contracts that support the [`tokenOfOwnerByIndex`](https://portal.thirdweb.com/references/typescript/v5/erc721/tokenOfOwnerByIndex) method
|
16
17
|
* @param options - The options for retrieving the owned NFTs.
|
17
18
|
* @returns A promise that resolves to an array of NFTs owned by the specified owner.
|
18
19
|
* @extension ERC721
|
@@ -3,7 +3,7 @@ import { TEST_CLIENT } from "~test/test-clients.js";
|
|
3
3
|
import { isAddress } from "../../../utils/address.js";
|
4
4
|
import { resolveAddress } from "./resolveAddress.js";
|
5
5
|
|
6
|
-
describe("resolve lens address", () => {
|
6
|
+
describe.runIf(process.env.TW_SECRET_KEY)("resolve lens address", () => {
|
7
7
|
it("should resolve to correct address", async () => {
|
8
8
|
const address = await resolveAddress({
|
9
9
|
client: TEST_CLIENT,
|
@@ -8,6 +8,7 @@ import type { WaitForReceiptOptions } from "../../../../transaction/actions/wait
|
|
8
8
|
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
9
9
|
import { resolvePromisedValue } from "../../../../utils/promise/resolve-promised-value.js";
|
10
10
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
11
|
+
import { getWalletBalance } from "../../../../wallets/utils/getWalletBalance.js";
|
11
12
|
import type { LocaleId } from "../../../web/ui/types.js";
|
12
13
|
import type { Theme } from "../../design-system/index.js";
|
13
14
|
import type { SupportedTokens } from "../../utils/defaultTokens.js";
|
@@ -157,7 +158,18 @@ export function useSendTransactionCore(args: {
|
|
157
158
|
const nativeValue = _nativeValue || 0n;
|
158
159
|
const erc20Value = _erc20Value?.amountWei || 0n;
|
159
160
|
|
160
|
-
|
161
|
+
const balance = await getWalletBalance({
|
162
|
+
client: tx.client,
|
163
|
+
address: account.address,
|
164
|
+
chain: tx.chain,
|
165
|
+
tokenAddress: _erc20Value?.tokenAddress,
|
166
|
+
});
|
167
|
+
|
168
|
+
const shouldShowModal =
|
169
|
+
(erc20Value > 0n && balance.value < erc20Value) ||
|
170
|
+
(nativeValue > 0n && balance.value < nativeValue);
|
171
|
+
|
172
|
+
if (shouldShowModal) {
|
161
173
|
showPayModal({
|
162
174
|
tx,
|
163
175
|
sendTx,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
|
2
|
+
|
3
|
+
/**
|
4
|
+
* A hook to add a connected wallet without setting the active wallet.
|
5
|
+
* @returns A function that lets you add a connected wallet.
|
6
|
+
* @example
|
7
|
+
* ```jsx
|
8
|
+
* import { useAddConnectedWallet } from "thirdweb/react";
|
9
|
+
*
|
10
|
+
* const addConnectedWallet = useAddConnectedWallet();
|
11
|
+
*
|
12
|
+
* // later in your code
|
13
|
+
* await addConnectedWallet(wallet);
|
14
|
+
* ```
|
15
|
+
* @walletConnection
|
16
|
+
*/
|
17
|
+
export function useAddConnectedWallet() {
|
18
|
+
const manager = useConnectionManagerCtx("useAddConnectedWallet");
|
19
|
+
return manager.handleConnection;
|
20
|
+
}
|
@@ -11,7 +11,7 @@ import { ThemedSpinner } from "../components/spinner.js";
|
|
11
11
|
|
12
12
|
/**
|
13
13
|
* TransactionButton component is used to render a button that triggers a transaction.
|
14
|
-
*
|
14
|
+
* It shows a "Switch Network" button if the connected wallet is on a different chain than the transaction.
|
15
15
|
* @param props - The props for this component.
|
16
16
|
* Refer to [TransactionButtonProps](https://portal.thirdweb.com/references/typescript/v5/TransactionButtonProps) for details.
|
17
17
|
* @example
|
@@ -34,6 +34,7 @@ function AllWalletsUI(props: {
|
|
34
34
|
client: ThirdwebClient;
|
35
35
|
recommendedWallets: Wallet[] | undefined;
|
36
36
|
connectLocale: ConnectLocale;
|
37
|
+
disableSelectionDataReset?: boolean;
|
37
38
|
}) {
|
38
39
|
const { itemsToShow, lastItemRef } = useShowMore<HTMLLIElement>(10, 10);
|
39
40
|
const setSelectionData = useSetSelectionData();
|
@@ -143,7 +144,9 @@ function AllWalletsUI(props: {
|
|
143
144
|
selectWallet={() => {
|
144
145
|
const wallet = createWallet(walletInfo.id);
|
145
146
|
props.onSelect(wallet);
|
146
|
-
|
147
|
+
if (!props.disableSelectionDataReset) {
|
148
|
+
setSelectionData({});
|
149
|
+
}
|
147
150
|
}}
|
148
151
|
client={props.client}
|
149
152
|
recommendedWallets={props.recommendedWallets}
|
@@ -87,6 +87,7 @@ export type WalletSelectorProps = {
|
|
87
87
|
}
|
88
88
|
| undefined;
|
89
89
|
walletIdsToHide: WalletId[] | undefined;
|
90
|
+
disableSelectionDataReset?: boolean;
|
90
91
|
};
|
91
92
|
|
92
93
|
/**
|
@@ -278,6 +279,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
|
278
279
|
recommendedWallets={props.recommendedWallets}
|
279
280
|
chain={props.chain}
|
280
281
|
showAllWallets={props.showAllWallets}
|
282
|
+
diableSelectionDataReset={props.disableSelectionDataReset}
|
281
283
|
/>
|
282
284
|
);
|
283
285
|
|
@@ -305,6 +307,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
|
305
307
|
recommendedWallets={props.recommendedWallets}
|
306
308
|
chain={props.chain}
|
307
309
|
showAllWallets={props.showAllWallets}
|
310
|
+
diableSelectionDataReset={props.disableSelectionDataReset}
|
308
311
|
/>
|
309
312
|
);
|
310
313
|
|
@@ -348,6 +351,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
|
348
351
|
recommendedWallets={props.recommendedWallets}
|
349
352
|
chain={props.chain}
|
350
353
|
showAllWallets={props.showAllWallets}
|
354
|
+
diableSelectionDataReset={props.disableSelectionDataReset}
|
351
355
|
/>
|
352
356
|
{eoaWallets.length > 0 && (
|
353
357
|
<>
|
@@ -418,6 +422,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
|
418
422
|
recommendedWallets={props.recommendedWallets}
|
419
423
|
chain={props.chain}
|
420
424
|
showAllWallets={props.showAllWallets}
|
425
|
+
diableSelectionDataReset={props.disableSelectionDataReset}
|
421
426
|
/>
|
422
427
|
</Container>
|
423
428
|
|
@@ -456,6 +461,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
|
|
456
461
|
recommendedWallets={props.recommendedWallets}
|
457
462
|
chain={props.chain}
|
458
463
|
showAllWallets={props.showAllWallets}
|
464
|
+
diableSelectionDataReset={props.disableSelectionDataReset}
|
459
465
|
/>
|
460
466
|
);
|
461
467
|
|
@@ -578,6 +584,7 @@ const WalletSelection: React.FC<{
|
|
578
584
|
connectLocale: ConnectLocale;
|
579
585
|
client: ThirdwebClient;
|
580
586
|
chain: Chain | undefined;
|
587
|
+
diableSelectionDataReset?: boolean;
|
581
588
|
}> = (props) => {
|
582
589
|
const wallets = sortWallets(props.wallets, props.recommendedWallets);
|
583
590
|
const { screen } = useScreenContext();
|
@@ -615,7 +622,9 @@ const WalletSelection: React.FC<{
|
|
615
622
|
<WalletEntryButton
|
616
623
|
walletId={wallet.id}
|
617
624
|
selectWallet={() => {
|
618
|
-
|
625
|
+
if (!props.diableSelectionDataReset) {
|
626
|
+
setSelectionData({});
|
627
|
+
}
|
619
628
|
props.selectWallet(wallet);
|
620
629
|
}}
|
621
630
|
connectLocale={props.connectLocale}
|
@@ -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
|
+
}
|