thirdweb 5.64.6-nightly-f40d2474e6cc1227a8d05151210ef4793beb6142-20241101000357 → 5.65.0-nightly-06604162a11d99ff119bbf427a24b9a7d82c1575-20241103000408
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/analytics/track/index.js +2 -2
- package/dist/cjs/analytics/track/index.js.map +1 -1
- package/dist/cjs/auth/core/verify-jwt.js +2 -1
- package/dist/cjs/auth/core/verify-jwt.js.map +1 -1
- package/dist/cjs/extensions/erc721/drops/write/claimToBatch.js +8 -7
- package/dist/cjs/extensions/erc721/drops/write/claimToBatch.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +2 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +2 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +2 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +14 -0
- package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +5 -4
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewAssets.js +29 -11
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ViewAssets.js.map +1 -1
- package/dist/cjs/rpc/rpc.js +2 -1
- package/dist/cjs/rpc/rpc.js.map +1 -1
- package/dist/cjs/utils/domains.js +3 -0
- package/dist/cjs/utils/domains.js.map +1 -1
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc1155.js +3 -2
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc1155.js.map +1 -1
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc20.js +3 -2
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc20.js.map +1 -1
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc721.js +3 -2
- package/dist/cjs/utils/extensions/airdrop/process-snapshot-erc721.js.map +1 -1
- package/dist/cjs/utils/extensions/drops/process-override-list.js +3 -2
- package/dist/cjs/utils/extensions/drops/process-override-list.js.map +1 -1
- package/dist/cjs/utils/jwt/encode-jwt.js +5 -2
- package/dist/cjs/utils/jwt/encode-jwt.js.map +1 -1
- package/dist/cjs/utils/storage/walletStorage.js +4 -3
- package/dist/cjs/utils/storage/walletStorage.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/coinbase/coinbaseWebSDK.js +1 -0
- package/dist/cjs/wallets/coinbase/coinbaseWebSDK.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js +2 -1
- package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js +2 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/jwt.js +2 -1
- package/dist/cjs/wallets/in-app/core/authentication/jwt.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js +2 -1
- package/dist/cjs/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/passkeys.js +3 -2
- package/dist/cjs/wallets/in-app/core/authentication/passkeys.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/siwe.js +2 -1
- package/dist/cjs/wallets/in-app/core/authentication/siwe.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js +1 -0
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +2 -1
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +5 -4
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/errors.js +2 -1
- package/dist/cjs/wallets/in-app/native/helpers/errors.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/storage/local.js +2 -1
- package/dist/cjs/wallets/in-app/native/helpers/storage/local.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js +4 -3
- package/dist/cjs/wallets/in-app/native/helpers/wallet/migration.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/wallet/recoveryCode.js +5 -4
- package/dist/cjs/wallets/in-app/native/helpers/wallet/recoveryCode.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/auth/otp.js +3 -2
- package/dist/cjs/wallets/in-app/web/lib/auth/otp.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js +1 -0
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/cjs/wallets/injected/index.js +1 -0
- package/dist/cjs/wallets/injected/index.js.map +1 -1
- package/dist/cjs/wallets/manager/index.js +4 -3
- package/dist/cjs/wallets/manager/index.js.map +1 -1
- package/dist/cjs/wallets/smart/lib/bundler.js +1 -1
- package/dist/cjs/wallets/smart/lib/bundler.js.map +1 -1
- package/dist/cjs/wallets/smart/lib/paymaster.js +2 -1
- package/dist/cjs/wallets/smart/lib/paymaster.js.map +1 -1
- package/dist/cjs/wallets/wallet-connect/controller.js +3 -1
- package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/cjs/wallets/wallet-connect/receiver/session-store.js +3 -2
- package/dist/cjs/wallets/wallet-connect/receiver/session-store.js.map +1 -1
- package/dist/esm/analytics/track/index.js +2 -2
- package/dist/esm/analytics/track/index.js.map +1 -1
- package/dist/esm/auth/core/verify-jwt.js +2 -1
- package/dist/esm/auth/core/verify-jwt.js.map +1 -1
- package/dist/esm/extensions/erc721/drops/write/claimToBatch.js +8 -7
- package/dist/esm/extensions/erc721/drops/write/claimToBatch.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js +2 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +2 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +2 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +14 -0
- package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +5 -4
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewAssets.js +30 -12
- package/dist/esm/react/web/ui/ConnectWallet/screens/ViewAssets.js.map +1 -1
- package/dist/esm/rpc/rpc.js +2 -1
- package/dist/esm/rpc/rpc.js.map +1 -1
- package/dist/esm/utils/domains.js +3 -0
- package/dist/esm/utils/domains.js.map +1 -1
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc1155.js +3 -2
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc1155.js.map +1 -1
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc20.js +3 -2
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc20.js.map +1 -1
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc721.js +3 -2
- package/dist/esm/utils/extensions/airdrop/process-snapshot-erc721.js.map +1 -1
- package/dist/esm/utils/extensions/drops/process-override-list.js +3 -2
- package/dist/esm/utils/extensions/drops/process-override-list.js.map +1 -1
- package/dist/esm/utils/jwt/encode-jwt.js +5 -2
- package/dist/esm/utils/jwt/encode-jwt.js.map +1 -1
- package/dist/esm/utils/storage/walletStorage.js +4 -3
- package/dist/esm/utils/storage/walletStorage.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/coinbase/coinbaseWebSDK.js +1 -0
- package/dist/esm/wallets/coinbase/coinbaseWebSDK.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js +2 -1
- package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js +2 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/jwt.js +2 -1
- package/dist/esm/wallets/in-app/core/authentication/jwt.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/linkAccount.js +2 -1
- package/dist/esm/wallets/in-app/core/authentication/linkAccount.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/passkeys.js +3 -2
- package/dist/esm/wallets/in-app/core/authentication/passkeys.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/siwe.js +2 -1
- package/dist/esm/wallets/in-app/core/authentication/siwe.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js +1 -0
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +2 -1
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +5 -4
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/errors.js +2 -1
- package/dist/esm/wallets/in-app/native/helpers/errors.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/storage/local.js +2 -1
- package/dist/esm/wallets/in-app/native/helpers/storage/local.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js +4 -3
- package/dist/esm/wallets/in-app/native/helpers/wallet/migration.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/wallet/recoveryCode.js +5 -4
- package/dist/esm/wallets/in-app/native/helpers/wallet/recoveryCode.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/auth/otp.js +3 -2
- package/dist/esm/wallets/in-app/web/lib/auth/otp.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js +1 -0
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/esm/wallets/injected/index.js +1 -0
- package/dist/esm/wallets/injected/index.js.map +1 -1
- package/dist/esm/wallets/manager/index.js +4 -3
- package/dist/esm/wallets/manager/index.js.map +1 -1
- package/dist/esm/wallets/smart/lib/bundler.js +1 -1
- package/dist/esm/wallets/smart/lib/bundler.js.map +1 -1
- package/dist/esm/wallets/smart/lib/paymaster.js +2 -1
- package/dist/esm/wallets/smart/lib/paymaster.js.map +1 -1
- package/dist/esm/wallets/wallet-connect/controller.js +3 -1
- package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/esm/wallets/wallet-connect/receiver/session-store.js +3 -2
- package/dist/esm/wallets/wallet-connect/receiver/session-store.js.map +1 -1
- package/dist/types/analytics/track/index.d.ts.map +1 -1
- package/dist/types/auth/core/verify-jwt.d.ts.map +1 -1
- package/dist/types/extensions/erc721/drops/write/claimToBatch.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +7 -0
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +14 -0
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +7 -0
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts +5 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts.map +1 -1
- package/dist/types/rpc/rpc.d.ts.map +1 -1
- package/dist/types/utils/domains.d.ts +6 -0
- package/dist/types/utils/domains.d.ts.map +1 -1
- package/dist/types/utils/extensions/airdrop/process-snapshot-erc1155.d.ts.map +1 -1
- package/dist/types/utils/extensions/airdrop/process-snapshot-erc20.d.ts.map +1 -1
- package/dist/types/utils/extensions/airdrop/process-snapshot-erc721.d.ts.map +1 -1
- package/dist/types/utils/extensions/drops/process-override-list.d.ts.map +1 -1
- package/dist/types/utils/jwt/encode-jwt.d.ts.map +1 -1
- package/dist/types/utils/storage/walletStorage.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/coinbase/coinbaseWebSDK.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/jwt.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/linkAccount.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/passkeys.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/siwe.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/errors.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/storage/local.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/wallet/migration.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/wallet/recoveryCode.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/auth/otp.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/iframe-wallet.d.ts.map +1 -1
- package/dist/types/wallets/injected/index.d.ts.map +1 -1
- package/dist/types/wallets/manager/index.d.ts.map +1 -1
- package/dist/types/wallets/smart/lib/paymaster.d.ts.map +1 -1
- package/dist/types/wallets/wallet-connect/controller.d.ts.map +1 -1
- package/dist/types/wallets/wallet-connect/receiver/session-store.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/analytics/track/index.ts +2 -3
- package/src/auth/core/verify-jwt.ts +2 -1
- package/src/extensions/erc1155/drop1155.test.ts +12 -1
- package/src/extensions/erc1155/token1155.test.ts +12 -1
- package/src/extensions/erc1155/write/mintAdditionalSupplyToBatch.test.ts +0 -1
- package/src/extensions/erc20/drop20.test.ts +11 -2
- package/src/extensions/erc721/drop721.test.ts +10 -7
- package/src/extensions/erc721/drops/write/claimToBatch.ts +10 -11
- package/src/extensions/erc721/read/getNFT.test.ts +0 -67
- package/src/extensions/erc721/read/getNFTs.test.ts +0 -32
- package/src/extensions/erc721/token721.test.ts +115 -0
- package/src/extensions/prebuilts/deploy-erc721.test.ts +0 -42
- package/src/pay/buyWithCrypto/getQuote.ts +2 -1
- package/src/pay/buyWithCrypto/getTransfer.ts +2 -1
- package/src/pay/buyWithFiat/getQuote.ts +2 -1
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +8 -0
- package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +14 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +30 -16
- package/src/react/web/ui/ConnectWallet/screens/ViewAssets.tsx +46 -24
- package/src/rpc/rpc.ts +2 -1
- package/src/utils/domains.ts +8 -0
- package/src/utils/extensions/airdrop/process-snapshot-erc1155.ts +3 -2
- package/src/utils/extensions/airdrop/process-snapshot-erc20.ts +3 -2
- package/src/utils/extensions/airdrop/process-snapshot-erc721.ts +3 -2
- package/src/utils/extensions/drops/process-override-list.ts +3 -2
- package/src/utils/jwt/encode-jwt.ts +5 -5
- package/src/utils/nft/fetch-token-metadata.test.ts +2 -1
- package/src/utils/storage/walletStorage.ts +4 -3
- package/src/version.ts +1 -1
- package/src/wallets/coinbase/coinbaseWebSDK.ts +1 -0
- package/src/wallets/in-app/core/authentication/authEndpoint.ts +2 -1
- package/src/wallets/in-app/core/authentication/guest.ts +2 -1
- package/src/wallets/in-app/core/authentication/jwt.ts +2 -1
- package/src/wallets/in-app/core/authentication/linkAccount.ts +2 -1
- package/src/wallets/in-app/core/authentication/passkeys.ts +3 -2
- package/src/wallets/in-app/core/authentication/siwe.ts +2 -1
- package/src/wallets/in-app/core/wallet/enclave-wallet.ts +1 -0
- package/src/wallets/in-app/core/wallet/in-app-core.ts +2 -1
- package/src/wallets/in-app/native/helpers/api/fetchers.ts +5 -4
- package/src/wallets/in-app/native/helpers/errors.ts +3 -1
- package/src/wallets/in-app/native/helpers/storage/local.ts +2 -1
- package/src/wallets/in-app/native/helpers/wallet/migration.ts +4 -3
- package/src/wallets/in-app/native/helpers/wallet/recoveryCode.ts +5 -4
- package/src/wallets/in-app/web/lib/auth/otp.ts +3 -2
- package/src/wallets/in-app/web/lib/iframe-wallet.ts +1 -0
- package/src/wallets/injected/index.ts +1 -0
- package/src/wallets/manager/index.ts +4 -3
- package/src/wallets/smart/lib/bundler.ts +1 -1
- package/src/wallets/smart/lib/paymaster.ts +2 -1
- package/src/wallets/wallet-connect/controller.ts +3 -1
- package/src/wallets/wallet-connect/receiver/session-store.ts +3 -6
- package/src/extensions/erc721/write/mintTo.test.ts +0 -69
- package/src/extensions/prebuilts/deploy-erc1155.test.ts +0 -54
- package/src/extensions/prebuilts/deploy-erc20.test.ts +0 -56
@@ -109,7 +109,7 @@ import { ManageWalletScreen } from "./screens/ManageWalletScreen.js";
|
|
109
109
|
import { PrivateKey } from "./screens/PrivateKey.js";
|
110
110
|
import { ReceiveFunds } from "./screens/ReceiveFunds.js";
|
111
111
|
import { SendFunds } from "./screens/SendFunds.js";
|
112
|
-
import { ViewAssets } from "./screens/ViewAssets.js";
|
112
|
+
import { type AssetTabs, ViewAssets } from "./screens/ViewAssets.js";
|
113
113
|
import { ViewNFTs } from "./screens/ViewNFTs.js";
|
114
114
|
import { ViewTokens } from "./screens/ViewTokens.js";
|
115
115
|
import { WalletConnectReceiverScreen } from "./screens/WalletConnectReceiverScreen.js";
|
@@ -170,6 +170,7 @@ export const ConnectedWalletDetails: React.FC<{
|
|
170
170
|
chains={props.chains}
|
171
171
|
displayBalanceToken={props.detailsButton?.displayBalanceToken}
|
172
172
|
connectOptions={props.connectOptions}
|
173
|
+
assetTabs={props.detailsModal?.assetTabs}
|
173
174
|
/>,
|
174
175
|
);
|
175
176
|
}
|
@@ -284,6 +285,7 @@ function DetailsModal(props: {
|
|
284
285
|
chains: Chain[];
|
285
286
|
displayBalanceToken?: Record<number, string>;
|
286
287
|
connectOptions: DetailsModalConnectOptions | undefined;
|
288
|
+
assetTabs?: AssetTabs[];
|
287
289
|
}) {
|
288
290
|
const [screen, setScreen] = useState<WalletDetailsModalScreen>("main");
|
289
291
|
const { disconnect } = useDisconnect();
|
@@ -627,21 +629,24 @@ function DetailsModal(props: {
|
|
627
629
|
</MenuButton>
|
628
630
|
|
629
631
|
{/* View Funds */}
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
{
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
632
|
+
{/* Hide the View Funds button if the assetTabs props is set to an empty array */}
|
633
|
+
{(props.assetTabs === undefined || props.assetTabs.length) && (
|
634
|
+
<MenuButton
|
635
|
+
onClick={() => {
|
636
|
+
setScreen("view-assets");
|
637
|
+
}}
|
638
|
+
style={{
|
639
|
+
fontSize: fontSize.sm,
|
640
|
+
}}
|
641
|
+
>
|
642
|
+
<CoinsIcon size={iconSize.md} />
|
643
|
+
<Text color="primaryText">
|
644
|
+
{props.supportedNFTs
|
645
|
+
? locale.viewFunds.viewAssets
|
646
|
+
: locale.viewFunds.title}
|
647
|
+
</Text>
|
648
|
+
</MenuButton>
|
649
|
+
)}
|
645
650
|
|
646
651
|
{/* Manage Wallet */}
|
647
652
|
<MenuButton
|
@@ -799,6 +804,7 @@ function DetailsModal(props: {
|
|
799
804
|
setScreen={setScreen}
|
800
805
|
client={client}
|
801
806
|
connectLocale={locale}
|
807
|
+
assetTabs={props.detailsModal?.assetTabs}
|
802
808
|
/>
|
803
809
|
);
|
804
810
|
} else {
|
@@ -1458,6 +1464,13 @@ export type UseWalletDetailsModalOptions = {
|
|
1458
1464
|
* By default the "Buy Funds" button is shown.
|
1459
1465
|
*/
|
1460
1466
|
hideBuyFunds?: boolean;
|
1467
|
+
|
1468
|
+
/**
|
1469
|
+
* When you click on "View Assets", by default the "Tokens" tab is shown first.
|
1470
|
+
* If you want to show the "NFTs" tab first, change the order of the asset tabs to: ["nft", "token"]
|
1471
|
+
* Note: If an empty array is passed, the [View Funds] button will be hidden
|
1472
|
+
*/
|
1473
|
+
assetTabs?: AssetTabs[];
|
1461
1474
|
};
|
1462
1475
|
|
1463
1476
|
/**
|
@@ -1515,6 +1528,7 @@ export function useWalletDetailsModal() {
|
|
1515
1528
|
hideBuyFunds: props.hideBuyFunds,
|
1516
1529
|
hideReceiveFunds: props.hideReceiveFunds,
|
1517
1530
|
hideSendFunds: props.hideSendFunds,
|
1531
|
+
assetTabs: props.assetTabs,
|
1518
1532
|
}}
|
1519
1533
|
displayBalanceToken={props.displayBalanceToken}
|
1520
1534
|
theme={props.theme || "dark"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { useState } from "react";
|
1
|
+
import { useMemo, useState } from "react";
|
2
2
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
3
3
|
import { type Theme, iconSize } from "../../../../core/design-system/index.js";
|
4
4
|
import type {
|
@@ -15,6 +15,29 @@ import { ViewNFTsContent } from "./ViewNFTs.js";
|
|
15
15
|
import { ViewTokensContent } from "./ViewTokens.js";
|
16
16
|
import type { WalletDetailsModalScreen } from "./types.js";
|
17
17
|
|
18
|
+
/**
|
19
|
+
* @internal
|
20
|
+
*/
|
21
|
+
export type AssetTabs = "token" | "nft";
|
22
|
+
|
23
|
+
const TokenTab = {
|
24
|
+
label: (
|
25
|
+
<span className="flex gap-2">
|
26
|
+
<CoinsIcon size={iconSize.sm} /> Tokens
|
27
|
+
</span>
|
28
|
+
),
|
29
|
+
value: "Tokens",
|
30
|
+
};
|
31
|
+
|
32
|
+
const NftTab = {
|
33
|
+
label: (
|
34
|
+
<span className="flex gap-2">
|
35
|
+
<ImageIcon size={iconSize.sm} /> NFTs
|
36
|
+
</span>
|
37
|
+
),
|
38
|
+
value: "NFTs",
|
39
|
+
};
|
40
|
+
|
18
41
|
/**
|
19
42
|
* @internal
|
20
43
|
*/
|
@@ -26,9 +49,29 @@ export function ViewAssets(props: {
|
|
26
49
|
setScreen: (screen: WalletDetailsModalScreen) => void;
|
27
50
|
client: ThirdwebClient;
|
28
51
|
connectLocale: ConnectLocale;
|
52
|
+
assetTabs?: AssetTabs[];
|
29
53
|
}) {
|
30
|
-
const [activeTab, setActiveTab] = useState("Tokens");
|
31
54
|
const { connectLocale } = props;
|
55
|
+
const options = useMemo(() => {
|
56
|
+
if (!props.assetTabs) {
|
57
|
+
return [TokenTab, NftTab];
|
58
|
+
}
|
59
|
+
if (!props.assetTabs.length) {
|
60
|
+
return [];
|
61
|
+
}
|
62
|
+
const tabs = [];
|
63
|
+
for (const item of props.assetTabs) {
|
64
|
+
if (item === "token") {
|
65
|
+
tabs.push(TokenTab);
|
66
|
+
} else if (item === "nft") {
|
67
|
+
tabs.push(NftTab);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
return tabs;
|
71
|
+
}, [props.assetTabs]);
|
72
|
+
|
73
|
+
// Since `options` is now a dynamic value, the default active tab is set to the value of the first tab in `options`
|
74
|
+
const [activeTab, setActiveTab] = useState(options[0]?.value || "Tokens");
|
32
75
|
|
33
76
|
return (
|
34
77
|
<Container
|
@@ -52,28 +95,7 @@ export function ViewAssets(props: {
|
|
52
95
|
}}
|
53
96
|
>
|
54
97
|
<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
|
-
>
|
98
|
+
<Tabs options={options} selected={activeTab} onSelect={setActiveTab}>
|
77
99
|
<Container
|
78
100
|
scrollY
|
79
101
|
style={{
|
package/src/rpc/rpc.ts
CHANGED
@@ -3,6 +3,7 @@ import type { ThirdwebClient } from "../client/client.js";
|
|
3
3
|
|
4
4
|
import type { Chain } from "../chains/types.js";
|
5
5
|
import { getRpcUrlForChain } from "../chains/utils.js";
|
6
|
+
import { stringify } from "../utils/json.js";
|
6
7
|
import { type RpcRequest, fetchRpc, fetchSingleRpc } from "./fetch-rpc.js";
|
7
8
|
|
8
9
|
const RPC_CLIENT_MAP = new WeakMap();
|
@@ -23,7 +24,7 @@ function getRpcClientMap(client: ThirdwebClient) {
|
|
23
24
|
* @internal
|
24
25
|
*/
|
25
26
|
function rpcRequestKey(request: RpcRequest): string {
|
26
|
-
return `${request.method}:${
|
27
|
+
return `${request.method}:${stringify(request.params)}`;
|
27
28
|
}
|
28
29
|
|
29
30
|
const DEFAULT_MAX_BATCH_SIZE = 100;
|
package/src/utils/domains.ts
CHANGED
@@ -29,6 +29,11 @@ type DomainOverrides = {
|
|
29
29
|
* @default "bundler.thirdweb.com"
|
30
30
|
*/
|
31
31
|
bundler?: string;
|
32
|
+
/**
|
33
|
+
* The base URL for the analytics server.
|
34
|
+
* @default "c.thirdweb.com"
|
35
|
+
*/
|
36
|
+
analytics?: string;
|
32
37
|
};
|
33
38
|
|
34
39
|
export const DEFAULT_RPC_URL = "rpc.thirdweb.com";
|
@@ -37,6 +42,7 @@ const DEFAULT_IN_APP_WALLET_URL = "embedded-wallet.thirdweb.com";
|
|
37
42
|
const DEFAULT_PAY_URL = "pay.thirdweb.com";
|
38
43
|
const DEFAULT_STORAGE_URL = "storage.thirdweb.com";
|
39
44
|
const DEFAULT_BUNDLER_URL = "bundler.thirdweb.com";
|
45
|
+
const DEFAULT_ANALYTICS_URL = "c.thirdweb.com";
|
40
46
|
|
41
47
|
let domains: { [k in keyof DomainOverrides]-?: string } = {
|
42
48
|
rpc: DEFAULT_RPC_URL,
|
@@ -45,6 +51,7 @@ let domains: { [k in keyof DomainOverrides]-?: string } = {
|
|
45
51
|
pay: DEFAULT_PAY_URL,
|
46
52
|
storage: DEFAULT_STORAGE_URL,
|
47
53
|
bundler: DEFAULT_BUNDLER_URL,
|
54
|
+
analytics: DEFAULT_ANALYTICS_URL,
|
48
55
|
};
|
49
56
|
|
50
57
|
/**
|
@@ -58,6 +65,7 @@ export const setThirdwebDomains = (DomainOverrides: DomainOverrides) => {
|
|
58
65
|
pay: DomainOverrides.pay ?? DEFAULT_PAY_URL,
|
59
66
|
storage: DomainOverrides.storage ?? DEFAULT_STORAGE_URL,
|
60
67
|
bundler: DomainOverrides.bundler ?? DEFAULT_BUNDLER_URL,
|
68
|
+
analytics: DomainOverrides.analytics ?? DEFAULT_ANALYTICS_URL,
|
61
69
|
};
|
62
70
|
};
|
63
71
|
|
@@ -2,6 +2,7 @@ import type { ThirdwebClient } from "../../../client/client.js";
|
|
2
2
|
import { MerkleTree } from "../../../merkletree/MerkleTree.js";
|
3
3
|
import { upload } from "../../../storage/upload.js";
|
4
4
|
import type { Hex } from "../../encoding/hex.js";
|
5
|
+
import { stringify } from "../../json.js";
|
5
6
|
import { hashEntryERC1155 } from "./hash-entry-erc1155.js";
|
6
7
|
import type {
|
7
8
|
ShardDataERC1155,
|
@@ -54,7 +55,7 @@ export async function processSnapshotERC1155(options: {
|
|
54
55
|
entries,
|
55
56
|
};
|
56
57
|
shardsToUpload.push({
|
57
|
-
data:
|
58
|
+
data: stringify(data),
|
58
59
|
name: `${shardId}.json`,
|
59
60
|
});
|
60
61
|
}
|
@@ -74,7 +75,7 @@ export async function processSnapshotERC1155(options: {
|
|
74
75
|
// 6. Also upload the original entries for retrieving all entries
|
75
76
|
const originalEntriesUri = await upload({
|
76
77
|
client: options.client,
|
77
|
-
files: [
|
78
|
+
files: [stringify(options.snapshot)],
|
78
79
|
});
|
79
80
|
// 7. assmeble the final sharded merkle tree info
|
80
81
|
const shardedMerkleInfo: ShardedMerkleTreeInfo = {
|
@@ -2,6 +2,7 @@ import type { ThirdwebClient } from "../../../client/client.js";
|
|
2
2
|
import { MerkleTree } from "../../../merkletree/MerkleTree.js";
|
3
3
|
import { upload } from "../../../storage/upload.js";
|
4
4
|
import type { Hex } from "../../encoding/hex.js";
|
5
|
+
import { stringify } from "../../json.js";
|
5
6
|
import { hashEntryERC20 } from "./hash-entry-erc20.js";
|
6
7
|
import type {
|
7
8
|
ShardDataERC20,
|
@@ -56,7 +57,7 @@ export async function processSnapshotERC20(options: {
|
|
56
57
|
entries,
|
57
58
|
};
|
58
59
|
shardsToUpload.push({
|
59
|
-
data:
|
60
|
+
data: stringify(data),
|
60
61
|
name: `${shardId}.json`,
|
61
62
|
});
|
62
63
|
}
|
@@ -76,7 +77,7 @@ export async function processSnapshotERC20(options: {
|
|
76
77
|
// 6. Also upload the original entries for retrieving all entries
|
77
78
|
const originalEntriesUri = await upload({
|
78
79
|
client: options.client,
|
79
|
-
files: [
|
80
|
+
files: [stringify(options.snapshot)],
|
80
81
|
});
|
81
82
|
// 7. assmeble the final sharded merkle tree info
|
82
83
|
const shardedMerkleInfo: ShardedMerkleTreeInfo = {
|
@@ -2,6 +2,7 @@ import type { ThirdwebClient } from "../../../client/client.js";
|
|
2
2
|
import { MerkleTree } from "../../../merkletree/MerkleTree.js";
|
3
3
|
import { upload } from "../../../storage/upload.js";
|
4
4
|
import type { Hex } from "../../encoding/hex.js";
|
5
|
+
import { stringify } from "../../json.js";
|
5
6
|
import { hashEntryERC721 } from "./hash-entry-erc721.js";
|
6
7
|
import type {
|
7
8
|
ShardDataERC721,
|
@@ -54,7 +55,7 @@ export async function processSnapshotERC721(options: {
|
|
54
55
|
entries,
|
55
56
|
};
|
56
57
|
shardsToUpload.push({
|
57
|
-
data:
|
58
|
+
data: stringify(data),
|
58
59
|
name: `${shardId}.json`,
|
59
60
|
});
|
60
61
|
}
|
@@ -74,7 +75,7 @@ export async function processSnapshotERC721(options: {
|
|
74
75
|
// 6. Also upload the original entries for retrieving all entries
|
75
76
|
const originalEntriesUri = await upload({
|
76
77
|
client: options.client,
|
77
|
-
files: [
|
78
|
+
files: [stringify(options.snapshot)],
|
78
79
|
});
|
79
80
|
// 7. assmeble the final sharded merkle tree info
|
80
81
|
const shardedMerkleInfo: ShardedMerkleTreeInfo = {
|
@@ -3,6 +3,7 @@ import type { ThirdwebClient } from "../../../client/client.js";
|
|
3
3
|
import { MerkleTree } from "../../../merkletree/MerkleTree.js";
|
4
4
|
import { upload } from "../../../storage/upload.js";
|
5
5
|
import type { Hex } from "../../encoding/hex.js";
|
6
|
+
import { stringify } from "../../json.js";
|
6
7
|
import { hashEntry } from "./hash-entry.js";
|
7
8
|
import type {
|
8
9
|
OverrideEntry,
|
@@ -67,7 +68,7 @@ export async function processOverrideList(options: {
|
|
67
68
|
entries,
|
68
69
|
};
|
69
70
|
shardsToUpload.push({
|
70
|
-
data:
|
71
|
+
data: stringify(data),
|
71
72
|
name: `${shardId}.json`,
|
72
73
|
});
|
73
74
|
}
|
@@ -87,7 +88,7 @@ export async function processOverrideList(options: {
|
|
87
88
|
// 6. Also upload the original entries for retrieving all entries
|
88
89
|
const originalEntriesUri = await upload({
|
89
90
|
client: options.client,
|
90
|
-
files: [
|
91
|
+
files: [stringify(options.overrides)],
|
91
92
|
});
|
92
93
|
// 7. assmeble the final sharded merkle tree info
|
93
94
|
const shardedMerkleInfo: ShardedMerkleTreeInfo = {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Account } from "../../wallets/interfaces/wallet.js";
|
2
2
|
import { stringToBytes } from "../encoding/to-bytes.js";
|
3
|
+
import { stringify } from "../json.js";
|
3
4
|
import { randomBytesHex } from "../random.js";
|
4
5
|
import { uint8ArrayToBase64 } from "../uint8-array.js";
|
5
6
|
import { PRECOMPILED_B64_ENCODED_JWT_HEADER } from "./jwt-header.js";
|
@@ -47,14 +48,13 @@ type EncodeJWTParams = { payload: JWTPayloadInput; account: Account };
|
|
47
48
|
*/
|
48
49
|
export async function encodeJWT(options: EncodeJWTParams) {
|
49
50
|
const payload = await ensureJWTPayload(options.payload);
|
50
|
-
const message =
|
51
|
+
const message = stringify(payload);
|
51
52
|
|
52
53
|
const signature = await options.account.signMessage({ message });
|
53
54
|
|
54
|
-
const encodedData = uint8ArrayToBase64(
|
55
|
-
|
56
|
-
|
57
|
-
);
|
55
|
+
const encodedData = uint8ArrayToBase64(stringToBytes(message), {
|
56
|
+
urlSafe: true,
|
57
|
+
});
|
58
58
|
|
59
59
|
const encodedSignature = uint8ArrayToBase64(stringToBytes(signature), {
|
60
60
|
urlSafe: true,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
2
2
|
import { TEST_CLIENT } from "~test/test-clients.js";
|
3
|
+
import { stringify } from "../json.js";
|
3
4
|
import {
|
4
5
|
type FetchTokenMetadataOptions,
|
5
6
|
fetchTokenMetadata,
|
@@ -9,7 +10,7 @@ describe("fetchTokenMetadata", () => {
|
|
9
10
|
it("should return a json object from a valid base64 encoded json", async () => {
|
10
11
|
const validJson = { foo: "bar" };
|
11
12
|
const validBase64Json = `data:application/json;base64,${btoa(
|
12
|
-
|
13
|
+
stringify(validJson),
|
13
14
|
)}`;
|
14
15
|
|
15
16
|
const options: FetchTokenMetadataOptions = {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { stringify } from "../json.js";
|
1
2
|
import type { AsyncStorage } from "./AsyncStorage.js";
|
2
3
|
|
3
4
|
const CONNECT_PARAMS_MAP_KEY = "tw:connected-wallet-params";
|
@@ -39,7 +40,7 @@ export async function saveConnectParamsToStorage<T extends object>(
|
|
39
40
|
};
|
40
41
|
}
|
41
42
|
|
42
|
-
storage.setItem(CONNECT_PARAMS_MAP_KEY,
|
43
|
+
storage.setItem(CONNECT_PARAMS_MAP_KEY, stringify(value));
|
43
44
|
}
|
44
45
|
|
45
46
|
/**
|
@@ -67,7 +68,7 @@ export async function deleteConnectParamsFromStorage(
|
|
67
68
|
}
|
68
69
|
|
69
70
|
delete value[walletId];
|
70
|
-
storage.setItem(CONNECT_PARAMS_MAP_KEY,
|
71
|
+
storage.setItem(CONNECT_PARAMS_MAP_KEY, stringify(value));
|
71
72
|
}
|
72
73
|
}
|
73
74
|
|
@@ -100,7 +101,7 @@ export async function getSavedConnectParamsFromStorage<T extends object>(
|
|
100
101
|
|
101
102
|
function isStringifiable(value: unknown): boolean {
|
102
103
|
try {
|
103
|
-
|
104
|
+
stringify(value);
|
104
105
|
return true;
|
105
106
|
} catch {
|
106
107
|
return false;
|
package/src/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = "5.
|
1
|
+
export const version = "5.65.0-nightly-06604162a11d99ff119bbf427a24b9a7d82c1575-20241103000408";
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
3
|
+
import { stringify } from "../../../../utils/json.js";
|
3
4
|
import { ROUTE_AUTH_ENDPOINT_CALLBACK } from "../../native/helpers/constants.js";
|
4
5
|
import { createErrorMessage } from "../../native/helpers/errors.js";
|
5
6
|
import type { Ecosystem } from "../wallet/types.js";
|
@@ -17,7 +18,7 @@ export async function authEndpoint(args: {
|
|
17
18
|
headers: {
|
18
19
|
"Content-Type": "application/json",
|
19
20
|
},
|
20
|
-
body:
|
21
|
+
body: stringify({
|
21
22
|
payload: args.payload,
|
22
23
|
developerClientId: args.client.clientId,
|
23
24
|
}),
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
3
|
+
import { stringify } from "../../../../utils/json.js";
|
3
4
|
import { randomBytesHex } from "../../../../utils/random.js";
|
4
5
|
import type { AsyncStorage } from "../../../../utils/storage/AsyncStorage.js";
|
5
6
|
import type { Ecosystem } from "../wallet/types.js";
|
@@ -39,7 +40,7 @@ export async function guestAuthenticate(args: {
|
|
39
40
|
headers: {
|
40
41
|
"Content-Type": "application/json",
|
41
42
|
},
|
42
|
-
body:
|
43
|
+
body: stringify({
|
43
44
|
sessionId,
|
44
45
|
}),
|
45
46
|
});
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
3
|
+
import { stringify } from "../../../../utils/json.js";
|
3
4
|
import { ROUTE_AUTH_JWT_CALLBACK } from "../../native/helpers/constants.js";
|
4
5
|
import { createErrorMessage } from "../../native/helpers/errors.js";
|
5
6
|
import type { Ecosystem } from "../wallet/types.js";
|
@@ -17,7 +18,7 @@ export async function customJwt(args: {
|
|
17
18
|
headers: {
|
18
19
|
"Content-Type": "application/json",
|
19
20
|
},
|
20
|
-
body:
|
21
|
+
body: stringify({
|
21
22
|
jwt: args.jwt,
|
22
23
|
developerClientId: args.client.clientId,
|
23
24
|
}),
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
3
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
4
|
+
import { stringify } from "../../../../utils/json.js";
|
4
5
|
import type { Ecosystem } from "../wallet/types.js";
|
5
6
|
import type { ClientScopedStorage } from "./client-scoped-storage.js";
|
6
7
|
import type { Profile } from "./types.js";
|
@@ -40,7 +41,7 @@ export async function linkAccount({
|
|
40
41
|
{
|
41
42
|
method: "POST",
|
42
43
|
headers,
|
43
|
-
body:
|
44
|
+
body: stringify({
|
44
45
|
accountAuthTokenToConnect: tokenToLink,
|
45
46
|
}),
|
46
47
|
},
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
2
|
import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
3
3
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
4
|
+
import { stringify } from "../../../../utils/json.js";
|
4
5
|
import type { Ecosystem } from "../wallet/types.js";
|
5
6
|
import type { ClientScopedStorage } from "./client-scoped-storage.js";
|
6
7
|
import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
|
@@ -96,7 +97,7 @@ export async function registerPasskey(options: {
|
|
96
97
|
"Content-Type": "application/json",
|
97
98
|
...customHeaders,
|
98
99
|
},
|
99
|
-
body:
|
100
|
+
body: stringify({
|
100
101
|
type: "sign-up",
|
101
102
|
authenticatorData: registration.authenticatorData,
|
102
103
|
credentialId: registration.credentialId,
|
@@ -166,7 +167,7 @@ export async function loginWithPasskey(options: {
|
|
166
167
|
"Content-Type": "application/json",
|
167
168
|
...customHeaders,
|
168
169
|
},
|
169
|
-
body:
|
170
|
+
body: stringify({
|
170
171
|
type: "sign-in",
|
171
172
|
authenticatorData: authentication.authenticatorData,
|
172
173
|
credentialId: authentication.credentialId,
|
@@ -3,6 +3,7 @@ import type { LoginPayload } from "../../../../auth/core/types.js";
|
|
3
3
|
import type { Chain } from "../../../../chains/types.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
5
|
import { getClientFetch } from "../../../../utils/fetch.js";
|
6
|
+
import { stringify } from "../../../../utils/json.js";
|
6
7
|
import type { Wallet } from "../../../interfaces/wallet.js";
|
7
8
|
import type { Ecosystem } from "../wallet/types.js";
|
8
9
|
import { getLoginCallbackUrl, getLoginUrl } from "./getLoginPath.js";
|
@@ -50,7 +51,7 @@ export async function siweAuthenticate(args: {
|
|
50
51
|
headers: {
|
51
52
|
"Content-Type": "application/json",
|
52
53
|
},
|
53
|
-
body:
|
54
|
+
body: stringify({
|
54
55
|
signature,
|
55
56
|
payload,
|
56
57
|
}),
|
@@ -2,6 +2,7 @@ import { trackConnect } from "../../../../analytics/track/connect.js";
|
|
2
2
|
import type { Chain } from "../../../../chains/types.js";
|
3
3
|
import { getCachedChainIfExists } from "../../../../chains/utils.js";
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
5
|
+
import { stringify } from "../../../../utils/json.js";
|
5
6
|
import { getEcosystemInfo } from "../../../ecosystem/get-ecosystem-wallet-auth-options.js";
|
6
7
|
import type { Account, Wallet } from "../../../interfaces/wallet.js";
|
7
8
|
import { createWalletEmitter } from "../../../wallet-emitter.js";
|
@@ -22,7 +23,7 @@ export async function getOrCreateInAppWalletConnector(
|
|
22
23
|
connectorFactory: (client: ThirdwebClient) => Promise<InAppConnector>,
|
23
24
|
ecosystem?: Ecosystem,
|
24
25
|
) {
|
25
|
-
const key =
|
26
|
+
const key = stringify({ clientId: client.clientId, ecosystem });
|
26
27
|
if (connectorCache.has(key)) {
|
27
28
|
return connectorCache.get(key) as InAppConnector;
|
28
29
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../client/client.js";
|
2
2
|
import type { Hex } from "../../../../../utils/encoding/hex.js";
|
3
3
|
import { getClientFetch } from "../../../../../utils/fetch.js";
|
4
|
+
import { stringify } from "../../../../../utils/json.js";
|
4
5
|
import { randomBytesHex } from "../../../../../utils/random.js";
|
5
6
|
import type { ClientScopedStorage } from "../../../core/authentication/client-scoped-storage.js";
|
6
7
|
import type { UserDetailsApiType } from "../../../core/authentication/types.js";
|
@@ -35,7 +36,7 @@ export const verifyClientId = async (client: ThirdwebClient) => {
|
|
35
36
|
headers: {
|
36
37
|
...getSessionHeaders(),
|
37
38
|
},
|
38
|
-
body:
|
39
|
+
body: stringify({ clientId: client.clientId, parentDomain: "" }),
|
39
40
|
});
|
40
41
|
if (!resp.ok) {
|
41
42
|
const error = await resp.json();
|
@@ -155,7 +156,7 @@ export async function storeUserShares({
|
|
155
156
|
props: {
|
156
157
|
method: "POST",
|
157
158
|
headers: { "Content-Type": "application/json" },
|
158
|
-
body:
|
159
|
+
body: stringify({
|
159
160
|
walletAddress,
|
160
161
|
maybeEncryptedRecoveryShares,
|
161
162
|
authShare,
|
@@ -168,7 +169,7 @@ export async function storeUserShares({
|
|
168
169
|
const error = await resp.json();
|
169
170
|
|
170
171
|
throw new Error(
|
171
|
-
`Something went wrong storing user wallet shares: ${
|
172
|
+
`Something went wrong storing user wallet shares: ${stringify(
|
172
173
|
error.message,
|
173
174
|
null,
|
174
175
|
2,
|
@@ -193,7 +194,7 @@ export async function getUserShares(args: {
|
|
193
194
|
if (!resp.ok) {
|
194
195
|
const error = await resp.json();
|
195
196
|
throw new Error(
|
196
|
-
`Something went wrong getting user's wallet: ${
|
197
|
+
`Something went wrong getting user's wallet: ${stringify(
|
197
198
|
error.message,
|
198
199
|
null,
|
199
200
|
2,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { stringify } from "../../../../utils/json.js";
|
2
|
+
|
1
3
|
export const ErrorMessages = {
|
2
4
|
invalidOtp:
|
3
5
|
"Your OTP code is invalid or expired. Please request a new code or try again.",
|
@@ -8,5 +10,5 @@ export const createErrorMessage = (message: string, error: unknown): string => {
|
|
8
10
|
if (error instanceof Error) {
|
9
11
|
return `${message}: ${error.message}`;
|
10
12
|
}
|
11
|
-
return `${message}: ${
|
13
|
+
return `${message}: ${stringify(error)}`;
|
12
14
|
};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
2
|
+
import { stringify } from "../../../../../utils/json.js";
|
2
3
|
import {
|
3
4
|
DEVICE_SHARE_LOCAL_STORAGE_NAME,
|
4
5
|
WALLET_USER_DETAILS_LOCAL_STORAGE_NAME,
|
@@ -65,7 +66,7 @@ export async function setWallerUserDetails({
|
|
65
66
|
await setItemInAsyncStorage(
|
66
67
|
// ! Keep this in sync with getWalletUserDetails function below
|
67
68
|
name,
|
68
|
-
|
69
|
+
stringify({ userId, email: newEmail }),
|
69
70
|
);
|
70
71
|
}
|
71
72
|
|