@charterlabs/rhinestone-sdk 0.2.7-dev.4 → 0.2.9
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/README.md +46 -8
- package/dist/src/accounts/error.d.ts +4 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +9 -1
- package/dist/src/accounts/index.d.ts +13 -3
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +62 -6
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -1
- package/dist/src/accounts/json-rpc/index.js +4 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.test.js +33 -0
- package/dist/src/accounts/json-rpc/providers.d.ts +2 -1
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -1
- package/dist/src/accounts/json-rpc/providers.js +8 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.test.js +43 -0
- package/dist/src/accounts/kernel.d.ts +9 -2
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +13 -0
- package/dist/src/accounts/nexus.d.ts +9 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +15 -1
- package/dist/src/accounts/passport.d.ts +12 -0
- package/dist/src/accounts/passport.d.ts.map +1 -0
- package/dist/src/accounts/passport.js +173 -0
- package/dist/src/accounts/safe.d.ts +9 -2
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +15 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +26 -5
- package/dist/src/accounts/signing/message.js +1 -1
- package/dist/src/accounts/startale.d.ts +9 -2
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +15 -0
- package/dist/src/accounts/walletClient.d.ts +27 -0
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +77 -0
- package/dist/src/actions/smart-sessions.d.ts +14 -0
- package/dist/src/actions/smart-sessions.d.ts.map +1 -0
- package/dist/src/actions/smart-sessions.js +16 -0
- 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 +18 -1
- package/dist/src/execution/compact.d.ts +3 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +3 -3
- package/dist/src/execution/error.d.ts +8 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +10 -1
- package/dist/src/execution/index.d.ts +10 -4
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +85 -12
- package/dist/src/execution/permit2.d.ts +2 -2
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +28 -19
- package/dist/src/execution/singleChainOps.d.ts +28 -0
- package/dist/src/execution/singleChainOps.d.ts.map +1 -0
- package/dist/src/execution/singleChainOps.js +32 -0
- package/dist/src/execution/smart-session.d.ts +5 -7
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +114 -229
- package/dist/src/execution/types.d.ts +2 -1
- package/dist/src/execution/types.d.ts.map +1 -1
- package/dist/src/execution/utils.d.ts +16 -9
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +151 -76
- package/dist/src/index.d.ts +18 -19
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -25
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +1 -1
- package/dist/src/modules/index.test.js +1 -1
- package/dist/src/modules/read.js +2 -2
- package/dist/src/modules/validators/core.d.ts +5 -3
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +39 -2
- package/dist/src/modules/validators/smart-sessions.d.ts +8 -8
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +29 -80
- package/dist/src/modules/validators/smart-sessions.test.js +4 -5
- package/dist/src/orchestrator/client.d.ts +3 -2
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +230 -172
- package/dist/src/orchestrator/error.d.ts +137 -1
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +137 -1
- package/dist/src/orchestrator/index.d.ts +6 -6
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +19 -3
- package/dist/src/orchestrator/registry.d.ts +6 -2
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +16 -64
- package/dist/src/orchestrator/registry.test.js +24 -24
- package/dist/src/orchestrator/types.d.ts +63 -43
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +9 -5
- package/dist/src/types.d.ts +42 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +5 -0
- package/package.json +4 -4
- package/dist/src/actions/smart-session.d.ts +0 -11
- package/dist/src/actions/smart-session.d.ts.map +0 -1
- package/dist/src/actions/smart-session.js +0 -13
- package/dist/src/execution/smart-session.test.d.ts +0 -2
- package/dist/src/execution/smart-session.test.d.ts.map +0 -1
- package/dist/src/execution/smart-session.test.js +0 -34
package/README.md
CHANGED
|
@@ -26,12 +26,37 @@ bun install viem @rhinestone/sdk
|
|
|
26
26
|
|
|
27
27
|
You'll need a Rhinestone API key, as well as an existing account with some testnet ETH on the source chain.
|
|
28
28
|
|
|
29
|
+
### SDK Initialization
|
|
30
|
+
|
|
31
|
+
To initialize the SDK with your configuration:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
35
|
+
|
|
36
|
+
const sdk = new RhinestoneSDK({
|
|
37
|
+
apiKey: 'your-rhinestone-api-key',
|
|
38
|
+
// Optional: Provider configuration
|
|
39
|
+
provider: {
|
|
40
|
+
type: 'alchemy',
|
|
41
|
+
apiKey: 'your-alchemy-api-key',
|
|
42
|
+
},
|
|
43
|
+
// Optional: Bundler configuration
|
|
44
|
+
bundler: {
|
|
45
|
+
// the bundler settings
|
|
46
|
+
},
|
|
47
|
+
// Optional: Paymaster configuration
|
|
48
|
+
paymaster: {
|
|
49
|
+
// the paymaster settings
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
29
54
|
### Creating a Wallet
|
|
30
55
|
|
|
31
56
|
Let's create a smart account with a single owner:
|
|
32
57
|
|
|
33
58
|
```ts
|
|
34
|
-
import {
|
|
59
|
+
import { RhinestoneSDK } from '@rhinestone/sdk'
|
|
35
60
|
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
|
|
36
61
|
import { baseSepolia, arbitrumSepolia, optimismSepolia } from 'viem/chains'
|
|
37
62
|
import {
|
|
@@ -63,12 +88,17 @@ const privateKey = generatePrivateKey()
|
|
|
63
88
|
console.info(`Owner private key: ${privateKey}`)
|
|
64
89
|
const account = privateKeyToAccount(privateKey)
|
|
65
90
|
|
|
66
|
-
|
|
91
|
+
// Initialize the SDK
|
|
92
|
+
const sdk = new RhinestoneSDK({
|
|
93
|
+
apiKey: rhinestoneApiKey,
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
// Create the Rhinestone account
|
|
97
|
+
const rhinestoneAccount = await sdk.createAccount({
|
|
67
98
|
owners: {
|
|
68
99
|
type: 'ecdsa',
|
|
69
100
|
accounts: [account],
|
|
70
|
-
}
|
|
71
|
-
rhinestoneApiKey,
|
|
101
|
+
},
|
|
72
102
|
})
|
|
73
103
|
const address = await rhinestoneAccount.getAddress()
|
|
74
104
|
console.info(`Smart account address: ${address}`)
|
|
@@ -182,13 +212,21 @@ const session: Session = {
|
|
|
182
212
|
During account initialization, provide the session you've just created. Make sure to also provide a bundler configuration.
|
|
183
213
|
|
|
184
214
|
```ts
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
215
|
+
// Initialize the SDK with bundler configuration
|
|
216
|
+
const sdk = new RhinestoneSDK({
|
|
217
|
+
apiKey: rhinestoneApiKey,
|
|
188
218
|
bundler: {
|
|
189
|
-
//
|
|
219
|
+
// bundler configuration
|
|
190
220
|
},
|
|
191
221
|
})
|
|
222
|
+
|
|
223
|
+
const rhinestoneAccount = await sdk.createAccount({
|
|
224
|
+
owners: {
|
|
225
|
+
type: 'ecdsa',
|
|
226
|
+
accounts: [account],
|
|
227
|
+
},
|
|
228
|
+
sessions: [session],
|
|
229
|
+
})
|
|
192
230
|
```
|
|
193
231
|
|
|
194
232
|
When making a transaction, specify the `signers` object to sign it with the session key:
|
|
@@ -99,6 +99,9 @@ declare class OwnersFieldRequiredError extends AccountError {
|
|
|
99
99
|
traceId?: string;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
+
declare class Eip712DomainNotAvailableError extends AccountError {
|
|
103
|
+
constructor(message: string);
|
|
104
|
+
}
|
|
102
105
|
declare function isAccountError(error: Error): error is AccountError;
|
|
103
|
-
export { isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
106
|
+
export { isAccountError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, Eip7702NotSupportedForAccountError, AccountConfigurationNotSupportedError, WalletClientNoConnectedAccountError, ModuleInstallationNotSupportedError, EoaSigningNotSupportedError, EoaSigningMethodNotConfiguredError, OwnersFieldRequiredError, };
|
|
104
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,wCAAyC,SAAQ,YAAY;gBACrD,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,4BAA6B,SAAQ,YAAY;gBACzC,MAAM,CAAC,EAAE;QACnB,O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,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,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.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.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountError = void 0;
|
|
4
4
|
exports.isAccountError = isAccountError;
|
|
5
5
|
class AccountError extends Error {
|
|
6
6
|
_message;
|
|
@@ -138,6 +138,14 @@ class OwnersFieldRequiredError extends AccountError {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
exports.OwnersFieldRequiredError = OwnersFieldRequiredError;
|
|
141
|
+
class Eip712DomainNotAvailableError extends AccountError {
|
|
142
|
+
constructor(message) {
|
|
143
|
+
super({
|
|
144
|
+
message,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.Eip712DomainNotAvailableError = Eip712DomainNotAvailableError;
|
|
141
149
|
function isAccountError(error) {
|
|
142
150
|
return error instanceof AccountError;
|
|
143
151
|
}
|
|
@@ -2,7 +2,7 @@ import { type Account, type Chain, type HashTypedDataParameters, type Hex, type
|
|
|
2
2
|
import type { Module } from '../modules/common';
|
|
3
3
|
import type { EnableSessionData } from '../modules/validators/smart-sessions';
|
|
4
4
|
import type { AccountProviderConfig, Call, OwnerSet, RhinestoneConfig, Session, SignerSet } from '../types';
|
|
5
|
-
import { AccountConfigurationNotSupportedError, AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error';
|
|
5
|
+
import { AccountConfigurationNotSupportedError, AccountError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError } from './error';
|
|
6
6
|
import { type ValidatorConfig } from './utils';
|
|
7
7
|
declare function getInitCode(config: RhinestoneConfig): {
|
|
8
8
|
address: import("viem").Address;
|
|
@@ -18,6 +18,13 @@ declare function getEip7702InitCall(config: RhinestoneConfig, signature: Hex): P
|
|
|
18
18
|
initData: `0x${string}`;
|
|
19
19
|
contract: `0x${string}`;
|
|
20
20
|
}>;
|
|
21
|
+
declare function getEip712Domain(config: RhinestoneConfig, chain: Chain): {
|
|
22
|
+
name: string;
|
|
23
|
+
version: string;
|
|
24
|
+
chainId: number;
|
|
25
|
+
verifyingContract: `0x${string}`;
|
|
26
|
+
salt: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
27
|
+
};
|
|
21
28
|
declare function getModuleInstallationCalls(config: RhinestoneConfig, module: Module): Call[];
|
|
22
29
|
declare function getModuleUninstallationCalls(config: RhinestoneConfig, module: Module): Call[];
|
|
23
30
|
declare function getAddress(config: RhinestoneConfig): `0x${string}`;
|
|
@@ -25,7 +32,10 @@ declare function checkAddress(config: RhinestoneConfig): boolean;
|
|
|
25
32
|
declare function getPackedSignature(config: RhinestoneConfig, signers: SignerSet | undefined, chain: Chain, validator: ValidatorConfig, hash: Hex, transformSignature?: (signature: Hex) => Hex): Promise<Hex>;
|
|
26
33
|
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>;
|
|
27
34
|
declare function isDeployed(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
28
|
-
declare function deploy(config: RhinestoneConfig, chain: Chain,
|
|
35
|
+
declare function deploy(config: RhinestoneConfig, chain: Chain, params?: {
|
|
36
|
+
session?: Session;
|
|
37
|
+
sponsored?: boolean;
|
|
38
|
+
}): Promise<boolean>;
|
|
29
39
|
declare function setup(config: RhinestoneConfig, chain: Chain): Promise<boolean>;
|
|
30
40
|
declare function deployStandaloneWithEoa(chain: Chain, config: RhinestoneConfig, deployer: Account): Promise<void>;
|
|
31
41
|
declare function toErc6492Signature(config: RhinestoneConfig, signature: Hex, chain: Chain): Promise<Hex>;
|
|
@@ -34,5 +44,5 @@ declare function getSmartSessionSmartAccount(config: RhinestoneConfig, client: P
|
|
|
34
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>;
|
|
35
45
|
declare function is7702(config: RhinestoneConfig): boolean;
|
|
36
46
|
declare function getAccountProvider(config: RhinestoneConfig): AccountProviderConfig;
|
|
37
|
-
export { getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getSmartSessionSmartAccount, getGuardianSmartAccount, getPackedSignature, getTypedDataPackedSignature, deployStandaloneWithEoa, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
47
|
+
export { getEip712Domain, getModuleInstallationCalls, getModuleUninstallationCalls, getAddress, checkAddress, getAccountProvider, getInitCode, signEip7702InitData, getEip7702InitCall, is7702, isDeployed, deploy, setup, toErc6492Signature, getSmartAccount, getSmartSessionSmartAccount, getGuardianSmartAccount, getPackedSignature, getTypedDataPackedSignature, deployStandaloneWithEoa, isAccountError, AccountError, AccountConfigurationNotSupportedError, Eip712DomainNotAvailableError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, EoaSigningMethodNotConfiguredError, EoaSigningNotSupportedError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, ModuleInstallationNotSupportedError, OwnersFieldRequiredError, SigningNotSupportedForAccountError, SmartSessionsNotEnabledError, WalletClientNoConnectedAccountError, };
|
|
38
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,
|
|
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;AAWb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAM/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,SAAS,EACV,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qCAAqC,EACrC,YAAY,EACZ,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,cAAc,EACd,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,EACpC,MAAM,SAAS,CAAA;AAsDhB,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAkCh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AAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,UAAU,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EAEvB,cAAc,EACd,YAAY,EACZ,qCAAqC,EACrC,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,kCAAkC,EAClC,2BAA2B,EAC3B,wCAAwC,EACxC,4BAA4B,EAC5B,mCAAmC,EACnC,wBAAwB,EACxB,kCAAkC,EAClC,4BAA4B,EAC5B,mCAAmC,GACpC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
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.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.Eip7702NotSupportedForAccountError = exports.Eip7702AccountMustHaveEoaError = exports.Eip712DomainNotAvailableError = exports.AccountConfigurationNotSupportedError = exports.AccountError = exports.isAccountError = void 0;
|
|
4
|
+
exports.getEip712Domain = getEip712Domain;
|
|
4
5
|
exports.getModuleInstallationCalls = getModuleInstallationCalls;
|
|
5
6
|
exports.getModuleUninstallationCalls = getModuleUninstallationCalls;
|
|
6
7
|
exports.getAddress = getAddress;
|
|
@@ -29,6 +30,7 @@ const core_1 = require("../modules/validators/core");
|
|
|
29
30
|
const error_1 = require("./error");
|
|
30
31
|
Object.defineProperty(exports, "AccountConfigurationNotSupportedError", { enumerable: true, get: function () { return error_1.AccountConfigurationNotSupportedError; } });
|
|
31
32
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return error_1.AccountError; } });
|
|
33
|
+
Object.defineProperty(exports, "Eip712DomainNotAvailableError", { enumerable: true, get: function () { return error_1.Eip712DomainNotAvailableError; } });
|
|
32
34
|
Object.defineProperty(exports, "Eip7702AccountMustHaveEoaError", { enumerable: true, get: function () { return error_1.Eip7702AccountMustHaveEoaError; } });
|
|
33
35
|
Object.defineProperty(exports, "Eip7702NotSupportedForAccountError", { enumerable: true, get: function () { return error_1.Eip7702NotSupportedForAccountError; } });
|
|
34
36
|
Object.defineProperty(exports, "EoaSigningMethodNotConfiguredError", { enumerable: true, get: function () { return error_1.EoaSigningMethodNotConfiguredError; } });
|
|
@@ -43,6 +45,7 @@ Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: tru
|
|
|
43
45
|
Object.defineProperty(exports, "WalletClientNoConnectedAccountError", { enumerable: true, get: function () { return error_1.WalletClientNoConnectedAccountError; } });
|
|
44
46
|
const kernel_1 = require("./kernel");
|
|
45
47
|
const nexus_1 = require("./nexus");
|
|
48
|
+
const passport_1 = require("./passport");
|
|
46
49
|
const safe_1 = require("./safe");
|
|
47
50
|
const common_1 = require("./signing/common");
|
|
48
51
|
const message_1 = require("./signing/message");
|
|
@@ -64,6 +67,17 @@ function getDeployArgs(config) {
|
|
|
64
67
|
case 'startale': {
|
|
65
68
|
return (0, startale_1.getDeployArgs)(config);
|
|
66
69
|
}
|
|
70
|
+
case 'passport': {
|
|
71
|
+
// Mocked data; will be overridden by the actual deploy args
|
|
72
|
+
return {
|
|
73
|
+
factory: viem_1.zeroAddress,
|
|
74
|
+
factoryData: viem_1.zeroHash,
|
|
75
|
+
salt: viem_1.zeroHash,
|
|
76
|
+
implementation: viem_1.zeroAddress,
|
|
77
|
+
initializationCallData: '0x',
|
|
78
|
+
initData: '0x',
|
|
79
|
+
};
|
|
80
|
+
}
|
|
67
81
|
case 'eoa': {
|
|
68
82
|
throw new Error('EOA accounts do not have deploy args');
|
|
69
83
|
}
|
|
@@ -129,6 +143,29 @@ async function getEip7702InitCall(config, signature) {
|
|
|
129
143
|
}
|
|
130
144
|
}
|
|
131
145
|
}
|
|
146
|
+
function getEip712Domain(config, chain) {
|
|
147
|
+
const account = getAccountProvider(config);
|
|
148
|
+
switch (account.type) {
|
|
149
|
+
case 'nexus': {
|
|
150
|
+
return (0, nexus_1.getEip712Domain)(config, chain);
|
|
151
|
+
}
|
|
152
|
+
case 'safe': {
|
|
153
|
+
return (0, safe_1.getEip712Domain)(config, chain);
|
|
154
|
+
}
|
|
155
|
+
case 'kernel': {
|
|
156
|
+
return (0, kernel_1.getEip712Domain)(config, chain);
|
|
157
|
+
}
|
|
158
|
+
case 'startale': {
|
|
159
|
+
return (0, startale_1.getEip712Domain)(config, chain);
|
|
160
|
+
}
|
|
161
|
+
case 'eoa': {
|
|
162
|
+
throw new error_1.Eip712DomainNotAvailableError('EOA accounts do not have an EIP-712 domain');
|
|
163
|
+
}
|
|
164
|
+
default: {
|
|
165
|
+
throw new error_1.Eip712DomainNotAvailableError(`Account type ${account.type} not yet supported`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
132
169
|
function getModuleInstallationCalls(config, module) {
|
|
133
170
|
const address = getAddress(config);
|
|
134
171
|
function getInstallData() {
|
|
@@ -146,6 +183,9 @@ function getModuleInstallationCalls(config, module) {
|
|
|
146
183
|
case 'startale': {
|
|
147
184
|
return [(0, startale_1.getInstallData)(module)];
|
|
148
185
|
}
|
|
186
|
+
case 'passport': {
|
|
187
|
+
return [(0, passport_1.getInstallData)(module)];
|
|
188
|
+
}
|
|
149
189
|
case 'eoa': {
|
|
150
190
|
throw new error_1.ModuleInstallationNotSupportedError(account.type);
|
|
151
191
|
}
|
|
@@ -209,6 +249,9 @@ function getAddress(config) {
|
|
|
209
249
|
case 'startale': {
|
|
210
250
|
return (0, startale_1.getAddress)(config);
|
|
211
251
|
}
|
|
252
|
+
case 'passport': {
|
|
253
|
+
return (0, passport_1.getAddress)(config);
|
|
254
|
+
}
|
|
212
255
|
case 'eoa': {
|
|
213
256
|
if (!config.eoa) {
|
|
214
257
|
throw new error_1.AccountError({
|
|
@@ -244,6 +287,10 @@ async function getPackedSignature(config, signers, chain, validator, hash, trans
|
|
|
244
287
|
const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
|
|
245
288
|
return (0, nexus_1.packSignature)(signature, validator, transformSignature, defaultValidatorAddress);
|
|
246
289
|
}
|
|
290
|
+
case 'passport': {
|
|
291
|
+
const signature = await signFn(hash);
|
|
292
|
+
return (0, passport_1.packSignature)(signature, validator, transformSignature);
|
|
293
|
+
}
|
|
247
294
|
case 'kernel': {
|
|
248
295
|
const signature = await signFn((0, kernel_1.wrapMessageHash)(hash, address));
|
|
249
296
|
return (0, kernel_1.packSignature)(signature, validator, transformSignature);
|
|
@@ -276,6 +323,10 @@ async function getTypedDataPackedSignature(config, signers, chain, validator, pa
|
|
|
276
323
|
const defaultValidatorAddress = (0, nexus_1.getDefaultValidatorAddress)(account.version);
|
|
277
324
|
return (0, nexus_1.packSignature)(signature, validator, transformSignature, defaultValidatorAddress);
|
|
278
325
|
}
|
|
326
|
+
case 'passport': {
|
|
327
|
+
const signature = await signFn(parameters);
|
|
328
|
+
return (0, passport_1.packSignature)(signature, validator, transformSignature);
|
|
329
|
+
}
|
|
279
330
|
case 'kernel': {
|
|
280
331
|
const address = getAddress(config);
|
|
281
332
|
const signMessageFn = (hash) => (0, message_1.sign)(signers, chain, address, hash, false);
|
|
@@ -313,7 +364,7 @@ async function isDeployed(config, chain) {
|
|
|
313
364
|
}
|
|
314
365
|
return (0, viem_1.size)(code) > 0;
|
|
315
366
|
}
|
|
316
|
-
async function deploy(config, chain,
|
|
367
|
+
async function deploy(config, chain, params) {
|
|
317
368
|
const account = getAccountProvider(config);
|
|
318
369
|
if (account.type === 'eoa') {
|
|
319
370
|
return false;
|
|
@@ -327,10 +378,10 @@ async function deploy(config, chain, session) {
|
|
|
327
378
|
await deployWithBundler(chain, config);
|
|
328
379
|
}
|
|
329
380
|
else {
|
|
330
|
-
await deployWithIntent(chain, config);
|
|
381
|
+
await deployWithIntent(chain, config, params?.sponsored ?? false);
|
|
331
382
|
}
|
|
332
|
-
if (session) {
|
|
333
|
-
await (0, smart_session_1.enableSmartSession)(chain, config, session);
|
|
383
|
+
if (params?.session) {
|
|
384
|
+
await (0, smart_session_1.enableSmartSession)(chain, config, params.session);
|
|
334
385
|
}
|
|
335
386
|
return true;
|
|
336
387
|
}
|
|
@@ -398,7 +449,7 @@ async function setup(config, chain) {
|
|
|
398
449
|
await (0, execution_1.waitForExecution)(config, result, true);
|
|
399
450
|
return true;
|
|
400
451
|
}
|
|
401
|
-
async function deployWithIntent(chain, config) {
|
|
452
|
+
async function deployWithIntent(chain, config, sponsored) {
|
|
402
453
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
403
454
|
chain,
|
|
404
455
|
transport: (0, utils_1.createTransport)(chain, config.provider),
|
|
@@ -410,6 +461,7 @@ async function deployWithIntent(chain, config) {
|
|
|
410
461
|
return;
|
|
411
462
|
}
|
|
412
463
|
const result = await (0, execution_1.sendTransaction)(config, {
|
|
464
|
+
sourceChains: [chain],
|
|
413
465
|
targetChain: chain,
|
|
414
466
|
calls: [
|
|
415
467
|
{
|
|
@@ -417,6 +469,7 @@ async function deployWithIntent(chain, config) {
|
|
|
417
469
|
data: '0x',
|
|
418
470
|
},
|
|
419
471
|
],
|
|
472
|
+
sponsored,
|
|
420
473
|
});
|
|
421
474
|
await (0, execution_1.waitForExecution)(config, result, true);
|
|
422
475
|
}
|
|
@@ -548,6 +601,9 @@ async function getSmartSessionSmartAccount(config, client, chain, session, enabl
|
|
|
548
601
|
case 'kernel': {
|
|
549
602
|
return (0, kernel_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
550
603
|
}
|
|
604
|
+
case 'passport': {
|
|
605
|
+
return (0, passport_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
606
|
+
}
|
|
551
607
|
case 'startale': {
|
|
552
608
|
return (0, startale_1.getSessionSmartAccount)(client, address, session, smartSessionValidator.address, enableData, signFn);
|
|
553
609
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAQ,KAAK,SAAS,EAAE,MAAM,MAAM,CAAA;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,iBAAS,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAQ,KAAK,SAAS,EAAE,MAAM,MAAM,CAAA;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,iBAAS,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAkB3E;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -12,5 +12,9 @@ function createTransport(chain, provider) {
|
|
|
12
12
|
const alchemyUrl = (0, providers_1.getAlchemyUrl)(chain.id, provider.apiKey);
|
|
13
13
|
return (0, viem_1.http)(alchemyUrl);
|
|
14
14
|
}
|
|
15
|
+
case 'custom': {
|
|
16
|
+
const customUrl = (0, providers_1.getCustomUrl)(chain.id, provider.urls);
|
|
17
|
+
return (0, viem_1.http)(customUrl);
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chains_1 = require("viem/chains");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const index_1 = require("./index");
|
|
6
|
+
(0, vitest_1.describe)('JSON-RPC', () => {
|
|
7
|
+
(0, vitest_1.describe)('createTransport', () => {
|
|
8
|
+
(0, vitest_1.test)('Alchemy', () => {
|
|
9
|
+
const transport = (0, index_1.createTransport)(chains_1.base, {
|
|
10
|
+
type: 'alchemy',
|
|
11
|
+
apiKey: '123',
|
|
12
|
+
});
|
|
13
|
+
(0, vitest_1.expect)(transport).toBeDefined();
|
|
14
|
+
});
|
|
15
|
+
(0, vitest_1.test)('Custom', () => {
|
|
16
|
+
const transport = (0, index_1.createTransport)(chains_1.mainnet, {
|
|
17
|
+
type: 'custom',
|
|
18
|
+
urls: {
|
|
19
|
+
[chains_1.mainnet.id]: 'https://my-rpc.example.com',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.expect)(transport).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.test)('Custom throws error when URL not configured for chain', () => {
|
|
25
|
+
(0, vitest_1.expect)(() => (0, index_1.createTransport)(chains_1.mainnet, {
|
|
26
|
+
type: 'custom',
|
|
27
|
+
urls: {
|
|
28
|
+
[chains_1.base.id]: 'https://my-rpc.example.com',
|
|
29
|
+
},
|
|
30
|
+
})).toThrow('No custom provider URL configured for chain 1');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SupportedChain } from '../../orchestrator';
|
|
2
2
|
declare function getAlchemyUrl(chainId: SupportedChain, apiKey: string): string;
|
|
3
|
-
|
|
3
|
+
declare function getCustomUrl(chainId: number, urls: Record<number, string>): string;
|
|
4
|
+
export { getAlchemyUrl, getCustomUrl };
|
|
4
5
|
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/providers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,iBAAS,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAetE;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/providers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,iBAAS,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAetE;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAM3E;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getAlchemyUrl = getAlchemyUrl;
|
|
37
|
+
exports.getCustomUrl = getCustomUrl;
|
|
37
38
|
const sharedConfigs = __importStar(require("@rhinestone/shared-configs"));
|
|
38
39
|
function getAlchemyUrl(chainId, apiKey) {
|
|
39
40
|
const providers = sharedConfigs.providerRegistry ||
|
|
@@ -50,3 +51,10 @@ function getAlchemyUrl(chainId, apiKey) {
|
|
|
50
51
|
.split('${ALCHEMY_API_KEY}')
|
|
51
52
|
.join(apiKey);
|
|
52
53
|
}
|
|
54
|
+
function getCustomUrl(chainId, urls) {
|
|
55
|
+
const url = urls[chainId];
|
|
56
|
+
if (!url) {
|
|
57
|
+
throw new Error(`No custom provider URL configured for chain ${chainId}`);
|
|
58
|
+
}
|
|
59
|
+
return url;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.test.d.ts","sourceRoot":"","sources":["../../../../accounts/json-rpc/providers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const chains_1 = require("viem/chains");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const providers_1 = require("./providers");
|
|
6
|
+
(0, vitest_1.describe)('Providers', () => {
|
|
7
|
+
(0, vitest_1.describe)('Alchemy', () => {
|
|
8
|
+
(0, vitest_1.test)('Network', () => {
|
|
9
|
+
const mockApiKey = '123';
|
|
10
|
+
(0, vitest_1.expect)((0, providers_1.getAlchemyUrl)(chains_1.arbitrum.id, mockApiKey)).toBe('https://arb-mainnet.g.alchemy.com/v2/123');
|
|
11
|
+
(0, vitest_1.expect)((0, providers_1.getAlchemyUrl)(chains_1.sepolia.id, mockApiKey)).toBe('https://eth-sepolia.g.alchemy.com/v2/123');
|
|
12
|
+
(0, vitest_1.expect)((0, providers_1.getAlchemyUrl)(chains_1.polygon.id, mockApiKey)).toBe('https://polygon-mainnet.g.alchemy.com/v2/123');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
(0, vitest_1.describe)('Custom', () => {
|
|
16
|
+
(0, vitest_1.test)('Returns URL for configured chain', () => {
|
|
17
|
+
const urls = {
|
|
18
|
+
[chains_1.arbitrum.id]: 'https://my-rpc.example.com/mainnet',
|
|
19
|
+
[chains_1.sepolia.id]: 'https://my-rpc.example.com/sepolia',
|
|
20
|
+
};
|
|
21
|
+
(0, vitest_1.expect)((0, providers_1.getCustomUrl)(chains_1.arbitrum.id, urls)).toBe('https://my-rpc.example.com/mainnet');
|
|
22
|
+
(0, vitest_1.expect)((0, providers_1.getCustomUrl)(chains_1.sepolia.id, urls)).toBe('https://my-rpc.example.com/sepolia');
|
|
23
|
+
});
|
|
24
|
+
(0, vitest_1.test)('Throws error when chain not configured', () => {
|
|
25
|
+
const urls = {
|
|
26
|
+
[chains_1.arbitrum.id]: 'https://my-rpc.example.com/mainnet',
|
|
27
|
+
};
|
|
28
|
+
(0, vitest_1.expect)(() => (0, providers_1.getCustomUrl)(chains_1.sepolia.id, urls)).toThrow('No custom provider URL configured for chain 11155111');
|
|
29
|
+
});
|
|
30
|
+
(0, vitest_1.test)('Accepts HTTP URLs', () => {
|
|
31
|
+
const urls = {
|
|
32
|
+
[chains_1.arbitrum.id]: 'http://localhost:8545',
|
|
33
|
+
};
|
|
34
|
+
(0, vitest_1.expect)((0, providers_1.getCustomUrl)(chains_1.arbitrum.id, urls)).toBe('http://localhost:8545');
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.test)('Accepts HTTPS URLs', () => {
|
|
37
|
+
const urls = {
|
|
38
|
+
[chains_1.arbitrum.id]: 'https://my-rpc.example.com',
|
|
39
|
+
};
|
|
40
|
+
(0, vitest_1.expect)((0, providers_1.getCustomUrl)(chains_1.arbitrum.id, urls)).toBe('https://my-rpc.example.com');
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Abi, type Address, type Hex, type PublicClient } from 'viem';
|
|
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
4
|
import type { EnableSessionData } from '../modules/validators/smart-sessions';
|
|
@@ -12,11 +12,18 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
12
12
|
salt: `0x${string}`;
|
|
13
13
|
};
|
|
14
14
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
15
|
+
declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain): {
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
chainId: number;
|
|
19
|
+
verifyingContract: `0x${string}`;
|
|
20
|
+
salt: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
21
|
+
};
|
|
15
22
|
declare function getInstallData(module: Module): Hex[];
|
|
16
23
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
17
24
|
declare function wrapMessageHash(messageHash: Hex, accountAddress: Hex): Hex;
|
|
18
25
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
19
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">>>;
|
|
20
27
|
declare function getGuardianSmartAccount(client: PublicClient, address: Address, guardians: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
21
|
-
export { getInstallData, getAddress, getDeployArgs, getSmartAccount, getSessionSmartAccount, getGuardianSmartAccount, packSignature, wrapMessageHash, };
|
|
28
|
+
export { getEip712Domain, getInstallData, getAddress, getDeployArgs, getSmartAccount, getSessionSmartAccount, getGuardianSmartAccount, packSignature, wrapMessageHash, };
|
|
22
29
|
//# 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,
|
|
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;AAQ1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAK1E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAgBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;EA+ErD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBASlD;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,sBAAsB,CACnC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,OAAO,EACzB,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACpC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEA0ClC;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,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,eAAe,GAChB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEip712Domain = getEip712Domain;
|
|
3
4
|
exports.getInstallData = getInstallData;
|
|
4
5
|
exports.getAddress = getAddress;
|
|
5
6
|
exports.getDeployArgs = getDeployArgs;
|
|
@@ -97,6 +98,18 @@ function getAddress(config) {
|
|
|
97
98
|
salt: actualSalt,
|
|
98
99
|
});
|
|
99
100
|
}
|
|
101
|
+
function getEip712Domain(config, chain) {
|
|
102
|
+
if (config.initData) {
|
|
103
|
+
throw new error_1.Eip712DomainNotAvailableError('Existing Kernel accounts are not yet supported');
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
name: 'Kernel',
|
|
107
|
+
version: KERNEL_VERSION,
|
|
108
|
+
chainId: chain.id,
|
|
109
|
+
verifyingContract: getAddress(config),
|
|
110
|
+
salt: viem_1.zeroHash,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
100
113
|
function getInstallData(module) {
|
|
101
114
|
const HOOK_INSTALLED_ADDRESS = '0x0000000000000000000000000000000000000001';
|
|
102
115
|
switch (module.type) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Abi, Account, Address, Hex, PublicClient } from 'viem';
|
|
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
4
|
import type { EnableSessionData } from '../modules/validators/smart-sessions';
|
|
@@ -13,6 +13,13 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
13
13
|
initializationCallData: `0x${string}`;
|
|
14
14
|
};
|
|
15
15
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
16
|
+
declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain): {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
chainId: number;
|
|
20
|
+
verifyingContract: `0x${string}`;
|
|
21
|
+
salt: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
22
|
+
};
|
|
16
23
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
17
24
|
declare function getDefaultValidatorAddress(version: '1.0.2' | '1.2.0' | 'rhinestone-1.0.0-beta' | 'rhinestone-1.0.0' | undefined): Address;
|
|
18
25
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex, defaultValidatorAddress?: Address): Promise<`0x${string}`>;
|
|
@@ -24,5 +31,5 @@ declare function getEip7702InitCall(config: RhinestoneAccountConfig, signature:
|
|
|
24
31
|
initData: `0x${string}`;
|
|
25
32
|
contract: `0x${string}`;
|
|
26
33
|
}>;
|
|
27
|
-
export { getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getSessionSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
34
|
+
export { getEip712Domain, getInstallData, getAddress, getDefaultValidatorAddress, packSignature, getDeployArgs, getSmartAccount, getSessionSmartAccount, getGuardianSmartAccount, signEip7702InitData, getEip7702InitCall, };
|
|
28
35
|
//# sourceMappingURL=nexus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"nexus.d.ts","sourceRoot":"","sources":["../../../accounts/nexus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAe3E,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAS/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAM1E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAqBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;;EAoJrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAgClD;AAED,iBA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