thirdweb 5.64.4-nightly-043ee925981bdc39649d30ad65d2fce922515ab0-20241030000335 → 5.64.4-nightly-c2a90542d7f870c799c297c59cd2b468816f7939-20241031000332

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.
Files changed (116) hide show
  1. package/dist/cjs/exports/wallets/smart.js +2 -1
  2. package/dist/cjs/exports/wallets/smart.js.map +1 -1
  3. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
  4. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  5. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
  6. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  7. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
  8. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  9. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
  10. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  11. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
  12. package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
  13. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
  14. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  15. package/dist/cjs/transaction/prepare-contract-call.js +23 -0
  16. package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
  17. package/dist/cjs/utils/url.js +8 -0
  18. package/dist/cjs/utils/url.js.map +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js +7 -6
  21. package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
  22. package/dist/cjs/wallets/in-app/core/authentication/guest.js +17 -20
  23. package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
  24. package/dist/cjs/wallets/in-app/core/authentication/jwt.js +7 -6
  25. package/dist/cjs/wallets/in-app/core/authentication/jwt.js.map +1 -1
  26. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +0 -1
  27. package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  28. package/dist/cjs/wallets/in-app/native/native-connector.js +2 -2
  29. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  30. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +17 -20
  31. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  32. package/dist/cjs/wallets/smart/lib/calls.js +31 -0
  33. package/dist/cjs/wallets/smart/lib/calls.js.map +1 -1
  34. package/dist/cjs/wallets/smart/lib/userop.js +1 -0
  35. package/dist/cjs/wallets/smart/lib/userop.js.map +1 -1
  36. package/dist/esm/exports/wallets/smart.js +1 -1
  37. package/dist/esm/exports/wallets/smart.js.map +1 -1
  38. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
  39. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  40. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
  41. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  42. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
  43. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
  44. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
  45. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  46. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
  47. package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
  48. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
  49. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  50. package/dist/esm/transaction/prepare-contract-call.js +23 -0
  51. package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
  52. package/dist/esm/utils/url.js +6 -0
  53. package/dist/esm/utils/url.js.map +1 -1
  54. package/dist/esm/version.js +1 -1
  55. package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js +7 -6
  56. package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
  57. package/dist/esm/wallets/in-app/core/authentication/guest.js +17 -20
  58. package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
  59. package/dist/esm/wallets/in-app/core/authentication/jwt.js +7 -6
  60. package/dist/esm/wallets/in-app/core/authentication/jwt.js.map +1 -1
  61. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +1 -1
  62. package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
  63. package/dist/esm/wallets/in-app/native/native-connector.js +2 -2
  64. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  65. package/dist/esm/wallets/in-app/web/lib/web-connector.js +17 -20
  66. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  67. package/dist/esm/wallets/smart/lib/calls.js +30 -0
  68. package/dist/esm/wallets/smart/lib/calls.js.map +1 -1
  69. package/dist/esm/wallets/smart/lib/userop.js +1 -0
  70. package/dist/esm/wallets/smart/lib/userop.js.map +1 -1
  71. package/dist/types/exports/wallets/smart.d.ts +1 -1
  72. package/dist/types/exports/wallets/smart.d.ts.map +1 -1
  73. package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
  74. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  75. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
  76. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
  77. package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts.map +1 -1
  78. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
  79. package/dist/types/transaction/prepare-contract-call.d.ts +23 -0
  80. package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
  81. package/dist/types/utils/url.d.ts +2 -0
  82. package/dist/types/utils/url.d.ts.map +1 -1
  83. package/dist/types/version.d.ts +1 -1
  84. package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts +2 -2
  85. package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts.map +1 -1
  86. package/dist/types/wallets/in-app/core/authentication/guest.d.ts.map +1 -1
  87. package/dist/types/wallets/in-app/core/authentication/jwt.d.ts +2 -2
  88. package/dist/types/wallets/in-app/core/authentication/jwt.d.ts.map +1 -1
  89. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts +0 -4
  90. package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
  91. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
  92. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  93. package/dist/types/wallets/smart/lib/calls.d.ts +27 -1
  94. package/dist/types/wallets/smart/lib/calls.d.ts.map +1 -1
  95. package/dist/types/wallets/smart/lib/userop.d.ts.map +1 -1
  96. package/package.json +1 -1
  97. package/src/exports/wallets/smart.ts +4 -1
  98. package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +5 -1
  99. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +9 -2
  100. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +5 -3
  101. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +13 -3
  102. package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +2 -1
  103. package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +5 -1
  104. package/src/transaction/prepare-contract-call.ts +23 -0
  105. package/src/utils/url.ts +8 -0
  106. package/src/version.ts +1 -1
  107. package/src/wallets/in-app/core/authentication/authEndpoint.ts +11 -8
  108. package/src/wallets/in-app/core/authentication/guest.ts +16 -19
  109. package/src/wallets/in-app/core/authentication/jwt.ts +11 -8
  110. package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -1
  111. package/src/wallets/in-app/native/native-connector.ts +2 -2
  112. package/src/wallets/in-app/web/lib/web-connector.ts +20 -20
  113. package/src/wallets/smart/lib/calls.ts +42 -1
  114. package/src/wallets/smart/lib/userop.ts +1 -0
  115. package/src/wallets/smart/smart-wallet-integration-v07.test.ts +8 -0
  116. package/src/wallets/smart/smart-wallet-integration.test.ts +7 -0
@@ -1,34 +1,37 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
- import { getSessionHeaders } from "../../native/helpers/api/fetchers.js";
2
+ import { getClientFetch } from "../../../../utils/fetch.js";
3
3
  import { ROUTE_AUTH_ENDPOINT_CALLBACK } from "../../native/helpers/constants.js";
4
4
  import { createErrorMessage } from "../../native/helpers/errors.js";
5
- import type { ClientScopedStorage } from "./client-scoped-storage.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
7
7
 
8
8
  export async function authEndpoint(args: {
9
9
  payload: string;
10
10
  client: ThirdwebClient;
11
- storage: ClientScopedStorage;
11
+ ecosystem?: Ecosystem;
12
12
  }): Promise<AuthStoredTokenWithCookieReturnType> {
13
- const resp = await fetch(ROUTE_AUTH_ENDPOINT_CALLBACK, {
13
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
14
+
15
+ const res = await clientFetch(ROUTE_AUTH_ENDPOINT_CALLBACK, {
14
16
  method: "POST",
15
17
  headers: {
16
- ...getSessionHeaders(),
18
+ "Content-Type": "application/json",
17
19
  },
18
20
  body: JSON.stringify({
19
21
  payload: args.payload,
20
22
  developerClientId: args.client.clientId,
21
23
  }),
22
24
  });
23
- if (!resp.ok) {
24
- const error = await resp.json();
25
+
26
+ if (!res.ok) {
27
+ const error = await res.json();
25
28
  throw new Error(
26
29
  `Custom auth endpoint authentication error: ${error.message}`,
27
30
  );
28
31
  }
29
32
 
30
33
  try {
31
- const { verifiedToken } = await resp.json();
34
+ const { verifiedToken } = await res.json();
32
35
 
33
36
  return { storedToken: verifiedToken };
34
37
  } catch (e) {
@@ -29,25 +29,22 @@ export async function guestAuthenticate(args: {
29
29
  }
30
30
 
31
31
  const clientFetch = getClientFetch(args.client, args.ecosystem);
32
- const authResult = await (async () => {
33
- const path = getLoginCallbackUrl({
34
- authOption: "guest",
35
- client: args.client,
36
- ecosystem: args.ecosystem,
37
- });
38
- const res = await clientFetch(`${path}`, {
39
- method: "POST",
40
- headers: {
41
- "Content-Type": "application/json",
42
- },
43
- body: JSON.stringify({
44
- sessionId,
45
- }),
46
- });
32
+ const path = getLoginCallbackUrl({
33
+ authOption: "guest",
34
+ client: args.client,
35
+ ecosystem: args.ecosystem,
36
+ });
37
+ const res = await clientFetch(`${path}`, {
38
+ method: "POST",
39
+ headers: {
40
+ "Content-Type": "application/json",
41
+ },
42
+ body: JSON.stringify({
43
+ sessionId,
44
+ }),
45
+ });
47
46
 
48
- if (!res.ok) throw new Error("Failed to generate guest account");
47
+ if (!res.ok) throw new Error("Failed to generate guest account");
49
48
 
50
- return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
51
- })();
52
- return authResult;
49
+ return (await res.json()) satisfies AuthStoredTokenWithCookieReturnType;
53
50
  }
@@ -1,19 +1,21 @@
1
1
  import type { ThirdwebClient } from "../../../../client/client.js";
2
- import { getSessionHeaders } from "../../native/helpers/api/fetchers.js";
2
+ import { getClientFetch } from "../../../../utils/fetch.js";
3
3
  import { ROUTE_AUTH_JWT_CALLBACK } from "../../native/helpers/constants.js";
4
4
  import { createErrorMessage } from "../../native/helpers/errors.js";
5
- import type { ClientScopedStorage } from "./client-scoped-storage.js";
5
+ import type { Ecosystem } from "../wallet/types.js";
6
6
  import type { AuthStoredTokenWithCookieReturnType } from "./types.js";
7
7
 
8
8
  export async function customJwt(args: {
9
9
  jwt: string;
10
10
  client: ThirdwebClient;
11
- storage: ClientScopedStorage;
11
+ ecosystem?: Ecosystem;
12
12
  }): Promise<AuthStoredTokenWithCookieReturnType> {
13
- const resp = await fetch(ROUTE_AUTH_JWT_CALLBACK, {
13
+ const clientFetch = getClientFetch(args.client, args.ecosystem);
14
+
15
+ const res = await clientFetch(ROUTE_AUTH_JWT_CALLBACK, {
14
16
  method: "POST",
15
17
  headers: {
16
- ...getSessionHeaders(),
18
+ "Content-Type": "application/json",
17
19
  },
18
20
  body: JSON.stringify({
19
21
  jwt: args.jwt,
@@ -21,13 +23,14 @@ export async function customJwt(args: {
21
23
  }),
22
24
  });
23
25
 
24
- if (!resp.ok) {
25
- const error = await resp.json();
26
+ if (!res.ok) {
27
+ const error = await res.json();
26
28
  throw new Error(`JWT authentication error: ${error.message}`);
27
29
  }
28
30
 
29
31
  try {
30
- const { verifiedToken } = await resp.json();
32
+ const { verifiedToken } = await res.json();
33
+
31
34
  return { storedToken: verifiedToken };
32
35
  } catch (e) {
33
36
  throw new Error(
@@ -19,7 +19,7 @@ const ECOSYSTEM_PARTNER_ID_HEADER = "x-ecosystem-partner-id";
19
19
 
20
20
  let sessionNonce: Hex | undefined = undefined;
21
21
 
22
- export function getSessionHeaders() {
22
+ function getSessionHeaders() {
23
23
  if (!sessionNonce) {
24
24
  sessionNonce = randomBytesHex(16);
25
25
  }
@@ -199,13 +199,13 @@ export class InAppNativeConnector implements InAppConnector {
199
199
  return customJwt({
200
200
  jwt: params.jwt,
201
201
  client: this.client,
202
- storage: this.storage,
202
+ ecosystem: this.ecosystem,
203
203
  });
204
204
  case "auth_endpoint":
205
205
  return authEndpoint({
206
206
  payload: params.payload,
207
207
  client: this.client,
208
- storage: this.storage,
208
+ ecosystem: this.ecosystem,
209
209
  });
210
210
  default:
211
211
  throw new Error(`Unsupported authentication type: ${strategy}`);
@@ -4,8 +4,10 @@ import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
4
4
  import type { SocialAuthOption } from "../../../../wallets/types.js";
5
5
  import type { Account } from "../../../interfaces/wallet.js";
6
6
  import { getUserStatus } from "../../core/actions/get-enclave-user-status.js";
7
+ import { authEndpoint } from "../../core/authentication/authEndpoint.js";
7
8
  import { ClientScopedStorage } from "../../core/authentication/client-scoped-storage.js";
8
9
  import { guestAuthenticate } from "../../core/authentication/guest.js";
10
+ import { customJwt } from "../../core/authentication/jwt.js";
9
11
  import {
10
12
  getLinkedProfilesInternal,
11
13
  linkAccount,
@@ -268,8 +270,11 @@ export class InAppWebConnector implements InAppConnector {
268
270
  });
269
271
  }
270
272
 
271
- async loginWithAuthToken(authResult: AuthStoredTokenWithCookieReturnType) {
272
- return this.auth.loginWithAuthToken(authResult);
273
+ async loginWithAuthToken(
274
+ authResult: AuthStoredTokenWithCookieReturnType,
275
+ recoveryCode?: string,
276
+ ) {
277
+ return this.auth.loginWithAuthToken(authResult, recoveryCode);
273
278
  }
274
279
 
275
280
  /**
@@ -292,20 +297,22 @@ export class InAppWebConnector implements InAppConnector {
292
297
  client: this.client,
293
298
  ecosystem: this.ecosystem,
294
299
  });
300
+ case "auth_endpoint": {
301
+ return authEndpoint({
302
+ payload: args.payload,
303
+ client: this.client,
304
+ ecosystem: this.ecosystem,
305
+ });
306
+ }
295
307
  case "jwt":
296
- return this.auth.authenticateWithCustomJwt({
308
+ return customJwt({
297
309
  jwt: args.jwt,
298
- encryptionKey: args.encryptionKey,
310
+ client: this.client,
311
+ ecosystem: this.ecosystem,
299
312
  });
300
313
  case "passkey": {
301
314
  return this.passkeyAuth(args);
302
315
  }
303
- case "auth_endpoint": {
304
- return this.auth.authenticateWithCustomAuthEndpoint({
305
- payload: args.payload,
306
- encryptionKey: args.encryptionKey,
307
- });
308
- }
309
316
  case "iframe_email_verification": {
310
317
  return this.auth.authenticateWithIframe({
311
318
  email: args.email,
@@ -359,17 +366,10 @@ export class InAppWebConnector implements InAppConnector {
359
366
  ): Promise<AuthLoginReturnType> {
360
367
  const strategy = args.strategy;
361
368
  switch (strategy) {
369
+ case "auth_endpoint":
362
370
  case "jwt": {
363
- return this.auth.loginWithCustomJwt({
364
- jwt: args.jwt,
365
- encryptionKey: args.encryptionKey,
366
- });
367
- }
368
- case "auth_endpoint": {
369
- return this.auth.loginWithCustomAuthEndpoint({
370
- payload: args.payload,
371
- encryptionKey: args.encryptionKey,
372
- });
371
+ const authToken = await this.authenticate(args);
372
+ return await this.loginWithAuthToken(authToken, args.encryptionKey);
373
373
  }
374
374
  case "iframe_email_verification": {
375
375
  return this.auth.loginWithIframe({
@@ -1,9 +1,49 @@
1
- import type { ThirdwebContract } from "../../../contract/contract.js";
1
+ import type { Chain } from "../../../chains/types.js";
2
+ import type { ThirdwebClient } from "../../../client/client.js";
3
+ import {
4
+ type ThirdwebContract,
5
+ getContract,
6
+ } from "../../../contract/contract.js";
2
7
  import { prepareContractCall } from "../../../transaction/prepare-contract-call.js";
3
8
  import type { PreparedTransaction } from "../../../transaction/prepare-transaction.js";
4
9
  import { readContract } from "../../../transaction/read-contract.js";
5
10
  import { isHex, stringToHex } from "../../../utils/encoding/hex.js";
6
11
  import type { SendTransactionOption } from "../../interfaces/wallet.js";
12
+ import { DEFAULT_ACCOUNT_FACTORY_V0_6 } from "./constants.js";
13
+
14
+ /**
15
+ * Predict the address of a smart account.
16
+ * @param args - The options for predicting the address of a smart account.
17
+ * @returns The predicted address of the smart account.
18
+ * @example
19
+ * ```ts
20
+ * import { predictSmartAccountAddress } from "thirdweb/wallets/smart";
21
+ *
22
+ * const predictedAddress = await predictSmartAccountAddress({
23
+ * client,
24
+ * chain,
25
+ * adminAddress,
26
+ * });
27
+ * ```
28
+ * @walletUtils
29
+ */
30
+ export async function predictSmartAccountAddress(args: {
31
+ client: ThirdwebClient;
32
+ chain: Chain;
33
+ adminAddress: string;
34
+ factoryAddress?: string;
35
+ accountSalt?: string;
36
+ }): Promise<string> {
37
+ return predictAddress({
38
+ adminAddress: args.adminAddress,
39
+ accountSalt: args.accountSalt,
40
+ factoryContract: getContract({
41
+ address: args.factoryAddress ?? DEFAULT_ACCOUNT_FACTORY_V0_6,
42
+ chain: args.chain,
43
+ client: args.client,
44
+ }),
45
+ });
46
+ }
7
47
 
8
48
  /**
9
49
  * Predict the address of a smart account.
@@ -20,6 +60,7 @@ import type { SendTransactionOption } from "../../interfaces/wallet.js";
20
60
  * });
21
61
  * ```
22
62
  * @walletUtils
63
+ * @deprecated Use `predictSmartAccountAddress` instead.
23
64
  */
24
65
  export async function predictAddress(args: {
25
66
  factoryContract: ThirdwebContract;
@@ -149,6 +149,7 @@ export async function createUnsignedUserOp(args: {
149
149
  const bundlerOptions = {
150
150
  client,
151
151
  chain,
152
+ bundlerUrl: overrides?.bundlerUrl,
152
153
  entrypointAddress: overrides?.entrypointAddress,
153
154
  };
154
155
 
@@ -23,6 +23,7 @@ import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js
23
23
  import { sleep } from "../../utils/sleep.js";
24
24
  import type { Account, Wallet } from "../interfaces/wallet.js";
25
25
  import { generateAccount } from "../utils/generateAccount.js";
26
+ import { predictSmartAccountAddress } from "./lib/calls.js";
26
27
  import { DEFAULT_ACCOUNT_FACTORY_V0_7 } from "./lib/constants.js";
27
28
  import { smartWallet } from "./smart-wallet.js";
28
29
 
@@ -70,6 +71,13 @@ describe.runIf(process.env.TW_SECRET_KEY).sequential(
70
71
 
71
72
  it("can connect", async () => {
72
73
  expect(smartWalletAddress).toHaveLength(42);
74
+ const predictedAddress = await predictSmartAccountAddress({
75
+ client,
76
+ chain,
77
+ adminAddress: personalAccount.address,
78
+ factoryAddress: DEFAULT_ACCOUNT_FACTORY_V0_7,
79
+ });
80
+ expect(predictedAddress).toEqual(smartWalletAddress);
73
81
  });
74
82
 
75
83
  it("should revert on unsuccessful transactions", async () => {
@@ -23,6 +23,7 @@ import { isContractDeployed } from "../../utils/bytecode/is-contract-deployed.js
23
23
  import { sleep } from "../../utils/sleep.js";
24
24
  import type { Account, Wallet } from "../interfaces/wallet.js";
25
25
  import { generateAccount } from "../utils/generateAccount.js";
26
+ import { predictSmartAccountAddress } from "./lib/calls.js";
26
27
  import { smartWallet } from "./smart-wallet.js";
27
28
 
28
29
  let wallet: Wallet;
@@ -69,6 +70,12 @@ describe.runIf(process.env.TW_SECRET_KEY).sequential(
69
70
 
70
71
  it("can connect", async () => {
71
72
  expect(smartWalletAddress).toHaveLength(42);
73
+ const predictedAddress = await predictSmartAccountAddress({
74
+ client,
75
+ chain,
76
+ adminAddress: personalAccount.address,
77
+ });
78
+ expect(predictedAddress).toEqual(smartWalletAddress);
72
79
  });
73
80
 
74
81
  it("should revert on unsuccessful transactions", async () => {