@rhinestone/sdk 2.0.0-beta.15 → 2.0.0-beta.17
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 +5 -5
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +46 -2
- package/dist/src/actions/ecdsa.js +2 -2
- package/dist/src/actions/index.js +2 -2
- package/dist/src/actions/mfa.js +2 -2
- package/dist/src/actions/passkeys.js +2 -2
- package/dist/src/actions/smart-sessions.d.ts +11 -3
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +14 -9
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +5 -1
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
2
|
-
import type
|
|
1
|
+
import { type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
2
|
+
import { type Module } from '../modules/common.js';
|
|
3
3
|
import type { ResolvedSessionSignerSet } from '../modules/validators/smart-sessions.js';
|
|
4
4
|
import type { AccountProviderConfig, Call, OwnerSet, RhinestoneConfig, SignerSet } from '../types.js';
|
|
5
5
|
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error.js';
|
|
6
6
|
import { type ValidatorConfig } from './utils.js';
|
|
7
7
|
type InternalSignerSet = SignerSet | ResolvedSessionSignerSet;
|
|
8
8
|
declare function getInitCode(config: RhinestoneConfig): {
|
|
9
|
-
address:
|
|
9
|
+
address: Address;
|
|
10
10
|
} | {
|
|
11
11
|
factory: `0x${string}`;
|
|
12
12
|
factoryData: `0x${string}`;
|
|
13
13
|
} | undefined;
|
|
14
14
|
declare function getV0InitCode(config: RhinestoneConfig): {
|
|
15
|
-
address:
|
|
15
|
+
address: Address;
|
|
16
16
|
} | {
|
|
17
17
|
factory: `0x${string}`;
|
|
18
18
|
factoryData: `0x${string}`;
|
|
@@ -30,7 +30,7 @@ declare function getEip712Domain(config: RhinestoneConfig, chain: Chain): {
|
|
|
30
30
|
salt: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
31
31
|
};
|
|
32
32
|
declare function getModuleInstallationCalls(config: RhinestoneConfig, module: Module): Call[];
|
|
33
|
-
declare function getModuleUninstallationCalls(config: RhinestoneConfig, module: Module): Call[]
|
|
33
|
+
declare function getModuleUninstallationCalls(config: RhinestoneConfig, chain: Chain, module: Module): Promise<Call[]>;
|
|
34
34
|
declare function getAddress(config: RhinestoneConfig): `0x${string}`;
|
|
35
35
|
declare function checkAddress(config: RhinestoneConfig): boolean;
|
|
36
36
|
declare function getEip1271Signature(config: RhinestoneConfig, signers: InternalSignerSet | undefined, chain: Chain, validator: ValidatorConfig, hash: Hex, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,MAAM,CAAA;AASb,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAA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EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { concat, createPublicClient, encodeAbiParameters, encodeFunctionData, hashTypedData, size, zeroAddress, } from 'viem';
|
|
2
2
|
import { sendTransactionInternal, sendUserOperationInternal, waitForExecution, } from '../execution/index.js';
|
|
3
3
|
import { getIntentExecutor, getSetup } from '../modules/index.js';
|
|
4
|
+
import { MODULE_TYPE_ID_VALIDATOR } from '../modules/common.js';
|
|
5
|
+
import { getValidators as getValidatorsInternal } from '../modules/read.js';
|
|
4
6
|
import { getOwnerValidator } from '../modules/validators/index.js';
|
|
5
7
|
import { getSocialRecoveryValidator } from '../modules/validators/core.js';
|
|
6
8
|
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, } from './error.js';
|
|
@@ -178,8 +180,14 @@ function getModuleInstallationCalls(config, module) {
|
|
|
178
180
|
data,
|
|
179
181
|
}));
|
|
180
182
|
}
|
|
181
|
-
|
|
183
|
+
// SentinelList head pointer used by ERC-7579 module managers (Nexus, Safe7579,
|
|
184
|
+
// Startale). Validator/executor uninstall on these accounts decodes the
|
|
185
|
+
// `deInitData` slot as `(address prev, bytes moduleDeInit)`, where `prev`
|
|
186
|
+
// identifies the preceding linked-list entry to repair on removal.
|
|
187
|
+
const SENTINEL_LIST_HEAD = '0x0000000000000000000000000000000000000001';
|
|
188
|
+
async function getModuleUninstallationCalls(config, chain, module) {
|
|
182
189
|
const address = getAddress(config);
|
|
190
|
+
const onChainDeInitData = await resolveOnChainDeInitData(config, chain, address, module);
|
|
183
191
|
const data = encodeFunctionData({
|
|
184
192
|
abi: [
|
|
185
193
|
{
|
|
@@ -204,10 +212,46 @@ function getModuleUninstallationCalls(config, module) {
|
|
|
204
212
|
},
|
|
205
213
|
],
|
|
206
214
|
functionName: 'uninstallModule',
|
|
207
|
-
args: [module.type, module.address,
|
|
215
|
+
args: [module.type, module.address, onChainDeInitData],
|
|
208
216
|
});
|
|
209
217
|
return [{ to: address, data, value: 0n }];
|
|
210
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* Build the value the account expects in `uninstallModule`'s third argument.
|
|
221
|
+
*
|
|
222
|
+
* `Module.deInitData` carries module-level bytes (mirroring `Module.initData`,
|
|
223
|
+
* what the module's `onUninstall` sees). ERC-7579 accounts that store
|
|
224
|
+
* validators / executors in a SentinelList — Nexus, Safe7579, Startale —
|
|
225
|
+
* require an account-level wrapper `abi.encode(prev, moduleDeInit)` so they
|
|
226
|
+
* can pop the entry from the linked list. Kernel uses different storage and
|
|
227
|
+
* treats this slot as raw module bytes, so we pass `module.deInitData` through
|
|
228
|
+
* unchanged.
|
|
229
|
+
*
|
|
230
|
+
* Scope: validator type only — there are no public actions to disable
|
|
231
|
+
* executor modules today.
|
|
232
|
+
*/
|
|
233
|
+
async function resolveOnChainDeInitData(config, chain, account, module) {
|
|
234
|
+
if (module.type !== MODULE_TYPE_ID_VALIDATOR) {
|
|
235
|
+
return module.deInitData;
|
|
236
|
+
}
|
|
237
|
+
const accountType = getAccountProvider(config).type;
|
|
238
|
+
if (accountType !== 'nexus' &&
|
|
239
|
+
accountType !== 'safe' &&
|
|
240
|
+
accountType !== 'startale') {
|
|
241
|
+
return module.deInitData;
|
|
242
|
+
}
|
|
243
|
+
const validators = await getValidatorsInternal(accountType, account, chain, config.provider);
|
|
244
|
+
const targetLower = module.address.toLowerCase();
|
|
245
|
+
const index = validators.findIndex((v) => v.toLowerCase() === targetLower);
|
|
246
|
+
if (index === -1) {
|
|
247
|
+
// Not installed; pass through unchanged. The account's `uninstallModule`
|
|
248
|
+
// will surface a `ModuleNotInstalled` revert with the original module
|
|
249
|
+
// address, which is more useful than a silent abi.decode mismatch.
|
|
250
|
+
return module.deInitData;
|
|
251
|
+
}
|
|
252
|
+
const prev = index === 0 ? SENTINEL_LIST_HEAD : validators[index - 1];
|
|
253
|
+
return encodeAbiParameters([{ type: 'address' }, { type: 'bytes' }], [prev, module.deInitData]);
|
|
254
|
+
}
|
|
211
255
|
function getAddress(config) {
|
|
212
256
|
if (is7702(config)) {
|
|
213
257
|
if (!config.eoa) {
|
|
@@ -22,8 +22,8 @@ function enable(owners, threshold = 1) {
|
|
|
22
22
|
function disable() {
|
|
23
23
|
const module = getOwnableValidator(1, []);
|
|
24
24
|
return {
|
|
25
|
-
async resolve({ config }) {
|
|
26
|
-
return getModuleUninstallationCalls(config, module);
|
|
25
|
+
async resolve({ chain, config }) {
|
|
26
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -21,8 +21,8 @@ function installModule(module) {
|
|
|
21
21
|
function uninstallModule(module) {
|
|
22
22
|
const moduleData = getModule(module);
|
|
23
23
|
return {
|
|
24
|
-
async resolve({ config }) {
|
|
25
|
-
return getModuleUninstallationCalls(config, moduleData);
|
|
24
|
+
async resolve({ chain, config }) {
|
|
25
|
+
return getModuleUninstallationCalls(config, chain, moduleData);
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
}
|
package/dist/src/actions/mfa.js
CHANGED
|
@@ -47,8 +47,8 @@ function changeThreshold(newThreshold) {
|
|
|
47
47
|
function disable() {
|
|
48
48
|
const module = getMultiFactorValidator(1, []);
|
|
49
49
|
return {
|
|
50
|
-
async resolve({ config }) {
|
|
51
|
-
return getModuleUninstallationCalls(config, module);
|
|
50
|
+
async resolve({ chain, config }) {
|
|
51
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Hex } from 'viem';
|
|
2
|
-
import type { LazyCallInput,
|
|
2
|
+
import type { LazyCallInput, Session } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Enable smart sessions
|
|
5
5
|
* @returns Calls to enable smart sessions
|
|
@@ -12,10 +12,18 @@ declare function experimental_enable(): LazyCallInput;
|
|
|
12
12
|
declare function experimental_disable(): LazyCallInput;
|
|
13
13
|
/**
|
|
14
14
|
* Enable a smart session
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* The `session` must be a resolved `Session` (the return value of
|
|
17
|
+
* `toSession(...)`). Re-resolving it here would drop the explicit
|
|
18
|
+
* `permissions` — a `Session` only carries the derived `actions`, not the
|
|
19
|
+
* original `SessionDefinition.permissions` — which makes the on-chain digest
|
|
20
|
+
* computed by `SmartSessionLens.getAndVerifyDigest` diverge from the one
|
|
21
|
+
* signed in `getSessionDetails`, causing the emissary to reject the enable.
|
|
22
|
+
*
|
|
23
|
+
* @param session resolved session to enable
|
|
16
24
|
* @returns Calls to enable the smart session
|
|
17
25
|
*/
|
|
18
|
-
declare function experimental_enableSession(session:
|
|
26
|
+
declare function experimental_enableSession(session: Session, enableSessionSignature: Hex, hashesAndChainIds: {
|
|
19
27
|
chainId: bigint;
|
|
20
28
|
sessionDigest: Hex;
|
|
21
29
|
}[], sessionToEnableIndex: number): LazyCallInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../actions/smart-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAS/B,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtD;;;GAGG;AACH,iBAAS,mBAAmB,IAAI,aAAa,CAU5C;AAED;;;GAGG;AACH,iBAAS,oBAAoB,IAAI,aAAa,CAU7C;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,0BAA0B,CACjC,OAAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,GAAG,EAC3B,iBAAiB,EAAE;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,GAAG,CAAA;CACnB,EAAE,EACH,oBAAoB,EAAE,MAAM,GAC3B,aAAa,CAaf;AAED,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getModuleInstallationCalls, getModuleUninstallationCalls, } from '../accounts/index.js';
|
|
2
|
-
import { getEnableSessionCall, getSmartSessionValidator,
|
|
2
|
+
import { getEnableSessionCall, getSmartSessionValidator, } from '../modules/validators/smart-sessions.js';
|
|
3
3
|
/**
|
|
4
4
|
* Enable smart sessions
|
|
5
5
|
* @returns Calls to enable smart sessions
|
|
@@ -21,27 +21,32 @@ function experimental_enable() {
|
|
|
21
21
|
*/
|
|
22
22
|
function experimental_disable() {
|
|
23
23
|
return {
|
|
24
|
-
async resolve({ config }) {
|
|
24
|
+
async resolve({ chain, config }) {
|
|
25
25
|
const module = getSmartSessionValidator(config);
|
|
26
26
|
if (!module) {
|
|
27
27
|
return [];
|
|
28
28
|
}
|
|
29
|
-
return getModuleUninstallationCalls(config, module);
|
|
29
|
+
return getModuleUninstallationCalls(config, chain, module);
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Enable a smart session
|
|
35
|
-
*
|
|
35
|
+
*
|
|
36
|
+
* The `session` must be a resolved `Session` (the return value of
|
|
37
|
+
* `toSession(...)`). Re-resolving it here would drop the explicit
|
|
38
|
+
* `permissions` — a `Session` only carries the derived `actions`, not the
|
|
39
|
+
* original `SessionDefinition.permissions` — which makes the on-chain digest
|
|
40
|
+
* computed by `SmartSessionLens.getAndVerifyDigest` diverge from the one
|
|
41
|
+
* signed in `getSessionDetails`, causing the emissary to reject the enable.
|
|
42
|
+
*
|
|
43
|
+
* @param session resolved session to enable
|
|
36
44
|
* @returns Calls to enable the smart session
|
|
37
45
|
*/
|
|
38
46
|
function experimental_enableSession(session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex) {
|
|
39
47
|
return {
|
|
40
|
-
async resolve({ accountAddress,
|
|
41
|
-
return getEnableSessionCall(accountAddress,
|
|
42
|
-
...session,
|
|
43
|
-
chain,
|
|
44
|
-
}, { useDevContracts: config.useDevContracts }), enableSessionSignature, hashesAndChainIds, sessionToEnableIndex, config.useDevContracts);
|
|
48
|
+
async resolve({ accountAddress, config }) {
|
|
49
|
+
return getEnableSessionCall(accountAddress, session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex, config.useDevContracts);
|
|
45
50
|
},
|
|
46
51
|
};
|
|
47
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAMV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAOR,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAGrB,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AA+CjC,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAIL,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,KAAK,gBAAgB,EAGrB,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAA;AAMrC,OA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BAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,6BAA6B,EAC7B,sBAAsB,EACtB,oBAAoB,GACrB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,CAAA"}
|
|
@@ -30,7 +30,11 @@ async function resolveSignersForChain(config, signers, chainId) {
|
|
|
30
30
|
type: 'experimental_session',
|
|
31
31
|
session: resolved.session,
|
|
32
32
|
enableData,
|
|
33
|
-
|
|
33
|
+
// First use of any session must go through the emissary's verifyExecution
|
|
34
|
+
// path: that's the only mechanism that consumes enableData + calls setConfig
|
|
35
|
+
// to install the session on-chain. Once installed, steady-state signing can
|
|
36
|
+
// drop to mode 1 unless the session has explicit permissions to enforce.
|
|
37
|
+
verifyExecutions: !enabled || resolved.session.hasExplicitPermissions,
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
40
|
// Picks the single signature mode that matches the bytes shape the SDK will
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
2
|
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
3
|
-
declare const SDK_VERSION = "2.0.0-beta.
|
|
3
|
+
declare const SDK_VERSION = "2.0.0-beta.17";
|
|
4
4
|
declare const API_VERSION = "2026-04.blanc";
|
|
5
5
|
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|
|
6
6
|
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
|
|
2
2
|
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
3
|
-
const SDK_VERSION = '2.0.0-beta.
|
|
3
|
+
const SDK_VERSION = '2.0.0-beta.17';
|
|
4
4
|
const API_VERSION = '2026-04.blanc';
|
|
5
5
|
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|