thirdweb 5.40.1-nightly-b128530355f0dc47d897bd2ef7c3823752ea9b6c-20240727000321 → 5.41.0
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/extensions/erc20.js +3 -1
- package/dist/cjs/exports/extensions/erc20.js.map +1 -1
- package/dist/cjs/extensions/erc20/write/getApprovalForTransaction.js +38 -0
- package/dist/cjs/extensions/erc20/write/getApprovalForTransaction.js.map +1 -1
- package/dist/cjs/react/core/utils/socialIcons.js +3 -1
- package/dist/cjs/react/core/utils/socialIcons.js.map +1 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js +2 -0
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js +3 -1
- package/dist/cjs/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/cjs/react/native/ui/icons/svgs.js +7 -1
- package/dist/cjs/react/native/ui/icons/svgs.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +5 -5
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +12 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +4 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewAssets.js +37 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewAssets.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewNFTs.js +21 -18
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewNFTs.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewTokens.js +12 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewTokens.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +3 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Tabs.js +5 -3
- package/dist/cjs/react/web/ui/components/Tabs.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +3 -0
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/oauthSignIn.js +2 -1
- package/dist/cjs/react/web/wallets/shared/oauthSignIn.js.map +1 -1
- package/dist/cjs/transaction/actions/send-and-confirm-transaction.js +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 +11 -5
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/type.js +1 -0
- package/dist/cjs/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js +5 -1
- package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +1 -0
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js +7 -17
- package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/cjs/wallets/types.js +1 -0
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/exports/extensions/erc20.js +1 -0
- package/dist/esm/exports/extensions/erc20.js.map +1 -1
- package/dist/esm/extensions/erc20/write/getApprovalForTransaction.js +38 -0
- package/dist/esm/extensions/erc20/write/getApprovalForTransaction.js.map +1 -1
- package/dist/esm/react/core/utils/socialIcons.js +2 -0
- package/dist/esm/react/core/utils/socialIcons.js.map +1 -1
- package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
- package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js +4 -2
- package/dist/esm/react/native/ui/connect/InAppWalletUI.js.map +1 -1
- package/dist/esm/react/native/ui/icons/svgs.js +6 -0
- package/dist/esm/react/native/ui/icons/svgs.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +5 -5
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +12 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +4 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewAssets.js +34 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewAssets.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewNFTs.js +21 -19
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewNFTs.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewTokens.js +12 -10
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewTokens.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +3 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/esm/react/web/ui/components/Tabs.js +5 -3
- package/dist/esm/react/web/ui/components/Tabs.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +4 -1
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -0
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/oauthSignIn.js +2 -1
- package/dist/esm/react/web/wallets/shared/oauthSignIn.js.map +1 -1
- package/dist/esm/transaction/actions/send-and-confirm-transaction.js +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 +11 -5
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/type.js +1 -0
- package/dist/esm/wallets/in-app/core/authentication/type.js.map +1 -1
- package/dist/esm/wallets/in-app/native/auth/native-auth.js +5 -1
- package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +1 -0
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/oauth.js +6 -15
- package/dist/esm/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/wallets/types.js +1 -0
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/exports/extensions/erc20.d.ts +1 -0
- package/dist/types/exports/extensions/erc20.d.ts.map +1 -1
- package/dist/types/extensions/erc20/write/getApprovalForTransaction.d.ts +44 -0
- package/dist/types/extensions/erc20/write/getApprovalForTransaction.d.ts.map +1 -1
- package/dist/types/react/core/utils/socialIcons.d.ts +2 -0
- package/dist/types/react/core/utils/socialIcons.d.ts.map +1 -1
- package/dist/types/react/core/utils/storage.d.ts +1 -1
- package/dist/types/react/core/utils/storage.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
- package/dist/types/react/native/ui/icons/svgs.d.ts +1 -0
- package/dist/types/react/native/ui/icons/svgs.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/TransactionsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/{ViewFunds.d.ts → ViewAssets.d.ts} +4 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts +5 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Tabs.d.ts +5 -1
- package/dist/types/react/web/ui/components/Tabs.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/oauthSignIn.d.ts.map +1 -1
- package/dist/types/transaction/actions/send-and-confirm-transaction.d.ts +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 +6 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/type.d.ts +2 -1
- package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts +0 -1
- package/dist/types/wallets/in-app/web/lib/auth/oauth.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.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/extensions/erc20.ts +5 -0
- package/src/extensions/erc20/write/getApprovalForTransaction.ts +44 -0
- package/src/react/core/utils/socialIcons.ts +3 -0
- package/src/react/native/ui/components/WalletImage.tsx +3 -0
- package/src/react/native/ui/connect/InAppWalletUI.tsx +8 -3
- package/src/react/native/ui/icons/svgs.ts +7 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +5 -4
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +20 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +25 -22
- package/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx +104 -0
- package/src/react/web/ui/ConnectWallet/screens/ViewNFTs.tsx +63 -52
- package/src/react/web/ui/ConnectWallet/screens/ViewTokens.tsx +38 -29
- package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +8 -2
- package/src/react/web/ui/ConnectWallet/screens/types.ts +1 -1
- package/src/react/web/ui/components/Tabs.tsx +11 -6
- package/src/react/web/ui/components/WalletImage.tsx +4 -0
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +1 -0
- package/src/react/web/wallets/shared/oauthSignIn.ts +2 -1
- package/src/transaction/actions/send-and-confirm-transaction.ts +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +22 -9
- package/src/wallets/in-app/core/authentication/type.ts +1 -0
- package/src/wallets/in-app/native/auth/native-auth.ts +5 -1
- package/src/wallets/in-app/native/native-connector.ts +1 -0
- package/src/wallets/in-app/web/lib/auth/oauth.ts +6 -24
- package/src/wallets/in-app/web/lib/web-connector.ts +1 -0
- package/src/wallets/types.ts +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js +0 -31
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js +0 -28
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewFunds.js.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewFunds.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/screens/ViewFunds.tsx +0 -76
@@ -7,10 +7,54 @@ import { allowance } from "../__generated__/IERC20/read/allowance.js";
|
|
7
7
|
import { approve } from "../__generated__/IERC20/write/approve.js";
|
8
8
|
|
9
9
|
export type GetApprovalForTransactionParams = {
|
10
|
+
/**
|
11
|
+
* The transaction that involves the ERC20 token
|
12
|
+
*/
|
10
13
|
transaction: PreparedTransaction;
|
14
|
+
/**
|
15
|
+
* The caller's account
|
16
|
+
*/
|
11
17
|
account: Account;
|
12
18
|
};
|
13
19
|
|
20
|
+
/**
|
21
|
+
* When dealing with transactions that involve ERC20 tokens (Airdropping ERC20, buy NFTs with ERC20, etc.)
|
22
|
+
* you often have to do a pre-check to see if the targeted contract has the sufficient allowance to "take" the ERC20 tokens from the caller's wallet.
|
23
|
+
*
|
24
|
+
* This extension is a handy method that checks for the allowance and requests to approve for more if current allowance is insufficient
|
25
|
+
*
|
26
|
+
* @param options GetApprovalForTransactionParams
|
27
|
+
* @returns a PreparedTransaction
|
28
|
+
*
|
29
|
+
* @example
|
30
|
+
* ```ts
|
31
|
+
* import { getApprovalForTransaction } from "thirdweb/extensions/erc20";
|
32
|
+
* import { sendAndConfirmTransaction } from "thirdweb";
|
33
|
+
*
|
34
|
+
* async function buyNFT() {
|
35
|
+
* const buyTransaction = ... // could be a marketplacev3's buyFromListing
|
36
|
+
*
|
37
|
+
* // Check if you need to approve spending for the involved ERC20 contract
|
38
|
+
* const approveTx = await getApprovalForTransaction({
|
39
|
+
* transaction: buyTransaction,
|
40
|
+
* account, // the connected account
|
41
|
+
* });
|
42
|
+
* if (approveTx) {
|
43
|
+
* await sendAndConfirmTransaction({
|
44
|
+
* transaction: approveTx,
|
45
|
+
* account,
|
46
|
+
* })
|
47
|
+
* }
|
48
|
+
* // Once approved, you can finally perform the buy transaction
|
49
|
+
* await sendAndConfirmTransaction({
|
50
|
+
* transaction: buyTransaction,
|
51
|
+
* account,
|
52
|
+
* });
|
53
|
+
* }
|
54
|
+
* ```
|
55
|
+
*
|
56
|
+
* @transactions
|
57
|
+
*/
|
14
58
|
export async function getApprovalForTransaction(
|
15
59
|
options: GetApprovalForTransactionParams,
|
16
60
|
): Promise<PreparedTransaction | null> {
|
@@ -19,6 +19,8 @@ export const twitchIconUri =
|
|
19
19
|
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgdmlld0JveD0iMCAwIDExMS43ODY2NyAxMjcuMzg2NjciCiAgIGhlaWdodD0iMTI3LjM4NjY3IgogICB3aWR0aD0iMTExLjc4NjY3IgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmczMzU1IgogICBzb2RpcG9kaTpkb2NuYW1lPSJUd2l0Y2hfbG9nby5zdmciCiAgIGlua3NjYXBlOnZlcnNpb249IjEuMS4xICgzYmY1YWUwZDI1LCAyMDIxLTA5LTIwKSIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaX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yNi42NjcgODA1LjUwNSA2MjYuNjY3IDgxNy43NzhWODQ0LjQ0NEg4NzUuNTU2VjgxNy43NzhDODc1LjU1NiA4MDUuNTA1IDg2NS42MDYgNzk1LjU1NiA4NTMuMzMzIDc5NS41NTZIODQ4Ljg4OVY3NjguODg5Qzg0OC44ODkgNzU2LjYxNiA4MzguOTQgNzQ2LjY2NyA4MjYuNjY3IDc0Ni42NjdWMzUxLjExMUg4NTEuMTExTDg4MCAyNTMuMzMzSDcwMi4yMjJWNzQ2LjY2N0g2NzUuNTU2WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==";
|
22
24
|
export const microsoftIconUri =
|
23
25
|
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNDggNDgiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGZpbGw9IiNmZjU3MjIiIGQ9Ik02IDZIMjJWMjJINnoiIHRyYW5zZm9ybT0icm90YXRlKC0xODAgMTQgMTQpIi8+PHBhdGggZmlsbD0iIzRjYWY1MCIgZD0iTTI2IDZINDJWMjJIMjZ6IiB0cmFuc2Zvcm09InJvdGF0ZSgtMTgwIDM0IDE0KSIvPjxwYXRoIGZpbGw9IiNmZmMxMDciIGQ9Ik0yNiAyNkg0MlY0MkgyNnoiIHRyYW5zZm9ybT0icm90YXRlKC0xODAgMzQgMzQpIi8+PHBhdGggZmlsbD0iIzAzYTlmNCIgZD0iTTYgMjZIMjJWNDJINnoiIHRyYW5zZm9ybT0icm90YXRlKC0xODAgMTQgMzQpIi8+PC9zdmc+";
|
24
26
|
|
@@ -48,4 +50,5 @@ export const socialIcons = {
|
|
48
50
|
apple: appleIconUri,
|
49
51
|
facebook: facebookIconUri,
|
50
52
|
discord: discordIconUri,
|
53
|
+
farcaster: farcasterIconUri,
|
51
54
|
};
|
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
DISCORD_ICON,
|
11
11
|
EMAIL_ICON,
|
12
12
|
FACEBOOK_ICON,
|
13
|
+
FARCASTER_ICON,
|
13
14
|
GOOGLE_ICON,
|
14
15
|
PHONE_ICON,
|
15
16
|
WALLET_ICON,
|
@@ -76,6 +77,8 @@ export function getAuthProviderImage(lastAuthProvider: string | null): string {
|
|
76
77
|
return FACEBOOK_ICON;
|
77
78
|
case "discord":
|
78
79
|
return DISCORD_ICON;
|
80
|
+
case "farcaster":
|
81
|
+
return FARCASTER_ICON;
|
79
82
|
default:
|
80
83
|
return WALLET_ICON;
|
81
84
|
}
|
@@ -13,6 +13,10 @@ import type {
|
|
13
13
|
} from "../../../../wallets/in-app/core/wallet/types.js";
|
14
14
|
import { preAuthenticate } from "../../../../wallets/in-app/native/auth/index.js";
|
15
15
|
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
|
16
|
+
import {
|
17
|
+
type SocialAuthOption,
|
18
|
+
socialAuthOptions,
|
19
|
+
} from "../../../../wallets/types.js";
|
16
20
|
import type { Theme } from "../../../core/design-system/index.js";
|
17
21
|
import { setLastAuthProvider } from "../../../core/utils/storage.js";
|
18
22
|
import { radius, spacing } from "../../design-system/index.js";
|
@@ -26,6 +30,7 @@ import {
|
|
26
30
|
DISCORD_ICON,
|
27
31
|
EMAIL_ICON,
|
28
32
|
FACEBOOK_ICON,
|
33
|
+
FARCASTER_ICON,
|
29
34
|
GOOGLE_ICON,
|
30
35
|
PHONE_ICON,
|
31
36
|
} from "../icons/svgs.js";
|
@@ -44,6 +49,7 @@ const socialIcons = {
|
|
44
49
|
facebook: FACEBOOK_ICON,
|
45
50
|
apple: APPLE_ICON,
|
46
51
|
discord: DISCORD_ICON,
|
52
|
+
farcaster: FARCASTER_ICON,
|
47
53
|
};
|
48
54
|
|
49
55
|
type InAppWalletFormUIProps = {
|
@@ -62,9 +68,8 @@ export function InAppWalletUI(props: InAppWalletFormUIProps) {
|
|
62
68
|
const { wallet, theme } = props;
|
63
69
|
const config = wallet.getConfig();
|
64
70
|
const authOptions = config?.auth?.options || defaultAuthOptions;
|
65
|
-
const socialLogins = authOptions.filter(
|
66
|
-
(x)
|
67
|
-
x === "google" || x === "apple" || x === "facebook" || x === "discord",
|
71
|
+
const socialLogins = authOptions.filter((x) =>
|
72
|
+
socialAuthOptions.includes(x as SocialAuthOption),
|
68
73
|
) as InAppWalletSocialAuth[];
|
69
74
|
|
70
75
|
const [inputMode, setInputMode] = useState<"email" | "phone">("email");
|
@@ -37,6 +37,13 @@ export const DISCORD_ICON = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink
|
|
37
37
|
</g>
|
38
38
|
</svg>`;
|
39
39
|
|
40
|
+
export const FARCASTER_ICON = `<svg width={width} height={height} viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
41
|
+
<rect width="1000" height="1000" rx="200" fill="#855DCD"/>
|
42
|
+
<path d="M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z" fill="white"/>
|
43
|
+
<path d="M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z" fill="white"/>
|
44
|
+
<path d="M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z" fill="white"/>
|
45
|
+
</svg>`;
|
46
|
+
|
40
47
|
export const EMAIL_ICON = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
41
48
|
<path d="M13.3335 2.6665H2.66683C1.93045 2.6665 1.3335 3.26346 1.3335 3.99984V11.9998C1.3335 12.7362 1.93045 13.3332 2.66683 13.3332H13.3335C14.0699 13.3332 14.6668 12.7362 14.6668 11.9998V3.99984C14.6668 3.26346 14.0699 2.6665 13.3335 2.6665Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
42
49
|
<path d="M14.6668 4.6665L8.68683 8.4665C8.48101 8.59545 8.24304 8.66384 8.00016 8.66384C7.75728 8.66384 7.51931 8.59545 7.3135 8.4665L1.3335 4.6665" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
@@ -88,7 +88,7 @@ import { ManageWalletScreen } from "./screens/ManageWalletScreen.js";
|
|
88
88
|
import { PrivateKey } from "./screens/PrivateKey.js";
|
89
89
|
import { ReceiveFunds } from "./screens/ReceiveFunds.js";
|
90
90
|
import { SendFunds } from "./screens/SendFunds.js";
|
91
|
-
import {
|
91
|
+
import { ViewAssets } from "./screens/ViewAssets.js";
|
92
92
|
import { ViewNFTs } from "./screens/ViewNFTs.js";
|
93
93
|
import { ViewTokens } from "./screens/ViewTokens.js";
|
94
94
|
import { WalletConnectReceiverScreen } from "./screens/WalletConnectReceiverScreen.js";
|
@@ -538,7 +538,7 @@ function DetailsModal(props: {
|
|
538
538
|
{/* View Funds */}
|
539
539
|
<MenuButton
|
540
540
|
onClick={() => {
|
541
|
-
setScreen("view-
|
541
|
+
setScreen("view-assets");
|
542
542
|
}}
|
543
543
|
style={{
|
544
544
|
fontSize: fontSize.sm,
|
@@ -694,15 +694,16 @@ function DetailsModal(props: {
|
|
694
694
|
client={client}
|
695
695
|
/>
|
696
696
|
);
|
697
|
-
} else if (screen === "view-
|
697
|
+
} else if (screen === "view-assets") {
|
698
698
|
if (props.supportedNFTs) {
|
699
699
|
content = (
|
700
|
-
<
|
700
|
+
<ViewAssets
|
701
701
|
supportedTokens={props.supportedTokens}
|
702
702
|
supportedNFTs={props.supportedNFTs}
|
703
703
|
onBack={() => {
|
704
704
|
setScreen("main");
|
705
705
|
}}
|
706
|
+
theme={props.theme}
|
706
707
|
setScreen={setScreen}
|
707
708
|
client={client}
|
708
709
|
connectLocale={locale}
|
@@ -13,6 +13,8 @@ import { Spacer } from "../components/Spacer.js";
|
|
13
13
|
import Tabs from "../components/Tabs.js";
|
14
14
|
import { Container, Line, ModalHeader } from "../components/basic.js";
|
15
15
|
import { ButtonLink } from "../components/buttons.js";
|
16
|
+
import { CoinsIcon } from "./icons/CoinsIcon.js";
|
17
|
+
import { FundsIcon } from "./icons/FundsIcon.js";
|
16
18
|
import type { ConnectLocale } from "./locale/types.js";
|
17
19
|
import { PayTxHistoryList } from "./screens/Buy/pay-transactions/BuyTxHistory.js";
|
18
20
|
import { TxDetailsScreen } from "./screens/Buy/pay-transactions/TxDetailsScreen.js";
|
@@ -82,7 +84,24 @@ export function TransactionsScreen(props: {
|
|
82
84
|
>
|
83
85
|
<Spacer y="md" />
|
84
86
|
<Tabs
|
85
|
-
options={[
|
87
|
+
options={[
|
88
|
+
{
|
89
|
+
label: (
|
90
|
+
<span className="flex gap-2">
|
91
|
+
<CoinsIcon size={iconSize.sm} /> Transactions
|
92
|
+
</span>
|
93
|
+
),
|
94
|
+
value: "Transactions",
|
95
|
+
},
|
96
|
+
{
|
97
|
+
label: (
|
98
|
+
<span className="flex gap-2">
|
99
|
+
<FundsIcon size={iconSize.sm} /> Purchases
|
100
|
+
</span>
|
101
|
+
),
|
102
|
+
value: "Purchases",
|
103
|
+
},
|
104
|
+
]}
|
86
105
|
selected={activeTab}
|
87
106
|
onSelect={setActiveTab}
|
88
107
|
>
|
@@ -128,6 +128,7 @@ export function PayTxHistoryList(props: {
|
|
128
128
|
width: "100%",
|
129
129
|
minHeight: "250px",
|
130
130
|
maxHeight: "370px",
|
131
|
+
paddingBottom: spacing.lg,
|
131
132
|
}}
|
132
133
|
>
|
133
134
|
<Container flex="column" gap="xs" expand>
|
@@ -158,24 +159,26 @@ export function PayTxHistoryList(props: {
|
|
158
159
|
</Container>
|
159
160
|
)}
|
160
161
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
162
|
+
{txInfosToShow.length > 0 && (
|
163
|
+
<Container animate="fadein" flex="column" gap="xs">
|
164
|
+
{txInfosToShow.map((txInfo) => {
|
165
|
+
return (
|
166
|
+
<BuyTxHistoryButton
|
167
|
+
key={
|
168
|
+
txInfo.type === "swap"
|
169
|
+
? txInfo.status.source?.transactionHash
|
170
|
+
: txInfo.status.intentId
|
171
|
+
}
|
172
|
+
txInfo={txInfo}
|
173
|
+
client={props.client}
|
174
|
+
onClick={() => {
|
175
|
+
props.onSelectTx(txInfo);
|
176
|
+
}}
|
177
|
+
/>
|
178
|
+
);
|
179
|
+
})}
|
180
|
+
</Container>
|
181
|
+
)}
|
179
182
|
|
180
183
|
{isLoading && txInfosToShow.length > 0 && (
|
181
184
|
<>
|
@@ -186,8 +189,8 @@ export function PayTxHistoryList(props: {
|
|
186
189
|
)}
|
187
190
|
</Container>
|
188
191
|
|
189
|
-
|
190
|
-
|
192
|
+
{pagination && !hidePagination && (
|
193
|
+
<Container py="md">
|
191
194
|
<div
|
192
195
|
style={{
|
193
196
|
display: "grid",
|
@@ -234,8 +237,8 @@ export function PayTxHistoryList(props: {
|
|
234
237
|
<ArrowRightIcon width={iconSize.sm} height={iconSize.sm} />
|
235
238
|
</Button>
|
236
239
|
</div>
|
237
|
-
|
238
|
-
|
240
|
+
</Container>
|
241
|
+
)}
|
239
242
|
</Container>
|
240
243
|
);
|
241
244
|
}
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import { useState } from "react";
|
2
|
+
import type { ThirdwebClient } from "../../../../../client/client.js";
|
3
|
+
import { type Theme, iconSize } from "../../../../core/design-system/index.js";
|
4
|
+
import type {
|
5
|
+
SupportedNFTs,
|
6
|
+
SupportedTokens,
|
7
|
+
} from "../../../../core/utils/defaultTokens.js";
|
8
|
+
import { Spacer } from "../../components/Spacer.js";
|
9
|
+
import Tabs from "../../components/Tabs.js";
|
10
|
+
import { Container, Line, ModalHeader } from "../../components/basic.js";
|
11
|
+
import { CoinsIcon } from "../icons/CoinsIcon.js";
|
12
|
+
import { ImageIcon } from "../icons/ImageIcon.js";
|
13
|
+
import type { ConnectLocale } from "../locale/types.js";
|
14
|
+
import { ViewNFTsContent } from "./ViewNFTs.js";
|
15
|
+
import { ViewTokensContent } from "./ViewTokens.js";
|
16
|
+
import type { WalletDetailsModalScreen } from "./types.js";
|
17
|
+
|
18
|
+
/**
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
export function ViewAssets(props: {
|
22
|
+
supportedTokens?: SupportedTokens;
|
23
|
+
supportedNFTs?: SupportedNFTs;
|
24
|
+
theme: Theme | "light" | "dark";
|
25
|
+
onBack: () => void;
|
26
|
+
setScreen: (screen: WalletDetailsModalScreen) => void;
|
27
|
+
client: ThirdwebClient;
|
28
|
+
connectLocale: ConnectLocale;
|
29
|
+
}) {
|
30
|
+
const [activeTab, setActiveTab] = useState("Tokens");
|
31
|
+
const { connectLocale } = props;
|
32
|
+
|
33
|
+
return (
|
34
|
+
<Container
|
35
|
+
animate="fadein"
|
36
|
+
style={{
|
37
|
+
minHeight: "300px",
|
38
|
+
}}
|
39
|
+
>
|
40
|
+
<Container p="lg">
|
41
|
+
<ModalHeader
|
42
|
+
title={connectLocale.viewFunds.title}
|
43
|
+
onBack={props.onBack}
|
44
|
+
/>
|
45
|
+
</Container>
|
46
|
+
<Line />
|
47
|
+
<Container
|
48
|
+
px="lg"
|
49
|
+
scrollY
|
50
|
+
style={{
|
51
|
+
minHeight: "330px",
|
52
|
+
}}
|
53
|
+
>
|
54
|
+
<Spacer y="md" />
|
55
|
+
<Tabs
|
56
|
+
options={[
|
57
|
+
{
|
58
|
+
label: (
|
59
|
+
<span className="flex gap-2">
|
60
|
+
<CoinsIcon size={iconSize.sm} /> Tokens
|
61
|
+
</span>
|
62
|
+
),
|
63
|
+
value: "Tokens",
|
64
|
+
},
|
65
|
+
{
|
66
|
+
label: (
|
67
|
+
<span className="flex gap-2">
|
68
|
+
<ImageIcon size={iconSize.sm} /> NFTs
|
69
|
+
</span>
|
70
|
+
),
|
71
|
+
value: "NFTs",
|
72
|
+
},
|
73
|
+
]}
|
74
|
+
selected={activeTab}
|
75
|
+
onSelect={setActiveTab}
|
76
|
+
>
|
77
|
+
<Container
|
78
|
+
scrollY
|
79
|
+
style={{
|
80
|
+
maxHeight: "300px",
|
81
|
+
}}
|
82
|
+
>
|
83
|
+
{activeTab === "Tokens" && (
|
84
|
+
<ViewTokensContent
|
85
|
+
client={props.client}
|
86
|
+
connectLocale={connectLocale}
|
87
|
+
supportedTokens={props.supportedTokens}
|
88
|
+
/>
|
89
|
+
)}
|
90
|
+
{activeTab === "NFTs" && (
|
91
|
+
<ViewNFTsContent
|
92
|
+
supportedNFTs={props.supportedNFTs}
|
93
|
+
client={props.client}
|
94
|
+
theme={props.theme}
|
95
|
+
connectLocale={connectLocale}
|
96
|
+
/>
|
97
|
+
)}
|
98
|
+
</Container>
|
99
|
+
</Tabs>
|
100
|
+
<Spacer y="lg" />
|
101
|
+
</Container>
|
102
|
+
</Container>
|
103
|
+
);
|
104
|
+
}
|
@@ -71,6 +71,39 @@ export function ViewNFTs(props: {
|
|
71
71
|
onBack: () => void;
|
72
72
|
client: ThirdwebClient;
|
73
73
|
connectLocale: ConnectLocale;
|
74
|
+
}) {
|
75
|
+
return (
|
76
|
+
<Container
|
77
|
+
style={{
|
78
|
+
minHeight: "300px",
|
79
|
+
}}
|
80
|
+
>
|
81
|
+
<Container p="lg">
|
82
|
+
<ModalHeader
|
83
|
+
title={props.connectLocale.viewFunds.viewNFTs}
|
84
|
+
onBack={props.onBack}
|
85
|
+
/>
|
86
|
+
</Container>
|
87
|
+
<Line />
|
88
|
+
<Container
|
89
|
+
px="sm"
|
90
|
+
scrollY
|
91
|
+
style={{
|
92
|
+
maxHeight: "500px",
|
93
|
+
}}
|
94
|
+
>
|
95
|
+
<Spacer y="md" />
|
96
|
+
<ViewNFTsContent {...props} />
|
97
|
+
</Container>
|
98
|
+
</Container>
|
99
|
+
);
|
100
|
+
}
|
101
|
+
|
102
|
+
export function ViewNFTsContent(props: {
|
103
|
+
supportedNFTs?: SupportedNFTs;
|
104
|
+
client: ThirdwebClient;
|
105
|
+
theme: Theme | "light" | "dark";
|
106
|
+
connectLocale: ConnectLocale;
|
74
107
|
}) {
|
75
108
|
const activeAccount = useActiveAccount();
|
76
109
|
const activeChain = useActiveWalletChain();
|
@@ -79,8 +112,6 @@ export function ViewNFTs(props: {
|
|
79
112
|
return null;
|
80
113
|
}
|
81
114
|
|
82
|
-
const { connectLocale } = props;
|
83
|
-
|
84
115
|
const nftList = useMemo(() => {
|
85
116
|
const nfts = [];
|
86
117
|
if (!props.supportedNFTs) return [];
|
@@ -106,60 +137,40 @@ export function ViewNFTs(props: {
|
|
106
137
|
});
|
107
138
|
|
108
139
|
return (
|
109
|
-
|
110
|
-
style={{
|
111
|
-
minHeight: "300px",
|
112
|
-
}}
|
113
|
-
>
|
114
|
-
<Container p="lg">
|
115
|
-
<ModalHeader
|
116
|
-
title={connectLocale.viewFunds.viewNFTs}
|
117
|
-
onBack={props.onBack}
|
118
|
-
/>
|
119
|
-
</Container>
|
120
|
-
<Line />
|
140
|
+
<>
|
121
141
|
<Container
|
122
|
-
px="sm"
|
123
|
-
scrollY
|
124
142
|
style={{
|
125
|
-
|
143
|
+
display: "grid",
|
144
|
+
gridTemplateColumns: "1fr 1fr",
|
145
|
+
gap: "12px",
|
126
146
|
}}
|
127
147
|
>
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
148
|
+
{results.map((result, index) => {
|
149
|
+
if (result.error) {
|
150
|
+
console.error(result.error);
|
151
|
+
return null;
|
152
|
+
}
|
153
|
+
return result.isLoading || !result.data ? (
|
154
|
+
<Skeleton
|
155
|
+
key={`${nftList[index]?.chain?.id}:${nftList[index]?.address}`}
|
156
|
+
height="150px"
|
157
|
+
width="150px"
|
158
|
+
/>
|
159
|
+
) : (
|
160
|
+
result.data.map((nft) => (
|
161
|
+
<NftCard
|
162
|
+
key={`${nft.chain.id}:${nft.address}:${nft.id}`}
|
163
|
+
{...nft}
|
164
|
+
client={props.client}
|
165
|
+
chain={nft.chain}
|
166
|
+
theme={props.theme}
|
146
167
|
/>
|
147
|
-
)
|
148
|
-
|
149
|
-
|
150
|
-
key={`${nft.chain.id}:${nft.address}:${nft.id}`}
|
151
|
-
{...nft}
|
152
|
-
client={props.client}
|
153
|
-
chain={nft.chain}
|
154
|
-
theme={props.theme}
|
155
|
-
/>
|
156
|
-
))
|
157
|
-
);
|
158
|
-
})}
|
159
|
-
</Container>
|
160
|
-
<Spacer y="lg" />
|
168
|
+
))
|
169
|
+
);
|
170
|
+
})}
|
161
171
|
</Container>
|
162
|
-
|
172
|
+
<Spacer y="lg" />
|
173
|
+
</>
|
163
174
|
);
|
164
175
|
}
|
165
176
|
|
@@ -188,8 +199,8 @@ function NftCard(
|
|
188
199
|
display: "flex",
|
189
200
|
flexShrink: 0,
|
190
201
|
alignItems: "center",
|
191
|
-
width: "
|
192
|
-
height: "
|
202
|
+
width: "150px",
|
203
|
+
height: "150px",
|
193
204
|
borderRadius: "8px",
|
194
205
|
overflow: "hidden",
|
195
206
|
background:
|
@@ -30,17 +30,6 @@ export function ViewTokens(props: {
|
|
30
30
|
client: ThirdwebClient;
|
31
31
|
connectLocale: ConnectLocale;
|
32
32
|
}) {
|
33
|
-
const activeChain = useActiveWalletChain();
|
34
|
-
const supportedTokens = props.supportedTokens || defaultTokens;
|
35
|
-
|
36
|
-
if (!activeChain) {
|
37
|
-
return null;
|
38
|
-
}
|
39
|
-
|
40
|
-
const tokenList =
|
41
|
-
(activeChain?.id ? supportedTokens[activeChain.id] : undefined) || [];
|
42
|
-
const { connectLocale } = props;
|
43
|
-
|
44
33
|
return (
|
45
34
|
<Container
|
46
35
|
style={{
|
@@ -49,7 +38,7 @@ export function ViewTokens(props: {
|
|
49
38
|
>
|
50
39
|
<Container p="lg">
|
51
40
|
<ModalHeader
|
52
|
-
title={connectLocale.viewFunds.title}
|
41
|
+
title={props.connectLocale.viewFunds.title}
|
53
42
|
onBack={props.onBack}
|
54
43
|
/>
|
55
44
|
</Container>
|
@@ -62,29 +51,49 @@ export function ViewTokens(props: {
|
|
62
51
|
}}
|
63
52
|
>
|
64
53
|
<Spacer y="md" />
|
65
|
-
|
66
|
-
<TokenInfo
|
67
|
-
token={NATIVE_TOKEN}
|
68
|
-
chain={activeChain}
|
69
|
-
client={props.client}
|
70
|
-
/>
|
71
|
-
|
72
|
-
{tokenList.map((token) => {
|
73
|
-
return (
|
74
|
-
<TokenInfo
|
75
|
-
token={token}
|
76
|
-
key={token.address}
|
77
|
-
chain={activeChain}
|
78
|
-
client={props.client}
|
79
|
-
/>
|
80
|
-
);
|
81
|
-
})}
|
54
|
+
<ViewTokensContent {...props} />
|
82
55
|
<Spacer y="lg" />
|
83
56
|
</Container>
|
84
57
|
</Container>
|
85
58
|
);
|
86
59
|
}
|
87
60
|
|
61
|
+
export function ViewTokensContent(props: {
|
62
|
+
supportedTokens?: SupportedTokens;
|
63
|
+
client: ThirdwebClient;
|
64
|
+
connectLocale: ConnectLocale;
|
65
|
+
}) {
|
66
|
+
const activeChain = useActiveWalletChain();
|
67
|
+
if (!activeChain) {
|
68
|
+
return null;
|
69
|
+
}
|
70
|
+
const supportedTokens = props.supportedTokens || defaultTokens;
|
71
|
+
|
72
|
+
const tokenList =
|
73
|
+
(activeChain?.id ? supportedTokens[activeChain.id] : undefined) || [];
|
74
|
+
|
75
|
+
return (
|
76
|
+
<>
|
77
|
+
<TokenInfo
|
78
|
+
token={NATIVE_TOKEN}
|
79
|
+
chain={activeChain}
|
80
|
+
client={props.client}
|
81
|
+
/>
|
82
|
+
|
83
|
+
{tokenList.map((token) => {
|
84
|
+
return (
|
85
|
+
<TokenInfo
|
86
|
+
token={token}
|
87
|
+
key={token.address}
|
88
|
+
chain={activeChain}
|
89
|
+
client={props.client}
|
90
|
+
/>
|
91
|
+
);
|
92
|
+
})}
|
93
|
+
</>
|
94
|
+
);
|
95
|
+
}
|
96
|
+
|
88
97
|
function TokenInfo(props: {
|
89
98
|
token: ERC20OrNativeToken;
|
90
99
|
chain: Chain;
|
@@ -46,7 +46,7 @@ export function WalletTransactionHistory(props: {
|
|
46
46
|
fullHeight
|
47
47
|
style={{
|
48
48
|
minHeight: "250px",
|
49
|
-
maxHeight: "
|
49
|
+
maxHeight: "370px",
|
50
50
|
paddingBottom: spacing.lg,
|
51
51
|
}}
|
52
52
|
>
|
@@ -59,13 +59,19 @@ export function WalletTransactionHistory(props: {
|
|
59
59
|
color="secondaryText"
|
60
60
|
style={{
|
61
61
|
flex: "1",
|
62
|
+
minHeight: "250px",
|
62
63
|
}}
|
63
64
|
>
|
64
65
|
<CrossCircledIcon width={iconSize.xl} height={iconSize.xl} />
|
65
66
|
<Text>No Transactions</Text>
|
66
67
|
</Container>
|
67
68
|
) : (
|
68
|
-
<Container
|
69
|
+
<Container
|
70
|
+
animate="fadein"
|
71
|
+
flex="column"
|
72
|
+
gap="xs"
|
73
|
+
style={{ minHeight: "250px" }}
|
74
|
+
>
|
69
75
|
{transactions.map((tx) => {
|
70
76
|
return (
|
71
77
|
<TransactionButton
|