@charterlabs/rhinestone-sdk 0.2.9 → 0.3.1
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 +10 -1
- package/dist/src/accounts/index.d.ts +11 -11
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +71 -53
- package/dist/src/accounts/kernel.d.ts +3 -5
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +10 -18
- package/dist/src/accounts/kernel.test.js +10 -3
- package/dist/src/accounts/nexus.d.ts +5 -7
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +112 -59
- package/dist/src/accounts/nexus.test.js +10 -3
- package/dist/src/accounts/passport.d.ts +4 -7
- package/dist/src/accounts/passport.d.ts.map +1 -1
- package/dist/src/accounts/passport.js +0 -91
- package/dist/src/accounts/safe.d.ts +9 -4
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +110 -39
- package/dist/src/accounts/safe.test.js +10 -3
- package/dist/src/accounts/signing/common.d.ts +3 -3
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +36 -3
- package/dist/src/accounts/signing/message.js +2 -2
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +3 -3
- package/dist/src/accounts/startale.d.ts +2 -4
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +2 -5
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +10 -3
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +6 -0
- package/dist/src/actions/compact.d.ts +3 -2
- package/dist/src/actions/compact.d.ts.map +1 -1
- package/dist/src/actions/compact.js +1 -0
- package/dist/src/actions/deployment.d.ts +19 -0
- package/dist/src/actions/deployment.d.ts.map +1 -0
- package/dist/src/actions/deployment.js +78 -0
- package/dist/src/actions/index.d.ts +4 -11
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +12 -0
- package/dist/src/actions/smart-sessions.d.ts +7 -8
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +7 -4
- package/dist/src/errors/index.d.ts +2 -2
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +2 -1
- package/dist/src/execution/compact.d.ts +12 -17
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +10 -16
- package/dist/src/execution/index.d.ts +6 -6
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +16 -27
- package/dist/src/execution/permit2.d.ts +12 -17
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +10 -16
- package/dist/src/execution/singleChainOps.d.ts +15 -3
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +17 -3
- package/dist/src/execution/utils.d.ts +32 -10
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +121 -108
- package/dist/src/index.d.ts +23 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +36 -6
- package/dist/src/modules/abi/smart-session-emissary.d.ts +696 -0
- package/dist/src/modules/abi/smart-session-emissary.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-session-emissary.js +565 -0
- package/dist/src/modules/chain-abstraction.d.ts +5 -0
- package/dist/src/modules/chain-abstraction.d.ts.map +1 -0
- package/dist/src/modules/chain-abstraction.js +7 -0
- package/dist/src/modules/common.d.ts +10 -2
- package/dist/src/modules/common.d.ts.map +1 -1
- package/dist/src/modules/common.js +10 -0
- package/dist/src/modules/index.d.ts +3 -9
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +24 -8
- package/dist/src/modules/index.test.js +3 -9
- package/dist/src/modules/legacy.d.ts +10 -0
- package/dist/src/modules/legacy.d.ts.map +1 -0
- package/dist/src/modules/legacy.js +65 -0
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +2 -0
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +1 -6
- package/dist/src/modules/validators/smart-sessions.d.ts +105 -20
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +199 -435
- package/dist/src/orchestrator/client.d.ts +7 -3
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +3 -13
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +2 -1
- package/dist/src/orchestrator/registry.d.ts +2 -1
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +28 -8
- package/dist/src/orchestrator/registry.test.js +13 -0
- package/dist/src/orchestrator/types.d.ts +11 -12
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +1 -7
- package/dist/src/types.d.ts +47 -25
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +24 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +58 -0
- package/dist/test/utils/utils.d.ts +5 -0
- package/dist/test/utils/utils.d.ts.map +1 -0
- package/dist/test/utils/utils.js +20 -0
- package/package.json +33 -3
- package/dist/src/execution/smart-session.d.ts +0 -13
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -178
- package/dist/src/modules/omni-account.d.ts +0 -8
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -13
- package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.test.js +0 -222
|
@@ -29,6 +29,13 @@ declare class ExistingEip7702AccountsNotSupportedError extends AccountError {
|
|
|
29
29
|
traceId?: string;
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
declare class EoaAccountMustHaveAccountError extends AccountError {
|
|
33
|
+
constructor(params?: {
|
|
34
|
+
context?: any;
|
|
35
|
+
errorType?: string;
|
|
36
|
+
traceId?: string;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
32
39
|
declare class FactoryArgsNotAvailableError extends AccountError {
|
|
33
40
|
constructor(params?: {
|
|
34
41
|
context?: any;
|
|
@@ -103,5 +110,5 @@ declare class Eip712DomainNotAvailableError extends AccountError {
|
|
|
103
110
|
constructor(message: string);
|
|
104
111
|
}
|
|
105
112
|
declare function isAccountError(error: Error): error is AccountError;
|
|
106
|
-
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
113
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, EoaAccountMustHaveAccountError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
107
114
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
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AM,CAAA;KAAE;CAOnE;AAED,cAAM,wBAAyB,SAAQ,YAAY;gBACrC,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,6BAA8B,SAAQ,YAAY;gBAC1C,OAAO,EAAE,MAAM;CAK5B;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,YAAY,CAE3D;AAiBD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,wCAAwC,EACxC,8BAA8B,EAC9B,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,kCAAkC,EAClC,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,2BAA2B,EAC3B,kCAAkC,EAClC,wBAAwB,GACzB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OwnersFieldRequiredError = exports.EoaSigningMethodNotConfiguredError = exports.EoaSigningNotSupportedError = exports.ModuleInstallationNotSupportedError = exports.WalletClientNoConnectedAccountError = exports.AccountConfigurationNotSupportedError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountError = void 0;
|
|
3
|
+
exports.OwnersFieldRequiredError = exports.EoaSigningMethodNotConfiguredError = exports.EoaSigningNotSupportedError = exports.ModuleInstallationNotSupportedError = exports.WalletClientNoConnectedAccountError = exports.AccountConfigurationNotSupportedError = exports.Eip7702NotSupportedForAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.EoaAccountMustHaveAccountError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountError = void 0;
|
|
4
4
|
exports.isAccountError = isAccountError;
|
|
5
5
|
class AccountError extends Error {
|
|
6
6
|
_message;
|
|
@@ -46,6 +46,15 @@ class ExistingEip7702AccountsNotSupportedError extends AccountError {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.ExistingEip7702AccountsNotSupportedError = ExistingEip7702AccountsNotSupportedError;
|
|
49
|
+
class EoaAccountMustHaveAccountError extends AccountError {
|
|
50
|
+
constructor(params) {
|
|
51
|
+
super({
|
|
52
|
+
message: 'EOA accounts must have a signer `account` provided',
|
|
53
|
+
...params,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.EoaAccountMustHaveAccountError = EoaAccountMustHaveAccountError;
|
|
49
58
|
class FactoryArgsNotAvailableError extends AccountError {
|
|
50
59
|
constructor(params) {
|
|
51
60
|
super({
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { type Account, type Chain, type HashTypedDataParameters, type Hex, type PublicClient, type TypedData } from 'viem';
|
|
2
2
|
import type { Module } from '../modules/common';
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error';
|
|
3
|
+
import type { AccountProviderConfig, Call, OwnerSet, RhinestoneConfig, SignerSet } from '../types';
|
|
4
|
+
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error';
|
|
6
5
|
import { type ValidatorConfig } from './utils';
|
|
7
6
|
declare function getInitCode(config: RhinestoneConfig): {
|
|
8
7
|
address: import("viem").Address;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
} | {
|
|
9
|
+
factory: `0x${string}`;
|
|
10
|
+
factoryData: `0x${string}`;
|
|
11
|
+
} | undefined;
|
|
12
|
+
declare function getV0InitCode(config: RhinestoneConfig): {
|
|
13
|
+
address: import("viem").Address;
|
|
12
14
|
} | {
|
|
13
15
|
factory: `0x${string}`;
|
|
14
16
|
factoryData: `0x${string}`;
|
|
15
17
|
} | undefined;
|
|
16
18
|
declare function signEip7702InitData(config: RhinestoneConfig): Promise<`0x${string}`>;
|
|
17
|
-
declare function getEip7702InitCall(config: RhinestoneConfig, signature: Hex):
|
|
19
|
+
declare function getEip7702InitCall(config: RhinestoneConfig, signature: Hex): {
|
|
18
20
|
initData: `0x${string}`;
|
|
19
21
|
contract: `0x${string}`;
|
|
20
|
-
}
|
|
22
|
+
};
|
|
21
23
|
declare function getEip712Domain(config: RhinestoneConfig, chain: Chain): {
|
|
22
24
|
name: string;
|
|
23
25
|
version: string;
|
|
@@ -33,16 +35,14 @@ declare function getPackedSignature(config: RhinestoneConfig, signers: SignerSet
|
|
|
33
35
|
declare function getTypedDataPackedSignature<typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(config: RhinestoneConfig, signers: SignerSet | undefined, chain: Chain, validator: ValidatorConfig, parameters: HashTypedDataParameters<typedData, primaryType>, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
34
36
|
declare function isDeployed(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
35
37
|
declare function deploy(config: RhinestoneConfig, chain: Chain, params?: {
|
|
36
|
-
session?: Session;
|
|
37
38
|
sponsored?: boolean;
|
|
38
39
|
}): Promise<boolean>;
|
|
39
40
|
declare function setup(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
40
41
|
declare function deployStandaloneWithEoa(chain: Chain, config: RhinestoneConfig, deployer: Account): Promise<void>;
|
|
41
42
|
declare function toErc6492Signature(config: RhinestoneConfig, signature: Hex, chain: Chain): Promise<Hex>;
|
|
42
43
|
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>;
|
|
43
|
-
declare function getSmartSessionSmartAccount(config: RhinestoneConfig, client: PublicClient, chain: Chain, session: Session, enableData: EnableSessionData | null): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | undefined>;
|
|
44
44
|
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>;
|
|
45
45
|
declare function is7702(config: RhinestoneConfig): boolean;
|
|
46
46
|
declare function getAccountProvider(config: RhinestoneConfig): AccountProviderConfig;
|
|
47
|
-
export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount,
|
|
47
|
+
export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, getV0InitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getGuardianSmartAccount, getPackedSignature, getTypedDataPackedSignature, deployStandaloneWithEoa, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaAccountMustHaveAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
48
48
|
//# 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,EAMV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAMV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AAUb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,mCA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L,eAAe,EACf,0BAA0B,EAC1B,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,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EAEvB,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,8BAA8B,EAC9B,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletClientNoConnectedAccountError = exports.SmartSessionsNotEnabledError = exports.SigningNotSupportedForAccountError = exports.OwnersFieldRequiredError = exports.ModuleInstallationNotSupportedError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.EoaSigningNotSupportedError = exports.EoaSigningMethodNotConfiguredError = exports.Eip7702NotSupportedForAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
3
|
+
exports.WalletClientNoConnectedAccountError = exports.SmartSessionsNotEnabledError = exports.SigningNotSupportedForAccountError = exports.OwnersFieldRequiredError = exports.ModuleInstallationNotSupportedError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.EoaSigningNotSupportedError = exports.EoaSigningMethodNotConfiguredError = exports.EoaAccountMustHaveAccountError = exports.Eip7702NotSupportedForAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
4
4
|
exports.getEip712Domain = getEip712Domain;
|
|
5
5
|
exports.getModuleInstallationCalls = getModuleInstallationCalls;
|
|
6
6
|
exports.getModuleUninstallationCalls = getModuleUninstallationCalls;
|
|
@@ -8,6 +8,7 @@ exports.getAddress = getAddress;
|
|
|
8
8
|
exports.checkAddress = checkAddress;
|
|
9
9
|
exports.getAccountProvider = getAccountProvider;
|
|
10
10
|
exports.getInitCode = getInitCode;
|
|
11
|
+
exports.getV0InitCode = getV0InitCode;
|
|
11
12
|
exports.signEip7702InitData = signEip7702InitData;
|
|
12
13
|
exports.getEip7702InitCall = getEip7702InitCall;
|
|
13
14
|
exports.is7702 = is7702;
|
|
@@ -16,14 +17,12 @@ exports.deploy = deploy;
|
|
|
16
17
|
exports.setup = setup;
|
|
17
18
|
exports.toErc6492Signature = toErc6492Signature;
|
|
18
19
|
exports.getSmartAccount = getSmartAccount;
|
|
19
|
-
exports.getSmartSessionSmartAccount = getSmartSessionSmartAccount;
|
|
20
20
|
exports.getGuardianSmartAccount = getGuardianSmartAccount;
|
|
21
21
|
exports.getPackedSignature = getPackedSignature;
|
|
22
22
|
exports.getTypedDataPackedSignature = getTypedDataPackedSignature;
|
|
23
23
|
exports.deployStandaloneWithEoa = deployStandaloneWithEoa;
|
|
24
24
|
const viem_1 = require("viem");
|
|
25
25
|
const execution_1 = require("../execution");
|
|
26
|
-
const smart_session_1 = require("../execution/smart-session");
|
|
27
26
|
const modules_1 = require("../modules");
|
|
28
27
|
const validators_1 = require("../modules/validators");
|
|
29
28
|
const core_1 = require("../modules/validators/core");
|
|
@@ -33,6 +32,7 @@ Object.defineProperty(exports, "AccountError", { enumerable: true, get: function
|
|
|
33
32
|
Object.defineProperty(exports, "Eip712DomainNotAvailableError", { enumerable: true, get: function () { return error_1.Eip712DomainNotAvailableError; } });
|
|
34
33
|
Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return error_1.Eip7702AccountMustHaveEoaError; } });
|
|
35
34
|
Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return error_1.Eip7702NotSupportedForAccountError; } });
|
|
35
|
+
Object.defineProperty(exports, "EoaAccountMustHaveAccountError", { enumerable: true, get: function () { return error_1.EoaAccountMustHaveAccountError; } });
|
|
36
36
|
Object.defineProperty(exports, "EoaSigningMethodNotConfiguredError", { enumerable: true, get: function () { return error_1.EoaSigningMethodNotConfiguredError; } });
|
|
37
37
|
Object.defineProperty(exports, "EoaSigningNotSupportedError", { enumerable: true, get: function () { return error_1.EoaSigningNotSupportedError; } });
|
|
38
38
|
Object.defineProperty(exports, "ExistingEip7702AccountsNotSupportedError", { enumerable: true, get: function () { return error_1.ExistingEip7702AccountsNotSupportedError; } });
|
|
@@ -83,6 +83,17 @@ function getDeployArgs(config) {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
function getV0DeployArgs(config) {
|
|
87
|
+
const account = getAccountProvider(config);
|
|
88
|
+
switch (account.type) {
|
|
89
|
+
case 'safe': {
|
|
90
|
+
return (0, safe_1.getV0DeployArgs)(config);
|
|
91
|
+
}
|
|
92
|
+
default: {
|
|
93
|
+
throw new Error(`Unsupported account type: ${account.type}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
86
97
|
function getInitCode(config) {
|
|
87
98
|
if (is7702(config)) {
|
|
88
99
|
return undefined;
|
|
@@ -94,10 +105,33 @@ function getInitCode(config) {
|
|
|
94
105
|
return config.initData;
|
|
95
106
|
}
|
|
96
107
|
else {
|
|
97
|
-
const
|
|
98
|
-
if (!
|
|
108
|
+
const deployArgs = getDeployArgs(config);
|
|
109
|
+
if (!deployArgs) {
|
|
99
110
|
throw new error_1.FactoryArgsNotAvailableError();
|
|
100
111
|
}
|
|
112
|
+
const { factory, factoryData } = deployArgs;
|
|
113
|
+
return {
|
|
114
|
+
factory,
|
|
115
|
+
factoryData,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function getV0InitCode(config) {
|
|
120
|
+
if (is7702(config)) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
else if (config.account?.type === 'eoa') {
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
else if (config.initData) {
|
|
127
|
+
return config.initData;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const deployArgs = getV0DeployArgs(config);
|
|
131
|
+
if (!deployArgs) {
|
|
132
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
133
|
+
}
|
|
134
|
+
const { factory, factoryData } = deployArgs;
|
|
101
135
|
return {
|
|
102
136
|
factory,
|
|
103
137
|
factoryData,
|
|
@@ -127,11 +161,11 @@ async function signEip7702InitData(config) {
|
|
|
127
161
|
}
|
|
128
162
|
}
|
|
129
163
|
}
|
|
130
|
-
|
|
164
|
+
function getEip7702InitCall(config, signature) {
|
|
131
165
|
const account = getAccountProvider(config);
|
|
132
166
|
switch (account.type) {
|
|
133
167
|
case 'nexus': {
|
|
134
|
-
return
|
|
168
|
+
return (0, nexus_1.getEip7702InitCall)(config, signature);
|
|
135
169
|
}
|
|
136
170
|
case 'safe':
|
|
137
171
|
case 'kernel':
|
|
@@ -366,6 +400,10 @@ async function isDeployed(config, chain) {
|
|
|
366
400
|
}
|
|
367
401
|
async function deploy(config, chain, params) {
|
|
368
402
|
const account = getAccountProvider(config);
|
|
403
|
+
const deployArgs = getDeployArgs(config);
|
|
404
|
+
if (!deployArgs) {
|
|
405
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
406
|
+
}
|
|
369
407
|
if (account.type === 'eoa') {
|
|
370
408
|
return false;
|
|
371
409
|
}
|
|
@@ -373,16 +411,19 @@ async function deploy(config, chain, params) {
|
|
|
373
411
|
if (deployed) {
|
|
374
412
|
return false;
|
|
375
413
|
}
|
|
376
|
-
const
|
|
414
|
+
const intentExecutorInstalled = 'intentExecutorInstalled' in deployArgs
|
|
415
|
+
? deployArgs.intentExecutorInstalled
|
|
416
|
+
: false;
|
|
417
|
+
// Use bundler directly when:
|
|
418
|
+
// (account has initData and intent executor is not installed) || (custom bundler is configured)
|
|
419
|
+
const useCustomBundler = config.bundler?.type === 'custom';
|
|
420
|
+
const asUserOp = (config.initData && !intentExecutorInstalled) || useCustomBundler;
|
|
377
421
|
if (asUserOp) {
|
|
378
422
|
await deployWithBundler(chain, config);
|
|
379
423
|
}
|
|
380
424
|
else {
|
|
381
425
|
await deployWithIntent(chain, config, params?.sponsored ?? false);
|
|
382
426
|
}
|
|
383
|
-
if (params?.session) {
|
|
384
|
-
await (0, smart_session_1.enableSmartSession)(chain, config, params.session);
|
|
385
|
-
}
|
|
386
427
|
return true;
|
|
387
428
|
}
|
|
388
429
|
// Installs the missing modules
|
|
@@ -441,7 +482,9 @@ async function setup(config, chain) {
|
|
|
441
482
|
const hasIntentExecutor = modulesToInstall.every((module) => module.address !== intentExecutor.address);
|
|
442
483
|
let result;
|
|
443
484
|
if (hasIntentExecutor) {
|
|
444
|
-
result = await (0, execution_1.sendTransactionInternal)(config, [chain], chain,
|
|
485
|
+
result = await (0, execution_1.sendTransactionInternal)(config, [chain], chain, {
|
|
486
|
+
callInputs: calls,
|
|
487
|
+
});
|
|
445
488
|
}
|
|
446
489
|
else {
|
|
447
490
|
result = await (0, execution_1.sendUserOperationInternal)(config, chain, calls);
|
|
@@ -463,12 +506,7 @@ async function deployWithIntent(chain, config, sponsored) {
|
|
|
463
506
|
const result = await (0, execution_1.sendTransaction)(config, {
|
|
464
507
|
sourceChains: [chain],
|
|
465
508
|
targetChain: chain,
|
|
466
|
-
calls: [
|
|
467
|
-
{
|
|
468
|
-
to: viem_1.zeroAddress,
|
|
469
|
-
data: '0x',
|
|
470
|
-
},
|
|
471
|
-
],
|
|
509
|
+
calls: [],
|
|
472
510
|
sponsored,
|
|
473
511
|
});
|
|
474
512
|
await (0, execution_1.waitForExecution)(config, result, true);
|
|
@@ -480,7 +518,11 @@ async function deployWithBundler(chain, config) {
|
|
|
480
518
|
});
|
|
481
519
|
const bundlerClient = (0, utils_1.getBundlerClient)(config, publicClient);
|
|
482
520
|
const smartAccount = await getSmartAccount(config, publicClient, chain);
|
|
483
|
-
const
|
|
521
|
+
const deployArgs = getDeployArgs(config);
|
|
522
|
+
if (!deployArgs) {
|
|
523
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
524
|
+
}
|
|
525
|
+
const { factory, factoryData } = deployArgs;
|
|
484
526
|
const opHash = await bundlerClient.sendUserOperation({
|
|
485
527
|
account: smartAccount,
|
|
486
528
|
factory,
|
|
@@ -515,7 +557,11 @@ async function deployStandaloneWithEoa(chain, config, deployer) {
|
|
|
515
557
|
if (!initCode) {
|
|
516
558
|
throw new error_1.FactoryArgsNotAvailableError();
|
|
517
559
|
}
|
|
518
|
-
const
|
|
560
|
+
const deployArgs = getDeployArgs(config);
|
|
561
|
+
if (!deployArgs) {
|
|
562
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
563
|
+
}
|
|
564
|
+
const { factory, factoryData } = deployArgs;
|
|
519
565
|
const walletClient = (0, viem_1.createWalletClient)({
|
|
520
566
|
account: deployer,
|
|
521
567
|
chain,
|
|
@@ -537,7 +583,11 @@ async function toErc6492Signature(config, signature, chain) {
|
|
|
537
583
|
if (!initCode) {
|
|
538
584
|
throw new error_1.FactoryArgsNotAvailableError();
|
|
539
585
|
}
|
|
540
|
-
const
|
|
586
|
+
const deployArgs = getDeployArgs(config);
|
|
587
|
+
if (!deployArgs) {
|
|
588
|
+
throw new error_1.FactoryArgsNotAvailableError();
|
|
589
|
+
}
|
|
590
|
+
const { factory, factoryData } = deployArgs;
|
|
541
591
|
const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';
|
|
542
592
|
return (0, viem_1.concat)([
|
|
543
593
|
(0, viem_1.encodeAbiParameters)([
|
|
@@ -577,38 +627,6 @@ async function getSmartAccount(config, client, chain) {
|
|
|
577
627
|
}
|
|
578
628
|
}
|
|
579
629
|
}
|
|
580
|
-
async function getSmartSessionSmartAccount(config, client, chain, session, enableData) {
|
|
581
|
-
const address = getAddress(config);
|
|
582
|
-
const smartSessionValidator = (0, validators_1.getSmartSessionValidator)(config);
|
|
583
|
-
if (!smartSessionValidator) {
|
|
584
|
-
throw new error_1.SmartSessionsNotEnabledError();
|
|
585
|
-
}
|
|
586
|
-
const signers = {
|
|
587
|
-
type: 'session',
|
|
588
|
-
session,
|
|
589
|
-
enableData: enableData || undefined,
|
|
590
|
-
};
|
|
591
|
-
const signFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, true);
|
|
592
|
-
const account = getAccountProvider(config);
|
|
593
|
-
switch (account.type) {
|
|
594
|
-
case 'safe': {
|
|
595
|
-
return (0, safe_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
596
|
-
}
|
|
597
|
-
case 'nexus': {
|
|
598
|
-
const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
|
|
599
|
-
return (0, nexus_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn, defaultValidatorAddress);
|
|
600
|
-
}
|
|
601
|
-
case 'kernel': {
|
|
602
|
-
return (0, kernel_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
603
|
-
}
|
|
604
|
-
case 'passport': {
|
|
605
|
-
return (0, passport_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
606
|
-
}
|
|
607
|
-
case 'startale': {
|
|
608
|
-
return (0, startale_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
630
|
async function getGuardianSmartAccount(config, client, chain, guardians) {
|
|
613
631
|
const address = getAddress(config);
|
|
614
632
|
const accounts = guardians.type === 'ecdsa' ? guardians.accounts : [];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type Abi, type Address, type Chain, type Hex, type PublicClient } from 'viem';
|
|
2
2
|
import { type SmartAccount, type SmartAccountImplementation } from 'viem/account-abstraction';
|
|
3
3
|
import { type Module } from '../modules/common';
|
|
4
|
-
import type {
|
|
5
|
-
import type { OwnerSet, RhinestoneAccountConfig, Session } from '../types';
|
|
4
|
+
import type { OwnerSet, RhinestoneAccountConfig } from '../types';
|
|
6
5
|
import { type ValidatorConfig } from './utils';
|
|
7
6
|
declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
8
7
|
factory: `0x${string}`;
|
|
@@ -10,7 +9,7 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
10
9
|
implementation: `0x${string}`;
|
|
11
10
|
initializationCallData: `0x${string}`;
|
|
12
11
|
salt: `0x${string}`;
|
|
13
|
-
};
|
|
12
|
+
} | null;
|
|
14
13
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
15
14
|
declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain): {
|
|
16
15
|
name: string;
|
|
@@ -23,7 +22,6 @@ declare function getInstallData(module: Module): Hex[];
|
|
|
23
22
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
24
23
|
declare function wrapMessageHash(messageHash: Hex, accountAddress: Hex): Hex;
|
|
25
24
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
26
|
-
declare function getSessionSmartAccount(client: PublicClient, address: Address, session: Session, validatorAddress: Address, enableData: EnableSessionData | null, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
27
25
|
declare function getGuardianSmartAccount(client: PublicClient, address: Address, guardians: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
28
|
-
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount,
|
|
26
|
+
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount, getGuardianSmartAccount, packSignature, wrapMessageHash, };
|
|
29
27
|
//# 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;
|
|
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,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,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;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,iEAclC;AA+ED,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -5,7 +5,6 @@ exports.getInstallData = getInstallData;
|
|
|
5
5
|
exports.getAddress = getAddress;
|
|
6
6
|
exports.getDeployArgs = getDeployArgs;
|
|
7
7
|
exports.getSmartAccount = getSmartAccount;
|
|
8
|
-
exports.getSessionSmartAccount = getSessionSmartAccount;
|
|
9
8
|
exports.getGuardianSmartAccount = getGuardianSmartAccount;
|
|
10
9
|
exports.packSignature = packSignature;
|
|
11
10
|
exports.wrapMessageHash = wrapMessageHash;
|
|
@@ -23,6 +22,9 @@ const KERNEL_BYTECODE = '0x603d3d8160223d3973d6cedde84be40893d153be9d467cd6ad378
|
|
|
23
22
|
const KERNEL_VERSION = '0.3.3';
|
|
24
23
|
function getDeployArgs(config) {
|
|
25
24
|
if (config.initData) {
|
|
25
|
+
if (!('factory' in config.initData)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
26
28
|
const factoryData = (0, viem_1.decodeFunctionData)({
|
|
27
29
|
abi: (0, viem_1.parseAbi)([
|
|
28
30
|
'function deployWithFactory(address factory,bytes createData,bytes32 salt)',
|
|
@@ -49,7 +51,8 @@ function getDeployArgs(config) {
|
|
|
49
51
|
salt,
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
|
-
const
|
|
54
|
+
const account = config.account;
|
|
55
|
+
const salt = account?.salt ?? viem_1.zeroHash;
|
|
53
56
|
const moduleSetup = (0, modules_1.getSetup)(config);
|
|
54
57
|
const rootValidator = (0, viem_1.concat)(['0x01', moduleSetup.validators[0].address]);
|
|
55
58
|
const hook = viem_1.zeroAddress;
|
|
@@ -89,7 +92,11 @@ function getDeployArgs(config) {
|
|
|
89
92
|
};
|
|
90
93
|
}
|
|
91
94
|
function getAddress(config) {
|
|
92
|
-
const
|
|
95
|
+
const deployArgs = getDeployArgs(config);
|
|
96
|
+
if (!deployArgs) {
|
|
97
|
+
throw new Error('Cannot derive address: deploy args not available');
|
|
98
|
+
}
|
|
99
|
+
const { salt, initializationCallData } = deployArgs;
|
|
93
100
|
const actualSalt = (0, viem_1.keccak256)((0, viem_1.concat)([initializationCallData, salt]));
|
|
94
101
|
return (0, viem_1.getContractAddress)({
|
|
95
102
|
from: KERNEL_FACTORY_ADDRESS,
|
|
@@ -197,21 +204,6 @@ async function getSmartAccount(client, address, owners, validatorAddress, sign)
|
|
|
197
204
|
return (0, validators_1.getMockSignature)(owners);
|
|
198
205
|
}, sign);
|
|
199
206
|
}
|
|
200
|
-
async function getSessionSmartAccount(client, address, session, validatorAddress, enableData, sign) {
|
|
201
|
-
return await getBaseSmartAccount(address, client, validatorAddress, 'validator', async () => {
|
|
202
|
-
const dummyOpSignature = (0, validators_1.getMockSignature)(session.owners);
|
|
203
|
-
if (enableData) {
|
|
204
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_ENABLE, (0, validators_1.getPermissionId)(session), dummyOpSignature, enableData);
|
|
205
|
-
}
|
|
206
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_USE, (0, validators_1.getPermissionId)(session), dummyOpSignature);
|
|
207
|
-
}, async (hash) => {
|
|
208
|
-
const signature = await sign(hash);
|
|
209
|
-
if (enableData) {
|
|
210
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_ENABLE, (0, validators_1.getPermissionId)(session), signature, enableData);
|
|
211
|
-
}
|
|
212
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_USE, (0, validators_1.getPermissionId)(session), signature);
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
207
|
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign) {
|
|
216
208
|
return await getBaseSmartAccount(address, client, validatorAddress, 'validator', async () => {
|
|
217
209
|
return (0, validators_1.getMockSignature)(guardians);
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
4
|
const consts_1 = require("../../test/consts");
|
|
5
|
+
const utils_1 = require("../../test/utils/utils");
|
|
5
6
|
const common_1 = require("../modules/common");
|
|
6
7
|
const kernel_1 = require("./kernel");
|
|
7
8
|
const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
8
9
|
(0, vitest_1.describe)('Accounts: Kernel', () => {
|
|
9
10
|
(0, vitest_1.describe)('Deploy Args', () => {
|
|
10
11
|
(0, vitest_1.test)('ECDSA owners', () => {
|
|
11
|
-
const
|
|
12
|
+
const deployArgs = (0, kernel_1.getDeployArgs)({
|
|
12
13
|
owners: {
|
|
13
14
|
type: 'ecdsa',
|
|
14
15
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
15
16
|
},
|
|
16
17
|
});
|
|
18
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
19
|
+
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
17
20
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
18
21
|
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003243c3b752b01000000000013fdb5234e4e3162a810f54d9f7e980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
19
22
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
@@ -21,12 +24,14 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
21
24
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b01000000000013fdb5234e4e3162a810f54d9f7e980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
22
25
|
});
|
|
23
26
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
24
|
-
const
|
|
27
|
+
const deployArgs = (0, kernel_1.getDeployArgs)({
|
|
25
28
|
owners: {
|
|
26
29
|
type: 'passkey',
|
|
27
30
|
accounts: [consts_1.passkeyAccount],
|
|
28
31
|
},
|
|
29
32
|
});
|
|
33
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
34
|
+
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
30
35
|
(0, vitest_1.expect)(factory).toEqual('0xd703aae79538628d27099b8c4f621be4ccd142d5');
|
|
31
36
|
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003443c3b752b010000000000578c4cb0e472a5462da43c495c3f330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000094000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
32
37
|
(0, vitest_1.expect)(salt).toEqual('0x0000000000000000000000000000000000000000000000000000000000000000');
|
|
@@ -34,7 +39,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
34
39
|
(0, vitest_1.expect)(initializationCallData).toEqual('0x3c3b752b010000000000578c4cb0e472a5462da43c495c3f330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001249517e29f000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
35
40
|
});
|
|
36
41
|
(0, vitest_1.test)('Existing account', () => {
|
|
37
|
-
const
|
|
42
|
+
const deployArgs = (0, kernel_1.getDeployArgs)({
|
|
38
43
|
owners: {
|
|
39
44
|
type: 'ecdsa',
|
|
40
45
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
@@ -46,6 +51,8 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
46
51
|
intentExecutorInstalled: false,
|
|
47
52
|
},
|
|
48
53
|
});
|
|
54
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
55
|
+
const { factory, factoryData } = deployArgs;
|
|
49
56
|
(0, vitest_1.expect)(factory).toEqual('0xd703aaE79538628d27099B8c4f621bE4CCd142d5');
|
|
50
57
|
(0, vitest_1.expect)(factoryData).toEqual('0xc5265d5d0000000000000000000000002577507b78c2008ff367261cb6285d44ba5ef2e90000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001243c3b752b01845ADb2C711129d4f3966735eD98a9F09fC4cE570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001460098F8D98a9c55F21D17C26c78bF3D71Edc0E740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
51
58
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Abi, Account, Address, Chain, Hex, PublicClient } from 'viem';
|
|
2
2
|
import { type SmartAccount, type SmartAccountImplementation } from 'viem/account-abstraction';
|
|
3
3
|
import type { Module } from '../modules/common';
|
|
4
|
-
import type {
|
|
5
|
-
import type { OwnerSet, RhinestoneAccountConfig, Session } from '../types';
|
|
4
|
+
import type { OwnerSet, RhinestoneAccountConfig } from '../types';
|
|
6
5
|
import { type ValidatorConfig } from './utils';
|
|
7
6
|
declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
8
7
|
salt: `0x${string}`;
|
|
@@ -11,7 +10,7 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
11
10
|
implementation: `0x${string}`;
|
|
12
11
|
initData: `0x${string}`;
|
|
13
12
|
initializationCallData: `0x${string}`;
|
|
14
|
-
};
|
|
13
|
+
} | null;
|
|
15
14
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
16
15
|
declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain): {
|
|
17
16
|
name: string;
|
|
@@ -24,12 +23,11 @@ declare function getInstallData(module: Module): `0x${string}`;
|
|
|
24
23
|
declare function getDefaultValidatorAddress(version: '1.0.2' | '1.2.0' | 'rhinestone-1.0.0-beta' | 'rhinestone-1.0.0' | undefined): Address;
|
|
25
24
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex, defaultValidatorAddress?: Address): Promise<`0x${string}`>;
|
|
26
25
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>, defaultValidatorAddress?: Address): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
27
|
-
declare function getSessionSmartAccount(client: PublicClient, address: Address, session: Session, validatorAddress: Address, enableData: EnableSessionData | null, sign: (hash: Hex) => Promise<Hex>, defaultValidatorAddress?: Address): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
28
26
|
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
27
|
declare function signEip7702InitData(config: RhinestoneAccountConfig, eoa: Account): Promise<`0x${string}`>;
|
|
30
|
-
declare function getEip7702InitCall(config: RhinestoneAccountConfig, signature: Hex):
|
|
28
|
+
declare function getEip7702InitCall(config: RhinestoneAccountConfig, signature: Hex): {
|
|
31
29
|
initData: `0x${string}`;
|
|
32
30
|
contract: `0x${string}`;
|
|
33
|
-
}
|
|
34
|
-
export { getEip712Domain, getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount,
|
|
31
|
+
};
|
|
32
|
+
export { getEip712Domain, getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
35
33
|
//# 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,GA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