diff --git a/.changeset/quick-queens-love.md b/.changeset/quick-queens-love.md new file mode 100644 index 00000000000..8658390587a --- /dev/null +++ b/.changeset/quick-queens-love.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fixes account logout state diff --git a/packages/thirdweb/src/extensions/erc1155/drop1155.test.ts b/packages/thirdweb/src/extensions/erc1155/drop1155.test.ts index b4523e897bd..138e208a21d 100644 --- a/packages/thirdweb/src/extensions/erc1155/drop1155.test.ts +++ b/packages/thirdweb/src/extensions/erc1155/drop1155.test.ts @@ -206,10 +206,10 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 0,1 contract: ${contract.address} - chainId: 31337] + chainId: ${contract.chain.id}] `); }); @@ -247,7 +247,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 1,2 contract: ${contract.address} chainId: ${contract.chain.id}] @@ -378,7 +378,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( account: TEST_ACCOUNT_D, }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 1,2 contract: ${contract.address} chainId: ${contract.chain.id}] diff --git a/packages/thirdweb/src/extensions/erc20/drop20.test.ts b/packages/thirdweb/src/extensions/erc20/drop20.test.ts index 58597a6de3a..baa121ec9da 100644 --- a/packages/thirdweb/src/extensions/erc20/drop20.test.ts +++ b/packages/thirdweb/src/extensions/erc20/drop20.test.ts @@ -212,10 +212,10 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 0,1000000000000000000 contract: ${contract.address} - chainId: 31337] + chainId: ${contract.chain.id}] `); }); @@ -262,7 +262,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 3000000000000000000,4000000000000000000 contract: ${contract.address} chainId: ${contract.chain.id}] @@ -421,7 +421,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( account: TEST_ACCOUNT_D, }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 1,2 contract: ${contract.address} chainId: ${contract.chain.id}] diff --git a/packages/thirdweb/src/extensions/erc721/drop721.test.ts b/packages/thirdweb/src/extensions/erc721/drop721.test.ts index 369925665b3..eca4bedd9a0 100644 --- a/packages/thirdweb/src/extensions/erc721/drop721.test.ts +++ b/packages/thirdweb/src/extensions/erc721/drop721.test.ts @@ -237,10 +237,10 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 0,1 contract: ${contract.address} - chainId: 31337] + chainId: ${contract.chain.id}] `); }); @@ -279,7 +279,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( }), }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 3,4 contract: ${contract.address} chainId: ${contract.chain.id}] @@ -405,7 +405,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( account: TEST_ACCOUNT_D, }), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [TransactionError: Error - !Qty + [TransactionError: DropClaimExceedLimit - 1,2 contract: ${contract.address} chainId: ${contract.chain.id}] diff --git a/packages/thirdweb/src/extensions/prebuilts/deploy-published.test.ts b/packages/thirdweb/src/extensions/prebuilts/deploy-published.test.ts index 4553ff017ce..a1392036256 100644 --- a/packages/thirdweb/src/extensions/prebuilts/deploy-published.test.ts +++ b/packages/thirdweb/src/extensions/prebuilts/deploy-published.test.ts @@ -93,7 +93,7 @@ describe.runIf(process.env.TW_SECRET_KEY)( }, salt: "test", }); - expect(address).toBe("0x777151741260F8d4098dD492e45FdB536F442672"); + expect(address).toBe("0x9A18AD1DdCfA00009C2db7dc78a5746d85feF759"); const isDeployed = await isContractDeployed({ client: TEST_CLIENT, chain: ANVIL_CHAIN, diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx index 2621c3abc3c..923ba456764 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx @@ -1075,7 +1075,10 @@ function InAppWalletUserInfo(props: { const { data: walletInfo } = useWalletInfo(activeWallet?.id); const isSmartWallet = hasSmartAccount(activeWallet); const { data: walletName } = useQuery({ - queryKey: [activeWallet?.id, "wallet-name"], + queryKey: [ + "wallet-name", + { walletId: activeWallet?.id, walletAddress: account?.address }, + ], queryFn: async () => { const lastAuthProvider = await getLastAuthProvider(webLocalStorage); if (lastAuthProvider === "guest") { diff --git a/packages/thirdweb/src/wallets/in-app/web/lib/auth/iframe-auth.ts b/packages/thirdweb/src/wallets/in-app/web/lib/auth/iframe-auth.ts index 8d4742edec4..6d7a94dd312 100644 --- a/packages/thirdweb/src/wallets/in-app/web/lib/auth/iframe-auth.ts +++ b/packages/thirdweb/src/wallets/in-app/web/lib/auth/iframe-auth.ts @@ -321,6 +321,13 @@ export class Auth { * @internal */ async logout(): Promise { + if (this.AuthQuerier) { + await this.AuthQuerier.call({ + procedureName: "logout", + params: undefined, + }); + } + const isRemoveAuthCookie = await this.localStorage.removeAuthCookie(); const isRemoveUserId = await this.localStorage.removeWalletUserId();