@rhinestone/sdk 2.0.0-beta.26 → 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/index.d.ts +8 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +23 -1
- package/dist/src/modules/read.d.ts +2 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +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;gBA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AAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE3D;AAmBD,OAAO,EACL,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,K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AC3B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,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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E,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAYnE;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
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type TransactionResult, type TransactionStatus, type UserOperationResul
|
|
|
5
5
|
import { type PreparedQuotes, type PreparedTransactionData, type PreparedUserOperationData, type QuoteSelection, type SignedTransactionData, type SignedUserOperationData } from './execution/utils.js';
|
|
6
6
|
import { MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from './modules/index.js';
|
|
7
7
|
import { type SessionDetails } from './modules/validators/smart-sessions.js';
|
|
8
|
-
import type { ApprovalRequired, AuxiliaryFunds, BridgeFill, ChainOperation, DestinationChain, FailureReason, IntentInput, IntentOpStatus, NonEvmAddress, NonEvmChain, OperationStatus, OriginSignature, Portfolio, Quote, SettlementLayer, SettlementLayerFilter, SplitIntentsInput, SplitIntentsResult, TokenRequirements, WrapRequired } from './orchestrator/index.js';
|
|
8
|
+
import type { ApprovalRequired, AuxiliaryFunds, BridgeFill, ChainOperation, DestinationChain, FailureReason, IntentInput, IntentOpStatus, NonEvmAddress, NonEvmChain, OperationStatus, OriginSignature, Portfolio, Quote, SettlementLayer, SettlementLayerFilter, SignData, SplitIntentsInput, SplitIntentsResult, TokenRequirements, WrapRequired } from './orchestrator/index.js';
|
|
9
9
|
import { hyperCoreMainnet, solanaMainnet, tronMainnet } from './orchestrator/index.js';
|
|
10
10
|
import type { AccountProviderConfig, AccountType, BundlerConfig, Call, CallInput, ChainSessionConfig, CrossChainPermit, CrossChainSettlementLayer, MultiFactorValidatorConfig, NonEvmTokenRequest, NonEvmTokenRequests, OwnableValidatorConfig, OwnerSet, ParamConstraint, PaymasterConfig, Permission, PermissionFunctionConfig, Permit2ClaimPolicy, Policy, ProviderConfig, Recovery, RhinestoneAccountConfig, RhinestoneConfig, RhinestoneSDKConfig, Session, SessionDefinition, SignerSet, SourceCallInput, SourceCallProvidedFunds, TokenRequest, TokenSymbol, Transaction, UniversalActionPolicyParamCondition, UserOperationTransaction, WebauthnValidatorConfig } from './types.js';
|
|
11
11
|
interface SubmitTransactionOptions {
|
|
@@ -40,6 +40,7 @@ interface RhinestoneAccount {
|
|
|
40
40
|
signAuthorizations: (preparedTransaction: PreparedTransactionData) => Promise<SignedAuthorizationList>;
|
|
41
41
|
signMessage: (message: SignableMessage, chain: Chain, signers: SignerSet | undefined) => Promise<Hex>;
|
|
42
42
|
signTypedData: <typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(parameters: HashTypedDataParameters<typedData, primaryType>, chain: Chain, signers: SignerSet | undefined) => Promise<Hex>;
|
|
43
|
+
signIntent: (signData: SignData, targetChain: DestinationChain, signers?: SignerSet) => Promise<SignedIntentData>;
|
|
43
44
|
submitTransaction: (signedTransaction: SignedTransactionData, options?: SubmitTransactionOptions) => Promise<TransactionResult>;
|
|
44
45
|
prepareUserOperation: (transaction: UserOperationTransaction) => Promise<PreparedUserOperationData>;
|
|
45
46
|
signUserOperation: (preparedUserOperation: PreparedUserOperationData) => Promise<SignedUserOperationData>;
|
|
@@ -59,6 +60,11 @@ interface RhinestoneAccount {
|
|
|
59
60
|
getValidators: (chain: Chain) => Promise<Address[]>;
|
|
60
61
|
getExecutors: (chain: Chain) => Promise<Address[]>;
|
|
61
62
|
}
|
|
63
|
+
interface SignedIntentData {
|
|
64
|
+
originSignatures: OriginSignature[];
|
|
65
|
+
destinationSignature: Hex;
|
|
66
|
+
targetExecutionSignature: Hex | undefined;
|
|
67
|
+
}
|
|
62
68
|
/**
|
|
63
69
|
* Initialize a Rhinestone account
|
|
64
70
|
* Note: accounts are deployed onchain only when the first transaction is sent.
|
|
@@ -80,5 +86,5 @@ declare class RhinestoneSDK {
|
|
|
80
86
|
splitIntents(input: SplitIntentsInput): Promise<SplitIntentsResult>;
|
|
81
87
|
}
|
|
82
88
|
export { RhinestoneSDK, createRhinestoneAccount, hyperCoreMainnet, solanaMainnet, tronMainnet, OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, createCrossChainPermission, };
|
|
83
|
-
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, NonEvmTokenRequest, NonEvmTokenRequests, NonEvmAddress, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, SourceCallInput, SourceCallProvidedFunds, ChainSessionConfig, Session, SessionDefinition, Recovery, Permission, PermissionFunctionConfig, ParamConstraint, Policy, Permit2ClaimPolicy, CrossChainPermit, CrossChainSettlementLayer, UniversalActionPolicyParamCondition, PreparedQuotes, PreparedTransactionData, Quote, QuoteSelection, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, BridgeFill, DestinationChain, NonEvmChain, IntentInput, IntentOpStatus, SettlementLayer, SettlementLayerFilter, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, OriginSignature, OperationStatus, FailureReason, ChainOperation, };
|
|
89
|
+
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, NonEvmTokenRequest, NonEvmTokenRequests, NonEvmAddress, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, SourceCallInput, SourceCallProvidedFunds, ChainSessionConfig, Session, SessionDefinition, Recovery, Permission, PermissionFunctionConfig, ParamConstraint, Policy, Permit2ClaimPolicy, CrossChainPermit, CrossChainSettlementLayer, UniversalActionPolicyParamCondition, PreparedQuotes, PreparedTransactionData, Quote, QuoteSelection, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, BridgeFill, DestinationChain, NonEvmChain, IntentInput, IntentOpStatus, SettlementLayer, SettlementLayerFilter, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, OriginSignature, SignData, SignedIntentData, OperationStatus, FailureReason, ChainOperation, };
|
|
84
90
|
//# 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,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACT,mBAAmB,EACpB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAapE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAEzB,MAAM,aAAa,CAAA;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,KAAK,E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gB,EAEhB,eAAe,EACf,aAAa,EACb,cAAc,GACf,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { checkAddress, deploy as deployInternal, FactoryArgsNotAvailableError, g
|
|
|
2
2
|
import { createCrossChainPermission } from './actions/smart-sessions.js';
|
|
3
3
|
import { createAuthProvider } from './auth/provider.js';
|
|
4
4
|
import { getIntentStatus as getIntentStatusInternal, getPortfolio as getPortfolioInternal, sendUserOperation as sendUserOperationInternal, splitIntents as splitIntentsInternal, waitForExecution as waitForExecutionInternal, } from './execution/index.js';
|
|
5
|
-
import { getTransactionMessages as getTransactionMessagesInternal, prepareTransaction as prepareTransactionInternal, prepareUserOperation as prepareUserOperationInternal, signAuthorizations as signAuthorizationsInternal, signMessage as signMessageInternal, signTransaction as signTransactionInternal, signTypedData as signTypedDataInternal, signUserOperation as signUserOperationInternal, submitTransaction as submitTransactionInternal, submitUserOperation as submitUserOperationInternal, } from './execution/utils.js';
|
|
5
|
+
import { getTargetExecutionSignature as getTargetExecutionSignatureInternal, getTransactionMessages as getTransactionMessagesInternal, prepareTransaction as prepareTransactionInternal, prepareUserOperation as prepareUserOperationInternal, signAuthorizations as signAuthorizationsInternal, signIntent as signIntentInternal, signMessage as signMessageInternal, signTransaction as signTransactionInternal, signTypedData as signTypedDataInternal, signUserOperation as signUserOperationInternal, submitTransaction as submitTransactionInternal, submitUserOperation as submitUserOperationInternal, } from './execution/utils.js';
|
|
6
6
|
import { getExecutors as getExecutorsInternal, getOwners as getOwnersInternal, getSessionDetails as getSessionDetailsInternal, getValidators as getValidatorsInternal, MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, signEnableSession as signEnableSessionInternal, WEBAUTHN_VALIDATOR_ADDRESS, } from './modules/index.js';
|
|
7
7
|
import { isSessionEnabled as isSessionEnabledInternal, } from './modules/validators/smart-sessions.js';
|
|
8
8
|
import { hyperCoreMainnet, solanaMainnet, tronMainnet } from './orchestrator/index.js';
|
|
@@ -124,6 +124,27 @@ async function createRhinestoneAccount(config) {
|
|
|
124
124
|
function signTypedData(parameters, chain, signers) {
|
|
125
125
|
return signTypedDataInternal(config, parameters, chain, signers);
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Sign an orchestrator intent operation.
|
|
129
|
+
* This is used by headless flows that prepare the intent outside the SDK but
|
|
130
|
+
* still need the SDK-owned SmartSession signature packing and target-execution
|
|
131
|
+
* signature routing. Mirrors the canonical {@link signTransaction} path: origin
|
|
132
|
+
* and destination are always signed in claim mode, and the target-execution
|
|
133
|
+
* signature is derived separately (returned only when the intent requires it).
|
|
134
|
+
* @param signData Sign data returned by the orchestrator (origin/destination/targetExecution typed data)
|
|
135
|
+
* @param targetChain Chain where the destination execution runs
|
|
136
|
+
* @param signers Signers to use for signing
|
|
137
|
+
* @returns Intent signatures ready for submission
|
|
138
|
+
*/
|
|
139
|
+
async function signIntent(signData, targetChain, signers) {
|
|
140
|
+
const { originSignatures, destinationSignature } = await signIntentInternal(config, signData, targetChain, signers, false);
|
|
141
|
+
const targetExecutionSignature = await getTargetExecutionSignatureInternal(config, signData, targetChain, signers);
|
|
142
|
+
return {
|
|
143
|
+
originSignatures,
|
|
144
|
+
destinationSignature,
|
|
145
|
+
targetExecutionSignature,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
127
148
|
/**
|
|
128
149
|
* Submit a transaction
|
|
129
150
|
* @param signedTransaction Signed transaction data
|
|
@@ -236,6 +257,7 @@ async function createRhinestoneAccount(config) {
|
|
|
236
257
|
signAuthorizations,
|
|
237
258
|
signMessage,
|
|
238
259
|
signTypedData,
|
|
260
|
+
signIntent,
|
|
239
261
|
submitTransaction,
|
|
240
262
|
prepareUserOperation,
|
|
241
263
|
signUserOperation,
|
|
@@ -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,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAqER;AAED,iBAAe,YAAY,CACzB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CAkDpB;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,CAAA"}
|
|
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,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAqER;AAED,iBAAe,YAAY,CACzB,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,sBAAsB,CACnC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,OAAO,EACzB,QAAQ,CAAC,EAAE,cAAc,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, };
|