@rhinestone/sdk 1.0.0-alpha.6 → 1.0.0-alpha.7
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.test.js +2 -2
- package/dist/src/accounts/kernel.test.js +6 -6
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +23 -14
- package/dist/src/accounts/nexus.test.js +10 -10
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +16 -21
- package/dist/src/accounts/safe.test.js +6 -6
- package/dist/src/actions/index.d.ts +1 -2
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +1 -3
- package/dist/src/actions/index.test.js +17 -17
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +1 -6
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -7
- package/dist/src/modules/index.d.ts +3 -7
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +1 -9
- package/dist/src/modules/index.test.js +2 -2
- package/dist/src/modules/omni-account.d.ts +1 -4
- package/dist/src/modules/omni-account.d.ts.map +1 -1
- package/dist/src/modules/omni-account.js +2 -8
- package/dist/src/modules/read.d.ts +1 -2
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +0 -33
- package/dist/src/modules/validators/core.js +2 -2
- package/dist/src/modules/validators/core.test.js +4 -4
- package/dist/src/modules/validators/smart-sessions.test.js +4 -4
- package/dist/src/orchestrator/utils.js +2 -2
- package/package.json +1 -1
- package/dist/src/actions/registry.d.ts +0 -7
- package/dist/src/actions/registry.d.ts.map +0 -1
- package/dist/src/actions/registry.js +0 -7
- package/dist/src/actions/registry.test.d.ts +0 -2
- package/dist/src/actions/registry.test.d.ts.map +0 -1
- package/dist/src/actions/registry.test.js +0 -24
- package/dist/src/modules/registry.d.ts +0 -13
- package/dist/src/modules/registry.d.ts.map +0 -1
- package/dist/src/modules/registry.js +0 -67
|
@@ -14,7 +14,7 @@ const _1 = require(".");
|
|
|
14
14
|
},
|
|
15
15
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
16
16
|
});
|
|
17
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
17
|
+
(0, vitest_1.expect)(address).toEqual('0x0cd1c38d4cdffdbbd4ac192babf70110ad250668');
|
|
18
18
|
});
|
|
19
19
|
(0, vitest_1.test)('Safe, passkey owner with a session', () => {
|
|
20
20
|
const address = (0, _1.getAddress)({
|
|
@@ -24,7 +24,7 @@ const _1 = require(".");
|
|
|
24
24
|
},
|
|
25
25
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
26
26
|
});
|
|
27
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
27
|
+
(0, vitest_1.expect)(address).toEqual('0x35e1c3f1ded30246aa2ca361342c3ee0d0749293');
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
(0, vitest_1.describe)('Sign', () => {
|
|
@@ -17,10 +17,10 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
17
17
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
18
18
|
});
|
|
19
19
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
20
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
20
|
+
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003243c3b752b010000000000E9E6E96Bcaa3c113187CdB7E38AED90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
21
21
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
22
22
|
(0, vitest_1.expect)(implementation).toEqual('0xd6CEDDe84be40893d153Be9d467CD6aD37875b28');
|
|
23
|
-
(0, vitest_1.expect)(initializationCallData).toEqual('
|
|
23
|
+
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b010000000000E9E6E96Bcaa3c113187CdB7E38AED90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
24
24
|
});
|
|
25
25
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
26
26
|
const { factory, factoryData, salt, implementation, initializationCallData, } = (0, kernel_1.getDeployArgs)({
|
|
@@ -31,10 +31,10 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
31
31
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
32
32
|
});
|
|
33
33
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
34
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
34
|
+
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e43c3b752b010000000000578c4cB0e472a5462da43C495C3F330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
35
35
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
36
36
|
(0, vitest_1.expect)(implementation).toEqual('0xd6CEDDe84be40893d153Be9d467CD6aD37875b28');
|
|
37
|
-
(0, vitest_1.expect)(initializationCallData).toEqual('
|
|
37
|
+
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b010000000000578c4cB0e472a5462da43C495C3F330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
(0, vitest_1.describe)('Get Address', () => {
|
|
@@ -46,7 +46,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
46
46
|
},
|
|
47
47
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
48
48
|
});
|
|
49
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
49
|
+
(0, vitest_1.expect)(address).toEqual('0xe4090134D2FdC0fc13b43651B5b1c75BDf825c5f');
|
|
50
50
|
});
|
|
51
51
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
52
52
|
const address = (0, kernel_1.getAddress)({
|
|
@@ -56,7 +56,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
56
56
|
},
|
|
57
57
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
58
58
|
});
|
|
59
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
59
|
+
(0, vitest_1.expect)(address).toEqual('0x5a4063A8f32201C84B8e7a073C7494D53D7dFAe7');
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
(0, vitest_1.describe)('Get Install Data', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAY3D,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"m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C,iEAuClC;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAalC;AAoFD,OAAO,EACL,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,uBAAuB,GACxB,CAAA"}
|
|
@@ -11,26 +11,34 @@ const viem_1 = require("viem");
|
|
|
11
11
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
12
12
|
const modules_1 = require("../modules");
|
|
13
13
|
const validators_1 = require("../modules/validators");
|
|
14
|
+
const core_1 = require("../modules/validators/core");
|
|
14
15
|
const utils_1 = require("./utils");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const NEXUS_DEFAULT_VALIDATOR_ADDRESS = core_1.OWNABLE_VALIDATOR_ADDRESS;
|
|
17
|
+
const NEXUS_IMPLEMENTATION_ADDRESS = '0x00000000006a1bF4cBa18564Ecc916c3Cf768111';
|
|
18
|
+
const NEXUS_FACTORY_ADDRESS = '0x0000000000e70c5ebEBdEc2457508f6d1709bF55';
|
|
19
|
+
const NEXUS_BOOTSTRAP_ADDRESS = '0x00000000001Cf4667Bfd7be8f67D01d63938784b';
|
|
18
20
|
const NEXUS_CREATION_CODE = '0x60806040526102aa803803806100148161018c565b92833981016040828203126101885781516001600160a01b03811692909190838303610188576020810151906001600160401b03821161018857019281601f8501121561018857835161006e610069826101c5565b61018c565b9481865260208601936020838301011161018857815f926020809301865e8601015260017f90b772c2cb8a51aa7a8a65fc23543c6d022d5b3f8e2b92eed79fba7eef8293005d823b15610176577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a282511561015e575f8091610146945190845af43d15610156573d91610137610069846101c5565b9283523d5f602085013e6101e0565b505b604051606b908161023f8239f35b6060916101e0565b50505034156101485763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b6040519190601f01601f191682016001600160401b038111838210176101b157604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b0381116101b157601f01601f191660200190565b9061020457508051156101f557805190602001fd5b63d6bda27560e01b5f5260045ffd5b81511580610235575b610215575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b1561020d56fe60806040523615605c575f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156058573d5ff35b3d5ffd5b00fea164736f6c634300081b000a';
|
|
19
21
|
function getDeployArgs(config) {
|
|
20
22
|
const salt = (0, viem_1.keccak256)('0x');
|
|
21
23
|
const moduleSetup = (0, modules_1.getSetup)(config);
|
|
24
|
+
// Filter out the default validator
|
|
25
|
+
const defaultValidator = moduleSetup.validators.find((v) => v.address === NEXUS_DEFAULT_VALIDATOR_ADDRESS);
|
|
26
|
+
const defaultValidatorInitData = defaultValidator
|
|
27
|
+
? defaultValidator.initData
|
|
28
|
+
: '0x';
|
|
29
|
+
const validators = moduleSetup.validators.filter((v) => v.address !== NEXUS_DEFAULT_VALIDATOR_ADDRESS);
|
|
22
30
|
const initData = (0, viem_1.encodeAbiParameters)([{ type: 'address' }, { type: 'bytes' }], [
|
|
23
31
|
NEXUS_BOOTSTRAP_ADDRESS,
|
|
24
32
|
(0, viem_1.encodeFunctionData)({
|
|
25
33
|
abi: (0, viem_1.parseAbi)([
|
|
26
34
|
'struct BootstrapConfig {address module;bytes initData;}',
|
|
27
35
|
'struct BootstrapPreValidationHookConfig {uint256 hookType;address module;bytes data;}',
|
|
28
|
-
'
|
|
29
|
-
'function initNexus(BootstrapConfig[] calldata validators,BootstrapConfig[] calldata executors,BootstrapConfig calldata hook,BootstrapConfig[] calldata fallbacks,BootstrapPreValidationHookConfig[] calldata preValidationHooks,RegistryConfig registryConfig) external',
|
|
36
|
+
'function initNexusWithDefaultValidatorAndOtherModulesNoRegistry(bytes calldata defaultValidatorInitData,BootstrapConfig[] calldata validators,BootstrapConfig[] calldata executors,BootstrapConfig calldata hook,BootstrapConfig[] calldata fallbacks,BootstrapPreValidationHookConfig[] calldata preValidationHooks) external',
|
|
30
37
|
]),
|
|
31
|
-
functionName: '
|
|
38
|
+
functionName: 'initNexusWithDefaultValidatorAndOtherModulesNoRegistry',
|
|
32
39
|
args: [
|
|
33
|
-
|
|
40
|
+
defaultValidatorInitData,
|
|
41
|
+
validators.map((v) => ({
|
|
34
42
|
module: v.address,
|
|
35
43
|
initData: v.initData,
|
|
36
44
|
})),
|
|
@@ -47,11 +55,6 @@ function getDeployArgs(config) {
|
|
|
47
55
|
initData: f.initData,
|
|
48
56
|
})),
|
|
49
57
|
[],
|
|
50
|
-
{
|
|
51
|
-
registry: moduleSetup.registry,
|
|
52
|
-
attesters: moduleSetup.attesters,
|
|
53
|
-
threshold: moduleSetup.threshold,
|
|
54
|
-
},
|
|
55
58
|
],
|
|
56
59
|
}),
|
|
57
60
|
]);
|
|
@@ -120,7 +123,10 @@ function getInstallData(module) {
|
|
|
120
123
|
}
|
|
121
124
|
async function getPackedSignature(signFn, hash, validator, transformSignature = (signature) => signature) {
|
|
122
125
|
const signature = await signFn(hash);
|
|
123
|
-
const
|
|
126
|
+
const validatorAddress = validator.address === NEXUS_DEFAULT_VALIDATOR_ADDRESS
|
|
127
|
+
? viem_1.zeroAddress
|
|
128
|
+
: validator.address;
|
|
129
|
+
const packedSig = (0, viem_1.encodePacked)(['address', 'bytes'], [validatorAddress, transformSignature(signature)]);
|
|
124
130
|
return packedSig;
|
|
125
131
|
}
|
|
126
132
|
async function getSmartAccount(client, address, owners, validatorAddress, sign) {
|
|
@@ -179,13 +185,16 @@ async function getBaseSmartAccount(address, client, nonceValidatorAddress, getSt
|
|
|
179
185
|
return {};
|
|
180
186
|
},
|
|
181
187
|
async getNonce(args) {
|
|
188
|
+
const validatorAddress = nonceValidatorAddress === NEXUS_DEFAULT_VALIDATOR_ADDRESS
|
|
189
|
+
? viem_1.zeroAddress
|
|
190
|
+
: nonceValidatorAddress;
|
|
182
191
|
const TIMESTAMP_ADJUSTMENT = 16777215n; // max value for size 3
|
|
183
192
|
const defaultedKey = (args?.key ?? 0n) % TIMESTAMP_ADJUSTMENT;
|
|
184
193
|
const defaultedValidationMode = '0x00';
|
|
185
194
|
const key = (0, viem_1.concat)([
|
|
186
195
|
(0, viem_1.toHex)(defaultedKey, { size: 3 }),
|
|
187
196
|
defaultedValidationMode,
|
|
188
|
-
|
|
197
|
+
validatorAddress,
|
|
189
198
|
]);
|
|
190
199
|
return (0, utils_1.getAccountNonce)(client, {
|
|
191
200
|
address,
|
|
@@ -15,11 +15,11 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
15
15
|
},
|
|
16
16
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
17
17
|
});
|
|
18
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
19
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
18
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000000000e70c5ebEBdEc2457508f6d1709bF55');
|
|
19
|
+
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000001cf4667bfd7be8f67d01d63938784b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e441bede0300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
20
20
|
(0, vitest_1.expect)(salt).toEqual('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470');
|
|
21
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
22
|
-
(0, vitest_1.expect)(initializationCallData).toEqual('
|
|
21
|
+
(0, vitest_1.expect)(implementation).toEqual('0x00000000006a1bF4cBa18564Ecc916c3Cf768111');
|
|
22
|
+
(0, vitest_1.expect)(initializationCallData).toEqual('0x4b6a14190000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000001cf4667bfd7be8f67d01d63938784b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000002e441bede0300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
23
23
|
});
|
|
24
24
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
25
25
|
const { factory, factoryData, salt, implementation, initializationCallData, } = (0, nexus_1.getDeployArgs)({
|
|
@@ -29,11 +29,11 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
29
29
|
},
|
|
30
30
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
31
31
|
});
|
|
32
|
-
(0, vitest_1.expect)(factory).toEqual('
|
|
33
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
32
|
+
(0, vitest_1.expect)(factory).toEqual('0x0000000000e70c5ebEBdEc2457508f6d1709bF55');
|
|
33
|
+
(0, vitest_1.expect)(factoryData).toEqual('0xea6d13ac0000000000000000000000000000000000000000000000000000000000000040c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000001cf4667bfd7be8f67d01d63938784b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000032441bede0300000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
34
34
|
(0, vitest_1.expect)(salt).toEqual('0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470');
|
|
35
|
-
(0, vitest_1.expect)(implementation).toEqual('
|
|
36
|
-
(0, vitest_1.expect)(initializationCallData).toEqual('
|
|
35
|
+
(0, vitest_1.expect)(implementation).toEqual('0x00000000006a1bF4cBa18564Ecc916c3Cf768111');
|
|
36
|
+
(0, vitest_1.expect)(initializationCallData).toEqual('0x4b6a1419000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000001cf4667bfd7be8f67d01d63938784b0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000032441bede0300000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
(0, vitest_1.describe)('Get Address', () => {
|
|
@@ -45,7 +45,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
45
45
|
},
|
|
46
46
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
47
47
|
});
|
|
48
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
48
|
+
(0, vitest_1.expect)(address).toEqual('0x0cd1c38d4cdffdbbd4ac192babf70110ad250668');
|
|
49
49
|
});
|
|
50
50
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
51
51
|
const address = (0, nexus_1.getAddress)({
|
|
@@ -55,7 +55,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
55
55
|
},
|
|
56
56
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
57
57
|
});
|
|
58
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
58
|
+
(0, vitest_1.expect)(address).toEqual('0x35e1c3f1ded30246aa2ca361342c3ee0d0749293');
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
(0, vitest_1.describe)('Get Install Data', () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAIZ,KAAK,GAAG,EAER,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAQ/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAchF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EAIZ,KAAK,GAAG,EAER,KAAK,YAAY,EAIlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAQ/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAoC,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= require("../modules");
|
|
13
13
|
const validators_1 = require("../modules/validators");
|
|
14
14
|
const utils_1 = require("./utils");
|
|
15
|
-
const SAFE_7579_LAUNCHPAD_ADDRESS = '
|
|
16
|
-
const SAFE_7579_ADAPTER_ADDRESS = '
|
|
15
|
+
const SAFE_7579_LAUNCHPAD_ADDRESS = '0x75798463024Bda64D83c94A64Bc7D7eaB41300eF';
|
|
16
|
+
const SAFE_7579_ADAPTER_ADDRESS = '0x7579f2AD53b01c3D8779Fe17928e0D48885B0003';
|
|
17
17
|
const SAFE_SINGLETON_ADDRESS = '0x29fcb43b46531bca003ddc8fcb67ffe91900c762';
|
|
18
18
|
const SAFE_PROXY_FACTORY_ADDRESS = '0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67';
|
|
19
19
|
const NO_SAFE_OWNER_ADDRESS = '0xbabe99e62d8bcbd3acf5ccbcfcd4f64fe75e5e72';
|
|
@@ -22,6 +22,12 @@ function getDeployArgs(config) {
|
|
|
22
22
|
const owners = getOwners(config);
|
|
23
23
|
const threshold = getThreshold(config);
|
|
24
24
|
const moduleSetup = (0, modules_1.getSetup)(config);
|
|
25
|
+
const modules = [
|
|
26
|
+
...moduleSetup.validators,
|
|
27
|
+
...moduleSetup.executors,
|
|
28
|
+
...moduleSetup.fallbacks,
|
|
29
|
+
...moduleSetup.hooks,
|
|
30
|
+
];
|
|
25
31
|
const initData = (0, viem_1.encodeFunctionData)({
|
|
26
32
|
abi: (0, viem_1.parseAbi)([
|
|
27
33
|
'function setup(address[] calldata _owners,uint256 _threshold,address to,bytes calldata data,address fallbackHandler,address paymentToken,uint256 payment, address paymentReceiver) external',
|
|
@@ -33,30 +39,19 @@ function getDeployArgs(config) {
|
|
|
33
39
|
SAFE_7579_LAUNCHPAD_ADDRESS,
|
|
34
40
|
(0, viem_1.encodeFunctionData)({
|
|
35
41
|
abi: (0, viem_1.parseAbi)([
|
|
36
|
-
'struct ModuleInit {address module;bytes initData;}',
|
|
37
|
-
'function addSafe7579(address safe7579,ModuleInit[] calldata
|
|
42
|
+
'struct ModuleInit {address module;bytes initData;uint256 moduleType}',
|
|
43
|
+
'function addSafe7579(address safe7579,ModuleInit[] calldata modules,address[] calldata attesters,uint8 threshold) external',
|
|
38
44
|
]),
|
|
39
45
|
functionName: 'addSafe7579',
|
|
40
46
|
args: [
|
|
41
47
|
SAFE_7579_ADAPTER_ADDRESS,
|
|
42
|
-
|
|
43
|
-
module:
|
|
44
|
-
initData:
|
|
48
|
+
modules.map((m) => ({
|
|
49
|
+
module: m.address,
|
|
50
|
+
initData: m.initData,
|
|
51
|
+
moduleType: m.type,
|
|
45
52
|
})),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
initData: e.initData,
|
|
49
|
-
})),
|
|
50
|
-
moduleSetup.fallbacks.map((f) => ({
|
|
51
|
-
module: f.address,
|
|
52
|
-
initData: f.initData,
|
|
53
|
-
})),
|
|
54
|
-
moduleSetup.hooks.map((h) => ({
|
|
55
|
-
module: h.address,
|
|
56
|
-
initData: h.initData,
|
|
57
|
-
})),
|
|
58
|
-
moduleSetup.attesters,
|
|
59
|
-
moduleSetup.threshold,
|
|
53
|
+
[],
|
|
54
|
+
0,
|
|
60
55
|
],
|
|
61
56
|
}),
|
|
62
57
|
SAFE_7579_ADAPTER_ADDRESS,
|
|
@@ -16,8 +16,8 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
16
16
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
17
17
|
});
|
|
18
18
|
(0, vitest_1.expect)(factory).toEqual('0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67');
|
|
19
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
20
|
-
(0, vitest_1.expect)(salt).toEqual('
|
|
19
|
+
(0, vitest_1.expect)(factoryData).toEqual('0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000444b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000075798463024bda64d83c94a64bc7d7eab41300ef00000000000000000000000000000000000000000000000000000000000001600000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000f6c02c78ded62973b43bfa523b247da0994869360000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb700000000000000000000000000000000000000000000000000000000000002a447cbbdca0000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000e9e6e96bcaa3c113187cdb7e38aed90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
20
|
+
(0, vitest_1.expect)(salt).toEqual('0xcd22c6be130453e1c7a5617c2792d41dd1d8a3ce4024819179507b20de8201f5');
|
|
21
21
|
(0, vitest_1.expect)(implementation).toEqual('0x29fcb43b46531bca003ddc8fcb67ffe91900c762');
|
|
22
22
|
(0, vitest_1.expect)(initializationCallData).toEqual(null);
|
|
23
23
|
});
|
|
@@ -30,8 +30,8 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
30
30
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
31
31
|
});
|
|
32
32
|
(0, vitest_1.expect)(factory).toEqual('0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67');
|
|
33
|
-
(0, vitest_1.expect)(factoryData).toEqual('
|
|
34
|
-
(0, vitest_1.expect)(salt).toEqual('
|
|
33
|
+
(0, vitest_1.expect)(factoryData).toEqual('0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c7620000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e4b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000075798463024bda64d83c94a64bc7d7eab41300ef00000000000000000000000000000000000000000000000000000000000001400000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000babe99e62d8bcbd3acf5ccbcfcd4f64fe75e5e72000000000000000000000000000000000000000000000000000000000000026447cbbdca0000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a00000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
34
|
+
(0, vitest_1.expect)(salt).toEqual('0x1774a1bf788cc08a2f87e82e78226fd1484c5dfc9d8ae3041cf96f478e470214');
|
|
35
35
|
(0, vitest_1.expect)(implementation).toEqual('0x29fcb43b46531bca003ddc8fcb67ffe91900c762');
|
|
36
36
|
(0, vitest_1.expect)(initializationCallData).toEqual(null);
|
|
37
37
|
});
|
|
@@ -45,7 +45,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
45
45
|
},
|
|
46
46
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
47
47
|
});
|
|
48
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
48
|
+
(0, vitest_1.expect)(address).toEqual('0xd1f90bf932b56145800b608d9dd15c653270f042');
|
|
49
49
|
});
|
|
50
50
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
51
51
|
const address = (0, safe_1.getAddress)({
|
|
@@ -55,7 +55,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
55
55
|
},
|
|
56
56
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
57
57
|
});
|
|
58
|
-
(0, vitest_1.expect)(address).toEqual('
|
|
58
|
+
(0, vitest_1.expect)(address).toEqual('0xa4a75e55097539ef474613c56d2e70942af42e52');
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
(0, vitest_1.describe)('Get Install Data', () => {
|
|
@@ -2,7 +2,6 @@ import { type Address, type Chain, type Hex } from 'viem';
|
|
|
2
2
|
import type { RhinestoneAccount } from '..';
|
|
3
3
|
import { type WebauthnCredential } from '../modules/validators/core';
|
|
4
4
|
import type { Call, OwnableValidatorConfig, OwnerSet, ProviderConfig, Recovery, WebauthnValidatorConfig } from '../types';
|
|
5
|
-
import { trustAttester } from './registry';
|
|
6
5
|
import { encodeSmartSessionSignature } from './smart-session';
|
|
7
6
|
declare function setUpRecovery({ rhinestoneAccount, guardians, threshold, }: {
|
|
8
7
|
rhinestoneAccount: RhinestoneAccount;
|
|
@@ -36,5 +35,5 @@ declare function disableMultiFactor({ rhinestoneAccount, }: {
|
|
|
36
35
|
declare function changeMultiFactorThreshold(newThreshold: number): Call;
|
|
37
36
|
declare function setSubValidator(id: Hex | number, validator: OwnableValidatorConfig | WebauthnValidatorConfig): Call;
|
|
38
37
|
declare function removeSubValidator(id: Hex | number, validator: OwnableValidatorConfig | WebauthnValidatorConfig): Call;
|
|
39
|
-
export { enableEcdsa, enablePasskeys, disableEcdsa, disablePasskeys, addOwner, removeOwner, changeThreshold, recover, setUpRecovery, encodeSmartSessionSignature,
|
|
38
|
+
export { enableEcdsa, enablePasskeys, disableEcdsa, disablePasskeys, addOwner, removeOwner, changeThreshold, recover, setUpRecovery, encodeSmartSessionSignature, enableMultiFactor, disableMultiFactor, changeMultiFactorThreshold, setSubValidator, removeSubValidator, };
|
|
40
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAGV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAM3C,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAA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|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.encodeSmartSessionSignature = void 0;
|
|
4
4
|
exports.enableEcdsa = enableEcdsa;
|
|
5
5
|
exports.enablePasskeys = enablePasskeys;
|
|
6
6
|
exports.disableEcdsa = disableEcdsa;
|
|
@@ -19,8 +19,6 @@ const viem_1 = require("viem");
|
|
|
19
19
|
const accounts_1 = require("../accounts");
|
|
20
20
|
const utils_1 = require("../accounts/utils");
|
|
21
21
|
const core_1 = require("../modules/validators/core");
|
|
22
|
-
const registry_1 = require("./registry");
|
|
23
|
-
Object.defineProperty(exports, "trustAttester", { enumerable: true, get: function () { return registry_1.trustAttester; } });
|
|
24
22
|
const smart_session_1 = require("./smart-session");
|
|
25
23
|
Object.defineProperty(exports, "encodeSmartSessionSignature", { enumerable: true, get: function () { return smart_session_1.encodeSmartSessionSignature; } });
|
|
26
24
|
function setUpRecovery({ rhinestoneAccount, guardians, threshold = 1, }) {
|
|
@@ -10,7 +10,7 @@ const MOCK_OWNER_A = '0xd1aefebdceefc094f1805b241fa5e6db63a9181a';
|
|
|
10
10
|
const MOCK_OWNER_B = '0xeddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817';
|
|
11
11
|
const MOCK_OWNER_C = '0xb31e76f19defe76edc4b7eceeb4b0a2d6ddaca39';
|
|
12
12
|
const MOCK_ACCOUNT_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
13
|
-
const accountAddress = '
|
|
13
|
+
const accountAddress = '0x9bcf96dd2b526344238701e6eaba4ef986a498af';
|
|
14
14
|
// Mock viem
|
|
15
15
|
vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
16
16
|
const actual = await importOriginal();
|
|
@@ -37,7 +37,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
37
37
|
{
|
|
38
38
|
to: accountAddress,
|
|
39
39
|
value: 0n,
|
|
40
|
-
data: '
|
|
40
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000e9e6e96bcaa3c113187cdb7e38aed900000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
41
41
|
},
|
|
42
42
|
]);
|
|
43
43
|
});
|
|
@@ -49,7 +49,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
49
49
|
{
|
|
50
50
|
to: accountAddress,
|
|
51
51
|
value: 0n,
|
|
52
|
-
data: '
|
|
52
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000e9e6e96bcaa3c113187cdb7e38aed9000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
53
53
|
},
|
|
54
54
|
]);
|
|
55
55
|
});
|
|
@@ -62,7 +62,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
62
62
|
{
|
|
63
63
|
to: accountAddress,
|
|
64
64
|
value: 0n,
|
|
65
|
-
data: '
|
|
65
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000e9e6e96bcaa3c113187cdb7e38aed9000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003000000000000000000000000b31e76f19defe76edc4b7eceeb4b0a2d6ddaca39000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
66
66
|
},
|
|
67
67
|
]);
|
|
68
68
|
});
|
|
@@ -84,7 +84,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
84
84
|
{
|
|
85
85
|
to: accountAddress,
|
|
86
86
|
value: 0n,
|
|
87
|
-
data: '
|
|
87
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a',
|
|
88
88
|
},
|
|
89
89
|
]);
|
|
90
90
|
});
|
|
@@ -104,7 +104,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
104
104
|
{
|
|
105
105
|
to: accountAddress,
|
|
106
106
|
value: 0n,
|
|
107
|
-
data: '
|
|
107
|
+
data: '0xa71763a800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000e9e6e96bcaa3c113187cdb7e38aed900000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
|
108
108
|
},
|
|
109
109
|
]);
|
|
110
110
|
});
|
|
@@ -124,7 +124,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
124
124
|
{
|
|
125
125
|
to: accountAddress,
|
|
126
126
|
value: 0n,
|
|
127
|
-
data: '
|
|
127
|
+
data: '0xa71763a800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
|
128
128
|
},
|
|
129
129
|
]);
|
|
130
130
|
});
|
|
@@ -132,7 +132,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
132
132
|
(0, vitest_1.describe)('Add Owner', () => {
|
|
133
133
|
(0, vitest_1.test)('', () => {
|
|
134
134
|
(0, vitest_1.expect)((0, _1.addOwner)(MOCK_OWNER_A)).toEqual({
|
|
135
|
-
to: '
|
|
135
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
136
136
|
value: 0n,
|
|
137
137
|
data: '0x7065cb48000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
138
138
|
});
|
|
@@ -141,7 +141,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
141
141
|
(0, vitest_1.describe)('Remove Owner', () => {
|
|
142
142
|
(0, vitest_1.test)('', () => {
|
|
143
143
|
(0, vitest_1.expect)((0, _1.removeOwner)(MOCK_OWNER_A, MOCK_OWNER_B)).toEqual({
|
|
144
|
-
to: '
|
|
144
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
145
145
|
value: 0n,
|
|
146
146
|
data: '0xfbe5ce0a000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
147
147
|
});
|
|
@@ -150,7 +150,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
150
150
|
(0, vitest_1.describe)('Set Threshold', () => {
|
|
151
151
|
(0, vitest_1.test)('', () => {
|
|
152
152
|
(0, vitest_1.expect)((0, _1.changeThreshold)(1)).toEqual({
|
|
153
|
-
to: '
|
|
153
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
154
154
|
value: 0n,
|
|
155
155
|
data: '0x960bfe040000000000000000000000000000000000000000000000000000000000000001',
|
|
156
156
|
});
|
|
@@ -216,12 +216,12 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
216
216
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
217
217
|
(0, vitest_1.expect)(result).toEqual([
|
|
218
218
|
{
|
|
219
|
-
to: '
|
|
219
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
220
220
|
value: 0n,
|
|
221
221
|
data: '0x7065cb480000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
|
-
to: '
|
|
224
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
225
225
|
value: 0n,
|
|
226
226
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
227
227
|
},
|
|
@@ -249,12 +249,12 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
249
249
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
250
250
|
(0, vitest_1.expect)(result).toEqual([
|
|
251
251
|
{
|
|
252
|
-
to: '
|
|
252
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
253
253
|
value: 0n,
|
|
254
254
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
|
-
to: '
|
|
257
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
258
258
|
value: 0n,
|
|
259
259
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
260
260
|
},
|
|
@@ -282,17 +282,17 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
282
282
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
283
283
|
(0, vitest_1.expect)(result).toEqual([
|
|
284
284
|
{
|
|
285
|
-
to: '
|
|
285
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
286
286
|
value: 0n,
|
|
287
287
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
|
-
to: '
|
|
290
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
291
291
|
value: 0n,
|
|
292
292
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
|
-
to: '
|
|
295
|
+
to: '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9',
|
|
296
296
|
value: 0n,
|
|
297
297
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596',
|
|
298
298
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-session.d.ts","sourceRoot":"","sources":["../../../execution/smart-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAIV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"smart-session.d.ts","sourceRoot":"","sources":["../../../execution/smart-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EAIV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAmBb,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EAGtB,KAAK,oBAAoB,EAC1B,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAGV,uBAAuB,EACvB,OAAO,EACR,MAAM,UAAU,CAAA;AAGjB,UAAU,cAAc;IACtB,oBAAoB,EAAE,GAAG,CAAA;IACzB,IAAI,EAAE,oBAAoB,CAAA;IAC1B,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,iBAAiB,EAAE,iBAAiB,CAAA;CACrC;AAED,iBAAe,iBAAiB,CAC9B,MAAM,EAAE,uBAAuB,EAC/B,QAAQ,EAAE,OAAO,EAAE,EACnB,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,cAAc,CAAC,CA4BzB;AAgGD,iBAAS,mBAAmB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,GAAG,CAgC7D;AAiLD,iBAAe,kBAAkB,CAC/B,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,OAAO,iBA+BjB;AAED,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACrE,YAAY,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -6,7 +6,6 @@ exports.getMultichainDigest = getMultichainDigest;
|
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
7
|
const accounts_1 = require("../accounts");
|
|
8
8
|
const utils_1 = require("../accounts/utils");
|
|
9
|
-
const modules_1 = require("../modules");
|
|
10
9
|
const validators_1 = require("../modules/validators");
|
|
11
10
|
const smart_sessions_1 = require("../modules/validators/smart-sessions");
|
|
12
11
|
const error_1 = require("./error");
|
|
@@ -282,15 +281,11 @@ async function enableSmartSession(chain, config, session) {
|
|
|
282
281
|
return;
|
|
283
282
|
}
|
|
284
283
|
const enableSessionCall = await (0, validators_1.getEnableSessionCall)(chain, session, config.provider);
|
|
285
|
-
const trustedAttesters = await (0, modules_1.getTrustedAttesters)(publicClient, address);
|
|
286
|
-
const trustAttesterCall = trustedAttesters.length === 0 ? (0, modules_1.getTrustAttesterCall)(config) : undefined;
|
|
287
284
|
const smartAccount = await (0, accounts_1.getSmartAccount)(config, publicClient, chain);
|
|
288
285
|
const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
|
|
289
286
|
const opHash = await bundlerClient.sendUserOperation({
|
|
290
287
|
account: smartAccount,
|
|
291
|
-
calls:
|
|
292
|
-
? [trustAttesterCall, enableSessionCall]
|
|
293
|
-
: [enableSessionCall],
|
|
288
|
+
calls: [enableSessionCall],
|
|
294
289
|
});
|
|
295
290
|
await bundlerClient.waitForUserOperationReceipt({
|
|
296
291
|
hash: opHash,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Address, Chain, Hex } from 'viem';
|
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
3
|
import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, SmartSessionsNotEnabledError } from './accounts';
|
|
4
4
|
import { createTransport } from './accounts/utils';
|
|
5
|
-
import { addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery
|
|
5
|
+
import { addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery } from './actions';
|
|
6
6
|
import type { TransactionResult } from './execution';
|
|
7
7
|
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
8
8
|
import { type SessionDetails } from './execution/smart-session';
|
|
@@ -21,7 +21,6 @@ interface RhinestoneAccount {
|
|
|
21
21
|
getPortfolio: (onTestnets?: boolean) => Promise<Portfolio>;
|
|
22
22
|
getMaxSpendableAmount: (chain: Chain, tokenAddress: Address, gasUnits: bigint) => Promise<bigint>;
|
|
23
23
|
getSessionDetails: (sessions: Session[], sessionIndex: number, signature?: Hex) => Promise<SessionDetails>;
|
|
24
|
-
areAttestersTrusted: (chain: Chain) => Promise<boolean>;
|
|
25
24
|
getOwners: (chain: Chain) => Promise<{
|
|
26
25
|
accounts: Address[];
|
|
27
26
|
threshold: number;
|
|
@@ -35,6 +34,6 @@ interface RhinestoneAccount {
|
|
|
35
34
|
* @returns account
|
|
36
35
|
*/
|
|
37
36
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
38
|
-
export { createRhinestoneAccount, createTransport, addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery,
|
|
37
|
+
export { createRhinestoneAccount, createTransport, addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, };
|
|
39
38
|
export type { RhinestoneAccount, Session, Call, IntentData, PreparedTransactionData, SignedTransactionData, TransactionResult, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, Portfolio, };
|
|
40
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAC7B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAC7B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,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ACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,qCAAqC,EACrC,kCAAkC,EAElC,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EAEzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = exports.Eip7702NotSupportedForAccountError = exports.SignMessageNotSupportedByAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = exports.isAccountError = exports.
|
|
3
|
+
exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = exports.Eip7702NotSupportedForAccountError = exports.SignMessageNotSupportedByAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = exports.isAccountError = exports.setUpRecovery = exports.setSubValidator = exports.removeSubValidator = exports.removeOwner = exports.recover = exports.encodeSmartSessionSignature = exports.enablePasskeys = exports.enableMultiFactor = exports.enableEcdsa = exports.disablePasskeys = exports.disableMultiFactor = exports.disableEcdsa = exports.changeThreshold = exports.changeMultiFactorThreshold = exports.addOwner = exports.createTransport = void 0;
|
|
4
4
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
5
5
|
const accounts_1 = require("./accounts");
|
|
6
6
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
@@ -30,7 +30,6 @@ Object.defineProperty(exports, "removeOwner", { enumerable: true, get: function
|
|
|
30
30
|
Object.defineProperty(exports, "removeSubValidator", { enumerable: true, get: function () { return actions_1.removeSubValidator; } });
|
|
31
31
|
Object.defineProperty(exports, "setSubValidator", { enumerable: true, get: function () { return actions_1.setSubValidator; } });
|
|
32
32
|
Object.defineProperty(exports, "setUpRecovery", { enumerable: true, get: function () { return actions_1.setUpRecovery; } });
|
|
33
|
-
Object.defineProperty(exports, "trustAttester", { enumerable: true, get: function () { return actions_1.trustAttester; } });
|
|
34
33
|
const execution_1 = require("./execution");
|
|
35
34
|
Object.defineProperty(exports, "ExecutionError", { enumerable: true, get: function () { return execution_1.ExecutionError; } });
|
|
36
35
|
Object.defineProperty(exports, "IntentFailedError", { enumerable: true, get: function () { return execution_1.IntentFailedError; } });
|
|
@@ -120,10 +119,6 @@ async function createRhinestoneAccount(config) {
|
|
|
120
119
|
function getSessionDetails(sessions, sessionIndex, signature) {
|
|
121
120
|
return (0, smart_session_1.getSessionDetails)(config, sessions, sessionIndex, signature);
|
|
122
121
|
}
|
|
123
|
-
function areAttestersTrusted(chain) {
|
|
124
|
-
const account = getAddress();
|
|
125
|
-
return (0, modules_1.areAttestersTrusted)(account, chain, config.provider);
|
|
126
|
-
}
|
|
127
122
|
function getOwners(chain) {
|
|
128
123
|
const account = getAddress();
|
|
129
124
|
return (0, modules_1.getOwners)(account, chain, config.provider);
|
|
@@ -145,7 +140,6 @@ async function createRhinestoneAccount(config) {
|
|
|
145
140
|
getPortfolio,
|
|
146
141
|
getMaxSpendableAmount,
|
|
147
142
|
getSessionDetails,
|
|
148
|
-
areAttestersTrusted,
|
|
149
143
|
getOwners,
|
|
150
144
|
getValidators,
|
|
151
145
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Chain, type Hex } from 'viem';
|
|
2
2
|
import type { RhinestoneAccountConfig } from '../types';
|
|
3
3
|
import { type Module } from './common';
|
|
4
4
|
import { HOOK_ADDRESS } from './omni-account';
|
|
5
|
-
import {
|
|
6
|
-
import { getTrustAttesterCall, getTrustedAttesters } from './registry';
|
|
5
|
+
import { getOwners, getValidators } from './read';
|
|
7
6
|
import { getOwnerValidator } from './validators';
|
|
8
7
|
interface WebAuthnData {
|
|
9
8
|
authenticatorData: Hex;
|
|
@@ -24,12 +23,9 @@ interface ModeleSetup {
|
|
|
24
23
|
executors: Module[];
|
|
25
24
|
fallbacks: Module[];
|
|
26
25
|
hooks: Module[];
|
|
27
|
-
registry: Address;
|
|
28
|
-
attesters: Address[];
|
|
29
|
-
threshold: number;
|
|
30
26
|
}
|
|
31
27
|
declare function getSetup(config: RhinestoneAccountConfig): ModeleSetup;
|
|
32
28
|
declare function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled, }: WebauthnValidatorSignature): `0x${string}`;
|
|
33
29
|
declare function isRip7212SupportedNetwork(chain: Chain): boolean;
|
|
34
|
-
export { HOOK_ADDRESS, getSetup,
|
|
30
|
+
export { HOOK_ADDRESS, getSetup, getOwnerValidator, getWebauthnValidatorSignature, getOwners, getValidators, isRip7212SupportedNetwork, };
|
|
35
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,KAAK,EAEV,KAAK,GAAG,EAET,MAAM,MAAM,CAAA;AAYb,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAA2B,MAAM,gBAAgB,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAA4B,MAAM,cAAc,CAAA;AAM1E,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B;AAED,UAAU,0BAA0B;IAClC,QAAQ,EAAE,YAAY,CAAA;IACtB,SAAS,EAAE,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAA;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,UAAU,iBAAiB;IACzB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,WAAW,CAwD9D;AAED,iBAAS,6BAA6B,CAAC,EACrC,QAAQ,EACR,SAAS,EACT,cAAsB,GACvB,EAAE,0BAA0B,iBA6C5B;AAED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAa9C;AAaD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,6BAA6B,EAC7B,SAAS,EACT,aAAa,EACb,yBAAyB,GAC1B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValidators = exports.getOwners = exports.
|
|
3
|
+
exports.getValidators = exports.getOwners = exports.getOwnerValidator = exports.HOOK_ADDRESS = void 0;
|
|
4
4
|
exports.getSetup = getSetup;
|
|
5
5
|
exports.getWebauthnValidatorSignature = getWebauthnValidatorSignature;
|
|
6
6
|
exports.isRip7212SupportedNetwork = isRip7212SupportedNetwork;
|
|
@@ -10,12 +10,8 @@ const common_1 = require("./common");
|
|
|
10
10
|
const omni_account_1 = require("./omni-account");
|
|
11
11
|
Object.defineProperty(exports, "HOOK_ADDRESS", { enumerable: true, get: function () { return omni_account_1.HOOK_ADDRESS; } });
|
|
12
12
|
const read_1 = require("./read");
|
|
13
|
-
Object.defineProperty(exports, "areAttestersTrusted", { enumerable: true, get: function () { return read_1.areAttestersTrusted; } });
|
|
14
13
|
Object.defineProperty(exports, "getOwners", { enumerable: true, get: function () { return read_1.getOwners; } });
|
|
15
14
|
Object.defineProperty(exports, "getValidators", { enumerable: true, get: function () { return read_1.getValidators; } });
|
|
16
|
-
const registry_1 = require("./registry");
|
|
17
|
-
Object.defineProperty(exports, "getTrustAttesterCall", { enumerable: true, get: function () { return registry_1.getTrustAttesterCall; } });
|
|
18
|
-
Object.defineProperty(exports, "getTrustedAttesters", { enumerable: true, get: function () { return registry_1.getTrustedAttesters; } });
|
|
19
15
|
const validators_1 = require("./validators");
|
|
20
16
|
Object.defineProperty(exports, "getOwnerValidator", { enumerable: true, get: function () { return validators_1.getOwnerValidator; } });
|
|
21
17
|
const core_1 = require("./validators/core");
|
|
@@ -58,15 +54,11 @@ function getSetup(config) {
|
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
const hooks = [];
|
|
61
|
-
const attesters = (0, registry_1.getAttesters)();
|
|
62
57
|
return {
|
|
63
58
|
validators,
|
|
64
59
|
executors,
|
|
65
60
|
fallbacks,
|
|
66
61
|
hooks,
|
|
67
|
-
registry: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
|
|
68
|
-
attesters: attesters.list,
|
|
69
|
-
threshold: attesters.threshold,
|
|
70
62
|
};
|
|
71
63
|
}
|
|
72
64
|
function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled = false, }) {
|
|
@@ -15,7 +15,7 @@ const index_1 = require("./index");
|
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
const setup = (0, index_1.getSetup)(config);
|
|
18
|
-
(0, vitest_1.expect)(setup.validators[0].address).toBe('
|
|
18
|
+
(0, vitest_1.expect)(setup.validators[0].address).toBe('0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9');
|
|
19
19
|
(0, vitest_1.expect)(setup.validators[0].type).toBe(1n);
|
|
20
20
|
});
|
|
21
21
|
(0, vitest_1.test)('should use webauthn validator for passkey owners', () => {
|
|
@@ -28,7 +28,7 @@ const index_1 = require("./index");
|
|
|
28
28
|
};
|
|
29
29
|
const setup = (0, index_1.getSetup)(config);
|
|
30
30
|
(0, vitest_1.expect)(setup.validators).toHaveLength(1);
|
|
31
|
-
(0, vitest_1.expect)(setup.validators[0].address).toBe('
|
|
31
|
+
(0, vitest_1.expect)(setup.validators[0].address).toBe('0x0000000000578c4cB0e472a5462da43C495C3F33');
|
|
32
32
|
(0, vitest_1.expect)(setup.validators[0].type).toBe(1n);
|
|
33
33
|
});
|
|
34
34
|
(0, vitest_1.test)('should use smart session validator when sessions are enabled', () => {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
|
-
declare const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS: Address;
|
|
3
|
-
declare const RHINESTONE_MODULE_REGISTRY_ADDRESS: Address;
|
|
4
|
-
declare const RHINESTONE_ATTESTER_ADDRESS: Address;
|
|
5
2
|
declare const HOOK_ADDRESS: Address;
|
|
6
3
|
declare const TARGET_MODULE_ADDRESS: Address;
|
|
7
4
|
declare const SAME_CHAIN_MODULE_ADDRESS: Address;
|
|
8
5
|
declare const INTENT_EXECUTOR_ADDRESS: Address;
|
|
9
|
-
export {
|
|
6
|
+
export { HOOK_ADDRESS, TARGET_MODULE_ADDRESS, SAME_CHAIN_MODULE_ADDRESS, INTENT_EXECUTOR_ADDRESS, };
|
|
10
7
|
//# sourceMappingURL=omni-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../../modules/omni-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../../modules/omni-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,QAAA,MAAM,YAAY,EAAE,OAAsD,CAAA;AAC1E,QAAA,MAAM,qBAAqB,EAAE,OACiB,CAAA;AAC9C,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAE9C,QAAA,MAAM,uBAAuB,EAAE,OACe,CAAA;AAE9C,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,GACxB,CAAA"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTENT_EXECUTOR_ADDRESS = exports.SAME_CHAIN_MODULE_ADDRESS = exports.TARGET_MODULE_ADDRESS = exports.HOOK_ADDRESS =
|
|
4
|
-
const OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = '0x6D0515e8E499468DCe9583626f0cA15b887f9d03';
|
|
5
|
-
exports.OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS = OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS;
|
|
6
|
-
const RHINESTONE_MODULE_REGISTRY_ADDRESS = '0x000000000069e2a187aeffb852bf3ccdc95151b2';
|
|
7
|
-
exports.RHINESTONE_MODULE_REGISTRY_ADDRESS = RHINESTONE_MODULE_REGISTRY_ADDRESS;
|
|
8
|
-
const RHINESTONE_ATTESTER_ADDRESS = '0x000000333034E9f539ce08819E12c1b8Cb29084d';
|
|
9
|
-
exports.RHINESTONE_ATTESTER_ADDRESS = RHINESTONE_ATTESTER_ADDRESS;
|
|
3
|
+
exports.INTENT_EXECUTOR_ADDRESS = exports.SAME_CHAIN_MODULE_ADDRESS = exports.TARGET_MODULE_ADDRESS = exports.HOOK_ADDRESS = void 0;
|
|
10
4
|
const HOOK_ADDRESS = '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
11
5
|
exports.HOOK_ADDRESS = HOOK_ADDRESS;
|
|
12
6
|
const TARGET_MODULE_ADDRESS = '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
13
7
|
exports.TARGET_MODULE_ADDRESS = TARGET_MODULE_ADDRESS;
|
|
14
8
|
const SAME_CHAIN_MODULE_ADDRESS = '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
15
9
|
exports.SAME_CHAIN_MODULE_ADDRESS = SAME_CHAIN_MODULE_ADDRESS;
|
|
16
|
-
const INTENT_EXECUTOR_ADDRESS = '
|
|
10
|
+
const INTENT_EXECUTOR_ADDRESS = '0x00000000005aD9ce1f5035FD62CA96CEf16AdAAF';
|
|
17
11
|
exports.INTENT_EXECUTOR_ADDRESS = INTENT_EXECUTOR_ADDRESS;
|
|
@@ -5,6 +5,5 @@ declare function getOwners(account: Address, chain: Chain, provider?: ProviderCo
|
|
|
5
5
|
accounts: Address[];
|
|
6
6
|
threshold: number;
|
|
7
7
|
} | null>;
|
|
8
|
-
|
|
9
|
-
export { getValidators, getOwners, areAttestersTrusted };
|
|
8
|
+
export { getValidators, getOwners };
|
|
10
9
|
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAkC,MAAM,MAAM,CAAA;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAkC,MAAM,MAAM,CAAA;AAE/E,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3D,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CA6CpB;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAkER;AAED,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/src/modules/read.js
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getValidators = getValidators;
|
|
4
4
|
exports.getOwners = getOwners;
|
|
5
|
-
exports.areAttestersTrusted = areAttestersTrusted;
|
|
6
5
|
const viem_1 = require("viem");
|
|
7
6
|
const utils_1 = require("../accounts/utils");
|
|
8
|
-
const omni_account_1 = require("./omni-account");
|
|
9
|
-
const registry_1 = require("./registry");
|
|
10
7
|
const core_1 = require("./validators/core");
|
|
11
8
|
async function getValidators(accountType, account, chain, provider) {
|
|
12
9
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
@@ -121,33 +118,3 @@ async function getOwners(account, chain, provider) {
|
|
|
121
118
|
threshold: thresholdResult.result,
|
|
122
119
|
};
|
|
123
120
|
}
|
|
124
|
-
async function areAttestersTrusted(account, chain, provider) {
|
|
125
|
-
const { list: requiredAttesters } = (0, registry_1.getAttesters)();
|
|
126
|
-
const publicClient = (0, viem_1.createPublicClient)({
|
|
127
|
-
chain,
|
|
128
|
-
transport: (0, utils_1.createTransport)(chain, provider),
|
|
129
|
-
});
|
|
130
|
-
const trustedAttesters = await publicClient.readContract({
|
|
131
|
-
abi: [
|
|
132
|
-
{
|
|
133
|
-
type: 'function',
|
|
134
|
-
name: 'findTrustedAttesters',
|
|
135
|
-
inputs: [
|
|
136
|
-
{
|
|
137
|
-
type: 'address',
|
|
138
|
-
name: 'smartAccount',
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
outputs: [
|
|
142
|
-
{
|
|
143
|
-
type: 'address[]',
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
functionName: 'findTrustedAttesters',
|
|
149
|
-
address: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
|
|
150
|
-
args: [account],
|
|
151
|
-
});
|
|
152
|
-
return requiredAttesters.every((attester) => trustedAttesters.includes((0, viem_1.getAddress)(attester)));
|
|
153
|
-
}
|
|
@@ -10,9 +10,9 @@ exports.getValidator = getValidator;
|
|
|
10
10
|
exports.getMockSignature = getMockSignature;
|
|
11
11
|
const viem_1 = require("viem");
|
|
12
12
|
const common_1 = require("../common");
|
|
13
|
-
const OWNABLE_VALIDATOR_ADDRESS = '
|
|
13
|
+
const OWNABLE_VALIDATOR_ADDRESS = '0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9';
|
|
14
14
|
exports.OWNABLE_VALIDATOR_ADDRESS = OWNABLE_VALIDATOR_ADDRESS;
|
|
15
|
-
const WEBAUTHN_VALIDATOR_ADDRESS = '
|
|
15
|
+
const WEBAUTHN_VALIDATOR_ADDRESS = '0x0000000000578c4cB0e472a5462da43C495C3F33';
|
|
16
16
|
exports.WEBAUTHN_VALIDATOR_ADDRESS = WEBAUTHN_VALIDATOR_ADDRESS;
|
|
17
17
|
const SOCIAL_RECOVERY_VALIDATOR_ADDRESS = '0xA04D053b3C8021e8D5bF641816c42dAA75D8b597';
|
|
18
18
|
const MULTI_FACTOR_VALIDATOR_ADDRESS = '0xf6bDf42c9BE18cEcA5C06c42A43DAf7FBbe7896b';
|
|
@@ -14,7 +14,7 @@ const core_1 = require("./core");
|
|
|
14
14
|
});
|
|
15
15
|
(0, vitest_1.expect)(validator.type).toEqual(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
16
16
|
(0, vitest_1.expect)((0, viem_1.isAddress)(validator.address)).toEqual(true);
|
|
17
|
-
(0, vitest_1.expect)(validator.address).toEqual('
|
|
17
|
+
(0, vitest_1.expect)(validator.address).toEqual('0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9');
|
|
18
18
|
(0, vitest_1.expect)(validator.initData).toEqual('0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936');
|
|
19
19
|
});
|
|
20
20
|
(0, vitest_1.test)('ECDSA: two addresses', () => {
|
|
@@ -24,7 +24,7 @@ const core_1 = require("./core");
|
|
|
24
24
|
});
|
|
25
25
|
(0, vitest_1.expect)(validator.type).toEqual(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
26
26
|
(0, vitest_1.expect)((0, viem_1.isAddress)(validator.address)).toEqual(true);
|
|
27
|
-
(0, vitest_1.expect)(validator.address).toEqual('
|
|
27
|
+
(0, vitest_1.expect)(validator.address).toEqual('0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9');
|
|
28
28
|
(0, vitest_1.expect)(validator.initData).toEqual('0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936');
|
|
29
29
|
});
|
|
30
30
|
(0, vitest_1.test)('ECDSA: three addresses, custom threshold', () => {
|
|
@@ -35,7 +35,7 @@ const core_1 = require("./core");
|
|
|
35
35
|
});
|
|
36
36
|
(0, vitest_1.expect)(validator.type).toEqual(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
37
37
|
(0, vitest_1.expect)((0, viem_1.isAddress)(validator.address)).toEqual(true);
|
|
38
|
-
(0, vitest_1.expect)(validator.address).toEqual('
|
|
38
|
+
(0, vitest_1.expect)(validator.address).toEqual('0x0000000000E9E6E96Bcaa3c113187CdB7E38AED9');
|
|
39
39
|
(0, vitest_1.expect)(validator.initData).toEqual('0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936');
|
|
40
40
|
});
|
|
41
41
|
(0, vitest_1.test)('Passkey', () => {
|
|
@@ -45,7 +45,7 @@ const core_1 = require("./core");
|
|
|
45
45
|
});
|
|
46
46
|
(0, vitest_1.expect)(validator.type).toEqual(common_1.MODULE_TYPE_ID_VALIDATOR);
|
|
47
47
|
(0, vitest_1.expect)((0, viem_1.isAddress)(validator.address)).toEqual(true);
|
|
48
|
-
(0, vitest_1.expect)(validator.address).toEqual('
|
|
48
|
+
(0, vitest_1.expect)(validator.address).toEqual('0x0000000000578c4cB0e472a5462da43C495C3F33');
|
|
49
49
|
(0, vitest_1.expect)(validator.initData).toEqual('0x580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d19c9a01073b202db2ed56e604ad11db557d8c3ad75181619597f21b830f2da82a');
|
|
50
50
|
});
|
|
51
51
|
});
|
|
@@ -15,7 +15,7 @@ const smart_sessions_2 = require("./smart-sessions");
|
|
|
15
15
|
type: 'ecdsa',
|
|
16
16
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
17
17
|
},
|
|
18
|
-
})).toBe('
|
|
18
|
+
})).toBe('0x4ad46f8661acf29090a7635877ff94953e0ea05b0583d32de3839acc49739182');
|
|
19
19
|
});
|
|
20
20
|
(0, vitest_1.test)('with salt', () => {
|
|
21
21
|
(0, vitest_1.expect)((0, smart_sessions_2.getPermissionId)({
|
|
@@ -24,7 +24,7 @@ const smart_sessions_2 = require("./smart-sessions");
|
|
|
24
24
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
25
25
|
},
|
|
26
26
|
salt: '0x97340e1cfff3319c76ef22b2bc9d3231071d550125d68c9d4a8972823f166320',
|
|
27
|
-
})).toBe('
|
|
27
|
+
})).toBe('0xb1adc169088099c6830120c63cde8d2c7e1b9a82857b35c0527dc2e37ce3e7bd');
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
(0, vitest_1.describe)('Smart Session Validator', () => {
|
|
@@ -217,10 +217,10 @@ const smart_sessions_2 = require("./smart-sessions");
|
|
|
217
217
|
});
|
|
218
218
|
(0, vitest_1.describe)('Encode Smart Session Signature', () => {
|
|
219
219
|
(0, vitest_1.test)('use mode', () => {
|
|
220
|
-
const permissionId = '
|
|
220
|
+
const permissionId = '0x4ad46f8661acf29090a7635877ff94953e0ea05b0583d32de3839acc49739182';
|
|
221
221
|
const signature = '0xabcdef';
|
|
222
222
|
const sessionSignature = (0, smart_sessions_2.encodeSmartSessionSignature)(smart_sessions_2.SMART_SESSION_MODE_USE, permissionId, signature);
|
|
223
|
-
(0, vitest_1.expect)(sessionSignature).toEqual('
|
|
223
|
+
(0, vitest_1.expect)(sessionSignature).toEqual('0x004ad46f8661acf29090a7635877ff94953e0ea05b0583d32de3839acc49739182abcdef');
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
226
|
});
|
|
@@ -6,7 +6,7 @@ const viem_1 = require("viem");
|
|
|
6
6
|
function getClaimProofer(settlementSystem) {
|
|
7
7
|
switch (settlementSystem) {
|
|
8
8
|
case 'ACROSS':
|
|
9
|
-
return '
|
|
9
|
+
return '0x1636b30481Db91Bbc5818e65d3962838BdCd5569';
|
|
10
10
|
case 'SAME_CHAIN':
|
|
11
11
|
return viem_1.zeroAddress;
|
|
12
12
|
}
|
|
@@ -20,7 +20,7 @@ function getIntentOpHash(intentOp) {
|
|
|
20
20
|
name: 'The Compact',
|
|
21
21
|
version: '1',
|
|
22
22
|
chainId: BigInt(notarizedChainElement.chainId),
|
|
23
|
-
verifyingContract: '
|
|
23
|
+
verifyingContract: '0xAbd3388A633758D0Bae01Efb885EF1e87BD519a6',
|
|
24
24
|
},
|
|
25
25
|
types: {
|
|
26
26
|
MultichainCompact: [
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../actions/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAG3C,iBAAS,aAAa,CAAC,OAAO,EAAE,iBAAiB;;;EAEhD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../actions/registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const vitest_1 = require("vitest");
|
|
4
|
-
const consts_1 = require("../../test/consts");
|
|
5
|
-
const __1 = require("..");
|
|
6
|
-
const registry_1 = require("./registry");
|
|
7
|
-
(0, vitest_1.describe)('Actions', async () => {
|
|
8
|
-
const rhinestoneAccount = await (0, __1.createRhinestoneAccount)({
|
|
9
|
-
owners: {
|
|
10
|
-
type: 'ecdsa',
|
|
11
|
-
accounts: [consts_1.accountA],
|
|
12
|
-
},
|
|
13
|
-
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
14
|
-
});
|
|
15
|
-
(0, vitest_1.describe)('Trust Attester', () => {
|
|
16
|
-
(0, vitest_1.test)('should return the correct call', () => {
|
|
17
|
-
const call = (0, registry_1.trustAttester)(rhinestoneAccount);
|
|
18
|
-
(0, vitest_1.expect)(call).toStrictEqual({
|
|
19
|
-
data: '0xf05c04e1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000333034e9f539ce08819e12c1b8cb29084d0000000000000000000000006d0515e8e499468dce9583626f0ca15b887f9d03',
|
|
20
|
-
to: '0x000000000069e2a187aeffb852bf3ccdc95151b2',
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Address, type PublicClient } from 'viem';
|
|
2
|
-
import type { RhinestoneAccountConfig } from '../types';
|
|
3
|
-
declare function getAttesters(): {
|
|
4
|
-
list: Address[];
|
|
5
|
-
threshold: number;
|
|
6
|
-
};
|
|
7
|
-
declare function getTrustAttesterCall(config: RhinestoneAccountConfig): {
|
|
8
|
-
to: `0x${string}`;
|
|
9
|
-
data: `0x${string}`;
|
|
10
|
-
};
|
|
11
|
-
declare function getTrustedAttesters(client: PublicClient, account: Address): Promise<readonly Address[]>;
|
|
12
|
-
export { getTrustAttesterCall, getTrustedAttesters, getAttesters };
|
|
13
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../modules/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAA;AAE1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAQvD,iBAAS,YAAY,IAAI;IACvB,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAKA;AAED,iBAAS,oBAAoB,CAAC,MAAM,EAAE,uBAAuB;;;EA0B5D;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAyB7B;AAED,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTrustAttesterCall = getTrustAttesterCall;
|
|
4
|
-
exports.getTrustedAttesters = getTrustedAttesters;
|
|
5
|
-
exports.getAttesters = getAttesters;
|
|
6
|
-
const viem_1 = require("viem");
|
|
7
|
-
const _1 = require(".");
|
|
8
|
-
const omni_account_1 = require("./omni-account");
|
|
9
|
-
function getAttesters() {
|
|
10
|
-
return {
|
|
11
|
-
list: [omni_account_1.RHINESTONE_ATTESTER_ADDRESS, omni_account_1.OMNI_ACCOUNT_MOCK_ATTESTER_ADDRESS],
|
|
12
|
-
threshold: 1,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function getTrustAttesterCall(config) {
|
|
16
|
-
const moduleSetup = (0, _1.getSetup)(config);
|
|
17
|
-
return {
|
|
18
|
-
to: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
|
|
19
|
-
data: (0, viem_1.encodeFunctionData)({
|
|
20
|
-
abi: [
|
|
21
|
-
{
|
|
22
|
-
name: 'trustAttesters',
|
|
23
|
-
type: 'function',
|
|
24
|
-
inputs: [
|
|
25
|
-
{
|
|
26
|
-
name: 'threshold',
|
|
27
|
-
type: 'uint8',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'attesters',
|
|
31
|
-
type: 'address[]',
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
outputs: [],
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
functionName: 'trustAttesters',
|
|
38
|
-
args: [moduleSetup.threshold, moduleSetup.attesters],
|
|
39
|
-
}),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
async function getTrustedAttesters(client, account) {
|
|
43
|
-
return await client.readContract({
|
|
44
|
-
address: omni_account_1.RHINESTONE_MODULE_REGISTRY_ADDRESS,
|
|
45
|
-
abi: [
|
|
46
|
-
{
|
|
47
|
-
type: 'function',
|
|
48
|
-
stateMutability: 'view',
|
|
49
|
-
name: 'findTrustedAttesters',
|
|
50
|
-
inputs: [
|
|
51
|
-
{
|
|
52
|
-
type: 'address',
|
|
53
|
-
name: 'smartAccount',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
outputs: [
|
|
57
|
-
{
|
|
58
|
-
type: 'address[]',
|
|
59
|
-
name: 'attesters',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
functionName: 'findTrustedAttesters',
|
|
65
|
-
args: [account],
|
|
66
|
-
});
|
|
67
|
-
}
|