@rhinestone/sdk 1.2.9 → 1.2.11
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/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +13 -9
- package/dist/src/accounts/kernel.js +3 -3
- package/dist/src/accounts/kernel.test.js +2 -2
- package/dist/src/accounts/nexus.js +7 -7
- package/dist/src/accounts/nexus.test.js +4 -4
- package/dist/src/accounts/passport.js +2 -2
- package/dist/src/accounts/safe.js +3 -3
- package/dist/src/accounts/startale.js +2 -2
- package/dist/src/accounts/startale.test.js +2 -2
- package/dist/src/actions/ecdsa.test.js +2 -2
- package/dist/src/actions/passkeys.test.js +2 -2
- package/dist/src/actions/recovery.test.js +2 -2
- 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 -1
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +20 -14
- package/dist/src/execution/singleChainOps.d.ts +39 -2
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +51 -4
- package/dist/src/execution/utils.d.ts +3 -4
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +16 -17
- package/dist/src/execution/utils.test.d.ts +2 -0
- package/dist/src/execution/utils.test.d.ts.map +1 -0
- package/dist/src/execution/utils.test.js +49 -0
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -6
- package/dist/src/modules/index.d.ts +2 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +2 -1
- package/dist/src/modules/read.d.ts +2 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +52 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +2 -0
- package/dist/src/orchestrator/consts.d.ts +2 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +3 -3
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/types.d.ts +47 -1
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +4 -3
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +11 -1
|
@@ -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,EAGf,MAAM,MAAM,CAAA;AAUb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,SAAS,CAAA;AAkDhB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AA8ChB,iBAAS,WAAW,CAAC,MAAM,EAAE,gBAAgB;;;;;cAkB5C;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,gBAAgB;;;;;cAkB9C;AAED,iBAAe,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,0BAsB1D;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,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uB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAE3B,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -297,10 +297,14 @@ function getAddress(config) {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
function checkAddress(config) {
|
|
300
|
-
|
|
300
|
+
const initData = config.initData;
|
|
301
|
+
if (!initData) {
|
|
301
302
|
return true;
|
|
302
303
|
}
|
|
303
|
-
|
|
304
|
+
if (!('factory' in initData)) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
return initData.address.toLowerCase() === getAddress(config).toLowerCase();
|
|
304
308
|
}
|
|
305
309
|
// Signs and packs a signature to be EIP-1271 compatible
|
|
306
310
|
async function getEip1271Signature(config, signers, chain, validator, hash, transformSignature = (signature) => signature) {
|
|
@@ -406,17 +410,17 @@ async function isDeployed(config, chain) {
|
|
|
406
410
|
return (0, viem_1.size)(code) > 0;
|
|
407
411
|
}
|
|
408
412
|
async function deploy(config, chain, params) {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
throw new error_1.FactoryArgsNotAvailableError();
|
|
413
|
+
const deployed = await isDeployed(config, chain);
|
|
414
|
+
if (deployed) {
|
|
415
|
+
return false;
|
|
413
416
|
}
|
|
417
|
+
const account = getAccountProvider(config);
|
|
414
418
|
if (account.type === 'eoa') {
|
|
415
419
|
return false;
|
|
416
420
|
}
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
419
|
-
|
|
421
|
+
const deployArgs = getDeployArgs(config);
|
|
422
|
+
if (!deployArgs) {
|
|
423
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
420
424
|
}
|
|
421
425
|
const intentExecutorInstalled = 'intentExecutorInstalled' in deployArgs
|
|
422
426
|
? deployArgs.intentExecutorInstalled
|
|
@@ -16,8 +16,8 @@ const validators_1 = require("../modules/validators");
|
|
|
16
16
|
const error_1 = require("./error");
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
const KERNEL_META_FACTORY_ADDRESS = '0xd703aae79538628d27099b8c4f621be4ccd142d5';
|
|
19
|
-
const KERNEL_IMPLEMENTATION_ADDRESS = '
|
|
20
|
-
const KERNEL_FACTORY_ADDRESS = '
|
|
19
|
+
const KERNEL_IMPLEMENTATION_ADDRESS = '0xd6cedde84be40893d153be9d467cd6ad37875b28';
|
|
20
|
+
const KERNEL_FACTORY_ADDRESS = '0x2577507b78c2008ff367261cb6285d44ba5ef2e9';
|
|
21
21
|
const KERNEL_BYTECODE = '0x603d3d8160223d3973d6cedde84be40893d153be9d467cd6ad37875b2860095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3';
|
|
22
22
|
const KERNEL_VERSION = '0.3.3';
|
|
23
23
|
function getDeployArgs(config) {
|
|
@@ -37,7 +37,7 @@ function getDeployArgs(config) {
|
|
|
37
37
|
const factory = factoryData.args[0];
|
|
38
38
|
const createData = factoryData.args[1];
|
|
39
39
|
const salt = factoryData.args[2];
|
|
40
|
-
const implementation = factory === KERNEL_FACTORY_ADDRESS
|
|
40
|
+
const implementation = factory.toLowerCase() === KERNEL_FACTORY_ADDRESS
|
|
41
41
|
? KERNEL_IMPLEMENTATION_ADDRESS
|
|
42
42
|
: viem_1.zeroAddress;
|
|
43
43
|
if (implementation === viem_1.zeroAddress) {
|
|
@@ -20,7 +20,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
20
20
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
21
21
|
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003243c3b752b01000000000013fdb5234e4e3162a810f54d9f7e980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
22
22
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
23
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
23
|
+
(0, vitest_1.expect)(implementation).toEqual('0xd6cedde84be40893d153be9d467cd6ad37875b28');
|
|
24
24
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b01000000000013fdb5234e4e3162a810f54d9f7e980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
25
25
|
});
|
|
26
26
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
@@ -35,7 +35,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
35
35
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
36
36
|
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003443c3b752b010000000000578c4cb0e472a5462da43c495c3f330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
37
37
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
38
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
38
|
+
(0, vitest_1.expect)(implementation).toEqual('0xd6cedde84be40893d153be9d467cd6ad37875b28');
|
|
39
39
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b010000000000578c4cb0e472a5462da43c495c3f330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
40
40
|
});
|
|
41
41
|
(0, vitest_1.test)('Existing account', () => {
|
|
@@ -19,9 +19,9 @@ const error_1 = require("./error");
|
|
|
19
19
|
const utils_1 = require("./utils");
|
|
20
20
|
const NEXUS_DEFAULT_VALIDATOR_ADDRESS = core_1.OWNABLE_VALIDATOR_ADDRESS;
|
|
21
21
|
const NEXUS_VERSION = '1.2.0';
|
|
22
|
-
const NEXUS_IMPLEMENTATION_ADDRESS = '
|
|
23
|
-
const NEXUS_FACTORY_ADDRESS = '
|
|
24
|
-
const NEXUS_BOOTSTRAP_ADDRESS = '
|
|
22
|
+
const NEXUS_IMPLEMENTATION_ADDRESS = '0x000000000032ddc454c3bdcba80484ad5a798705';
|
|
23
|
+
const NEXUS_FACTORY_ADDRESS = '0x0000000000679a258c64d2f20f310e12b64b7375';
|
|
24
|
+
const NEXUS_BOOTSTRAP_ADDRESS = '0x00000000006efb61d8c9546ff1b500de3f244ea7';
|
|
25
25
|
const NEXUS_IMPLEMENTATION_1_0_0 = '0x000000039dfcad030719b07296710f045f0558f7';
|
|
26
26
|
const NEXUS_BOOTSTRAP_1_0_0 = '0x00000008c901d8871b6f6942de0b5d9ccf3873d3';
|
|
27
27
|
const NEXUS_K1_VALIDATOR = '0x00000004171351c442b202678c48d8ab5b321e8f';
|
|
@@ -137,10 +137,10 @@ function getAddress(config) {
|
|
|
137
137
|
throw new Error('Cannot derive address: deploy args not available');
|
|
138
138
|
}
|
|
139
139
|
const { factory, salt, initializationCallData, implementation } = deployArgs;
|
|
140
|
-
const creationCode = factory === NEXUS_FACTORY_ADDRESS
|
|
140
|
+
const creationCode = factory.toLowerCase() === NEXUS_FACTORY_ADDRESS
|
|
141
141
|
? NEXUS_CREATION_CODE
|
|
142
142
|
: '0x603d3d8160223d3973000000039dfcad030719b07296710f045f0558f760095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3';
|
|
143
|
-
const accountInitData = factory === NEXUS_FACTORY_ADDRESS
|
|
143
|
+
const accountInitData = factory.toLowerCase() === NEXUS_FACTORY_ADDRESS
|
|
144
144
|
? (0, viem_1.encodeAbiParameters)([
|
|
145
145
|
{
|
|
146
146
|
name: 'address',
|
|
@@ -206,7 +206,7 @@ function getDefaultValidatorAddress(version) {
|
|
|
206
206
|
}
|
|
207
207
|
switch (version) {
|
|
208
208
|
case '1.0.2':
|
|
209
|
-
return '
|
|
209
|
+
return '0x0000002d6db27c52e3c11c1cf24072004ac75cba';
|
|
210
210
|
case '1.2.0':
|
|
211
211
|
return '0x00000000d12897ddadc2044614a9677b191a2d95';
|
|
212
212
|
case 'rhinestone-1.0.0-beta':
|
|
@@ -417,7 +417,7 @@ function tryDecodeV0FactoryData(factory, factoryData) {
|
|
|
417
417
|
const attesters = decoded.args[2];
|
|
418
418
|
const threshold = decoded.args[3];
|
|
419
419
|
const salt = (0, viem_1.keccak256)((0, viem_1.encodePacked)(['address', 'uint256', 'address[]', 'uint8'], [owner, index, attesters, threshold]));
|
|
420
|
-
const implementation = factory === NEXUS_FACTORY_ADDRESS
|
|
420
|
+
const implementation = factory.toLowerCase() === NEXUS_FACTORY_ADDRESS
|
|
421
421
|
? NEXUS_IMPLEMENTATION_ADDRESS
|
|
422
422
|
: NEXUS_IMPLEMENTATION_1_0_0;
|
|
423
423
|
const registry = viem_1.zeroAddress;
|
|
@@ -17,10 +17,10 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
17
17
|
});
|
|
18
18
|
(0, utils_1.assertNotNull)(deployArgs);
|
|
19
19
|
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
20
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
20
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000000000679a258c64d2f20f310e12b64b7375');
|
|
21
21
|
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000006efb61d8c9546ff1b500de3f244ea7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e441bede0300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
22
22
|
(0, vitest_1.expect)(salt).toEqual('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470');
|
|
23
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
23
|
+
(0, vitest_1.expect)(implementation).toEqual('0x000000000032ddc454c3bdcba80484ad5a798705');
|
|
24
24
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x4b6a14190000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000006efb61d8c9546ff1b500de3f244ea7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e441bede0300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
25
25
|
});
|
|
26
26
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
@@ -32,10 +32,10 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
32
32
|
});
|
|
33
33
|
(0, utils_1.assertNotNull)(deployArgs);
|
|
34
34
|
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
35
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
35
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000000000679a258c64d2f20f310e12b64b7375');
|
|
36
36
|
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000006efb61d8c9546ff1b500de3f244ea7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003448643787600000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
37
37
|
(0, vitest_1.expect)(salt).toEqual('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470');
|
|
38
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
38
|
+
(0, vitest_1.expect)(implementation).toEqual('0x000000000032ddc454c3bdcba80484ad5a798705');
|
|
39
39
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x4b6a1419000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000006efb61d8c9546ff1b500de3f244ea7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003448643787600000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
40
40
|
});
|
|
41
41
|
(0, vitest_1.test)('Existing account', () => {
|
|
@@ -5,8 +5,8 @@ exports.packSignature = packSignature;
|
|
|
5
5
|
exports.getInstallData = getInstallData;
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
7
|
const CREATION_CODE = '0x6054600f3d396034805130553df3fe63906111273d3560e01c14602b57363d3d373d3d3d3d369030545af43d82803e156027573d90f35b3d90fd5b30543d5260203df3';
|
|
8
|
-
const PASSPORT_FACTORY_ADDRESS = '
|
|
9
|
-
const PASSPORT_MAIN_MODULE = '
|
|
8
|
+
const PASSPORT_FACTORY_ADDRESS = '0xd70c6386ca012cdeb249b4e46c53d3507d9cbb87';
|
|
9
|
+
const PASSPORT_MAIN_MODULE = '0x0d1bf2f4ab334324665aeb8d481ff92cde289439';
|
|
10
10
|
function getAddress(config) {
|
|
11
11
|
const owners = config.owners;
|
|
12
12
|
if (!owners) {
|
|
@@ -15,9 +15,9 @@ const legacy_1 = require("../modules/legacy");
|
|
|
15
15
|
const validators_1 = require("../modules/validators");
|
|
16
16
|
const error_1 = require("./error");
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
|
-
const SAFE_7579_LAUNCHPAD_V2_ADDRESS = '
|
|
19
|
-
const SAFE_7579_ADAPTER_V2_ADDRESS = '
|
|
20
|
-
const SAFE_7579_LAUNCHPAD_V1_ADDRESS = '
|
|
18
|
+
const SAFE_7579_LAUNCHPAD_V2_ADDRESS = '0x75798463024bda64d83c94a64bc7d7eab41300ef';
|
|
19
|
+
const SAFE_7579_ADAPTER_V2_ADDRESS = '0x7579f2ad53b01c3d8779fe17928e0d48885b0003';
|
|
20
|
+
const SAFE_7579_LAUNCHPAD_V1_ADDRESS = '0x7579011ab74c46090561ea277ba79d510c6c00ff';
|
|
21
21
|
const SAFE_7579_ADAPTER_V1_ADDRESS = '0x7579ee8307284f293b1927136486880611f20002';
|
|
22
22
|
const SAFE_SINGLETON_ADDRESS = '0x29fcb43b46531bca003ddc8fcb67ffe91900c762';
|
|
23
23
|
const SAFE_PROXY_FACTORY_ADDRESS = '0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67';
|
|
@@ -14,8 +14,8 @@ const nexus_1 = require("./nexus");
|
|
|
14
14
|
const K1_DEFAULT_VALIDATOR_ADDRESS = '0x00000072f286204bb934ed49d8969e86f7dec7b1';
|
|
15
15
|
const STARTALE_VERSION = '1.0.0';
|
|
16
16
|
const IMPLEMENTATION_ADDRESS = '0x000000b8f5f723a680d3d7ee624fe0bc84a6e05a';
|
|
17
|
-
const FACTORY_ADDRESS = '
|
|
18
|
-
const BOOTSTRAP_ADDRESS = '
|
|
17
|
+
const FACTORY_ADDRESS = '0x0000003b3e7b530b4f981ae80d9350392defef90';
|
|
18
|
+
const BOOTSTRAP_ADDRESS = '0x000000552a5fae3db7a8f3917c435448f49ba6a9';
|
|
19
19
|
const CREATION_CODE = '0x608060405261029d803803806100148161018c565b92833981016040828203126101885781516001600160a01b03811692909190838303610188576020810151906001600160401b03821161018857019281601f8501121561018857835161006e610069826101c5565b61018c565b9481865260208601936020838301011161018857815f926020809301865e8601015260017f754fd8b321c4649cb777ae6fdce7e89e9cceaa31a4f639795c7807eb7f1a27005d823b15610176577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a282511561015e575f8091610146945190845af43d15610156573d91610137610069846101c5565b9283523d5f602085013e6101e0565b505b604051605e908161023f8239f35b6060916101e0565b50505034156101485763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b6040519190601f01601f191682016001600160401b038111838210176101b157604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b0381116101b157601f01601f191660200190565b9061020457508051156101f557805190602001fd5b63d6bda27560e01b5f5260045ffd5b81511580610235575b610215575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b1561020d56fe60806040523615605c575f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156058573d5ff35b3d5ffd5b00';
|
|
20
20
|
function getDeployArgs(config) {
|
|
21
21
|
const account = config.account;
|
|
@@ -17,7 +17,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
17
17
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
20
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000003b3e7b530b4f981ae80d9350392defef90');
|
|
21
21
|
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a0000000000000000000000000000000552a5fae3db7a8f3917c435448f49ba6a9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003240984b2f700000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da0994869360000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
22
22
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
23
23
|
(0, vitest_1.expect)(implementation).toEqual('0x000000b8f5f723a680d3d7ee624fe0bc84a6e05a');
|
|
@@ -33,7 +33,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
33
33
|
accounts: [consts_1.passkeyAccount],
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
36
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000003b3e7b530b4f981ae80d9350392defef90');
|
|
37
37
|
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000552a5fae3db7a8f3917c435448f49ba6a9000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003440984b2f700000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
38
38
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
39
39
|
(0, vitest_1.expect)(implementation).toEqual('0x000000b8f5f723a680d3d7ee624fe0bc84a6e05a');
|
|
@@ -12,7 +12,7 @@ const MOCK_OWNER_C = '0xb31e76f19defe76edc4b7eceeb4b0a2d6ddaca39';
|
|
|
12
12
|
const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
13
13
|
(0, vitest_1.describe)('ECDSA Actions', () => {
|
|
14
14
|
(0, vitest_1.describe)('Install Ownable Validator', async () => {
|
|
15
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
15
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
16
16
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
17
17
|
owners: {
|
|
18
18
|
type: 'ecdsa',
|
|
@@ -51,7 +51,7 @@ const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
(0, vitest_1.describe)('Uninstall Ownable Validator', async () => {
|
|
54
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
54
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
55
55
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
56
56
|
owners: {
|
|
57
57
|
type: 'ecdsa',
|
|
@@ -9,7 +9,7 @@ const passkeys_1 = require("./passkeys");
|
|
|
9
9
|
const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
10
10
|
(0, vitest_1.describe)('Passkeys Actions', () => {
|
|
11
11
|
(0, vitest_1.describe)('Install WebAuthn Validator', async () => {
|
|
12
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
12
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
13
13
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
14
14
|
owners: {
|
|
15
15
|
type: 'ecdsa',
|
|
@@ -33,7 +33,7 @@ const accountAddress = '0x36C03e7D593F7B2C6b06fC18B5f4E9a4A29C99b0';
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
(0, vitest_1.describe)('Uninstall WebAuthn Validator', async () => {
|
|
36
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
36
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
37
37
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
38
38
|
owners: {
|
|
39
39
|
type: 'ecdsa',
|
|
@@ -19,7 +19,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
19
19
|
});
|
|
20
20
|
(0, vitest_1.describe)('Recovery Actions', () => {
|
|
21
21
|
(0, vitest_1.describe)('Set Up Recovery', async () => {
|
|
22
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
22
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
23
23
|
const rhinestoneAccount = await rhinestone.createAccount({
|
|
24
24
|
owners: {
|
|
25
25
|
type: 'ecdsa',
|
|
@@ -48,7 +48,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
(0, vitest_1.describe)('Recover', () => {
|
|
51
|
-
const rhinestone = new __1.RhinestoneSDK();
|
|
51
|
+
const rhinestone = new __1.RhinestoneSDK({ apiKey: 'test' });
|
|
52
52
|
const accountPromise = rhinestone.createAccount({
|
|
53
53
|
owners: {
|
|
54
54
|
type: 'ecdsa',
|
|
@@ -50,6 +50,13 @@ declare class IntentStatusTimeoutError extends ExecutionError {
|
|
|
50
50
|
traceId?: string;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
declare class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
54
|
+
constructor(params?: {
|
|
55
|
+
context?: any;
|
|
56
|
+
errorType?: string;
|
|
57
|
+
traceId?: string;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
53
60
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
54
|
-
export { isExecutionError, ExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
|
|
61
|
+
export { isExecutionError, ExecutionError, Eip7702InitSignatureRequiredError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, IntentStatusTimeoutError, SignerNotSupportedError, };
|
|
55
62
|
//# 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,gCAAiC,SAAQ,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,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAE/D;AAED,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iCAAiC,EACjC,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.OrderPathRequiredForIntentsError = exports.ExecutionError = void 0;
|
|
3
|
+
exports.SignerNotSupportedError = exports.IntentStatusTimeoutError = exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.Eip7702InitSignatureRequiredError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -73,6 +73,15 @@ class IntentStatusTimeoutError extends ExecutionError {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
exports.IntentStatusTimeoutError = IntentStatusTimeoutError;
|
|
76
|
+
class Eip7702InitSignatureRequiredError extends ExecutionError {
|
|
77
|
+
constructor(params) {
|
|
78
|
+
super({
|
|
79
|
+
message: 'EIP-7702 initialization signature is required for 7702 accounts. This signature is needed during transaction preparation, even if your account is already deployed on all chains. Use `getEip7702InitSignature()` to generate it.',
|
|
80
|
+
...params,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Eip7702InitSignatureRequiredError = Eip7702InitSignatureRequiredError;
|
|
76
85
|
function isExecutionError(error) {
|
|
77
86
|
return error instanceof ExecutionError;
|
|
78
87
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type Chain, type Hex } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/_types/account-abstraction';
|
|
3
|
-
import type
|
|
3
|
+
import { type IntentOpStatus, type SplitIntentsInput } from '../orchestrator';
|
|
4
4
|
import type { SettlementLayer } from '../orchestrator/types';
|
|
5
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';
|
|
@@ -24,6 +24,7 @@ declare function sendTransactionInternal(config: RhinestoneConfig, sourceChains:
|
|
|
24
24
|
recipient?: RhinestoneAccountConfig | Address;
|
|
25
25
|
signers?: SignerSet;
|
|
26
26
|
sponsored?: Sponsorship;
|
|
27
|
+
eip7702InitSignature?: Hex;
|
|
27
28
|
settlementLayers?: SettlementLayer[];
|
|
28
29
|
sourceAssets?: SourceAssetInput;
|
|
29
30
|
lockFunds?: boolean;
|
|
@@ -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;
|
|
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,iC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EACzB,uBAAuB,GACxB,CAAA;AACD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -10,7 +10,6 @@ exports.getPortfolio = getPortfolio;
|
|
|
10
10
|
exports.getIntentStatus = getIntentStatus;
|
|
11
11
|
exports.splitIntents = splitIntents;
|
|
12
12
|
const viem_1 = require("viem");
|
|
13
|
-
const chains_1 = require("viem/chains");
|
|
14
13
|
const accounts_1 = require("../accounts");
|
|
15
14
|
const utils_1 = require("../accounts/utils");
|
|
16
15
|
const orchestrator_1 = require("../orchestrator");
|
|
@@ -33,7 +32,7 @@ const POLL_ERROR_BACKOFF_MAX_MS = 10000;
|
|
|
33
32
|
async function sendTransaction(config, transaction) {
|
|
34
33
|
const sourceChains = 'chain' in transaction ? [transaction.chain] : transaction.sourceChains;
|
|
35
34
|
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
36
|
-
const { calls, gasLimit, tokenRequests, recipient, signers, sponsored, settlementLayers, sourceAssets, feeAsset, } = transaction;
|
|
35
|
+
const { calls, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, } = transaction;
|
|
37
36
|
const isUserOpSigner = signers?.type === 'guardians';
|
|
38
37
|
if (isUserOpSigner) {
|
|
39
38
|
throw new error_1.SignerNotSupportedError();
|
|
@@ -45,6 +44,7 @@ async function sendTransaction(config, transaction) {
|
|
|
45
44
|
recipient,
|
|
46
45
|
signers,
|
|
47
46
|
sponsored,
|
|
47
|
+
eip7702InitSignature,
|
|
48
48
|
settlementLayers,
|
|
49
49
|
sourceAssets,
|
|
50
50
|
feeAsset,
|
|
@@ -65,7 +65,7 @@ async function sendTransactionInternal(config, sourceChains, targetChain, option
|
|
|
65
65
|
throw new error_1.SignerNotSupportedError();
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.settlementLayers, options.sourceAssets, options.feeAsset, options.lockFunds);
|
|
68
|
+
return await sendTransactionAsIntent(config, sourceChains, targetChain, resolvedCalls, options.gasLimit, tokenRequests, options.recipient, options.signers, options.sponsored, options.eip7702InitSignature, options.settlementLayers, options.sourceAssets, options.feeAsset, options.lockFunds);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
@@ -91,8 +91,8 @@ async function sendUserOperationInternal(config, chain, callInputs, signers) {
|
|
|
91
91
|
chain: chain.id,
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, settlementLayers, sourceAssets, feeAsset, lockFunds) {
|
|
95
|
-
const intentRoute = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false,
|
|
94
|
+
async function sendTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds) {
|
|
95
|
+
const intentRoute = await (0, utils_2.prepareTransactionAsIntent)(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipient, sponsored ?? false, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, lockFunds, undefined, undefined, signers);
|
|
96
96
|
if (!intentRoute) {
|
|
97
97
|
throw new error_1.OrderPathRequiredForIntentsError();
|
|
98
98
|
}
|
|
@@ -127,7 +127,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
127
127
|
},
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
const orchestrator = (0,
|
|
130
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
131
131
|
try {
|
|
132
132
|
intentStatus = await orchestrator.getIntentOpStatus(result.id);
|
|
133
133
|
// reset error backoff on success
|
|
@@ -203,20 +203,26 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
203
203
|
}
|
|
204
204
|
async function getPortfolio(config, onTestnets) {
|
|
205
205
|
const address = (0, accounts_1.getAddress)(config);
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
|
|
206
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(config.apiKey, config.endpointUrl);
|
|
207
|
+
const supportedChainIds = (0, registry_1.getSupportedChainIds)();
|
|
208
|
+
const filteredChainIds = supportedChainIds.filter((id) => {
|
|
209
|
+
try {
|
|
210
|
+
return (0, registry_1.isTestnet)(id) === onTestnets;
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return orchestrator.getPortfolio(address, { chainIds: filteredChainIds });
|
|
209
217
|
}
|
|
210
218
|
async function getIntentStatus(apiKey, endpointUrl, intentId) {
|
|
211
|
-
const
|
|
212
|
-
const chainId = environment === 4n ? chains_1.base.id : chains_1.baseSepolia.id;
|
|
213
|
-
const orchestrator = (0, utils_2.getOrchestratorByChain)(chainId, apiKey, endpointUrl);
|
|
219
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl);
|
|
214
220
|
const internalStatus = await orchestrator.getIntentOpStatus(intentId);
|
|
215
221
|
return {
|
|
216
222
|
status: internalStatus.status,
|
|
217
223
|
fill: {
|
|
218
224
|
hash: internalStatus.fillTransactionHash,
|
|
219
|
-
chainId:
|
|
225
|
+
chainId: internalStatus.destinationChainId,
|
|
220
226
|
},
|
|
221
227
|
claims: internalStatus.claims.map((claim) => ({
|
|
222
228
|
hash: claim.claimTransactionHash,
|
|
@@ -225,6 +231,6 @@ async function getIntentStatus(apiKey, endpointUrl, intentId) {
|
|
|
225
231
|
};
|
|
226
232
|
}
|
|
227
233
|
async function splitIntents(apiKey, endpointUrl, input) {
|
|
228
|
-
const orchestrator = (0,
|
|
234
|
+
const orchestrator = (0, orchestrator_1.getOrchestrator)(apiKey, endpointUrl);
|
|
229
235
|
return orchestrator.splitIntents(input);
|
|
230
236
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type Address } from 'viem';
|
|
2
|
-
import type { IntentOpElement } from '../orchestrator/types';
|
|
2
|
+
import type { IntentOpElement, Op } from '../orchestrator/types';
|
|
3
|
+
interface GasRefund {
|
|
4
|
+
token: Address;
|
|
5
|
+
exchangeRate: bigint;
|
|
6
|
+
overhead: bigint;
|
|
7
|
+
}
|
|
3
8
|
declare function getTypedData(account: Address, intentExecutorAddress: Address, element: IntentOpElement, nonce: bigint): {
|
|
4
9
|
domain: {
|
|
5
10
|
name: string;
|
|
@@ -29,12 +34,44 @@ declare function getTypedData(account: Address, intentExecutorAddress: Address,
|
|
|
29
34
|
message: {
|
|
30
35
|
account: `0x${string}`;
|
|
31
36
|
nonce: bigint;
|
|
32
|
-
op:
|
|
37
|
+
op: Op;
|
|
33
38
|
gasRefund: {
|
|
34
39
|
token: "0x0000000000000000000000000000000000000000";
|
|
35
40
|
exchangeRate: bigint;
|
|
36
41
|
};
|
|
37
42
|
};
|
|
43
|
+
} | {
|
|
44
|
+
domain: {
|
|
45
|
+
name: string;
|
|
46
|
+
version: string;
|
|
47
|
+
chainId: number;
|
|
48
|
+
verifyingContract: `0x${string}`;
|
|
49
|
+
};
|
|
50
|
+
types: {
|
|
51
|
+
SingleChainOps: {
|
|
52
|
+
name: string;
|
|
53
|
+
type: string;
|
|
54
|
+
}[];
|
|
55
|
+
Op: {
|
|
56
|
+
name: string;
|
|
57
|
+
type: string;
|
|
58
|
+
}[];
|
|
59
|
+
GasRefund: {
|
|
60
|
+
name: string;
|
|
61
|
+
type: string;
|
|
62
|
+
}[];
|
|
63
|
+
Ops: {
|
|
64
|
+
name: string;
|
|
65
|
+
type: string;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
primaryType: "SingleChainOps";
|
|
69
|
+
message: {
|
|
70
|
+
account: `0x${string}`;
|
|
71
|
+
nonce: bigint;
|
|
72
|
+
op: Op;
|
|
73
|
+
gasRefund: GasRefund;
|
|
74
|
+
};
|
|
38
75
|
};
|
|
39
76
|
export { getTypedData };
|
|
40
77
|
//# sourceMappingURL=singleChainOps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleChainOps.d.ts","sourceRoot":"","sources":["../../../execution/singleChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAe,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"singleChainOps.d.ts","sourceRoot":"","sources":["../../../execution/singleChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAe,MAAM,MAAM,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAA;AAEhE,UAAU,SAAS;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAkGD,iBAAS,YAAY,CACnB,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,OAAO,EAC9B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBd;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|