@rhinestone/sdk 2.0.0-beta.29 → 2.0.0-beta.30
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 +1 -15
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +1 -17
- package/dist/src/accounts/hca.d.ts +1 -2
- package/dist/src/accounts/hca.d.ts.map +1 -1
- package/dist/src/accounts/hca.js +9 -13
- package/dist/src/accounts/index.d.ts +3 -4
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +8 -41
- package/dist/src/accounts/kernel.d.ts +1 -2
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +1 -8
- package/dist/src/accounts/nexus.d.ts +1 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +1 -8
- package/dist/src/accounts/safe.d.ts +1 -2
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +3 -9
- package/dist/src/accounts/signing/common.d.ts +1 -4
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +3 -7
- package/dist/src/accounts/signing/message.d.ts.map +1 -1
- package/dist/src/accounts/signing/message.js +1 -4
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +1 -4
- package/dist/src/accounts/startale.d.ts +1 -2
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +2 -5
- package/dist/src/actions/smart-sessions.d.ts +15 -81
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +18 -90
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +4 -4
- package/dist/src/execution/error.d.ts +1 -15
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +1 -17
- package/dist/src/execution/index.d.ts +4 -3
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +5 -11
- package/dist/src/execution/utils.d.ts +2 -2
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +10 -22
- package/dist/src/index.d.ts +5 -13
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -10
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +0 -5
- package/dist/src/modules/validators/core.d.ts +3 -4
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +20 -31
- package/dist/src/modules/validators/cross-chain-permits.d.ts +11 -0
- package/dist/src/modules/validators/cross-chain-permits.d.ts.map +1 -0
- package/dist/src/modules/validators/cross-chain-permits.js +76 -0
- package/dist/src/modules/validators/permissions.d.ts.map +1 -1
- package/dist/src/modules/validators/permissions.js +2 -3
- package/dist/src/modules/validators/smart-sessions.d.ts +5 -1
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +66 -2
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +12 -0
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.js +1 -1
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/types.d.ts +13 -1
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/smart-sessions/index.d.ts +5 -0
- package/dist/src/smart-sessions/index.d.ts.map +1 -0
- package/dist/src/smart-sessions/index.js +6 -0
- package/dist/src/types.d.ts +81 -26
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +3 -7
- package/dist/src/actions/recovery.d.ts +0 -33
- package/dist/src/actions/recovery.d.ts.map +0 -1
- package/dist/src/actions/recovery.js +0 -189
|
@@ -22,13 +22,6 @@ declare class Eip7702AccountMustHaveEoaError extends AccountError {
|
|
|
22
22
|
traceId?: string;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
declare class ExistingEip7702AccountsNotSupportedError extends AccountError {
|
|
26
|
-
constructor(params?: {
|
|
27
|
-
context?: any;
|
|
28
|
-
errorType?: string;
|
|
29
|
-
traceId?: string;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
25
|
declare class EoaAccountMustHaveAccountError extends AccountError {
|
|
33
26
|
constructor(params?: {
|
|
34
27
|
context?: any;
|
|
@@ -43,13 +36,6 @@ declare class FactoryArgsNotAvailableError extends AccountError {
|
|
|
43
36
|
traceId?: string;
|
|
44
37
|
});
|
|
45
38
|
}
|
|
46
|
-
declare class SmartSessionsNotEnabledError extends AccountError {
|
|
47
|
-
constructor(params?: {
|
|
48
|
-
context?: any;
|
|
49
|
-
errorType?: string;
|
|
50
|
-
traceId?: string;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
39
|
declare class DefaultValidatorAlreadyInitializedError extends AccountError {
|
|
54
40
|
constructor(params?: {
|
|
55
41
|
context?: any;
|
|
@@ -117,5 +103,5 @@ declare class Eip712DomainNotAvailableError extends AccountError {
|
|
|
117
103
|
constructor(message: string);
|
|
118
104
|
}
|
|
119
105
|
declare function isAccountError(error: Error): error is AccountError;
|
|
120
|
-
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError,
|
|
106
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, DefaultValidatorAlreadyInitializedError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
121
107
|
//# 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,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,
|
|
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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6BAA8B,SAAQ,YAAY;gBAC1C,OAAO,EAAE,MAAM;CAK5B;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE3D;AAmBD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,uCAAuC,EACvC,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,2BAA2B,EAC3B,kCAAkC,EAClC,wBAAwB,GACzB,CAAA"}
|
|
@@ -31,14 +31,6 @@ class Eip7702AccountMustHaveEoaError extends AccountError {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
class ExistingEip7702AccountsNotSupportedError extends AccountError {
|
|
35
|
-
constructor(params) {
|
|
36
|
-
super({
|
|
37
|
-
message: 'Existing EIP-7702 accounts are not yet supported',
|
|
38
|
-
...params,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
34
|
class EoaAccountMustHaveAccountError extends AccountError {
|
|
43
35
|
constructor(params) {
|
|
44
36
|
super({
|
|
@@ -55,14 +47,6 @@ class FactoryArgsNotAvailableError extends AccountError {
|
|
|
55
47
|
});
|
|
56
48
|
}
|
|
57
49
|
}
|
|
58
|
-
class SmartSessionsNotEnabledError extends AccountError {
|
|
59
|
-
constructor(params) {
|
|
60
|
-
super({
|
|
61
|
-
message: 'Smart sessions are not enabled for this account',
|
|
62
|
-
...params,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
50
|
class DefaultValidatorAlreadyInitializedError extends AccountError {
|
|
67
51
|
constructor(params) {
|
|
68
52
|
super({
|
|
@@ -163,4 +147,4 @@ function getAccountName(account) {
|
|
|
163
147
|
return 'EOA';
|
|
164
148
|
}
|
|
165
149
|
}
|
|
166
|
-
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError,
|
|
150
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, DefaultValidatorAlreadyInitializedError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
@@ -21,6 +21,5 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
21
21
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
22
22
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
23
23
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
24
|
-
|
|
25
|
-
export { ENS_HCA_MODULE, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
24
|
+
export { ENS_HCA_MODULE, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|
|
26
25
|
//# sourceMappingURL=hca.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hca.d.ts","sourceRoot":"","sources":["../../../accounts/hca.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAa7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAqB,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"hca.d.ts","sourceRoot":"","sources":["../../../accounts/hca.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAa7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAqB,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAUjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAc9C,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAiFrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAalD;AAmDD,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBAErC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAQvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,oKAUlC;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,GAChB,CAAA"}
|
package/dist/src/accounts/hca.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { concat, decodeAbiParameters, decodeFunctionData, encodeFunctionData, encodePacked, keccak256, pad, parseAbi, slice, zeroHash, } from 'viem';
|
|
2
2
|
import { ENS_HCA_MODULE, getOwnerValidator } from '../modules/validators/core.js';
|
|
3
3
|
import { AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, } from './error.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, packSignature as packNexusSignature, } from './nexus.js';
|
|
5
5
|
const HCA_IMPLEMENTATION_ADDRESS = '0x7c2cC1e499a87ab480Df154e05164cD56D05d570';
|
|
6
6
|
const HCA_FACTORY_ADDRESS = '0x358680728dedb552adaa9f5eb5d4395b291cf943';
|
|
7
7
|
// HCA inherits Nexus's EIP-712 domain (verified on-chain via eip712Domain()).
|
|
@@ -10,16 +10,15 @@ const HCA_VERSION = '1.2.0';
|
|
|
10
10
|
const CREATE3_PROXY_HASH = '0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f';
|
|
11
11
|
function getDeployArgs(config) {
|
|
12
12
|
// HCA accounts are locked to their initial configuration and block module
|
|
13
|
-
// installation, so
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
if (config.
|
|
17
|
-
config.experimental_sessions?.enabled ||
|
|
13
|
+
// installation, so sessions and extra modules can never be installed.
|
|
14
|
+
// Reject them on every path (including externally-provided initData)
|
|
15
|
+
// rather than silently dropping them.
|
|
16
|
+
if (config.experimental_sessions?.enabled ||
|
|
18
17
|
(config.modules && config.modules.length > 0)) {
|
|
19
|
-
throw new AccountConfigurationNotSupportedError('HCA accounts cannot install
|
|
18
|
+
throw new AccountConfigurationNotSupportedError('HCA accounts cannot install sessions or additional modules', 'hca');
|
|
20
19
|
}
|
|
21
20
|
if (config.owners && config.owners.type !== 'ens') {
|
|
22
|
-
throw new AccountConfigurationNotSupportedError('HCA accounts require ENS owners
|
|
21
|
+
throw new AccountConfigurationNotSupportedError('HCA accounts require ENS owners', 'hca');
|
|
23
22
|
}
|
|
24
23
|
if (config.initData) {
|
|
25
24
|
if (!('factory' in config.initData)) {
|
|
@@ -50,7 +49,7 @@ function getDeployArgs(config) {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
if (!config.owners) {
|
|
53
|
-
throw new AccountConfigurationNotSupportedError('HCA accounts require ENS owners
|
|
52
|
+
throw new AccountConfigurationNotSupportedError('HCA accounts require ENS owners', 'hca');
|
|
54
53
|
}
|
|
55
54
|
const ownerValidator = getOwnerValidator(config);
|
|
56
55
|
const moduleInitData = ownerValidator.initData;
|
|
@@ -143,7 +142,4 @@ async function packSignature(signature, validator, transformSignature = (signatu
|
|
|
143
142
|
async function getSmartAccount(client, address, owners, validatorAddress, sign) {
|
|
144
143
|
return getNexusSmartAccount(client, address, owners, validatorAddress, sign, ENS_HCA_MODULE);
|
|
145
144
|
}
|
|
146
|
-
|
|
147
|
-
return getNexusGuardianSmartAccount(client, address, guardians, validatorAddress, sign, ENS_HCA_MODULE);
|
|
148
|
-
}
|
|
149
|
-
export { ENS_HCA_MODULE, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
145
|
+
export { ENS_HCA_MODULE, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Address, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
2
2
|
import { type Module } from '../modules/common.js';
|
|
3
3
|
import type { ResolvedSessionSignerSet } from '../modules/validators/smart-sessions.js';
|
|
4
|
-
import type { AccountProviderConfig, Call,
|
|
5
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError,
|
|
4
|
+
import type { AccountProviderConfig, Call, RhinestoneConfig, SignerSet } from '../types.js';
|
|
5
|
+
import { AccountConfigurationNotSupportedError, AccountError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, 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): {
|
|
@@ -45,8 +45,7 @@ declare function deploy(config: RhinestoneConfig, chain: Chain, params?: {
|
|
|
45
45
|
declare function setup(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
46
46
|
declare function toErc6492Signature(config: RhinestoneConfig, signature: Hex, chain: Chain): Promise<Hex>;
|
|
47
47
|
declare function getSmartAccount(config: RhinestoneConfig, client: PublicClient, chain: Chain): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | undefined>;
|
|
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>;
|
|
49
48
|
declare function is7702(config: RhinestoneConfig): boolean;
|
|
50
49
|
declare function getAccountProvider(config: RhinestoneConfig): AccountProviderConfig;
|
|
51
|
-
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount,
|
|
50
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature, isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, };
|
|
52
51
|
//# 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,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAMzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AACpF,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACV,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,uCAAuC,EACvC,6B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AAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,GAAG,EACd,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,GAAG,CAAC,CA4Bd;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,gLAmEb;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAGjD;AAED,iBAAS,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,qBAAqB,CAO3E;AAED,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,6BAA6B,EAC7B,4BAA4B,EAC5B,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAE3B,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,uCAAuC,EACvC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,mCAAmC,GACpC,CAAA"}
|
|
@@ -4,16 +4,15 @@ import { getIntentExecutor, getSetup } from '../modules/index.js';
|
|
|
4
4
|
import { MODULE_TYPE_ID_VALIDATOR } from '../modules/common.js';
|
|
5
5
|
import { getValidators as getValidatorsInternal, isValidatorInitialized, } from '../modules/read.js';
|
|
6
6
|
import { getOwnerValidator } from '../modules/validators/index.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { getAddress as
|
|
10
|
-
import { getAddress as
|
|
11
|
-
import { getAddress as
|
|
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';
|
|
7
|
+
import { AccountConfigurationNotSupportedError, AccountError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, } from './error.js';
|
|
8
|
+
import { getAddress as getHcaAddress, getDeployArgs as getHcaDeployArgs, getEip712Domain as getHcaEip712Domain, getSmartAccount as getHcaSmartAccount, packSignature as packHcaSignature, } from './hca.js';
|
|
9
|
+
import { getAddress as getKernelAddress, getDeployArgs as getKernelDeployArgs, getEip712Domain as getKernelEip712Domain, getInstallData as getKernelInstallData, getSmartAccount as getKernelSmartAccount, packSignature as packKernelSignature, wrapMessageHash as wrapKernelMessageHash, } from './kernel.js';
|
|
10
|
+
import { getAddress as getNexusAddress, getDefaultValidatorAddress as getNexusDefaultValidatorAddress, getDefaultValidatorInitData as getNexusDefaultValidatorInitData, getDeployArgs as getNexusDeployArgs, getEip712Domain as getNexusEip712Domain, getEip7702InitCall as getNexusEip7702InitCall, getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, isDefaultValidatorConfigured as isNexusDefaultValidatorConfigured, packSignature as packNexusSignature, signEip7702InitData as signNexusEip7702InitData, } from './nexus.js';
|
|
11
|
+
import { getAddress as getSafeAddress, getDeployArgs as getSafeDeployArgs, getEip712Domain as getSafeEip712Domain, getInstallData as getSafeInstallData, getSmartAccount as getSafeSmartAccount, getV0DeployArgs as getSafeV0DeployArgs, packSignature as packSafeSignature, } from './safe.js';
|
|
13
12
|
import { convertOwnerSetToSignerSet } from './signing/common.js';
|
|
14
13
|
import { sign as signMessage } from './signing/message.js';
|
|
15
14
|
import { sign as signTypedData } from './signing/typedData.js';
|
|
16
|
-
import { getAddress as getStartaleAddress, getDeployArgs as getStartaleDeployArgs, getEip712Domain as getStartaleEip712Domain,
|
|
15
|
+
import { getAddress as getStartaleAddress, getDeployArgs as getStartaleDeployArgs, getEip712Domain as getStartaleEip712Domain, getInstallData as getStartaleInstallData, getSmartAccount as getStartaleSmartAccount, packSignature as packStartaleSignature, } from './startale.js';
|
|
17
16
|
import { createTransport, getBundlerClient, } from './utils.js';
|
|
18
17
|
function getDeployArgs(config) {
|
|
19
18
|
const account = getAccountProvider(config);
|
|
@@ -644,38 +643,6 @@ async function getSmartAccount(config, client, chain) {
|
|
|
644
643
|
}
|
|
645
644
|
}
|
|
646
645
|
}
|
|
647
|
-
async function getGuardianSmartAccount(config, client, chain, guardians) {
|
|
648
|
-
const address = getAddress(config);
|
|
649
|
-
const accounts = guardians.type === 'ecdsa' ? guardians.accounts : [];
|
|
650
|
-
const socialRecoveryValidator = getSocialRecoveryValidator(accounts);
|
|
651
|
-
if (!socialRecoveryValidator) {
|
|
652
|
-
throw new Error('Social recovery is not available');
|
|
653
|
-
}
|
|
654
|
-
const signers = {
|
|
655
|
-
type: 'guardians',
|
|
656
|
-
guardians: accounts,
|
|
657
|
-
};
|
|
658
|
-
const signFn = (hash) => signMessage(signers, chain, address, hash, true);
|
|
659
|
-
const account = getAccountProvider(config);
|
|
660
|
-
switch (account.type) {
|
|
661
|
-
case 'safe': {
|
|
662
|
-
return getSafeGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
|
|
663
|
-
}
|
|
664
|
-
case 'nexus': {
|
|
665
|
-
const defaultValidatorAddress = getNexusDefaultValidatorAddress(account.version);
|
|
666
|
-
return getNexusGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn, defaultValidatorAddress);
|
|
667
|
-
}
|
|
668
|
-
case 'kernel': {
|
|
669
|
-
return getKernelGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
|
|
670
|
-
}
|
|
671
|
-
case 'startale': {
|
|
672
|
-
return getStartaleGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
|
|
673
|
-
}
|
|
674
|
-
case 'hca': {
|
|
675
|
-
return getHcaGuardianSmartAccount(client, address, guardians, socialRecoveryValidator.address, signFn);
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
646
|
function is7702(config) {
|
|
680
647
|
const account = getAccountProvider(config);
|
|
681
648
|
return account.type !== 'eoa' && config.eoa !== undefined;
|
|
@@ -688,6 +655,6 @@ function getAccountProvider(config) {
|
|
|
688
655
|
type: 'nexus',
|
|
689
656
|
};
|
|
690
657
|
}
|
|
691
|
-
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount,
|
|
658
|
+
export { getEip712Domain, getModuleInstallationCalls, getValidatorInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getEip1271Signature, getEmissarySignature, getTypedDataPackedSignature,
|
|
692
659
|
// Errors
|
|
693
|
-
isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError,
|
|
660
|
+
isAccountError, AccountError, AccountConfigurationNotSupportedError, DefaultValidatorAlreadyInitializedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, WalletClientNoConnectedAccountError, };
|
|
@@ -22,6 +22,5 @@ declare function getInstallData(module: Module): Hex[];
|
|
|
22
22
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
23
23
|
declare function wrapMessageHash(messageHash: Hex, accountAddress: Hex): Hex;
|
|
24
24
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
25
|
-
|
|
26
|
-
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount, getGuardianSmartAccount, packSignature, wrapMessageHash, };
|
|
25
|
+
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount, packSignature, wrapMessageHash, };
|
|
27
26
|
//# sourceMappingURL=kernel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../accounts/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,KAAK,EASV,KAAK,GAAG,EAER,KAAK,YAAY,EAMlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAiB,QAAQ,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAKhF,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAgBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAmFrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAalD;AAED,iBAAS,eAAe,C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CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,EAAE,CAsE7C;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAYvE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,GAAG,GAAG,CAoBnE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAYlC;AA+ED,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -194,13 +194,6 @@ async function getSmartAccount(client, address, owners, validatorAddress, sign)
|
|
|
194
194
|
return getMockSignature(owners);
|
|
195
195
|
}, sign);
|
|
196
196
|
}
|
|
197
|
-
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign) {
|
|
198
|
-
return await getBaseSmartAccount(address, client, validatorAddress, 'validator', async () => {
|
|
199
|
-
return getMockSignature(guardians);
|
|
200
|
-
}, async (hash) => {
|
|
201
|
-
return await sign(hash);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
197
|
async function getBaseSmartAccount(address, client, validatorAddress, validatorType, getStubSignature, signUserOperation) {
|
|
205
198
|
return await toSmartAccount({
|
|
206
199
|
client,
|
|
@@ -269,4 +262,4 @@ async function getBaseSmartAccount(address, client, validatorAddress, validatorT
|
|
|
269
262
|
},
|
|
270
263
|
});
|
|
271
264
|
}
|
|
272
|
-
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount,
|
|
265
|
+
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount, packSignature, wrapMessageHash, };
|
|
@@ -25,11 +25,10 @@ declare function isDefaultValidatorConfigured(config: RhinestoneAccountConfig):
|
|
|
25
25
|
declare function getDefaultValidatorAddress(version: '1.0.2' | '1.2.0' | 'rhinestone-1.0.0-beta' | 'rhinestone-1.0.0' | undefined): Address;
|
|
26
26
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex, defaultValidatorAddress?: Address): Promise<`0x${string}`>;
|
|
27
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">>>;
|
|
28
|
-
declare function getGuardianSmartAccount(client: PublicClient, address: Address, guardians: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>, defaultValidatorAddress?: Address): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
29
28
|
declare function signEip7702InitData(config: RhinestoneAccountConfig, eoa: Account): Promise<`0x${string}`>;
|
|
30
29
|
declare function getEip7702InitCall(config: RhinestoneAccountConfig, signature: Hex): {
|
|
31
30
|
initData: `0x${string}`;
|
|
32
31
|
contract: `0x${string}`;
|
|
33
32
|
};
|
|
34
|
-
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount,
|
|
33
|
+
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
35
34
|
//# 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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AC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,EACjC,uBAAuB,GAAE,OAAyC,iEAYnE;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,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
|
|
@@ -247,13 +247,6 @@ async function getSmartAccount(client, address, owners, validatorAddress, sign,
|
|
|
247
247
|
return getMockSignature(owners);
|
|
248
248
|
}, sign, defaultValidatorAddress);
|
|
249
249
|
}
|
|
250
|
-
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign, defaultValidatorAddress = NEXUS_DEFAULT_VALIDATOR_ADDRESS) {
|
|
251
|
-
return await getBaseSmartAccount(address, client, validatorAddress, async () => {
|
|
252
|
-
return getMockSignature(guardians);
|
|
253
|
-
}, async (hash) => {
|
|
254
|
-
return await sign(hash);
|
|
255
|
-
}, defaultValidatorAddress);
|
|
256
|
-
}
|
|
257
250
|
async function getBaseSmartAccount(address, client, nonceValidatorAddress, getStubSignature, signUserOperation, defaultValidatorAddress) {
|
|
258
251
|
return await toSmartAccount({
|
|
259
252
|
client,
|
|
@@ -473,4 +466,4 @@ function tryDecodeV0FactoryData(factory, factoryData) {
|
|
|
473
466
|
function isAbiDecodingError(error) {
|
|
474
467
|
return (error instanceof Error && error.name === 'AbiFunctionSignatureNotFoundError');
|
|
475
468
|
}
|
|
476
|
-
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount,
|
|
469
|
+
export { getEip712Domain, getInstallData, getDefaultValidatorInitData, isDefaultValidatorConfigured, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
@@ -28,6 +28,5 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
28
28
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
29
29
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
30
30
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
31
|
-
|
|
32
|
-
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getV0DeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
31
|
+
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getV0DeployArgs, getSmartAccount, };
|
|
33
32
|
//# sourceMappingURL=safe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,KAAK,EAOV,KAAK,GAAG,EAER,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAM/C,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAe,MAAM,UAAU,CAAA;AAM9E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAoBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAmGrD;AAED,iBAAS,eAAe,CAAC,MAAM,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uB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBA2BrC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAMvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAWlC;AA2GD,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,GAChB,CAAA"}
|
|
@@ -239,13 +239,6 @@ async function getSmartAccount(client, address, owners, validatorAddress, sign)
|
|
|
239
239
|
return getMockSignature(owners);
|
|
240
240
|
}, sign);
|
|
241
241
|
}
|
|
242
|
-
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign) {
|
|
243
|
-
return await getBaseSmartAccount(address, client, validatorAddress, async () => {
|
|
244
|
-
return getMockSignature(guardians);
|
|
245
|
-
}, async (hash) => {
|
|
246
|
-
return await sign(hash);
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
242
|
async function getBaseSmartAccount(address, client, validatorAddress, getStubSignature, signUserOperation) {
|
|
250
243
|
return await toSmartAccount({
|
|
251
244
|
client,
|
|
@@ -317,8 +310,9 @@ function getOwners(config) {
|
|
|
317
310
|
const ownerSet = config.owners;
|
|
318
311
|
switch (ownerSet.type) {
|
|
319
312
|
case 'ecdsa':
|
|
320
|
-
case 'ens':
|
|
321
313
|
return ownerSet.accounts.map((account) => account.address);
|
|
314
|
+
case 'ens':
|
|
315
|
+
return ownerSet.owners.map((o) => o.account.address);
|
|
322
316
|
case 'passkey':
|
|
323
317
|
return [NO_SAFE_OWNER_ADDRESS];
|
|
324
318
|
case 'multi-factor':
|
|
@@ -340,4 +334,4 @@ function getThreshold(config) {
|
|
|
340
334
|
return 1n;
|
|
341
335
|
}
|
|
342
336
|
}
|
|
343
|
-
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getV0DeployArgs, getSmartAccount,
|
|
337
|
+
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getV0DeployArgs, getSmartAccount, };
|
|
@@ -22,11 +22,8 @@ declare function signWithMultiFactorAuth<T>(signers: SignerSet & {
|
|
|
22
22
|
kind: 'multi-factor';
|
|
23
23
|
}, chain: Chain, address: Address, params: T, isUserOpHash: boolean, signMain: (signers: SignerSet, chain: Chain, address: Address, params: T, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
24
24
|
declare function signWithSession(signers: ResolvedSessionSignerSet, chain: Chain, address: Address, hash: Hex, signMain: (signers: SignerSet, chain: Chain, address: Address, hash: Hex, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
25
|
-
declare function signWithGuardians<T>(signers: SignerSet & {
|
|
26
|
-
type: 'guardians';
|
|
27
|
-
}, params: T, signingFunctions: SigningFunctions<T>): Promise<Hex>;
|
|
28
25
|
declare function signWithOwners<T>(signers: SignerSet & {
|
|
29
26
|
type: 'owner';
|
|
30
27
|
}, chain: Chain, address: Address, params: T, signingFunctions: SigningFunctions<T>, isUserOpHash: boolean, signMain: (signers: SignerSet, chain: Chain, address: Address, params: T, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
31
|
-
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession,
|
|
28
|
+
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession, signWithOwners, type SigningFunctions, };
|
|
32
29
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/common.ts"],"names":[],"mapp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CAAC,CAAC,CAAC,EACrC,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,CACR,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,GAAG,CAAC,GAChB,OAAO,CAAC,GAAG,CAAC,CAqFd;AAED,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,KAAK,gBAAgB,GACtB,CAAA"}
|
|
@@ -17,7 +17,7 @@ function convertOwnerSetToSignerSet(owners) {
|
|
|
17
17
|
return {
|
|
18
18
|
type: 'owner',
|
|
19
19
|
kind: 'ecdsa',
|
|
20
|
-
accounts: owners.
|
|
20
|
+
accounts: owners.owners.map((o) => o.account),
|
|
21
21
|
module: owners.module ?? ENS_HCA_MODULE,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -47,7 +47,7 @@ function convertOwnerSetToSignerSet(owners) {
|
|
|
47
47
|
return {
|
|
48
48
|
type: 'ecdsa',
|
|
49
49
|
id: index,
|
|
50
|
-
accounts: validator.
|
|
50
|
+
accounts: validator.owners.map((o) => o.account),
|
|
51
51
|
module: validator.module ?? ENS_HCA_MODULE,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -115,10 +115,6 @@ async function signWithSession(signers, chain, address, hash, signMain) {
|
|
|
115
115
|
const validatorSignature = await signMain(sessionSigners, chain, address, signedHash, false);
|
|
116
116
|
return packSmartSessionSignature(signers, validatorSignature);
|
|
117
117
|
}
|
|
118
|
-
async function signWithGuardians(signers, params, signingFunctions) {
|
|
119
|
-
const signatures = await Promise.all(signers.guardians.map((account) => signingFunctions.signEcdsa(account, params, false)));
|
|
120
|
-
return concat(signatures);
|
|
121
|
-
}
|
|
122
118
|
async function signWithOwners(signers, chain, address, params, signingFunctions, isUserOpHash, signMain) {
|
|
123
119
|
async function signEcdsWithChain(account, params, updateV, chain) {
|
|
124
120
|
const client = account.client;
|
|
@@ -181,4 +177,4 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
181
177
|
}
|
|
182
178
|
}
|
|
183
179
|
}
|
|
184
|
-
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession,
|
|
180
|
+
export { convertOwnerSetToSignerSet, signWithMultiFactorAuth, signWithSession, signWithOwners, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAQ5C,KAAK,iBAAiB,GAAG,SAAS,GAAG,wBAAwB,CAAA;AAE7D,iBAAe,IAAI,CACjB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CA4Bd;AA4BD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { concat, parseSignature, toHex, } from 'viem';
|
|
2
2
|
import { SigningNotSupportedForAccountError } from '../error.js';
|
|
3
|
-
import {
|
|
3
|
+
import { signWithOwners, signWithSession, } from './common.js';
|
|
4
4
|
async function sign(signers, chain, address, hash, isUserOpHash) {
|
|
5
5
|
const signingFunctions = {
|
|
6
6
|
signEcdsa: (account, hash, updateV) => signEcdsa(account, hash, updateV),
|
|
@@ -13,9 +13,6 @@ async function sign(signers, chain, address, hash, isUserOpHash) {
|
|
|
13
13
|
case 'experimental_session': {
|
|
14
14
|
return signWithSession(signers, chain, address, hash, sign);
|
|
15
15
|
}
|
|
16
|
-
case 'guardians': {
|
|
17
|
-
return signWithGuardians(signers, hash, signingFunctions);
|
|
18
|
-
}
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
async function signEcdsa(account, hash, updateV) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAI5C,iBAAe,IAAI,CACjB,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACjE,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,EAEtE,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,uBAAuB,CAAC,SAAS,EAAE,WAAW,CAAC,GAC1D,OAAO,CAAC,GAAG,CAAC,CAwBd;AA6BD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SigningNotSupportedForAccountError } from '../error.js';
|
|
2
|
-
import {
|
|
2
|
+
import { signWithOwners } from './common.js';
|
|
3
3
|
async function sign(signers, chain, address, parameters) {
|
|
4
4
|
const signingFunctions = {
|
|
5
5
|
signEcdsa: (account, params) => signEcdsa(account, params),
|
|
@@ -9,9 +9,6 @@ async function sign(signers, chain, address, parameters) {
|
|
|
9
9
|
case 'owner': {
|
|
10
10
|
return signWithOwners(signers, chain, address, parameters, signingFunctions, false, sign);
|
|
11
11
|
}
|
|
12
|
-
case 'guardians': {
|
|
13
|
-
return signWithGuardians(signers, parameters, signingFunctions);
|
|
14
|
-
}
|
|
15
12
|
case 'experimental_session': {
|
|
16
13
|
throw new Error('Not supported');
|
|
17
14
|
}
|
|
@@ -21,6 +21,5 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
21
21
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
22
22
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
23
23
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
24
|
-
|
|
25
|
-
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
24
|
+
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|
|
26
25
|
//# sourceMappingURL=startale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAc7D,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,KAAK,EAEV,QAAQ,EACR,uBAAuB,EAExB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAc7D,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE5D,OAAO,KAAK,EAEV,QAAQ,EACR,uBAAuB,EAExB,MAAM,UAAU,CAAA;AAUjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,QAAA,MAAM,4BAA4B,EAAE,OACU,CAAA;AAW9C,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAwErD;AAoFD,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAmClD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBAErC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAQvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,oKAUlC;AAED,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { concat, decodeFunctionData, encodeAbiParameters, encodeFunctionData, en
|
|
|
2
2
|
import { getSetup as getModuleSetup } from '../modules/index.js';
|
|
3
3
|
import { getOwnerValidator } from '../modules/validators/core.js';
|
|
4
4
|
import { AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, } from './error.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getInstallData as getNexusInstallData, getSmartAccount as getNexusSmartAccount, packSignature as packNexusSignature, } from './nexus.js';
|
|
6
6
|
const K1_DEFAULT_VALIDATOR_ADDRESS = '0x00000072f286204bb934ed49d8969e86f7dec7b1';
|
|
7
7
|
const STARTALE_VERSION = '1.0.0';
|
|
8
8
|
const IMPLEMENTATION_ADDRESS = '0x000000b8f5f723a680d3d7ee624fe0bc84a6e05a';
|
|
@@ -185,7 +185,4 @@ async function packSignature(signature, validator, transformSignature = (signatu
|
|
|
185
185
|
async function getSmartAccount(client, address, owners, validatorAddress, sign) {
|
|
186
186
|
return getNexusSmartAccount(client, address, owners, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
return getNexusGuardianSmartAccount(client, address, guardians, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
190
|
-
}
|
|
191
|
-
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
188
|
+
export { K1_DEFAULT_VALIDATOR_ADDRESS, getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, };
|