@rhinestone/sdk 1.0.0-alpha.26 → 1.0.0-alpha.27
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/src/accounts/error.d.ts +12 -5
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +19 -10
- package/dist/src/accounts/index.d.ts +2 -2
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +5 -4
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +3 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +1 -1
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +2 -1
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +2 -1
- package/dist/src/actions/index.d.ts +29 -1
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +34 -0
- package/dist/src/execution/error.d.ts +8 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +10 -1
- package/dist/src/execution/index.d.ts +2 -2
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +2 -1
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -3
- package/dist/src/modules/common.d.ts +10 -4
- package/dist/src/modules/common.d.ts.map +1 -1
- package/dist/src/modules/common.js +22 -1
- package/dist/src/modules/index.test.js +5 -4
- package/dist/src/orchestrator/client.js +6 -6
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +11 -10
- package/dist/src/orchestrator/registry.test.js +4 -4
- package/package.json +1 -1
|
@@ -50,20 +50,27 @@ declare class SigningNotSupportedForAccountError extends AccountError {
|
|
|
50
50
|
traceId?: string;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
declare class
|
|
54
|
-
constructor(params?: {
|
|
53
|
+
declare class Eip7702NotSupportedForAccountError extends AccountError {
|
|
54
|
+
constructor(account: AccountType, params?: {
|
|
55
55
|
context?: any;
|
|
56
56
|
errorType?: string;
|
|
57
57
|
traceId?: string;
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
declare class
|
|
61
|
-
constructor(account: AccountType, params?: {
|
|
60
|
+
declare class AccountConfigurationNotSupportedError extends AccountError {
|
|
61
|
+
constructor(message: string, account: AccountType, params?: {
|
|
62
|
+
context?: any;
|
|
63
|
+
errorType?: string;
|
|
64
|
+
traceId?: string;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
declare class WalletClientNoConnectedAccountError extends AccountError {
|
|
68
|
+
constructor(params?: {
|
|
62
69
|
context?: any;
|
|
63
70
|
errorType?: string;
|
|
64
71
|
traceId?: string;
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
declare function isAccountError(error: Error): error is AccountError;
|
|
68
|
-
export { isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError,
|
|
75
|
+
export { isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, };
|
|
69
76
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../accounts/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,cAAM,YAAa,SAAQ,KAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAA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|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WalletClientNoConnectedAccountError = exports.AccountConfigurationNotSupportedError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = void 0;
|
|
4
4
|
exports.isAccountError = isAccountError;
|
|
5
5
|
class AccountError extends Error {
|
|
6
6
|
_message;
|
|
@@ -73,15 +73,6 @@ class SigningNotSupportedForAccountError extends AccountError {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
exports.SigningNotSupportedForAccountError = SigningNotSupportedForAccountError;
|
|
76
|
-
class SignMessageNotSupportedByAccountError extends AccountError {
|
|
77
|
-
constructor(params) {
|
|
78
|
-
super({
|
|
79
|
-
message: 'Sign message not supported by account',
|
|
80
|
-
...params,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.SignMessageNotSupportedByAccountError = SignMessageNotSupportedByAccountError;
|
|
85
76
|
class Eip7702NotSupportedForAccountError extends AccountError {
|
|
86
77
|
constructor(account, params) {
|
|
87
78
|
const accountName = getAccountName(account);
|
|
@@ -92,6 +83,24 @@ class Eip7702NotSupportedForAccountError extends AccountError {
|
|
|
92
83
|
}
|
|
93
84
|
}
|
|
94
85
|
exports.Eip7702NotSupportedForAccountError = Eip7702NotSupportedForAccountError;
|
|
86
|
+
class AccountConfigurationNotSupportedError extends AccountError {
|
|
87
|
+
constructor(message, account, params) {
|
|
88
|
+
super({
|
|
89
|
+
message: `Account configuration for ${getAccountName(account)} account is not supported: ${message}`,
|
|
90
|
+
...params,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.AccountConfigurationNotSupportedError = AccountConfigurationNotSupportedError;
|
|
95
|
+
class WalletClientNoConnectedAccountError extends AccountError {
|
|
96
|
+
constructor(params) {
|
|
97
|
+
super({
|
|
98
|
+
message: 'WalletClient is missing a default account. Ensure the wallet is connected and the client has an account.',
|
|
99
|
+
...params,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.WalletClientNoConnectedAccountError = WalletClientNoConnectedAccountError;
|
|
95
104
|
function isAccountError(error) {
|
|
96
105
|
return error instanceof AccountError;
|
|
97
106
|
}
|
|
@@ -2,7 +2,7 @@ import { type Chain, type HashTypedDataParameters, type Hex, type PublicClient,
|
|
|
2
2
|
import type { Module } from '../modules/common';
|
|
3
3
|
import type { EnableSessionData } from '../modules/validators/smart-sessions';
|
|
4
4
|
import type { AccountProviderConfig, Call, OwnerSet, RhinestoneAccountConfig, Session, SignerSet } from '../types';
|
|
5
|
-
import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError,
|
|
5
|
+
import { AccountConfigurationNotSupportedError, AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error';
|
|
6
6
|
import { type ValidatorConfig } from './utils';
|
|
7
7
|
declare function getInitCode(config: RhinestoneAccountConfig): {
|
|
8
8
|
address: import("viem").Address;
|
|
@@ -32,5 +32,5 @@ declare function getSmartAccount(config: RhinestoneAccountConfig, client: Public
|
|
|
32
32
|
declare function getSmartSessionSmartAccount(config: RhinestoneAccountConfig, client: PublicClient, chain: Chain, session: Session, enableData: EnableSessionData | null): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
33
33
|
declare function getGuardianSmartAccount(config: RhinestoneAccountConfig, client: PublicClient, chain: Chain, guardians: OwnerSet): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
34
34
|
declare function getAccountProvider(config: RhinestoneAccountConfig): AccountProviderConfig;
|
|
35
|
-
export { getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, signEip7702InitData, getEip7702InitCall, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getSmartSessionSmartAccount, getGuardianSmartAccount, getPackedSignature, getTypedDataPackedSignature, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError,
|
|
35
|
+
export { getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, signEip7702InitData, getEip7702InitCall, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getSmartSessionSmartAccount, getGuardianSmartAccount, getPackedSignature, getTypedDataPackedSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,MAAM,CAAA;AAQb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAM/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ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B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,oKAiDb;AAED,iBAAe,2BAA2B,CACxC,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,iBAAiB,GAAG,IAAI,oKA6DrC;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,oKAyDpB;AAMD,iBAAS,kBAAkB,CACzB,MAAM,EAAE,uBAAuB,GAC9B,qBAAqB,CAOvB;AAED,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAE3B,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WalletClientNoConnectedAccountError = exports.SmartSessionsNotEnabledError = exports.SigningNotSupportedForAccountError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702NotSupportedForAccountError = exports.Eip7702AccountMustHaveEoaError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
4
4
|
exports.getModuleInstallationCalls = getModuleInstallationCalls;
|
|
5
5
|
exports.getModuleUninstallationCalls = getModuleUninstallationCalls;
|
|
6
6
|
exports.getAddress = getAddress;
|
|
@@ -25,6 +25,7 @@ const modules_1 = require("../modules");
|
|
|
25
25
|
const validators_1 = require("../modules/validators");
|
|
26
26
|
const core_1 = require("../modules/validators/core");
|
|
27
27
|
const error_1 = require("./error");
|
|
28
|
+
Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return error_1.AccountConfigurationNotSupportedError; } });
|
|
28
29
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return error_1.AccountError; } });
|
|
29
30
|
Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return error_1.Eip7702AccountMustHaveEoaError; } });
|
|
30
31
|
Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return error_1.Eip7702NotSupportedForAccountError; } });
|
|
@@ -32,8 +33,8 @@ Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enu
|
|
|
32
33
|
Object.defineProperty(exports, "FactoryArgsNotAvailableError", { enumerable: true, get: function () { return error_1.FactoryArgsNotAvailableError; } });
|
|
33
34
|
Object.defineProperty(exports, "isAccountError", { enumerable: true, get: function () { return error_1.isAccountError; } });
|
|
34
35
|
Object.defineProperty(exports, "SigningNotSupportedForAccountError", { enumerable: true, get: function () { return error_1.SigningNotSupportedForAccountError; } });
|
|
35
|
-
Object.defineProperty(exports, "SignMessageNotSupportedByAccountError", { enumerable: true, get: function () { return error_1.SignMessageNotSupportedByAccountError; } });
|
|
36
36
|
Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return error_1.SmartSessionsNotEnabledError; } });
|
|
37
|
+
Object.defineProperty(exports, "WalletClientNoConnectedAccountError", { enumerable: true, get: function () { return error_1.WalletClientNoConnectedAccountError; } });
|
|
37
38
|
const kernel_1 = require("./kernel");
|
|
38
39
|
const nexus_1 = require("./nexus");
|
|
39
40
|
const safe_1 = require("./safe");
|
|
@@ -90,7 +91,7 @@ async function signEip7702InitData(config) {
|
|
|
90
91
|
case 'safe':
|
|
91
92
|
case 'kernel':
|
|
92
93
|
case 'startale': {
|
|
93
|
-
throw new
|
|
94
|
+
throw new error_1.Eip7702NotSupportedForAccountError(account.type);
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}
|
|
@@ -103,7 +104,7 @@ async function getEip7702InitCall(config, signature) {
|
|
|
103
104
|
case 'safe':
|
|
104
105
|
case 'kernel':
|
|
105
106
|
case 'startale': {
|
|
106
|
-
throw new
|
|
107
|
+
throw new error_1.Eip7702NotSupportedForAccountError(account.type);
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../accounts/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EASZ,KAAK,GAAG,EAER,KAAK,YAAY,EAMlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAA;AAQ1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../accounts/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EASZ,KAAK,GAAG,EAER,KAAK,YAAY,EAMlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,mB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AC,GAAG,CAAC,iEAclC;AA+ED,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -13,6 +13,7 @@ const account_abstraction_1 = require("viem/account-abstraction");
|
|
|
13
13
|
const modules_1 = require("../modules");
|
|
14
14
|
const common_1 = require("../modules/common");
|
|
15
15
|
const validators_1 = require("../modules/validators");
|
|
16
|
+
const error_1 = require("./error");
|
|
16
17
|
const utils_1 = require("./utils");
|
|
17
18
|
const KERNEL_META_FACTORY_ADDRESS = '0xd703aae79538628d27099b8c4f621be4ccd142d5';
|
|
18
19
|
const KERNEL_IMPLEMENTATION_ADDRESS = '0xd6CEDDe84be40893d153Be9d467CD6aD37875b28';
|
|
@@ -28,7 +29,7 @@ function getDeployArgs(config) {
|
|
|
28
29
|
data: config.initData.factoryData,
|
|
29
30
|
});
|
|
30
31
|
if (factoryData.functionName !== 'deployWithFactory') {
|
|
31
|
-
throw new
|
|
32
|
+
throw new error_1.AccountConfigurationNotSupportedError('Invalid factory data', 'kernel');
|
|
32
33
|
}
|
|
33
34
|
const factory = factoryData.args[0];
|
|
34
35
|
const createData = factoryData.args[1];
|
|
@@ -37,7 +38,7 @@ function getDeployArgs(config) {
|
|
|
37
38
|
? KERNEL_IMPLEMENTATION_ADDRESS
|
|
38
39
|
: viem_1.zeroAddress;
|
|
39
40
|
if (implementation === viem_1.zeroAddress) {
|
|
40
|
-
throw new
|
|
41
|
+
throw new error_1.AccountConfigurationNotSupportedError('Unsupported Kernel implementation', 'kernel');
|
|
41
42
|
}
|
|
42
43
|
return {
|
|
43
44
|
factory: config.initData.factory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAA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,GAA8B,EACtE,uBAAuB,GAAE,OAAyC,0BAWnE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAYnE;AAED,iBAAe,sBAAsB,CACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACpC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAwCnE;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAcnE;AAqFD,iBAAe,mBAAmB,CAChC,MAAM,EAAE,uBAAuB,EAC/B,GAAG,EAAE,OAAO,0BA0Bb;AAED,iBAAe,kBAAkB,CAC/B,MAAM,EAAE,uBAAuB,EAC/B,SAAS,EAAE,GAAG;;;GAuCf;AAED,OAAO,EACL,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
|
|
@@ -34,7 +34,7 @@ function getDeployArgs(config) {
|
|
|
34
34
|
data: config.initData.factoryData,
|
|
35
35
|
});
|
|
36
36
|
if (factoryData.functionName !== 'createAccount') {
|
|
37
|
-
throw new
|
|
37
|
+
throw new error_1.AccountConfigurationNotSupportedError('Invalid factory data', 'nexus');
|
|
38
38
|
}
|
|
39
39
|
const owner = factoryData.args[0];
|
|
40
40
|
const index = factoryData.args[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAOZ,KAAK,GAAG,EAER,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAQ/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAOZ,KAAK,GAAG,EAER,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAQ/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAE1E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAgBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;EA4FrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAalD;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBA2BrC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAMvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAWlC;AAED,iBAAe,sBAAsB,CACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACpC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAyClC;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAalC;AAkGD,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,uBAAuB,GACxB,CAAA"}
|
|
@@ -11,6 +11,7 @@ const viem_1 = require("viem");
|
|
|
11
11
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
12
12
|
const modules_1 = require("../modules");
|
|
13
13
|
const validators_1 = require("../modules/validators");
|
|
14
|
+
const error_1 = require("./error");
|
|
14
15
|
const utils_1 = require("./utils");
|
|
15
16
|
const SAFE_7579_LAUNCHPAD_ADDRESS = '0x75798463024Bda64D83c94A64Bc7D7eaB41300eF';
|
|
16
17
|
const SAFE_7579_ADAPTER_ADDRESS = '0x7579f2AD53b01c3D8779Fe17928e0D48885B0003';
|
|
@@ -27,7 +28,7 @@ function getDeployArgs(config) {
|
|
|
27
28
|
data: config.initData.factoryData,
|
|
28
29
|
});
|
|
29
30
|
if (factoryData.functionName !== 'createProxyWithNonce') {
|
|
30
|
-
throw new
|
|
31
|
+
throw new error_1.AccountConfigurationNotSupportedError('Invalid factory data', 'safe');
|
|
31
32
|
}
|
|
32
33
|
const implementation = factoryData.args[0];
|
|
33
34
|
const initData = factoryData.args[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletClient.d.ts","sourceRoot":"","sources":["../../../accounts/walletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAMP,YAAY,EACb,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"walletClient.d.ts","sourceRoot":"","sources":["../../../accounts/walletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAMP,YAAY,EACb,MAAM,MAAM,CAAA;AAGb;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CA0CzE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.walletClientToAccount = walletClientToAccount;
|
|
4
|
+
const error_1 = require("./error");
|
|
4
5
|
/**
|
|
5
6
|
* Adapts a Viem/Wagmi WalletClient into an Account-like signer that the SDK can consume.
|
|
6
7
|
* Ensures address is set and routes sign methods through the provided client.
|
|
@@ -8,7 +9,7 @@ exports.walletClientToAccount = walletClientToAccount;
|
|
|
8
9
|
function walletClientToAccount(walletClient) {
|
|
9
10
|
const address = walletClient.account?.address;
|
|
10
11
|
if (!address) {
|
|
11
|
-
throw new
|
|
12
|
+
throw new error_1.WalletClientNoConnectedAccountError();
|
|
12
13
|
}
|
|
13
14
|
const account = {
|
|
14
15
|
address,
|
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
2
|
import type { RhinestoneAccount } from '..';
|
|
3
|
+
import { type ModuleType } from '../modules/common';
|
|
3
4
|
import { type WebauthnCredential } from '../modules/validators/core';
|
|
4
5
|
import type { Call, OwnableValidatorConfig, OwnerSet, ProviderConfig, Recovery, WebauthnValidatorConfig } from '../types';
|
|
5
6
|
import { encodeSmartSessionSignature } from './smart-session';
|
|
7
|
+
interface ModuleInput {
|
|
8
|
+
type: ModuleType;
|
|
9
|
+
address: Address;
|
|
10
|
+
initData?: Hex;
|
|
11
|
+
deInitData?: Hex;
|
|
12
|
+
additionalContext?: Hex;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Install a custom module
|
|
16
|
+
* @param rhinestoneAccount Account to install the module on
|
|
17
|
+
* @param module Module to install
|
|
18
|
+
* @returns Calls to install the module
|
|
19
|
+
*/
|
|
20
|
+
declare function installModule({ rhinestoneAccount, module, }: {
|
|
21
|
+
rhinestoneAccount: RhinestoneAccount;
|
|
22
|
+
module: ModuleInput;
|
|
23
|
+
}): Call[];
|
|
24
|
+
/**
|
|
25
|
+
* Uninstall a custom module
|
|
26
|
+
* @param rhinestoneAccount Account to uninstall the module on
|
|
27
|
+
* @param module Module to uninstall
|
|
28
|
+
* @returns Calls to uninstall the module
|
|
29
|
+
*/
|
|
30
|
+
declare function uninstallModule({ rhinestoneAccount, module, }: {
|
|
31
|
+
rhinestoneAccount: RhinestoneAccount;
|
|
32
|
+
module: ModuleInput;
|
|
33
|
+
}): Call[];
|
|
6
34
|
/**
|
|
7
35
|
* Set up social recovery
|
|
8
36
|
* @param rhinestoneAccount Account to set up social recovery on
|
|
@@ -163,5 +191,5 @@ declare function setSubValidator(id: Hex | number, validator: OwnableValidatorCo
|
|
|
163
191
|
* @returns Call to remove the sub-validator
|
|
164
192
|
*/
|
|
165
193
|
declare function removeSubValidator(id: Hex | number, validator: OwnableValidatorConfig | WebauthnValidatorConfig): Call;
|
|
166
|
-
export { enableEcdsa, enablePasskeys, disableEcdsa, disablePasskeys, addOwner, removeOwner, changeThreshold, addPasskeyOwner, removePasskeyOwner, changePasskeyThreshold, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, setUpRecovery, encodeSmartSessionSignature, enableMultiFactor, disableMultiFactor, changeMultiFactorThreshold, setSubValidator, removeSubValidator, };
|
|
194
|
+
export { installModule, uninstallModule, enableEcdsa, enablePasskeys, disableEcdsa, disablePasskeys, addOwner, removeOwner, changeThreshold, addPasskeyOwner, removePasskeyOwner, changePasskeyThreshold, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, setUpRecovery, encodeSmartSessionSignature, enableMultiFactor, disableMultiFactor, changeMultiFactorThreshold, setSubValidator, removeSubValidator, };
|
|
167
195
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAM3C,OAAO,EASL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EACV,IAAI,EACJ,sBAAsB,EACtB,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,uBAAuB,EACxB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAM3C,OAAO,EAAe,KAAK,UAAU,EAAkB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,GACnB,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeSmartSessionSignature = void 0;
|
|
4
|
+
exports.installModule = installModule;
|
|
5
|
+
exports.uninstallModule = uninstallModule;
|
|
4
6
|
exports.enableEcdsa = enableEcdsa;
|
|
5
7
|
exports.enablePasskeys = enablePasskeys;
|
|
6
8
|
exports.disableEcdsa = disableEcdsa;
|
|
@@ -23,9 +25,32 @@ exports.removeSubValidator = removeSubValidator;
|
|
|
23
25
|
const viem_1 = require("viem");
|
|
24
26
|
const accounts_1 = require("../accounts");
|
|
25
27
|
const utils_1 = require("../accounts/utils");
|
|
28
|
+
const common_1 = require("../modules/common");
|
|
26
29
|
const core_1 = require("../modules/validators/core");
|
|
27
30
|
const smart_session_1 = require("./smart-session");
|
|
28
31
|
Object.defineProperty(exports, "encodeSmartSessionSignature", { enumerable: true, get: function () { return smart_session_1.encodeSmartSessionSignature; } });
|
|
32
|
+
/**
|
|
33
|
+
* Install a custom module
|
|
34
|
+
* @param rhinestoneAccount Account to install the module on
|
|
35
|
+
* @param module Module to install
|
|
36
|
+
* @returns Calls to install the module
|
|
37
|
+
*/
|
|
38
|
+
function installModule({ rhinestoneAccount, module, }) {
|
|
39
|
+
const moduleData = getModule(module);
|
|
40
|
+
const calls = (0, accounts_1.getModuleInstallationCalls)(rhinestoneAccount.config, moduleData);
|
|
41
|
+
return calls;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Uninstall a custom module
|
|
45
|
+
* @param rhinestoneAccount Account to uninstall the module on
|
|
46
|
+
* @param module Module to uninstall
|
|
47
|
+
* @returns Calls to uninstall the module
|
|
48
|
+
*/
|
|
49
|
+
function uninstallModule({ rhinestoneAccount, module, }) {
|
|
50
|
+
const moduleData = getModule(module);
|
|
51
|
+
const calls = (0, accounts_1.getModuleUninstallationCalls)(rhinestoneAccount.config, moduleData);
|
|
52
|
+
return calls;
|
|
53
|
+
}
|
|
29
54
|
/**
|
|
30
55
|
* Set up social recovery
|
|
31
56
|
* @param rhinestoneAccount Account to set up social recovery on
|
|
@@ -558,3 +583,12 @@ function removeSubValidator(id, validator) {
|
|
|
558
583
|
}),
|
|
559
584
|
};
|
|
560
585
|
}
|
|
586
|
+
function getModule(module) {
|
|
587
|
+
return {
|
|
588
|
+
type: (0, common_1.toModuleTypeId)(module.type),
|
|
589
|
+
address: module.address,
|
|
590
|
+
initData: module.initData ?? '0x',
|
|
591
|
+
deInitData: module.deInitData ?? '0x',
|
|
592
|
+
additionalContext: module.additionalContext ?? '0x',
|
|
593
|
+
};
|
|
594
|
+
}
|
|
@@ -42,6 +42,13 @@ declare class SessionChainRequiredError extends ExecutionError {
|
|
|
42
42
|
traceId?: string;
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
declare class SimulationNotSupportedForUserOpFlowError extends ExecutionError {
|
|
46
|
+
constructor(params?: {
|
|
47
|
+
context?: any;
|
|
48
|
+
errorType?: string;
|
|
49
|
+
traceId?: string;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
45
52
|
declare class IntentFailedError extends ExecutionError {
|
|
46
53
|
constructor(params?: {
|
|
47
54
|
context?: any;
|
|
@@ -50,5 +57,5 @@ declare class IntentFailedError extends ExecutionError {
|
|
|
50
57
|
});
|
|
51
58
|
}
|
|
52
59
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
53
|
-
export { isExecutionError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, };
|
|
60
|
+
export { isExecutionError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, SimulationNotSupportedForUserOpFlowError, };
|
|
54
61
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|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ACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,gCAAiC,SAAQ,cAAc;gBAC/C,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,yBAA0B,SAAQ,cAAc;gBACxC,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,cAAM,wCAAyC,SAAQ,cAAc;gBACvD,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,iBAAkB,SAAQ,cAAc;gBAChC,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAE/D;AAED,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,wCAAwC,GACzC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = void 0;
|
|
3
|
+
exports.SimulationNotSupportedForUserOpFlowError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -64,6 +64,15 @@ class SessionChainRequiredError extends ExecutionError {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
exports.SessionChainRequiredError = SessionChainRequiredError;
|
|
67
|
+
class SimulationNotSupportedForUserOpFlowError extends ExecutionError {
|
|
68
|
+
constructor(params) {
|
|
69
|
+
super({
|
|
70
|
+
message: 'Simulation not supported for user operation flow',
|
|
71
|
+
...params,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.SimulationNotSupportedForUserOpFlowError = SimulationNotSupportedForUserOpFlowError;
|
|
67
76
|
class IntentFailedError extends ExecutionError {
|
|
68
77
|
constructor(params) {
|
|
69
78
|
super({
|
|
@@ -2,7 +2,7 @@ import { type Address, type Chain } from 'viem';
|
|
|
2
2
|
import type { IntentOpStatus } from '../orchestrator';
|
|
3
3
|
import type { SettlementLayer } from '../orchestrator/types';
|
|
4
4
|
import type { CallInput, RhinestoneAccountConfig, SignerSet, TokenRequest, Transaction } from '../types';
|
|
5
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './error';
|
|
5
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SimulationNotSupportedForUserOpFlowError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './error';
|
|
6
6
|
import type { IntentData, TransactionResult } from './utils';
|
|
7
7
|
declare function sendTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<TransactionResult>;
|
|
8
8
|
declare function sendTransactionInternal(config: RhinestoneAccountConfig, sourceChains: Chain[], targetChain: Chain, callInputs: CallInput[], options: {
|
|
@@ -28,6 +28,6 @@ declare function waitForExecution(config: RhinestoneAccountConfig, result: Trans
|
|
|
28
28
|
}>;
|
|
29
29
|
declare function getMaxSpendableAmount(config: RhinestoneAccountConfig, chain: Chain, tokenAddress: Address, gasUnits: bigint, sponsored?: boolean): Promise<bigint>;
|
|
30
30
|
declare function getPortfolio(config: RhinestoneAccountConfig, onTestnets: boolean): Promise<import("../orchestrator").Portfolio>;
|
|
31
|
-
export { sendTransaction, sendTransactionInternal, waitForExecution, getMaxSpendableAmount, getPortfolio, isExecutionError, IntentFailedError,
|
|
31
|
+
export { sendTransaction, sendTransactionInternal, waitForExecution, getMaxSpendableAmount, getPortfolio, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SimulationNotSupportedForUserOpFlowError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, };
|
|
32
32
|
export type { IntentData, TransactionResult };
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAmC,MAAM,MAAM,CAAA;AAKhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAQrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,0CAA0C,EAC1C,0CA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,iBAAe,YAAY,CACzB,MAAM,EAAE,uBAAuB,EAC/B,UAAU,EAAE,OAAO,gDAUpB;AAED,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EAEZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,wCAAwC,EACxC,0CAA0C,EAC1C,0CAA0C,GAC3C,CAAA;AACD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.SimulationNotSupportedForUserOpFlowError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = void 0;
|
|
4
4
|
exports.sendTransaction = sendTransaction;
|
|
5
5
|
exports.sendTransactionInternal = sendTransactionInternal;
|
|
6
6
|
exports.waitForExecution = waitForExecution;
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: fun
|
|
|
18
18
|
Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return error_1.isExecutionError; } });
|
|
19
19
|
Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return error_1.OrderPathRequiredForIntentsError; } });
|
|
20
20
|
Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return error_1.SessionChainRequiredError; } });
|
|
21
|
+
Object.defineProperty(exports, "SimulationNotSupportedForUserOpFlowError", { enumerable: true, get: function () { return error_1.SimulationNotSupportedForUserOpFlowError; } });
|
|
21
22
|
Object.defineProperty(exports, "SourceChainsNotAvailableForUserOpFlowError", { enumerable: true, get: function () { return error_1.SourceChainsNotAvailableForUserOpFlowError; } });
|
|
22
23
|
Object.defineProperty(exports, "UserOperationRequiredForSmartSessionsError", { enumerable: true, get: function () { return error_1.UserOperationRequiredForSmartSessionsError; } });
|
|
23
24
|
const smart_session_1 = require("./smart-session");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAGR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AA0BjC,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,WAAW,EACZ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAGR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AA0BjC,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAA;AAUxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC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0CAUzB;AA2CD,iBAAe,oBAAoB,CACjC,MAAM,EAAE,uBAAuB,EAC/B,YAAY,EAAE,KAAK,EAAE,GAAG,SAAS,EACjC,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EACd,cAAc,EAAE,uBAAuB,8BAmBxC;AAED,iBAAe,sBAAsB,CACnC,MAAM,EAAE,uBAAuB,EAC/B,aAAa,EAAE,KAAK,EAAE,GAAG,SAAS,EAClC,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EACd,cAAc,EAAE,uBAAuB,mDAcxC;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,6JA6Bb;AAmDD,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAM/D;AA0DD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,GACX,CAAA;AACD,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
|
@@ -159,7 +159,7 @@ async function simulateTransaction(config, signedTransaction, authorizations) {
|
|
|
159
159
|
const { sourceChains, targetChain } = getTransactionParams(transaction);
|
|
160
160
|
const asUserOp = data.type === 'userop';
|
|
161
161
|
if (asUserOp) {
|
|
162
|
-
throw new
|
|
162
|
+
throw new error_1.SimulationNotSupportedForUserOpFlowError();
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
165
|
const intentOp = data.intentRoute.intentOp;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Address, Chain, HashTypedDataParameters, Hex, SignableMessage, SignedAuthorizationList, TypedData } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
|
-
import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError,
|
|
3
|
+
import { AccountConfigurationNotSupportedError, AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './accounts';
|
|
4
4
|
import { walletClientToAccount } from './accounts/walletClient';
|
|
5
|
-
import { addOwner, addPasskeyOwner, changeMultiFactorThreshold, changePasskeyThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery } from './actions';
|
|
6
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, type TransactionResult, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
5
|
+
import { addOwner, addPasskeyOwner, changeMultiFactorThreshold, changePasskeyThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, installModule, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, uninstallModule } from './actions';
|
|
6
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SimulationNotSupportedForUserOpFlowError, SourceChainsNotAvailableForUserOpFlowError, type TransactionResult, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
7
7
|
import { type SessionDetails } from './execution/smart-session';
|
|
8
8
|
import { type IntentData, type PreparedTransactionData, type SignedTransactionData } from './execution/utils';
|
|
9
9
|
import { AuthenticationRequiredError, getSupportedTokens, getTokenAddress, InsufficientBalanceError, type IntentCost, type IntentInput, IntentNotFoundError, type IntentOp, type IntentOpStatus, type IntentResult, type IntentRoute, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, type Portfolio, type SettlementSystem, type SignedIntentOp, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './orchestrator';
|
|
@@ -39,6 +39,6 @@ interface RhinestoneAccount {
|
|
|
39
39
|
* @returns account
|
|
40
40
|
*/
|
|
41
41
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
42
|
-
export { createRhinestoneAccount, walletClientToAccount, addOwner, addPasskeyOwner, changeMultiFactorThreshold, changeThreshold, changePasskeyThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError,
|
|
42
|
+
export { createRhinestoneAccount, walletClientToAccount, addOwner, addPasskeyOwner, changeMultiFactorThreshold, changeThreshold, changePasskeyThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, installModule, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, uninstallModule, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SimulationNotSupportedForUserOpFlowError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getSupportedTokens, getTokenAddress, };
|
|
43
43
|
export type { RhinestoneAccount, Session, Call, IntentData, PreparedTransactionData, SignedTransactionData, TransactionResult, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, Portfolio, };
|
|
44
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACV,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAGZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":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AA;CACpD;AAED;;;;;GAKG;AACH,iBAAe,uBAAuB,CACpC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CAsP5B;AAED,OAAO,EACL,uBAAuB,EAEvB,qBAAqB,EAErB,QAAQ,EACR,eAAe,EACf,0BAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,eAAe,EAEf,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,wCAAwC,EACxC,0CAA0C,EAC1C,0CAA0C,EAE1C,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,GAChB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.getTokenAddress = exports.getSupportedTokens = void 0;
|
|
3
|
+
exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.SimulationNotSupportedForUserOpFlowError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = exports.WalletClientNoConnectedAccountError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = exports.uninstallModule = exports.setUpRecovery = exports.setSubValidator = exports.removeSubValidator = exports.removePasskeyOwner = exports.removeOwner = exports.recoverPasskeyOwnership = exports.recoverEcdsaOwnership = exports.recover = exports.installModule = exports.encodeSmartSessionSignature = exports.enablePasskeys = exports.enableMultiFactor = exports.enableEcdsa = exports.disablePasskeys = exports.disableMultiFactor = exports.disableEcdsa = exports.changePasskeyThreshold = exports.changeThreshold = exports.changeMultiFactorThreshold = exports.addPasskeyOwner = exports.addOwner = exports.walletClientToAccount = void 0;
|
|
4
|
+
exports.getTokenAddress = exports.getSupportedTokens = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = void 0;
|
|
5
5
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
6
6
|
const accounts_1 = require("./accounts");
|
|
7
|
+
Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return accounts_1.AccountConfigurationNotSupportedError; } });
|
|
7
8
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
8
9
|
Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return accounts_1.Eip7702AccountMustHaveEoaError; } });
|
|
9
10
|
Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.Eip7702NotSupportedForAccountError; } });
|
|
@@ -11,8 +12,8 @@ Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enu
|
|
|
11
12
|
Object.defineProperty(exports, "FactoryArgsNotAvailableError", { enumerable: true, get: function () { return accounts_1.FactoryArgsNotAvailableError; } });
|
|
12
13
|
Object.defineProperty(exports, "isAccountError", { enumerable: true, get: function () { return accounts_1.isAccountError; } });
|
|
13
14
|
Object.defineProperty(exports, "SigningNotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.SigningNotSupportedForAccountError; } });
|
|
14
|
-
Object.defineProperty(exports, "SignMessageNotSupportedByAccountError", { enumerable: true, get: function () { return accounts_1.SignMessageNotSupportedByAccountError; } });
|
|
15
15
|
Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return accounts_1.SmartSessionsNotEnabledError; } });
|
|
16
|
+
Object.defineProperty(exports, "WalletClientNoConnectedAccountError", { enumerable: true, get: function () { return accounts_1.WalletClientNoConnectedAccountError; } });
|
|
16
17
|
const walletClient_1 = require("./accounts/walletClient");
|
|
17
18
|
Object.defineProperty(exports, "walletClientToAccount", { enumerable: true, get: function () { return walletClient_1.walletClientToAccount; } });
|
|
18
19
|
const actions_1 = require("./actions");
|
|
@@ -28,6 +29,7 @@ Object.defineProperty(exports, "enableEcdsa", { enumerable: true, get: function
|
|
|
28
29
|
Object.defineProperty(exports, "enableMultiFactor", { enumerable: true, get: function () { return actions_1.enableMultiFactor; } });
|
|
29
30
|
Object.defineProperty(exports, "enablePasskeys", { enumerable: true, get: function () { return actions_1.enablePasskeys; } });
|
|
30
31
|
Object.defineProperty(exports, "encodeSmartSessionSignature", { enumerable: true, get: function () { return actions_1.encodeSmartSessionSignature; } });
|
|
32
|
+
Object.defineProperty(exports, "installModule", { enumerable: true, get: function () { return actions_1.installModule; } });
|
|
31
33
|
Object.defineProperty(exports, "recover", { enumerable: true, get: function () { return actions_1.recover; } });
|
|
32
34
|
Object.defineProperty(exports, "recoverEcdsaOwnership", { enumerable: true, get: function () { return actions_1.recoverEcdsaOwnership; } });
|
|
33
35
|
Object.defineProperty(exports, "recoverPasskeyOwnership", { enumerable: true, get: function () { return actions_1.recoverPasskeyOwnership; } });
|
|
@@ -36,12 +38,14 @@ Object.defineProperty(exports, "removePasskeyOwner", { enumerable: true, get: fu
|
|
|
36
38
|
Object.defineProperty(exports, "removeSubValidator", { enumerable: true, get: function () { return actions_1.removeSubValidator; } });
|
|
37
39
|
Object.defineProperty(exports, "setSubValidator", { enumerable: true, get: function () { return actions_1.setSubValidator; } });
|
|
38
40
|
Object.defineProperty(exports, "setUpRecovery", { enumerable: true, get: function () { return actions_1.setUpRecovery; } });
|
|
41
|
+
Object.defineProperty(exports, "uninstallModule", { enumerable: true, get: function () { return actions_1.uninstallModule; } });
|
|
39
42
|
const execution_1 = require("./execution");
|
|
40
43
|
Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return execution_1.ExecutionError; } });
|
|
41
44
|
Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: function () { return execution_1.IntentFailedError; } });
|
|
42
45
|
Object.defineProperty(exports, "isExecutionError", { enumerable: true, get: function () { return execution_1.isExecutionError; } });
|
|
43
46
|
Object.defineProperty(exports, "OrderPathRequiredForIntentsError", { enumerable: true, get: function () { return execution_1.OrderPathRequiredForIntentsError; } });
|
|
44
47
|
Object.defineProperty(exports, "SessionChainRequiredError", { enumerable: true, get: function () { return execution_1.SessionChainRequiredError; } });
|
|
48
|
+
Object.defineProperty(exports, "SimulationNotSupportedForUserOpFlowError", { enumerable: true, get: function () { return execution_1.SimulationNotSupportedForUserOpFlowError; } });
|
|
45
49
|
Object.defineProperty(exports, "SourceChainsNotAvailableForUserOpFlowError", { enumerable: true, get: function () { return execution_1.SourceChainsNotAvailableForUserOpFlowError; } });
|
|
46
50
|
Object.defineProperty(exports, "UserOperationRequiredForSmartSessionsError", { enumerable: true, get: function () { return execution_1.UserOperationRequiredForSmartSessionsError; } });
|
|
47
51
|
const smart_session_1 = require("./execution/smart-session");
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import type { Address, Hex } from 'viem';
|
|
2
|
-
type
|
|
2
|
+
type ModuleTypeId = typeof MODULE_TYPE_ID_VALIDATOR | typeof MODULE_TYPE_ID_EXECUTOR | typeof MODULE_TYPE_ID_FALLBACK | typeof MODULE_TYPE_ID_HOOK;
|
|
3
|
+
type ModuleType = typeof MODULE_TYPE_VALIDATOR | typeof MODULE_TYPE_EXECUTOR | typeof MODULE_TYPE_FALLBACK | typeof MODULE_TYPE_HOOK;
|
|
3
4
|
interface Module {
|
|
4
5
|
address: Address;
|
|
5
6
|
initData: Hex;
|
|
6
7
|
deInitData: Hex;
|
|
7
8
|
additionalContext: Hex;
|
|
8
|
-
type:
|
|
9
|
+
type: ModuleTypeId;
|
|
9
10
|
}
|
|
10
11
|
declare const MODULE_TYPE_ID_VALIDATOR = 1n;
|
|
11
12
|
declare const MODULE_TYPE_ID_EXECUTOR = 2n;
|
|
12
13
|
declare const MODULE_TYPE_ID_FALLBACK = 3n;
|
|
13
14
|
declare const MODULE_TYPE_ID_HOOK = 4n;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
declare const MODULE_TYPE_VALIDATOR = "validator";
|
|
16
|
+
declare const MODULE_TYPE_EXECUTOR = "executor";
|
|
17
|
+
declare const MODULE_TYPE_FALLBACK = "fallback";
|
|
18
|
+
declare const MODULE_TYPE_HOOK = "hook";
|
|
19
|
+
declare function toModuleTypeId(type: ModuleType): ModuleTypeId;
|
|
20
|
+
export { MODULE_TYPE_ID_VALIDATOR, MODULE_TYPE_ID_EXECUTOR, MODULE_TYPE_ID_FALLBACK, MODULE_TYPE_ID_HOOK, MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR, MODULE_TYPE_FALLBACK, MODULE_TYPE_HOOK, toModuleTypeId, };
|
|
21
|
+
export type { Module, ModuleType, ModuleTypeId };
|
|
16
22
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../modules/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAExC,KAAK,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../modules/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAExC,KAAK,YAAY,GACb,OAAO,wBAAwB,GAC/B,OAAO,uBAAuB,GAC9B,OAAO,uBAAuB,GAC9B,OAAO,mBAAmB,CAAA;AAE9B,KAAK,UAAU,GACX,OAAO,qBAAqB,GAC5B,OAAO,oBAAoB,GAC3B,OAAO,oBAAoB,GAC3B,OAAO,gBAAgB,CAAA;AAE3B,UAAU,MAAM;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,GAAG,CAAA;IACb,UAAU,EAAE,GAAG,CAAA;IACf,iBAAiB,EAAE,GAAG,CAAA;IACtB,IAAI,EAAE,YAAY,CAAA;CACnB;AAED,QAAA,MAAM,wBAAwB,KAAK,CAAA;AACnC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,uBAAuB,KAAK,CAAA;AAClC,QAAA,MAAM,mBAAmB,KAAK,CAAA;AAE9B,QAAA,MAAM,qBAAqB,cAAc,CAAA;AACzC,QAAA,MAAM,oBAAoB,aAAa,CAAA;AACvC,QAAA,MAAM,oBAAoB,aAAa,CAAA;AACvC,QAAA,MAAM,gBAAgB,SAAS,CAAA;AAE/B,iBAAS,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAWtD;AAED,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,GACf,CAAA;AACD,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MODULE_TYPE_ID_HOOK = exports.MODULE_TYPE_ID_FALLBACK = exports.MODULE_TYPE_ID_EXECUTOR = exports.MODULE_TYPE_ID_VALIDATOR = void 0;
|
|
3
|
+
exports.MODULE_TYPE_HOOK = exports.MODULE_TYPE_FALLBACK = exports.MODULE_TYPE_EXECUTOR = exports.MODULE_TYPE_VALIDATOR = exports.MODULE_TYPE_ID_HOOK = exports.MODULE_TYPE_ID_FALLBACK = exports.MODULE_TYPE_ID_EXECUTOR = exports.MODULE_TYPE_ID_VALIDATOR = void 0;
|
|
4
|
+
exports.toModuleTypeId = toModuleTypeId;
|
|
4
5
|
const MODULE_TYPE_ID_VALIDATOR = 1n;
|
|
5
6
|
exports.MODULE_TYPE_ID_VALIDATOR = MODULE_TYPE_ID_VALIDATOR;
|
|
6
7
|
const MODULE_TYPE_ID_EXECUTOR = 2n;
|
|
@@ -9,3 +10,23 @@ const MODULE_TYPE_ID_FALLBACK = 3n;
|
|
|
9
10
|
exports.MODULE_TYPE_ID_FALLBACK = MODULE_TYPE_ID_FALLBACK;
|
|
10
11
|
const MODULE_TYPE_ID_HOOK = 4n;
|
|
11
12
|
exports.MODULE_TYPE_ID_HOOK = MODULE_TYPE_ID_HOOK;
|
|
13
|
+
const MODULE_TYPE_VALIDATOR = 'validator';
|
|
14
|
+
exports.MODULE_TYPE_VALIDATOR = MODULE_TYPE_VALIDATOR;
|
|
15
|
+
const MODULE_TYPE_EXECUTOR = 'executor';
|
|
16
|
+
exports.MODULE_TYPE_EXECUTOR = MODULE_TYPE_EXECUTOR;
|
|
17
|
+
const MODULE_TYPE_FALLBACK = 'fallback';
|
|
18
|
+
exports.MODULE_TYPE_FALLBACK = MODULE_TYPE_FALLBACK;
|
|
19
|
+
const MODULE_TYPE_HOOK = 'hook';
|
|
20
|
+
exports.MODULE_TYPE_HOOK = MODULE_TYPE_HOOK;
|
|
21
|
+
function toModuleTypeId(type) {
|
|
22
|
+
switch (type) {
|
|
23
|
+
case MODULE_TYPE_VALIDATOR:
|
|
24
|
+
return MODULE_TYPE_ID_VALIDATOR;
|
|
25
|
+
case MODULE_TYPE_EXECUTOR:
|
|
26
|
+
return MODULE_TYPE_ID_EXECUTOR;
|
|
27
|
+
case MODULE_TYPE_FALLBACK:
|
|
28
|
+
return MODULE_TYPE_ID_FALLBACK;
|
|
29
|
+
case MODULE_TYPE_HOOK:
|
|
30
|
+
return MODULE_TYPE_ID_HOOK;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
4
|
const consts_1 = require("../../test/consts");
|
|
5
|
+
const common_1 = require("./common");
|
|
5
6
|
const index_1 = require("./index");
|
|
6
7
|
(0, vitest_1.describe)('Modules', () => {
|
|
7
8
|
(0, vitest_1.describe)('Setup', () => {
|
|
@@ -16,7 +17,7 @@ const index_1 = require("./index");
|
|
|
16
17
|
};
|
|
17
18
|
const setup = (0, index_1.getSetup)(config);
|
|
18
19
|
(0, vitest_1.expect)(setup.validators[0].address).toBe('0x000000000013fdb5234e4e3162a810f54d9f7e98');
|
|
19
|
-
(0, vitest_1.expect)(setup.validators[0].type).toBe(
|
|
20
|
+
(0, vitest_1.expect)(setup.validators[0].type).toBe(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
20
21
|
});
|
|
21
22
|
(0, vitest_1.test)('should use webauthn validator for passkey owners', () => {
|
|
22
23
|
const config = {
|
|
@@ -29,7 +30,7 @@ const index_1 = require("./index");
|
|
|
29
30
|
const setup = (0, index_1.getSetup)(config);
|
|
30
31
|
(0, vitest_1.expect)(setup.validators).toHaveLength(1);
|
|
31
32
|
(0, vitest_1.expect)(setup.validators[0].address).toBe('0x0000000000578c4cb0e472a5462da43c495c3f33');
|
|
32
|
-
(0, vitest_1.expect)(setup.validators[0].type).toBe(
|
|
33
|
+
(0, vitest_1.expect)(setup.validators[0].type).toBe(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
33
34
|
});
|
|
34
35
|
(0, vitest_1.test)('should use smart session validator when sessions are enabled', () => {
|
|
35
36
|
const config = {
|
|
@@ -54,7 +55,7 @@ const index_1 = require("./index");
|
|
|
54
55
|
if (!smartSessionValidator) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
(0, vitest_1.expect)(smartSessionValidator.type).toBe(
|
|
58
|
+
(0, vitest_1.expect)(smartSessionValidator.type).toBe(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
58
59
|
});
|
|
59
60
|
(0, vitest_1.test)('should use smart session compatibility fallback for safe accounts with sessions', () => {
|
|
60
61
|
const config = {
|
|
@@ -83,7 +84,7 @@ const index_1 = require("./index");
|
|
|
83
84
|
if (!smartSessionFallback) {
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
86
|
-
(0, vitest_1.expect)(smartSessionFallback.type).toBe(
|
|
87
|
+
(0, vitest_1.expect)(smartSessionFallback.type).toBe(common_1.MODULE_TYPE_ID_FALLBACK);
|
|
87
88
|
});
|
|
88
89
|
vitest_1.test.todo('using the omni account should install the necessary modules');
|
|
89
90
|
});
|
|
@@ -49,7 +49,7 @@ class Orchestrator {
|
|
|
49
49
|
}
|
|
50
50
|
catch (error) {
|
|
51
51
|
this.parseError(error);
|
|
52
|
-
throw new
|
|
52
|
+
throw new error_1.OrchestratorError({ message: 'Failed to get portfolio' });
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
async getMaxTokenAmount(userAddress, destinationChainId, destinationTokenAddress, destinationGasUnits, sponsored) {
|
|
@@ -112,7 +112,7 @@ class Orchestrator {
|
|
|
112
112
|
}
|
|
113
113
|
catch (error) {
|
|
114
114
|
this.parseError(error);
|
|
115
|
-
throw new
|
|
115
|
+
throw new error_1.OrchestratorError({ message: 'Failed to get intent cost' });
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
async getIntentRoute(input) {
|
|
@@ -128,7 +128,7 @@ class Orchestrator {
|
|
|
128
128
|
}
|
|
129
129
|
catch (error) {
|
|
130
130
|
this.parseError(error);
|
|
131
|
-
throw new
|
|
131
|
+
throw new error_1.OrchestratorError({ message: 'Failed to get intent route' });
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
async submitIntent(signedIntentOp) {
|
|
@@ -144,7 +144,7 @@ class Orchestrator {
|
|
|
144
144
|
}
|
|
145
145
|
catch (error) {
|
|
146
146
|
this.parseError(error);
|
|
147
|
-
throw new
|
|
147
|
+
throw new error_1.OrchestratorError({ message: 'Failed to submit intent' });
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
async simulateIntent(signedIntentOp) {
|
|
@@ -160,7 +160,7 @@ class Orchestrator {
|
|
|
160
160
|
}
|
|
161
161
|
catch (error) {
|
|
162
162
|
this.parseError(error);
|
|
163
|
-
throw new
|
|
163
|
+
throw new error_1.OrchestratorError({ message: 'Failed to simulate intent' });
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
async getIntentOpStatus(intentId) {
|
|
@@ -174,7 +174,7 @@ class Orchestrator {
|
|
|
174
174
|
}
|
|
175
175
|
catch (error) {
|
|
176
176
|
this.parseError(error);
|
|
177
|
-
throw new
|
|
177
|
+
throw new error_1.OrchestratorError({ message: 'Failed to get intent op status' });
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
parseError(error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MAAM,CAAA;AAcvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MAAM,CAAA;AAcvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1D,iBAAS,oBAAoB,IAAI,MAAM,EAAE,CAExC;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAY7C;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAetE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAsB3E;AAOD,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAmB5C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3C;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAS3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAO1D;AAED,iBAAS,2BAA2B,CAAC,UAAU,CAAC,EAAE,OAAO;;EAaxD;AAED,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,WAAW,GAAG,OAAO,EAC5B,OAAO,EAAE,MAAM,GACd,OAAO,CAKT;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,SAAS,EACT,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,GACpB,CAAA"}
|
|
@@ -13,6 +13,7 @@ exports.resolveTokenAddress = resolveTokenAddress;
|
|
|
13
13
|
const shared_configs_1 = require("@rhinestone/shared-configs");
|
|
14
14
|
const viem_1 = require("viem");
|
|
15
15
|
const chains_1 = require("viem/chains");
|
|
16
|
+
const error_1 = require("./error");
|
|
16
17
|
function getSupportedChainIds() {
|
|
17
18
|
return shared_configs_1.chains.map((chain) => chain.id);
|
|
18
19
|
}
|
|
@@ -22,42 +23,42 @@ function getChainEntry(chainId) {
|
|
|
22
23
|
function getWethAddress(chain) {
|
|
23
24
|
const chainEntry = getChainEntry(chain.id);
|
|
24
25
|
if (!chainEntry) {
|
|
25
|
-
throw new
|
|
26
|
+
throw new error_1.UnsupportedChainError(chain.id);
|
|
26
27
|
}
|
|
27
28
|
const wethToken = chainEntry.tokens.find((token) => token.symbol === 'WETH');
|
|
28
29
|
if (!wethToken) {
|
|
29
|
-
throw new
|
|
30
|
+
throw new error_1.UnsupportedTokenError('WETH', chain.id);
|
|
30
31
|
}
|
|
31
32
|
return wethToken.address;
|
|
32
33
|
}
|
|
33
34
|
function getTokenSymbol(tokenAddress, chainId) {
|
|
34
35
|
const chainEntry = getChainEntry(chainId);
|
|
35
36
|
if (!chainEntry) {
|
|
36
|
-
throw new
|
|
37
|
+
throw new error_1.UnsupportedChainError(chainId);
|
|
37
38
|
}
|
|
38
39
|
const token = chainEntry.tokens.find((t) => t.address.toLowerCase() === tokenAddress.toLowerCase());
|
|
39
40
|
if (!token) {
|
|
40
|
-
throw new
|
|
41
|
+
throw new error_1.UnsupportedTokenError(tokenAddress, chainId);
|
|
41
42
|
}
|
|
42
43
|
return token.symbol;
|
|
43
44
|
}
|
|
44
45
|
function getTokenAddress(tokenSymbol, chainId) {
|
|
45
46
|
if (chainId === chains_1.polygon.id && tokenSymbol === 'ETH') {
|
|
46
|
-
throw new
|
|
47
|
+
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId);
|
|
47
48
|
}
|
|
48
49
|
if (chainId === chains_1.sonic.id && tokenSymbol !== 'USDC') {
|
|
49
|
-
throw new
|
|
50
|
+
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId);
|
|
50
51
|
}
|
|
51
52
|
if (tokenSymbol === 'ETH') {
|
|
52
53
|
return viem_1.zeroAddress;
|
|
53
54
|
}
|
|
54
55
|
const chainEntry = getChainEntry(chainId);
|
|
55
56
|
if (!chainEntry) {
|
|
56
|
-
throw new
|
|
57
|
+
throw new error_1.UnsupportedChainError(chainId);
|
|
57
58
|
}
|
|
58
59
|
const token = chainEntry.tokens.find((t) => t.symbol === tokenSymbol);
|
|
59
60
|
if (!token) {
|
|
60
|
-
throw new
|
|
61
|
+
throw new error_1.UnsupportedTokenError(tokenSymbol, chainId);
|
|
61
62
|
}
|
|
62
63
|
return token.address;
|
|
63
64
|
}
|
|
@@ -80,7 +81,7 @@ function getChainById(chainId) {
|
|
|
80
81
|
[chains_1.sonic.id]: chains_1.sonic,
|
|
81
82
|
};
|
|
82
83
|
if (!isChainIdSupported(chainId)) {
|
|
83
|
-
throw new
|
|
84
|
+
throw new error_1.UnsupportedChainError(chainId);
|
|
84
85
|
}
|
|
85
86
|
return chains[chainId];
|
|
86
87
|
}
|
|
@@ -98,7 +99,7 @@ function isTokenAddressSupported(address, chainId) {
|
|
|
98
99
|
function getSupportedTokens(chainId) {
|
|
99
100
|
const chainEntry = getChainEntry(chainId);
|
|
100
101
|
if (!chainEntry) {
|
|
101
|
-
throw new
|
|
102
|
+
throw new error_1.UnsupportedChainError(chainId);
|
|
102
103
|
}
|
|
103
104
|
return chainEntry.tokens;
|
|
104
105
|
}
|
|
@@ -73,7 +73,7 @@ const UNSUPPORTED_TOKEN_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
|
73
73
|
(0, vitest_1.expect)(chain.name).toBe(chains_1.mainnet.name);
|
|
74
74
|
});
|
|
75
75
|
(0, vitest_1.test)('throws error for unsupported chain', () => {
|
|
76
|
-
(0, vitest_1.expect)(() => (0, registry_1.getChainById)(UNSUPPORTED_CHAIN_ID)).toThrow(`
|
|
76
|
+
(0, vitest_1.expect)(() => (0, registry_1.getChainById)(UNSUPPORTED_CHAIN_ID)).toThrow(`Unsupported chain ${UNSUPPORTED_CHAIN_ID}`);
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
(0, vitest_1.describe)('isTestnet', () => {
|
|
@@ -84,7 +84,7 @@ const UNSUPPORTED_TOKEN_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
|
84
84
|
(0, vitest_1.expect)((0, registry_1.isTestnet)(chains_1.sepolia.id)).toBe(true);
|
|
85
85
|
});
|
|
86
86
|
(0, vitest_1.test)('throws error for unsupported chain', () => {
|
|
87
|
-
(0, vitest_1.expect)(() => (0, registry_1.isTestnet)(UNSUPPORTED_CHAIN_ID)).toThrow(`
|
|
87
|
+
(0, vitest_1.expect)(() => (0, registry_1.isTestnet)(UNSUPPORTED_CHAIN_ID)).toThrow(`Unsupported chain ${UNSUPPORTED_CHAIN_ID}`);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
90
|
(0, vitest_1.describe)('isTokenAddressSupported', () => {
|
|
@@ -104,7 +104,7 @@ const UNSUPPORTED_TOKEN_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
|
104
104
|
(0, vitest_1.expect)(tokens.find((t) => t.symbol === TOKEN_SYMBOLS.USDC)).toBeDefined();
|
|
105
105
|
});
|
|
106
106
|
(0, vitest_1.test)('throws error for unsupported chain', () => {
|
|
107
|
-
(0, vitest_1.expect)(() => (0, registry_1.getSupportedTokens)(UNSUPPORTED_CHAIN_ID)).toThrow(`
|
|
107
|
+
(0, vitest_1.expect)(() => (0, registry_1.getSupportedTokens)(UNSUPPORTED_CHAIN_ID)).toThrow(`Unsupported chain ${UNSUPPORTED_CHAIN_ID}`);
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
(0, vitest_1.describe)('getDefaultAccountAccessList', () => {
|
|
@@ -128,7 +128,7 @@ const UNSUPPORTED_TOKEN_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
|
128
128
|
(0, vitest_1.expect)(result).toBe(TOKEN_ADDRESSES.ETHEREUM_USDC);
|
|
129
129
|
});
|
|
130
130
|
(0, vitest_1.test)('throw error for unsupported token', () => {
|
|
131
|
-
(0, vitest_1.expect)(() => (0, registry_1.resolveTokenAddress)(TOKEN_SYMBOLS.USDT, chains_1.baseSepolia.id)).toThrow(`Unsupported token
|
|
131
|
+
(0, vitest_1.expect)(() => (0, registry_1.resolveTokenAddress)(TOKEN_SYMBOLS.USDT, chains_1.baseSepolia.id)).toThrow(`Unsupported token ${TOKEN_SYMBOLS.USDT} for chain ${chains_1.baseSepolia.id}`);
|
|
132
132
|
});
|
|
133
133
|
(0, vitest_1.test)('throws error for unsupported chain', () => {
|
|
134
134
|
(0, vitest_1.expect)(() => (0, registry_1.resolveTokenAddress)(TOKEN_SYMBOLS.USDC, UNSUPPORTED_CHAIN_ID)).toThrow(`Unsupported chain ${UNSUPPORTED_CHAIN_ID}`);
|