@charterlabs/rhinestone-sdk 0.3.0 → 0.3.2
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/README.md +31 -200
- package/dist/src/accounts/error.d.ts +8 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +10 -1
- package/dist/src/accounts/index.d.ts +11 -10
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +79 -50
- package/dist/src/accounts/kernel.d.ts +3 -5
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +8 -17
- package/dist/src/accounts/kernel.test.js +10 -3
- package/dist/src/accounts/nexus.d.ts +3 -5
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +108 -57
- package/dist/src/accounts/nexus.test.js +10 -3
- package/dist/src/accounts/passport.d.ts +4 -7
- package/dist/src/accounts/passport.d.ts.map +1 -1
- package/dist/src/accounts/passport.js +0 -91
- package/dist/src/accounts/safe.d.ts +9 -4
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +108 -38
- package/dist/src/accounts/safe.test.js +10 -3
- package/dist/src/accounts/signing/common.d.ts +3 -3
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +29 -5
- package/dist/src/accounts/signing/message.js +2 -2
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +3 -3
- package/dist/src/accounts/startale.d.ts +2 -4
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +0 -4
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +10 -3
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +6 -0
- package/dist/src/actions/compact.d.ts +4 -2
- package/dist/src/actions/compact.d.ts.map +1 -1
- package/dist/src/actions/compact.js +4 -1
- package/dist/src/actions/deployment.d.ts +19 -0
- package/dist/src/actions/deployment.d.ts.map +1 -0
- package/dist/src/actions/deployment.js +78 -0
- package/dist/src/actions/index.d.ts +3 -1
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +12 -0
- package/dist/src/actions/smart-sessions.d.ts +17 -8
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +40 -4
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +3 -1
- package/dist/src/execution/compact.d.ts +15 -18
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +15 -17
- package/dist/src/execution/error.d.ts +2 -8
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +1 -10
- package/dist/src/execution/index.d.ts +6 -6
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +22 -28
- package/dist/src/execution/permit2.d.ts +12 -17
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +10 -16
- package/dist/src/execution/singleChainOps.d.ts +15 -3
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +17 -3
- package/dist/src/execution/utils.d.ts +36 -12
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +180 -133
- package/dist/src/index.d.ts +26 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +49 -16
- package/dist/src/modules/abi/smart-session-emissary.d.ts +696 -0
- package/dist/src/modules/abi/smart-session-emissary.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-session-emissary.js +565 -0
- package/dist/src/modules/chain-abstraction.d.ts +5 -0
- package/dist/src/modules/chain-abstraction.d.ts.map +1 -0
- package/dist/src/modules/chain-abstraction.js +7 -0
- package/dist/src/modules/common.d.ts +7 -1
- package/dist/src/modules/common.d.ts.map +1 -1
- package/dist/src/modules/index.d.ts +3 -9
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +11 -8
- package/dist/src/modules/index.test.js +3 -9
- package/dist/src/modules/legacy.d.ts +10 -0
- package/dist/src/modules/legacy.d.ts.map +1 -0
- package/dist/src/modules/legacy.js +65 -0
- package/dist/src/modules/validators/core.d.ts +2 -1
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +4 -1
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +1 -6
- package/dist/src/modules/validators/smart-sessions.d.ts +112 -23
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +426 -301
- package/dist/src/orchestrator/client.d.ts +3 -4
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +49 -53
- package/dist/src/orchestrator/error.d.ts +11 -1
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +16 -1
- package/dist/src/orchestrator/index.d.ts +5 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +3 -1
- package/dist/src/orchestrator/registry.d.ts +3 -2
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +15 -14
- package/dist/src/orchestrator/registry.test.js +18 -1
- package/dist/src/orchestrator/types.d.ts +33 -8
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +15 -1
- package/dist/src/types.d.ts +57 -28
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +14 -2
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +46 -4
- package/dist/test/utils/utils.d.ts +5 -0
- package/dist/test/utils/utils.d.ts.map +1 -0
- package/dist/test/utils/utils.js +20 -0
- package/package.json +33 -3
- package/dist/src/execution/smart-session.d.ts +0 -13
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -178
- package/dist/src/modules/omni-account.d.ts +0 -8
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -13
- package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.test.js +0 -222
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../actions/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAO,MAAM,MAAM,CAAA;AAQ/C,OAAO,KAAK,EACV,qBAAqB,EAErB,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAyCjB;;;GAGG;AACH,iBAAe,uBAAuB,CAAC,MAAM,EAAE;IAC7C,cAAc,EAAE,OAAO,MAAM,EAAE,OAAO,CAAA;IACtC,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,aAAa,EAAE,qBAAqB,CAAA;IACpC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,mBAAmB,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAmDvD;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployAccountsForOwners = deployAccountsForOwners;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const accounts_1 = require("../accounts");
|
|
6
|
+
const utils_1 = require("../accounts/utils");
|
|
7
|
+
async function deployWithCustomFactory(sponsorConfig, chain, factoryArgs) {
|
|
8
|
+
const sponsorOwners = sponsorConfig.owners;
|
|
9
|
+
if (!sponsorOwners ||
|
|
10
|
+
sponsorOwners.type !== 'ecdsa' ||
|
|
11
|
+
sponsorOwners.accounts.length === 0) {
|
|
12
|
+
throw new Error('Sponsor must have an ECDSA account');
|
|
13
|
+
}
|
|
14
|
+
const sponsorAccount = sponsorOwners.accounts[0];
|
|
15
|
+
if (!('signTransaction' in sponsorAccount)) {
|
|
16
|
+
throw new Error('Sponsor account must be able to sign transactions');
|
|
17
|
+
}
|
|
18
|
+
const publicClient = (0, viem_1.createPublicClient)({
|
|
19
|
+
chain,
|
|
20
|
+
transport: (0, utils_1.createTransport)(chain, sponsorConfig.provider),
|
|
21
|
+
});
|
|
22
|
+
const walletClient = (0, viem_1.createWalletClient)({
|
|
23
|
+
account: sponsorAccount,
|
|
24
|
+
chain,
|
|
25
|
+
transport: (0, utils_1.createTransport)(chain, sponsorConfig.provider),
|
|
26
|
+
});
|
|
27
|
+
const hash = await walletClient.sendTransaction({
|
|
28
|
+
to: factoryArgs.factory,
|
|
29
|
+
data: factoryArgs.factoryData,
|
|
30
|
+
value: 0n,
|
|
31
|
+
});
|
|
32
|
+
await publicClient.waitForTransactionReceipt({ hash });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Deploy smart accounts for multiple users from a backend using a sponsor wallet.
|
|
36
|
+
* The sponsor pays for gas, but users own and control their accounts.
|
|
37
|
+
*/
|
|
38
|
+
async function deployAccountsForOwners(params) {
|
|
39
|
+
const { sponsorAccount, ownerAddresses, accountConfig, chain, sdkConfig } = params;
|
|
40
|
+
const results = [];
|
|
41
|
+
for (const ownerAddress of ownerAddresses) {
|
|
42
|
+
const ownerAccountRef = {
|
|
43
|
+
address: ownerAddress,
|
|
44
|
+
type: 'json-rpc',
|
|
45
|
+
};
|
|
46
|
+
const userConfig = {
|
|
47
|
+
account: accountConfig,
|
|
48
|
+
owners: {
|
|
49
|
+
type: 'ecdsa',
|
|
50
|
+
accounts: [ownerAccountRef],
|
|
51
|
+
threshold: 1,
|
|
52
|
+
},
|
|
53
|
+
...sdkConfig,
|
|
54
|
+
};
|
|
55
|
+
const accountAddress = (0, accounts_1.getAddress)(userConfig);
|
|
56
|
+
const isAlreadyDeployed = await (0, accounts_1.isDeployed)(userConfig, chain);
|
|
57
|
+
if (isAlreadyDeployed) {
|
|
58
|
+
results.push({ owner: ownerAddress, account: accountAddress });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const sponsorConfig = {
|
|
62
|
+
account: accountConfig,
|
|
63
|
+
owners: {
|
|
64
|
+
type: 'ecdsa',
|
|
65
|
+
accounts: [sponsorAccount],
|
|
66
|
+
threshold: 1,
|
|
67
|
+
},
|
|
68
|
+
...sdkConfig,
|
|
69
|
+
};
|
|
70
|
+
const initCode = (0, accounts_1.getInitCode)(userConfig);
|
|
71
|
+
if (!initCode || !('factory' in initCode)) {
|
|
72
|
+
throw new Error('Failed to get init code for account deployment');
|
|
73
|
+
}
|
|
74
|
+
await deployWithCustomFactory(sponsorConfig, chain, initCode);
|
|
75
|
+
results.push({ owner: ownerAddress, account: accountAddress });
|
|
76
|
+
}
|
|
77
|
+
return results;
|
|
78
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RhinestoneAccount } from '../index';
|
|
1
2
|
import type { LazyCallInput, ModuleInput } from '../types';
|
|
2
3
|
/**
|
|
3
4
|
* Install a custom module
|
|
@@ -11,5 +12,6 @@ declare function installModule(module: ModuleInput): LazyCallInput;
|
|
|
11
12
|
* @returns Calls to uninstall the module
|
|
12
13
|
*/
|
|
13
14
|
declare function uninstallModule(module: ModuleInput): LazyCallInput;
|
|
14
|
-
|
|
15
|
+
declare function deploy(account: RhinestoneAccount): LazyCallInput;
|
|
16
|
+
export { installModule, uninstallModule, deploy };
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../actions/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../actions/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;GAIG;AACH,iBAAS,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAOzD;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAO3D;AAYD,iBAAS,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAUzD;AAED,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.installModule = installModule;
|
|
4
4
|
exports.uninstallModule = uninstallModule;
|
|
5
|
+
exports.deploy = deploy;
|
|
5
6
|
const accounts_1 = require("../accounts");
|
|
6
7
|
const common_1 = require("../modules/common");
|
|
7
8
|
/**
|
|
@@ -39,3 +40,14 @@ function getModule(module) {
|
|
|
39
40
|
additionalContext: module.additionalContext ?? '0x',
|
|
40
41
|
};
|
|
41
42
|
}
|
|
43
|
+
function deploy(account) {
|
|
44
|
+
const initData = account.getInitData();
|
|
45
|
+
return {
|
|
46
|
+
async resolve() {
|
|
47
|
+
return {
|
|
48
|
+
to: initData.factory,
|
|
49
|
+
data: initData.factoryData,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { LazyCallInput, SessionInput } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Enable smart sessions
|
|
5
|
+
* @returns Calls to enable smart sessions
|
|
6
|
+
*/
|
|
7
|
+
declare function experimental_enable(): LazyCallInput;
|
|
8
|
+
/**
|
|
9
|
+
* Disable smart sessions
|
|
10
|
+
* @returns Calls to disable smart sessions
|
|
11
|
+
*/
|
|
12
|
+
declare function experimental_disable(): LazyCallInput;
|
|
2
13
|
/**
|
|
3
14
|
* Enable a smart session
|
|
4
15
|
* @param session session to enable
|
|
5
16
|
* @returns Calls to enable the smart session
|
|
6
17
|
*/
|
|
7
|
-
declare function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
export { enableSession };
|
|
18
|
+
declare function experimental_enableSession(session: SessionInput, enableSessionSignature: Hex, hashesAndChainIds: {
|
|
19
|
+
chainId: bigint;
|
|
20
|
+
sessionDigest: Hex;
|
|
21
|
+
}[], sessionToEnableIndex: number): LazyCallInput;
|
|
22
|
+
export { experimental_disable, experimental_enable, experimental_enableSession };
|
|
14
23
|
//# sourceMappingURL=smart-sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAS/B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE3D;;;GAGG;AACH,iBAAS,mBAAmB,IAAI,aAAa,CAU5C;AAED;;;GAGG;AACH,iBAAS,oBAAoB,IAAI,aAAa,CAU7C;AAED;;;;GAIG;AACH,iBAAS,0BAA0B,CACjC,OAAO,EAAE,YAAY,EACrB,sBAAsB,EAAE,GAAG,EAC3B,iBAAiB,EAAE;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,GAAG,CAAA;CACnB,EAAE,EACH,oBAAoB,EAAE,MAAM,GAC3B,aAAa,CAef;AAED,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAA"}
|
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.experimental_disable = experimental_disable;
|
|
4
|
+
exports.experimental_enable = experimental_enable;
|
|
5
|
+
exports.experimental_enableSession = experimental_enableSession;
|
|
6
|
+
const accounts_1 = require("../accounts");
|
|
4
7
|
const smart_sessions_1 = require("../modules/validators/smart-sessions");
|
|
8
|
+
/**
|
|
9
|
+
* Enable smart sessions
|
|
10
|
+
* @returns Calls to enable smart sessions
|
|
11
|
+
*/
|
|
12
|
+
function experimental_enable() {
|
|
13
|
+
return {
|
|
14
|
+
async resolve({ config }) {
|
|
15
|
+
const module = (0, smart_sessions_1.getSmartSessionValidator)(config);
|
|
16
|
+
if (!module) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return (0, accounts_1.getModuleInstallationCalls)(config, module);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Disable smart sessions
|
|
25
|
+
* @returns Calls to disable smart sessions
|
|
26
|
+
*/
|
|
27
|
+
function experimental_disable() {
|
|
28
|
+
return {
|
|
29
|
+
async resolve({ config }) {
|
|
30
|
+
const module = (0, smart_sessions_1.getSmartSessionValidator)(config);
|
|
31
|
+
if (!module) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return (0, accounts_1.getModuleUninstallationCalls)(config, module);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
5
38
|
/**
|
|
6
39
|
* Enable a smart session
|
|
7
40
|
* @param session session to enable
|
|
8
41
|
* @returns Calls to enable the smart session
|
|
9
42
|
*/
|
|
10
|
-
function
|
|
43
|
+
function experimental_enableSession(session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex) {
|
|
11
44
|
return {
|
|
12
|
-
async resolve() {
|
|
13
|
-
return (0, smart_sessions_1.getEnableSessionCall)(
|
|
45
|
+
async resolve({ accountAddress, chain }) {
|
|
46
|
+
return (0, smart_sessions_1.getEnableSessionCall)(accountAddress, {
|
|
47
|
+
...session,
|
|
48
|
+
chain,
|
|
49
|
+
}, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex);
|
|
14
50
|
},
|
|
15
51
|
};
|
|
16
52
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from '../accounts';
|
|
1
|
+
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from '../accounts';
|
|
2
2
|
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from '../execution';
|
|
3
|
-
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from '../orchestrator';
|
|
4
|
-
export { isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
3
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from '../orchestrator';
|
|
4
|
+
export { isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, EoaAccountMustHaveAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, WalletClientNoConnectedAccountError, isExecutionError, ExecutionError, IntentFailedError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,6BAA6B,EAC7B,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EAEvB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EAEnC,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gCAAgC,EAChC,yBAAyB,EACzB,uBAAuB,EAEvB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
package/dist/src/errors/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.SimulationFailedError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.SignerNotSupportedError = 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.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
3
|
+
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.SimulationFailedError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientLiquidityError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.SignerNotSupportedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.IntentFailedError = exports.ExecutionError = exports.isExecutionError = exports.WalletClientNoConnectedAccountError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.EoaAccountMustHaveAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
4
4
|
const accounts_1 = require("../accounts");
|
|
5
5
|
Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return accounts_1.AccountConfigurationNotSupportedError; } });
|
|
6
6
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
7
7
|
Object.defineProperty(exports, "Eip712DomainNotAvailableError", { enumerable: true, get: function () { return accounts_1.Eip712DomainNotAvailableError; } });
|
|
8
8
|
Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return accounts_1.Eip7702AccountMustHaveEoaError; } });
|
|
9
9
|
Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return accounts_1.Eip7702NotSupportedForAccountError; } });
|
|
10
|
+
Object.defineProperty(exports, "EoaAccountMustHaveAccountError", { enumerable: true, get: function () { return accounts_1.EoaAccountMustHaveAccountError; } });
|
|
10
11
|
Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enumerable: true, get: function () { return accounts_1.ExistingEip7702AccountsNotSupportedError; } });
|
|
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; } });
|
|
@@ -27,6 +28,7 @@ Object.defineProperty(exports, "BodyParserError", { enumerable: true, get: funct
|
|
|
27
28
|
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return orchestrator_1.ConflictError; } });
|
|
28
29
|
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return orchestrator_1.ForbiddenError; } });
|
|
29
30
|
Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return orchestrator_1.InsufficientBalanceError; } });
|
|
31
|
+
Object.defineProperty(exports, "InsufficientLiquidityError", { enumerable: true, get: function () { return orchestrator_1.InsufficientLiquidityError; } });
|
|
30
32
|
Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return orchestrator_1.IntentNotFoundError; } });
|
|
31
33
|
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return orchestrator_1.InternalServerError; } });
|
|
32
34
|
Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return orchestrator_1.InvalidApiKeyError; } });
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type Hex } from 'viem';
|
|
2
2
|
import type { IntentOp, IntentOpElement } from '../orchestrator/types';
|
|
3
|
+
declare const SCOPE_MULTICHAIN = 0;
|
|
4
|
+
declare const RESET_PERIOD_ONE_WEEK = 6;
|
|
3
5
|
declare const COMPACT_ADDRESS = "0x00000000000000171ede64904551eeDF3C6C9788";
|
|
4
6
|
declare function getCompactTypedData(intentOp: IntentOp): {
|
|
5
7
|
readonly domain: {
|
|
6
8
|
readonly name: "The Compact";
|
|
7
9
|
readonly version: "1";
|
|
8
|
-
readonly chainId:
|
|
10
|
+
readonly chainId: number;
|
|
9
11
|
readonly verifyingContract: "0x73d2dc0c21fca4ec1601895d50df7f5624f07d3f";
|
|
10
12
|
};
|
|
11
13
|
readonly types: {
|
|
@@ -48,18 +50,15 @@ declare function getCompactTypedData(intentOp: IntentOp): {
|
|
|
48
50
|
readonly Mandate: readonly [{
|
|
49
51
|
readonly name: "target";
|
|
50
52
|
readonly type: "Target";
|
|
51
|
-
}, {
|
|
52
|
-
readonly name: "v";
|
|
53
|
-
readonly type: "uint8";
|
|
54
53
|
}, {
|
|
55
54
|
readonly name: "minGas";
|
|
56
55
|
readonly type: "uint128";
|
|
57
56
|
}, {
|
|
58
57
|
readonly name: "originOps";
|
|
59
|
-
readonly type: "Op
|
|
58
|
+
readonly type: "Op";
|
|
60
59
|
}, {
|
|
61
60
|
readonly name: "destOps";
|
|
62
|
-
readonly type: "Op
|
|
61
|
+
readonly type: "Op";
|
|
63
62
|
}, {
|
|
64
63
|
readonly name: "q";
|
|
65
64
|
readonly type: "bytes32";
|
|
@@ -85,6 +84,13 @@ declare function getCompactTypedData(intentOp: IntentOp): {
|
|
|
85
84
|
readonly type: "uint256";
|
|
86
85
|
}];
|
|
87
86
|
readonly Op: readonly [{
|
|
87
|
+
readonly name: "vt";
|
|
88
|
+
readonly type: "bytes32";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "ops";
|
|
91
|
+
readonly type: "Ops[]";
|
|
92
|
+
}];
|
|
93
|
+
readonly Ops: readonly [{
|
|
88
94
|
readonly name: "to";
|
|
89
95
|
readonly type: "address";
|
|
90
96
|
}, {
|
|
@@ -118,18 +124,9 @@ declare function getCompactTypedData(intentOp: IntentOp): {
|
|
|
118
124
|
targetChain: bigint;
|
|
119
125
|
fillExpiry: bigint;
|
|
120
126
|
};
|
|
121
|
-
v: number;
|
|
122
127
|
minGas: bigint;
|
|
123
|
-
originOps:
|
|
124
|
-
|
|
125
|
-
value: bigint;
|
|
126
|
-
data: `0x${string}`;
|
|
127
|
-
}[];
|
|
128
|
-
destOps: {
|
|
129
|
-
to: `0x${string}`;
|
|
130
|
-
value: bigint;
|
|
131
|
-
data: `0x${string}`;
|
|
132
|
-
}[];
|
|
128
|
+
originOps: import("../orchestrator/types").Op;
|
|
129
|
+
destOps: import("../orchestrator/types").Op;
|
|
133
130
|
q: `0x${string}`;
|
|
134
131
|
};
|
|
135
132
|
}[];
|
|
@@ -147,5 +144,5 @@ declare function getCompactDigest(intentOp: IntentOp): Hex;
|
|
|
147
144
|
* @returns The digest hash
|
|
148
145
|
*/
|
|
149
146
|
declare function getPermit2Digest(element: IntentOpElement, nonce: bigint, expires: bigint): Hex;
|
|
150
|
-
export { COMPACT_ADDRESS, getCompactTypedData, getCompactDigest, getPermit2Digest, };
|
|
147
|
+
export { SCOPE_MULTICHAIN, RESET_PERIOD_ONE_WEEK, COMPACT_ADDRESS, getCompactTypedData, getCompactDigest, getPermit2Digest, };
|
|
151
148
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0C,MAAM,MAAM,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGtE,QAAA,MAAM,eAAe,+CAA+C,CAAA;
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA0C,MAAM,MAAM,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGtE,QAAA,MAAM,gBAAgB,IAAI,CAAA;AAC1B,QAAA,MAAM,qBAAqB,IAAI,CAAA;AAE/B,QAAA,MAAM,eAAe,+CAA+C,CAAA;AAiDpE,iBAAS,mBAAmB,CAAC,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C9C;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAGjD;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CACvB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,GAAG,CAGL;AAED,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,CAAA"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMPACT_ADDRESS = void 0;
|
|
3
|
+
exports.COMPACT_ADDRESS = exports.RESET_PERIOD_ONE_WEEK = exports.SCOPE_MULTICHAIN = void 0;
|
|
4
4
|
exports.getCompactTypedData = getCompactTypedData;
|
|
5
5
|
exports.getCompactDigest = getCompactDigest;
|
|
6
6
|
exports.getPermit2Digest = getPermit2Digest;
|
|
7
7
|
const viem_1 = require("viem");
|
|
8
8
|
const permit2_1 = require("./permit2");
|
|
9
|
+
const SCOPE_MULTICHAIN = 0;
|
|
10
|
+
exports.SCOPE_MULTICHAIN = SCOPE_MULTICHAIN;
|
|
11
|
+
const RESET_PERIOD_ONE_WEEK = 6;
|
|
12
|
+
exports.RESET_PERIOD_ONE_WEEK = RESET_PERIOD_ONE_WEEK;
|
|
9
13
|
const COMPACT_ADDRESS = '0x00000000000000171ede64904551eeDF3C6C9788';
|
|
10
14
|
exports.COMPACT_ADDRESS = COMPACT_ADDRESS;
|
|
11
15
|
// Define the typed data structure as const to preserve type safety
|
|
@@ -29,10 +33,9 @@ const COMPACT_TYPED_DATA_TYPES = {
|
|
|
29
33
|
],
|
|
30
34
|
Mandate: [
|
|
31
35
|
{ name: 'target', type: 'Target' },
|
|
32
|
-
{ name: 'v', type: 'uint8' },
|
|
33
36
|
{ name: 'minGas', type: 'uint128' },
|
|
34
|
-
{ name: 'originOps', type: 'Op
|
|
35
|
-
{ name: 'destOps', type: 'Op
|
|
37
|
+
{ name: 'originOps', type: 'Op' },
|
|
38
|
+
{ name: 'destOps', type: 'Op' },
|
|
36
39
|
{ name: 'q', type: 'bytes32' },
|
|
37
40
|
],
|
|
38
41
|
Target: [
|
|
@@ -46,6 +49,10 @@ const COMPACT_TYPED_DATA_TYPES = {
|
|
|
46
49
|
{ name: 'amount', type: 'uint256' },
|
|
47
50
|
],
|
|
48
51
|
Op: [
|
|
52
|
+
{ name: 'vt', type: 'bytes32' },
|
|
53
|
+
{ name: 'ops', type: 'Ops[]' },
|
|
54
|
+
],
|
|
55
|
+
Ops: [
|
|
49
56
|
{ name: 'to', type: 'address' },
|
|
50
57
|
{ name: 'value', type: 'uint256' },
|
|
51
58
|
{ name: 'data', type: 'bytes' },
|
|
@@ -56,7 +63,7 @@ function getCompactTypedData(intentOp) {
|
|
|
56
63
|
domain: {
|
|
57
64
|
name: 'The Compact',
|
|
58
65
|
version: '1',
|
|
59
|
-
chainId:
|
|
66
|
+
chainId: Number(intentOp.elements[0].chainId),
|
|
60
67
|
verifyingContract: '0x73d2dc0c21fca4ec1601895d50df7f5624f07d3f',
|
|
61
68
|
},
|
|
62
69
|
types: COMPACT_TYPED_DATA_TYPES,
|
|
@@ -83,18 +90,9 @@ function getCompactTypedData(intentOp) {
|
|
|
83
90
|
targetChain: BigInt(element.mandate.destinationChainId),
|
|
84
91
|
fillExpiry: BigInt(element.mandate.fillDeadline),
|
|
85
92
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
to: op.to,
|
|
90
|
-
value: BigInt(op.value),
|
|
91
|
-
data: op.data,
|
|
92
|
-
})),
|
|
93
|
-
destOps: element.mandate.destinationOps.map((op) => ({
|
|
94
|
-
to: op.to,
|
|
95
|
-
value: BigInt(op.value),
|
|
96
|
-
data: op.data,
|
|
97
|
-
})),
|
|
93
|
+
minGas: BigInt(element.mandate.minGas),
|
|
94
|
+
originOps: element.mandate.preClaimOps,
|
|
95
|
+
destOps: element.mandate.destinationOps,
|
|
98
96
|
q: (0, viem_1.keccak256)(element.mandate.qualifier.encodedVal),
|
|
99
97
|
},
|
|
100
98
|
})),
|
|
@@ -21,13 +21,6 @@ declare class SignerNotSupportedError extends ExecutionError {
|
|
|
21
21
|
traceId?: string;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
declare class CallsNotSupportedError extends ExecutionError {
|
|
25
|
-
constructor(params?: {
|
|
26
|
-
context?: any;
|
|
27
|
-
errorType?: string;
|
|
28
|
-
traceId?: string;
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
24
|
declare class OrderPathRequiredForIntentsError extends ExecutionError {
|
|
32
25
|
constructor(params?: {
|
|
33
26
|
context?: any;
|
|
@@ -44,6 +37,7 @@ declare class SessionChainRequiredError extends ExecutionError {
|
|
|
44
37
|
}
|
|
45
38
|
declare class IntentFailedError extends ExecutionError {
|
|
46
39
|
constructor(params?: {
|
|
40
|
+
intentId?: string;
|
|
47
41
|
context?: any;
|
|
48
42
|
errorType?: string;
|
|
49
43
|
traceId?: string;
|
|
@@ -57,5 +51,5 @@ declare class IntentStatusTimeoutError extends ExecutionError {
|
|
|
57
51
|
});
|
|
58
52
|
}
|
|
59
53
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
60
|
-
export { isExecutionError, ExecutionError, OrderPathRequiredForIntentsError,
|
|
54
|
+
export { isExecutionError, ExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
|
|
61
55
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,uBAAwB,SAAQ,cAAc;gBACtC,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,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,uBAAwB,SAAQ,cAAc;gBACtC,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,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,iBAAkB,SAAQ,cAAc;gBAChC,MAAM,CAAC,EAAE;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,wBAAyB,SAAQ,cAAc;gBACvC,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,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.
|
|
3
|
+
exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -37,15 +37,6 @@ class SignerNotSupportedError extends ExecutionError {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.SignerNotSupportedError = SignerNotSupportedError;
|
|
40
|
-
class CallsNotSupportedError extends ExecutionError {
|
|
41
|
-
constructor(params) {
|
|
42
|
-
super({
|
|
43
|
-
message: 'Target chain calls are not supported for this account type',
|
|
44
|
-
...params,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.CallsNotSupportedError = CallsNotSupportedError;
|
|
49
40
|
class OrderPathRequiredForIntentsError extends ExecutionError {
|
|
50
41
|
constructor(params) {
|
|
51
42
|
super({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/_types/account-abstraction';
|
|
3
|
-
import type { IntentOpStatus } from '../orchestrator';
|
|
3
|
+
import type { IntentOpStatus, SplitIntentsInput } from '../orchestrator';
|
|
4
4
|
import type { SettlementLayer } from '../orchestrator/types';
|
|
5
|
-
import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
|
|
5
|
+
import type { CalldataInput, CallInput, RhinestoneAccountConfig, RhinestoneConfig, SignerSet, SourceAssetInput, Sponsorship, TokenRequest, TokenSymbol, Transaction, UserOperationTransaction } from '../types';
|
|
6
6
|
import { ExecutionError, IntentFailedError, IntentStatusTimeoutError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError } from './error';
|
|
7
7
|
import type { TransactionResult, UserOperationResult } from './utils';
|
|
8
8
|
interface TransactionStatus {
|
|
@@ -17,13 +17,13 @@ interface TransactionStatus {
|
|
|
17
17
|
}
|
|
18
18
|
declare function sendTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<TransactionResult>;
|
|
19
19
|
declare function sendUserOperation(config: RhinestoneAccountConfig, transaction: UserOperationTransaction): Promise<UserOperationResult>;
|
|
20
|
-
declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains: Chain[], targetChain: Chain, options: {
|
|
20
|
+
declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains: Chain[] | undefined, targetChain: Chain, options: {
|
|
21
21
|
callInputs?: CallInput[];
|
|
22
22
|
gasLimit?: bigint;
|
|
23
23
|
initialTokenRequests?: TokenRequest[];
|
|
24
24
|
recipient?: RhinestoneAccountConfig | Address;
|
|
25
25
|
signers?: SignerSet;
|
|
26
|
-
sponsored?:
|
|
26
|
+
sponsored?: Sponsorship;
|
|
27
27
|
settlementLayers?: SettlementLayer[];
|
|
28
28
|
sourceAssets?: SourceAssetInput;
|
|
29
29
|
lockFunds?: boolean;
|
|
@@ -31,11 +31,11 @@ declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains:
|
|
|
31
31
|
}): Promise<TransactionResult>;
|
|
32
32
|
declare function sendUserOperationInternal(config: RhinestoneConfig, chain: Chain, callInputs: CalldataInput[], signers?: SignerSet): Promise<UserOperationResult>;
|
|
33
33
|
declare function waitForExecution(config: RhinestoneConfig, result: TransactionResult | UserOperationResult, acceptsPreconfirmations: boolean): Promise<TransactionStatus | UserOperationReceipt>;
|
|
34
|
-
declare function getMaxSpendableAmount(config: RhinestoneConfig, chain: Chain, token: Address | TokenSymbol, gasUnits: bigint, sponsored?: boolean): Promise<bigint>;
|
|
35
34
|
declare function getPortfolio(config: RhinestoneConfig, onTestnets: boolean): Promise<import("../orchestrator").Portfolio>;
|
|
36
35
|
declare function getIntentStatus(apiKey: string | undefined, endpointUrl: string | undefined, intentId: bigint): Promise<TransactionStatus & {
|
|
37
36
|
status: IntentOpStatus['status'];
|
|
38
37
|
}>;
|
|
39
|
-
|
|
38
|
+
declare function splitIntents(apiKey: string | undefined, endpointUrl: string | undefined, input: SplitIntentsInput): Promise<import("../orchestrator").SplitIntentsResult>;
|
|
39
|
+
export { sendTransaction, sendTransactionInternal, sendUserOperation, sendUserOperationInternal, waitForExecution, getPortfolio, getIntentStatus, splitIntents, isExecutionError, ExecutionError, IntentFailedError, IntentStatusTimeoutError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SignerNotSupportedError, };
|
|
40
40
|
export type { TransactionStatus, TransactionResult, UserOperationResult };
|
|
41
41
|
//# 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,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAI3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"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"}
|