@rhinestone/sdk 2.0.0-beta.27 → 2.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/accounts/error.d.ts +8 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +9 -1
- package/dist/src/accounts/index.d.ts +2 -1
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +34 -4
- package/dist/src/accounts/nexus.d.ts +3 -1
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +33 -1
- package/dist/src/actions/ecdsa.js +3 -3
- package/dist/src/modules/read.d.ts +2 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +26 -1
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/package.json +1 -1
|
@@ -50,6 +50,13 @@ declare class SmartSessionsNotEnabledError extends AccountError {
|
|
|
50
50
|
traceId?: string;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
+
declare class DefaultValidatorAlreadyInitializedError extends AccountError {
|
|
54
|
+
constructor(params?: {
|
|
55
|
+
context?: any;
|
|
56
|
+
errorType?: string;
|
|
57
|
+
traceId?: string;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
53
60
|
declare class SigningNotSupportedForAccountError extends AccountError {
|
|
54
61
|
constructor(params?: {
|
|
55
62
|
context?: any;
|
|
@@ -110,5 +117,5 @@ declare class Eip712DomainNotAvailableError extends AccountError {
|
|
|
110
117
|
constructor(message: string);
|
|
111
118
|
}
|
|
112
119
|
declare function isAccountError(error: Error): error is AccountError;
|
|
113
|
-
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
120
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, DefaultValidatorAlreadyInitializedError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
114
121
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../accounts/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,cAAM,YAAa,SAAQ,KAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,8BAA+B,SAAQ,YAAY;gBAC3C,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,C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,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,wCAAwC,EACxC,8BAA8B,EAC9B,4BAA4B,EAC5B,4BAA4B,EAC5B,uCAAuC,EACvC,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,2BAA2B,EAC3B,kCAAkC,EAClC,wBAAwB,GACzB,CAAA"}
|
|
@@ -63,6 +63,14 @@ class SmartSessionsNotEnabledError extends AccountError {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
class DefaultValidatorAlreadyInitializedError extends AccountError {
|
|
67
|
+
constructor(params) {
|
|
68
|
+
super({
|
|
69
|
+
message: 'ECDSA is already enabled on this account. Use `addOwner` / `removeOwner` / `changeThreshold` to manage owners instead of `enable`.',
|
|
70
|
+
...params,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
66
74
|
class SigningNotSupportedForAccountError extends AccountError {
|
|
67
75
|
constructor(params) {
|
|
68
76
|
super({
|
|
@@ -155,4 +163,4 @@ function getAccountName(account) {
|
|
|
155
163
|
return 'EOA';
|
|
156
164
|
}
|
|
157
165
|
}
|
|
158
|
-
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
166
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, DefaultValidatorAlreadyInitializedError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
@@ -30,6 +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 getValidatorInstallationCalls(config: RhinestoneConfig, chain: Chain, module: Module): Promise<Call[]>;
|
|
33
34
|
declare function getModuleUninstallationCalls(config: RhinestoneConfig, chain: Chain, module: Module): Promise<Call[]>;
|
|
34
35
|
declare function getAddress(config: RhinestoneConfig): `0x${string}`;
|
|
35
36
|
declare function checkAddress(config: RhinestoneConfig): boolean;
|
|
@@ -47,5 +48,5 @@ declare function getSmartAccount(config: RhinestoneConfig, client: PublicClient,
|
|
|
47
48
|
declare function getGuardianSmartAccount(config: RhinestoneConfig, client: PublicClient, chain: Chain, guardians: OwnerSet): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | undefined>;
|
|
48
49
|
declare function is7702(config: RhinestoneConfig): boolean;
|
|
49
50
|
declare function getAccountProvider(config: RhinestoneConfig): AccountProviderConfig;
|
|
50
|
-
export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
51
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
51
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,MAAM,CAAA;AASb,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,MAAM,CAAA;AASb,OAAO,EAA4B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C,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { concat, createPublicClient, encodeAbiParameters, encodeFunctionData, ha
|
|
|
2
2
|
import { sendTransactionInternal, sendUserOperationInternal, waitForExecution, } from '../execution/index.js';
|
|
3
3
|
import { getIntentExecutor, getSetup } from '../modules/index.js';
|
|
4
4
|
import { MODULE_TYPE_ID_VALIDATOR } from '../modules/common.js';
|
|
5
|
-
import { getValidators as getValidatorsInternal } from '../modules/read.js';
|
|
5
|
+
import { getValidators as getValidatorsInternal, isValidatorInitialized, } from '../modules/read.js';
|
|
6
6
|
import { getOwnerValidator } from '../modules/validators/index.js';
|
|
7
7
|
import { getSocialRecoveryValidator } from '../modules/validators/core.js';
|
|
8
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, } from './error.js';
|
|
8
|
+
import { AccountConfigurationNotSupportedError, AccountError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, } from './error.js';
|
|
9
9
|
import { getAddress as getHcaAddress, getDeployArgs as getHcaDeployArgs, getEip712Domain as getHcaEip712Domain, getGuardianSmartAccount as getHcaGuardianSmartAccount, getSmartAccount as getHcaSmartAccount, packSignature as packHcaSignature, } from './hca.js';
|
|
10
10
|
import { getAddress as getKernelAddress, getDeployArgs as getKernelDeployArgs, getEip712Domain as getKernelEip712Domain, getGuardianSmartAccount as getKernelGuardianSmartAccount, getInstallData as getKernelInstallData, getSmartAccount as getKernelSmartAccount, packSignature as packKernelSignature, wrapMessageHash as wrapKernelMessageHash, } from './kernel.js';
|
|
11
|
-
import { getAddress as getNexusAddress, getDefaultValidatorAddress as getNexusDefaultValidatorAddress, getDeployArgs as getNexusDeployArgs, getEip712Domain as getNexusEip712Domain, getEip7702InitCall as getNexusEip7702InitCall, getGuardianSmartAccount as getNexusGuardianSmartAccount, getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, packSignature as packNexusSignature, signEip7702InitData as signNexusEip7702InitData, } from './nexus.js';
|
|
11
|
+
import { getAddress as getNexusAddress, getDefaultValidatorAddress as getNexusDefaultValidatorAddress, getDefaultValidatorInitData as getNexusDefaultValidatorInitData, getDeployArgs as getNexusDeployArgs, getEip712Domain as getNexusEip712Domain, getEip7702InitCall as getNexusEip7702InitCall, getGuardianSmartAccount as getNexusGuardianSmartAccount, getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, isDefaultValidatorConfigured as isNexusDefaultValidatorConfigured, packSignature as packNexusSignature, signEip7702InitData as signNexusEip7702InitData, } from './nexus.js';
|
|
12
12
|
import { getAddress as getSafeAddress, getDeployArgs as getSafeDeployArgs, getEip712Domain as getSafeEip712Domain, getGuardianSmartAccount as getSafeGuardianSmartAccount, getInstallData as getSafeInstallData, getSmartAccount as getSafeSmartAccount, getV0DeployArgs as getSafeV0DeployArgs, packSignature as packSafeSignature, } from './safe.js';
|
|
13
13
|
import { convertOwnerSetToSignerSet } from './signing/common.js';
|
|
14
14
|
import { sign as signMessage } from './signing/message.js';
|
|
@@ -192,6 +192,36 @@ function getModuleInstallationCalls(config, module) {
|
|
|
192
192
|
data,
|
|
193
193
|
}));
|
|
194
194
|
}
|
|
195
|
+
// Like `getModuleInstallationCalls`, but aware of the Nexus default validator.
|
|
196
|
+
// On Nexus the OwnableValidator is the hardwired default validator: it can't be
|
|
197
|
+
// added via `installModule` (reverts `DefaultValidatorAlreadyInstalled`), and
|
|
198
|
+
// passkey-bootstrapped accounts never initialize it, so `addOwner` reverts with
|
|
199
|
+
// `NotInitialized`. For that case we initialize it directly via `onInstall`.
|
|
200
|
+
async function getValidatorInstallationCalls(config, chain, module) {
|
|
201
|
+
const account = getAccountProvider(config);
|
|
202
|
+
if (account.type === 'nexus') {
|
|
203
|
+
const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
|
|
204
|
+
if (module.address.toLowerCase() === defaultValidatorAddress.toLowerCase()) {
|
|
205
|
+
// Treat the validator as initialized if the account's deployment will
|
|
206
|
+
// initialize it (config check, covers not-yet-deployed accounts) or if
|
|
207
|
+
// it is already initialized on-chain (covers accounts where ECDSA was
|
|
208
|
+
// enabled separately after deployment).
|
|
209
|
+
const initialized = isNexusDefaultValidatorConfigured(config) ||
|
|
210
|
+
(await isValidatorInitialized(getAddress(config), chain, defaultValidatorAddress, config.provider));
|
|
211
|
+
if (initialized) {
|
|
212
|
+
throw new DefaultValidatorAlreadyInitializedError();
|
|
213
|
+
}
|
|
214
|
+
return [
|
|
215
|
+
{
|
|
216
|
+
to: defaultValidatorAddress,
|
|
217
|
+
value: 0n,
|
|
218
|
+
data: getNexusDefaultValidatorInitData(module),
|
|
219
|
+
},
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return getModuleInstallationCalls(config, module);
|
|
224
|
+
}
|
|
195
225
|
// SentinelList head pointer used by ERC-7579 module managers (Nexus, Safe7579,
|
|
196
226
|
// Startale). Validator/executor uninstall on these accounts decodes the
|
|
197
227
|
// `deInitData` slot as `(address prev, bytes moduleDeInit)`, where `prev`
|
|
@@ -658,6 +688,6 @@ function getAccountProvider(config) {
|
|
|
658
688
|
type: 'nexus',
|
|
659
689
|
};
|
|
660
690
|
}
|
|
661
|
-
export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature,
|
|
691
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature,
|
|
662
692
|
// Errors
|
|
663
693
|
isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
@@ -20,6 +20,8 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
20
20
|
salt: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
21
21
|
};
|
|
22
22
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
23
|
+
declare function getDefaultValidatorInitData(module: Module): Hex;
|
|
24
|
+
declare function isDefaultValidatorConfigured(config: RhinestoneAccountConfig): boolean;
|
|
23
25
|
declare function getDefaultValidatorAddress(version: '1.0.2' | '1.2.0' | 'rhinestone-1.0.0-beta' | 'rhinestone-1.0.0' | undefined): Address;
|
|
24
26
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex, defaultValidatorAddress?: Address): Promise<`0x${string}`>;
|
|
25
27
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>, defaultValidatorAddress?: Address): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
@@ -29,5 +31,5 @@ declare function getEip7702InitCall(config: RhinestoneAccountConfig, signature:
|
|
|
29
31
|
initData: `0x${string}`;
|
|
30
32
|
contract: `0x${string}`;
|
|
31
33
|
};
|
|
32
|
-
export { getEip712Domain, getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
34
|
+
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
33
35
|
//# sourceMappingURL=nexus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAe3E,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EAAgB,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAM/E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAqBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;;SAqHrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAsClD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KA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nE;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAcnE;AAqFD,iBAAe,mBAAmB,CAChC,MAAM,EAAE,uBAAuB,EAC/B,GAAG,EAAE,OAAO,0BA8Bb;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,uBAAuB,EAAE,SAAS,EAAE,GAAG;;;EA0C1E;AA6FD,OAAO,EACL,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,4BAA4B,EAC5B,UAAU,EACV,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
|
|
@@ -188,6 +188,38 @@ function getInstallData(module) {
|
|
|
188
188
|
args: [module.type, module.address, module.initData],
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
+
// On Nexus the OwnableValidator is the hardwired default validator. It cannot
|
|
192
|
+
// be added via `installModule` (reverts `DefaultValidatorAlreadyInstalled`), so
|
|
193
|
+
// it is initialized out-of-band by calling its `onInstall` directly with the
|
|
194
|
+
// same init data `installModule` would have passed (`abi.encode(threshold, owners)`).
|
|
195
|
+
function getDefaultValidatorInitData(module) {
|
|
196
|
+
return encodeFunctionData({
|
|
197
|
+
abi: [
|
|
198
|
+
{
|
|
199
|
+
type: 'function',
|
|
200
|
+
name: 'onInstall',
|
|
201
|
+
inputs: [{ type: 'bytes', name: 'data' }],
|
|
202
|
+
outputs: [],
|
|
203
|
+
stateMutability: 'nonpayable',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
functionName: 'onInstall',
|
|
207
|
+
args: [module.initData],
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
// Whether the deploy bootstrap will initialize the default validator — i.e. the
|
|
211
|
+
// account is configured with an Ownable/ECDSA owner set. Mirrors the
|
|
212
|
+
// `defaultValidatorInitData` computation in `getDeployArgs`, so a counterfactual
|
|
213
|
+
// (not-yet-deployed) account whose deployment initializes the default validator
|
|
214
|
+
// is treated as already-initialized rather than emitting a second `onInstall`.
|
|
215
|
+
function isDefaultValidatorConfigured(config) {
|
|
216
|
+
if (config.initData) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
const moduleSetup = getModuleSetup(config);
|
|
220
|
+
const defaultValidator = moduleSetup.validators.find((v) => v.address === NEXUS_DEFAULT_VALIDATOR_ADDRESS);
|
|
221
|
+
return defaultValidator ? size(defaultValidator.initData) > 0 : false;
|
|
222
|
+
}
|
|
191
223
|
function getDefaultValidatorAddress(version) {
|
|
192
224
|
if (!version) {
|
|
193
225
|
return NEXUS_DEFAULT_VALIDATOR_ADDRESS;
|
|
@@ -441,4 +473,4 @@ function tryDecodeV0FactoryData(factory, factoryData) {
|
|
|
441
473
|
function isAbiDecodingError(error) {
|
|
442
474
|
return (error instanceof Error && error.name === 'AbiFunctionSignatureNotFoundError');
|
|
443
475
|
}
|
|
444
|
-
export { getEip712Domain, getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
476
|
+
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { encodeFunctionData } from 'viem';
|
|
2
|
-
import {
|
|
2
|
+
import { getModuleUninstallationCalls, getValidatorInstallationCalls, } from '../accounts/index.js';
|
|
3
3
|
import { getOwnableValidator, OWNABLE_VALIDATOR_ADDRESS, } from '../modules/validators/core.js';
|
|
4
4
|
/**
|
|
5
5
|
* Enable ECDSA authentication
|
|
@@ -10,8 +10,8 @@ import { getOwnableValidator, OWNABLE_VALIDATOR_ADDRESS, } from '../modules/vali
|
|
|
10
10
|
function enable(owners, threshold = 1) {
|
|
11
11
|
const module = getOwnableValidator(threshold, owners);
|
|
12
12
|
return {
|
|
13
|
-
async resolve({ config }) {
|
|
14
|
-
return
|
|
13
|
+
async resolve({ chain, config }) {
|
|
14
|
+
return getValidatorInstallationCalls(config, chain, module);
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -6,5 +6,6 @@ declare function getOwners(accountType: AccountType, account: Address, chain: Ch
|
|
|
6
6
|
threshold: number;
|
|
7
7
|
} | null>;
|
|
8
8
|
declare function getExecutors(accountType: AccountType, account: Address, chain: Chain, provider?: ProviderConfig): Promise<Address[]>;
|
|
9
|
-
|
|
9
|
+
declare function isValidatorInitialized(account: Address, chain: Chain, validatorAddress: Address, provider?: ProviderConfig): Promise<boolean>;
|
|
10
|
+
export { getValidators, getExecutors, getOwners, isValidatorInitialized };
|
|
10
11
|
//# 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,EAAsB,MAAM,MAAM,CAAA;AAEnE,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,CAkDpB;AAED,iBAAe,SAAS,CACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,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,GACxB,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAA"}
|
package/dist/src/modules/read.js
CHANGED
|
@@ -172,4 +172,29 @@ async function getExecutors(accountType, account, chain, provider) {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
async function isValidatorInitialized(account, chain, validatorAddress, provider) {
|
|
176
|
+
const publicClient = createPublicClient({
|
|
177
|
+
chain,
|
|
178
|
+
transport: createTransport(chain, provider),
|
|
179
|
+
});
|
|
180
|
+
// `isInitialized` is a plain storage read on the validator singleton and
|
|
181
|
+
// returns `false` for an uninitialized (or undeployed) account without
|
|
182
|
+
// reverting. We deliberately let real read failures (provider/ABI errors)
|
|
183
|
+
// propagate rather than coercing them to `false`, which could otherwise
|
|
184
|
+
// produce an `onInstall` call for an already-initialized account.
|
|
185
|
+
return publicClient.readContract({
|
|
186
|
+
abi: [
|
|
187
|
+
{
|
|
188
|
+
name: 'isInitialized',
|
|
189
|
+
type: 'function',
|
|
190
|
+
stateMutability: 'view',
|
|
191
|
+
inputs: [{ name: 'smartAccount', type: 'address' }],
|
|
192
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
functionName: 'isInitialized',
|
|
196
|
+
address: validatorAddress,
|
|
197
|
+
args: [account],
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
export { getValidators, getExecutors, getOwners, isValidatorInitialized };
|
|
@@ -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.28";
|
|
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.28';
|
|
4
4
|
const API_VERSION = '2026-04.blanc';
|
|
5
5
|
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|