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.
- package/dist/cjs/exports/wallets/smart.js +2 -1
- package/dist/cjs/exports/wallets/smart.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/transaction/prepare-contract-call.js +23 -0
- package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
- package/dist/cjs/utils/url.js +8 -0
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js +7 -6
- package/dist/cjs/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/guest.js +17 -20
- package/dist/cjs/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/jwt.js +7 -6
- package/dist/cjs/wallets/in-app/core/authentication/jwt.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js +0 -1
- package/dist/cjs/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js +2 -2
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js +17 -20
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/cjs/wallets/smart/lib/calls.js +31 -0
- package/dist/cjs/wallets/smart/lib/calls.js.map +1 -1
- package/dist/cjs/wallets/smart/lib/userop.js +1 -0
- package/dist/cjs/wallets/smart/lib/userop.js.map +1 -1
- package/dist/esm/exports/wallets/smart.js +1 -1
- package/dist/esm/exports/wallets/smart.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +3 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +4 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +2 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/transaction/prepare-contract-call.js +23 -0
- package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
- package/dist/esm/utils/url.js +6 -0
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js +7 -6
- package/dist/esm/wallets/in-app/core/authentication/authEndpoint.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/guest.js +17 -20
- package/dist/esm/wallets/in-app/core/authentication/guest.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/jwt.js +7 -6
- package/dist/esm/wallets/in-app/core/authentication/jwt.js.map +1 -1
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js +1 -1
- package/dist/esm/wallets/in-app/native/helpers/api/fetchers.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js +2 -2
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js +17 -20
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/wallets/smart/lib/calls.js +30 -0
- package/dist/esm/wallets/smart/lib/calls.js.map +1 -1
- package/dist/esm/wallets/smart/lib/userop.js +1 -0
- package/dist/esm/wallets/smart/lib/userop.js.map +1 -1
- package/dist/types/exports/wallets/smart.d.ts +1 -1
- package/dist/types/exports/wallets/smart.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/fiat/FiatSteps.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.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/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/transaction/prepare-contract-call.d.ts +23 -0
- package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
- package/dist/types/utils/url.d.ts +2 -0
- package/dist/types/utils/url.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/authEndpoint.d.ts +2 -2
- 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 +2 -2
- package/dist/types/wallets/in-app/core/authentication/jwt.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts +0 -4
- package/dist/types/wallets/in-app/native/helpers/api/fetchers.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/dist/types/wallets/smart/lib/calls.d.ts +27 -1
- package/dist/types/wallets/smart/lib/calls.d.ts.map +1 -1
- package/dist/types/wallets/smart/lib/userop.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/exports/wallets/smart.ts +4 -1
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +5 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +9 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +5 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +13 -3
- package/src/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.tsx +2 -1
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +5 -1
- package/src/transaction/prepare-contract-call.ts +23 -0
- package/src/utils/url.ts +8 -0
- package/src/version.ts +1 -1
- package/src/wallets/in-app/core/authentication/authEndpoint.ts +11 -8
- package/src/wallets/in-app/core/authentication/guest.ts +16 -19
- package/src/wallets/in-app/core/authentication/jwt.ts +11 -8
- package/src/wallets/in-app/native/helpers/api/fetchers.ts +1 -1
- package/src/wallets/in-app/native/native-connector.ts +2 -2
- package/src/wallets/in-app/web/lib/web-connector.ts +20 -20
- package/src/wallets/smart/lib/calls.ts +42 -1
- package/src/wallets/smart/lib/userop.ts +1 -0
- package/src/wallets/smart/smart-wallet-integration-v07.test.ts +8 -0
- 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 {
|
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 {
|
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
|
-
|
11
|
+
ecosystem?: Ecosystem;
|
12
12
|
}): Promise<AuthStoredTokenWithCookieReturnType> {
|
13
|
-
const
|
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
|
-
|
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
|
-
|
24
|
-
|
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
|
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
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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
|
-
|
47
|
+
if (!res.ok) throw new Error("Failed to generate guest account");
|
49
48
|
|
50
|
-
|
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 {
|
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 {
|
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
|
-
|
11
|
+
ecosystem?: Ecosystem;
|
12
12
|
}): Promise<AuthStoredTokenWithCookieReturnType> {
|
13
|
-
const
|
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
|
-
|
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 (!
|
25
|
-
const error = await
|
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
|
32
|
+
const { verifiedToken } = await res.json();
|
33
|
+
|
31
34
|
return { storedToken: verifiedToken };
|
32
35
|
} catch (e) {
|
33
36
|
throw new Error(
|
@@ -199,13 +199,13 @@ export class InAppNativeConnector implements InAppConnector {
|
|
199
199
|
return customJwt({
|
200
200
|
jwt: params.jwt,
|
201
201
|
client: this.client,
|
202
|
-
|
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
|
-
|
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(
|
272
|
-
|
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
|
308
|
+
return customJwt({
|
297
309
|
jwt: args.jwt,
|
298
|
-
|
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
|
-
|
364
|
-
|
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 {
|
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;
|
@@ -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 () => {
|