@rhinestone/sdk 1.0.41-alpha.0 → 1.0.41
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 +114 -0
- package/dist/src/accounts/error.d.ts.map +1 -0
- package/dist/src/accounts/error.js +174 -0
- package/dist/src/accounts/index.d.ts +50 -0
- package/dist/src/accounts/index.d.ts.map +1 -0
- package/dist/src/accounts/index.js +669 -0
- package/dist/src/accounts/index.test.d.ts +2 -0
- package/dist/src/accounts/index.test.d.ts.map +1 -0
- package/dist/src/accounts/index.test.js +33 -0
- package/dist/src/accounts/json-rpc/index.d.ts +5 -0
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.js +20 -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 +5 -0
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.js +22 -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 +29 -0
- package/dist/src/accounts/kernel.d.ts.map +1 -0
- package/dist/src/accounts/kernel.js +297 -0
- package/dist/src/accounts/kernel.test.d.ts +2 -0
- package/dist/src/accounts/kernel.test.d.ts.map +1 -0
- package/dist/src/accounts/kernel.test.js +132 -0
- package/dist/src/accounts/nexus.d.ts +35 -0
- package/dist/src/accounts/nexus.d.ts.map +1 -0
- package/dist/src/accounts/nexus.js +471 -0
- package/dist/src/accounts/nexus.test.d.ts +2 -0
- package/dist/src/accounts/nexus.test.d.ts.map +1 -0
- package/dist/src/accounts/nexus.test.js +118 -0
- 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 +35 -0
- package/dist/src/accounts/safe.d.ts.map +1 -0
- package/dist/src/accounts/safe.js +365 -0
- package/dist/src/accounts/safe.test.d.ts +2 -0
- package/dist/src/accounts/safe.test.d.ts.map +1 -0
- package/dist/src/accounts/safe.test.js +118 -0
- package/dist/src/accounts/signing/common.d.ts +27 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -0
- package/dist/src/accounts/signing/common.js +183 -0
- package/dist/src/accounts/signing/message.d.ts +5 -0
- package/dist/src/accounts/signing/message.d.ts.map +1 -0
- package/dist/src/accounts/signing/message.js +47 -0
- package/dist/src/accounts/signing/passkeys.d.ts +36 -0
- package/dist/src/accounts/signing/passkeys.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.js +125 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts +2 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.test.js +88 -0
- package/dist/src/accounts/signing/typedData.d.ts +5 -0
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
- package/dist/src/accounts/signing/typedData.js +35 -0
- package/dist/src/accounts/startale.d.ts +27 -0
- package/dist/src/accounts/startale.d.ts.map +1 -0
- package/dist/src/accounts/startale.js +116 -0
- package/dist/src/accounts/startale.test.d.ts +2 -0
- package/dist/src/accounts/startale.test.d.ts.map +1 -0
- package/dist/src/accounts/startale.test.js +92 -0
- package/dist/src/accounts/utils.d.ts +33 -0
- package/dist/src/accounts/utils.d.ts.map +1 -0
- package/dist/src/accounts/utils.js +208 -0
- package/dist/src/accounts/utils.test.d.ts +2 -0
- package/dist/src/accounts/utils.test.d.ts.map +1 -0
- package/dist/src/accounts/utils.test.js +49 -0
- package/dist/src/accounts/walletClient.d.ts +34 -0
- package/dist/src/accounts/walletClient.d.ts.map +1 -0
- package/dist/src/accounts/walletClient.js +121 -0
- package/dist/src/actions/compact.d.ts +13 -0
- package/dist/src/actions/compact.d.ts.map +1 -0
- package/dist/src/actions/compact.js +210 -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/ecdsa.d.ts +35 -0
- package/dist/src/actions/ecdsa.d.ts.map +1 -0
- package/dist/src/actions/ecdsa.js +114 -0
- package/dist/src/actions/ecdsa.test.d.ts +2 -0
- package/dist/src/actions/ecdsa.test.d.ts.map +1 -0
- package/dist/src/actions/ecdsa.test.js +99 -0
- package/dist/src/actions/index.d.ts +17 -0
- package/dist/src/actions/index.d.ts.map +1 -0
- package/dist/src/actions/index.js +53 -0
- package/dist/src/actions/mfa.d.ts +37 -0
- package/dist/src/actions/mfa.d.ts.map +1 -0
- package/dist/src/actions/mfa.js +133 -0
- package/dist/src/actions/passkeys.d.ts +37 -0
- package/dist/src/actions/passkeys.d.ts.map +1 -0
- package/dist/src/actions/passkeys.js +129 -0
- package/dist/src/actions/passkeys.test.d.ts +2 -0
- package/dist/src/actions/passkeys.test.d.ts.map +1 -0
- package/dist/src/actions/passkeys.test.js +54 -0
- package/dist/src/actions/recovery.d.ts +33 -0
- package/dist/src/actions/recovery.d.ts.map +1 -0
- package/dist/src/actions/recovery.js +193 -0
- package/dist/src/actions/recovery.test.d.ts +2 -0
- package/dist/src/actions/recovery.test.d.ts.map +1 -0
- package/dist/src/actions/recovery.test.js +168 -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 +5 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/errors/index.js +53 -0
- package/dist/src/execution/compact.d.ts +151 -0
- package/dist/src/execution/compact.d.ts.map +1 -0
- package/dist/src/execution/compact.js +122 -0
- package/dist/src/execution/error.d.ts +61 -0
- package/dist/src/execution/error.d.ts.map +1 -0
- package/dist/src/execution/error.js +87 -0
- package/dist/src/execution/index.d.ts +41 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +233 -0
- package/dist/src/execution/permit2.d.ts +148 -0
- package/dist/src/execution/permit2.d.ts.map +1 -0
- package/dist/src/execution/permit2.js +291 -0
- 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 +13 -0
- package/dist/src/execution/smart-session.d.ts.map +1 -0
- package/dist/src/execution/smart-session.js +178 -0
- package/dist/src/execution/types.d.ts +36 -0
- package/dist/src/execution/types.d.ts.map +1 -0
- package/dist/src/execution/types.js +2 -0
- package/dist/src/execution/utils.d.ts +83 -0
- package/dist/src/execution/utils.d.ts.map +1 -0
- package/dist/src/execution/utils.js +705 -0
- package/dist/src/index.d.ts +74 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +317 -0
- package/dist/src/modules/abi/smart-sessions.d.ts +104 -0
- package/dist/src/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-sessions.js +131 -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 +30 -0
- package/dist/src/modules/common.d.ts.map +1 -0
- package/dist/src/modules/common.js +42 -0
- package/dist/src/modules/index.d.ts +10 -0
- package/dist/src/modules/index.d.ts.map +1 -0
- package/dist/src/modules/index.js +94 -0
- package/dist/src/modules/index.test.d.ts +2 -0
- package/dist/src/modules/index.test.d.ts.map +1 -0
- package/dist/src/modules/index.test.js +81 -0
- 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/read.d.ts +9 -0
- package/dist/src/modules/read.d.ts.map +1 -0
- package/dist/src/modules/read.js +125 -0
- package/dist/src/modules/validators/core.d.ts +29 -0
- package/dist/src/modules/validators/core.d.ts.map +1 -0
- package/dist/src/modules/validators/core.js +278 -0
- package/dist/src/modules/validators/core.test.d.ts +2 -0
- package/dist/src/modules/validators/core.test.d.ts.map +1 -0
- package/dist/src/modules/validators/core.test.js +101 -0
- package/dist/src/modules/validators/index.d.ts +4 -0
- package/dist/src/modules/validators/index.d.ts.map +1 -0
- package/dist/src/modules/validators/index.js +15 -0
- package/dist/src/modules/validators/smart-sessions.d.ts +96 -0
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions.js +497 -0
- package/dist/src/modules/validators/smart-sessions.test.d.ts +2 -0
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions.test.js +219 -0
- package/dist/src/orchestrator/client.d.ts +27 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -0
- package/dist/src/orchestrator/client.js +354 -0
- package/dist/src/orchestrator/consts.d.ts +5 -0
- package/dist/src/orchestrator/consts.d.ts.map +1 -0
- package/dist/src/orchestrator/consts.js +9 -0
- package/dist/src/orchestrator/error.d.ts +232 -0
- package/dist/src/orchestrator/error.d.ts.map +1 -0
- package/dist/src/orchestrator/error.js +268 -0
- package/dist/src/orchestrator/index.d.ts +10 -0
- package/dist/src/orchestrator/index.d.ts.map +1 -0
- package/dist/src/orchestrator/index.js +57 -0
- package/dist/src/orchestrator/registry.d.ts +22 -0
- package/dist/src/orchestrator/registry.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.js +121 -0
- package/dist/src/orchestrator/registry.test.d.ts +2 -0
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +150 -0
- package/dist/src/orchestrator/types.d.ts +295 -0
- package/dist/src/orchestrator/types.d.ts.map +1 -0
- package/dist/src/orchestrator/types.js +17 -0
- package/dist/src/orchestrator/utils.d.ts +3 -0
- package/dist/src/orchestrator/utils.d.ts.map +1 -0
- package/dist/src/orchestrator/utils.js +24 -0
- package/dist/src/types.d.ts +284 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/utils/index.d.ts +26 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +63 -0
- package/dist/test/consts.d.ts +10 -0
- package/dist/test/consts.d.ts.map +1 -0
- package/dist/test/consts.js +22 -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 +1 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import type { Account, Address, Chain, Hex } from 'viem';
|
|
2
|
+
import type { WebAuthnAccount } from 'viem/account-abstraction';
|
|
3
|
+
import type { ModuleType } from './modules/common';
|
|
4
|
+
import type { EnableSessionData } from './modules/validators/smart-sessions';
|
|
5
|
+
import type { SettlementLayer } from './orchestrator/types';
|
|
6
|
+
type AccountType = 'safe' | 'nexus' | 'kernel' | 'startale' | 'passport' | 'eoa';
|
|
7
|
+
interface SafeAccount {
|
|
8
|
+
type: 'safe';
|
|
9
|
+
version?: '1.4.1';
|
|
10
|
+
adapter?: '1.0.0' | '2.0.0';
|
|
11
|
+
nonce?: bigint;
|
|
12
|
+
}
|
|
13
|
+
interface NexusAccount {
|
|
14
|
+
type: 'nexus';
|
|
15
|
+
version?: '1.0.2' | '1.2.0' | 'rhinestone-1.0.0-beta' | 'rhinestone-1.0.0';
|
|
16
|
+
salt?: Hex;
|
|
17
|
+
}
|
|
18
|
+
interface KernelAccount {
|
|
19
|
+
type: 'kernel';
|
|
20
|
+
version?: '3.1' | '3.2' | '3.3';
|
|
21
|
+
salt?: Hex;
|
|
22
|
+
}
|
|
23
|
+
interface StartaleAccount {
|
|
24
|
+
type: 'startale';
|
|
25
|
+
salt?: Hex;
|
|
26
|
+
}
|
|
27
|
+
interface PassportAccount {
|
|
28
|
+
type: 'passport';
|
|
29
|
+
}
|
|
30
|
+
interface EoaAccount {
|
|
31
|
+
type: 'eoa';
|
|
32
|
+
}
|
|
33
|
+
type AccountProviderConfig = SafeAccount | NexusAccount | KernelAccount | StartaleAccount | PassportAccount | EoaAccount;
|
|
34
|
+
interface OwnableValidatorConfig {
|
|
35
|
+
type: 'ecdsa';
|
|
36
|
+
accounts: Account[];
|
|
37
|
+
threshold?: number;
|
|
38
|
+
module?: Address;
|
|
39
|
+
}
|
|
40
|
+
interface ENSValidatorConfig {
|
|
41
|
+
type: 'ens';
|
|
42
|
+
accounts: Account[];
|
|
43
|
+
threshold?: number;
|
|
44
|
+
ownerExpirations: number[];
|
|
45
|
+
module?: Address;
|
|
46
|
+
}
|
|
47
|
+
interface WebauthnValidatorConfig {
|
|
48
|
+
type: 'passkey';
|
|
49
|
+
accounts: WebAuthnAccount[];
|
|
50
|
+
threshold?: number;
|
|
51
|
+
module?: Address;
|
|
52
|
+
}
|
|
53
|
+
interface MultiFactorValidatorConfig {
|
|
54
|
+
type: 'multi-factor';
|
|
55
|
+
validators: (OwnableValidatorConfig | ENSValidatorConfig | WebauthnValidatorConfig)[];
|
|
56
|
+
threshold?: number;
|
|
57
|
+
module?: Address;
|
|
58
|
+
}
|
|
59
|
+
type ProviderConfig = {
|
|
60
|
+
type: 'alchemy';
|
|
61
|
+
apiKey: string;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'custom';
|
|
64
|
+
urls: Record<number, string>;
|
|
65
|
+
};
|
|
66
|
+
type BundlerConfig = {
|
|
67
|
+
type: 'pimlico' | 'biconomy';
|
|
68
|
+
apiKey: string;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'custom';
|
|
71
|
+
url: string | Record<number, string>;
|
|
72
|
+
};
|
|
73
|
+
type PaymasterConfig = {
|
|
74
|
+
type: 'pimlico' | 'biconomy';
|
|
75
|
+
apiKey: string;
|
|
76
|
+
} | {
|
|
77
|
+
type: 'custom';
|
|
78
|
+
url: string | Record<number, string>;
|
|
79
|
+
};
|
|
80
|
+
type OwnerSet = OwnableValidatorConfig | ENSValidatorConfig | WebauthnValidatorConfig | MultiFactorValidatorConfig;
|
|
81
|
+
interface SudoPolicy {
|
|
82
|
+
type: 'sudo';
|
|
83
|
+
}
|
|
84
|
+
interface UniversalActionPolicy {
|
|
85
|
+
type: 'universal-action';
|
|
86
|
+
valueLimitPerUse?: bigint;
|
|
87
|
+
rules: [UniversalActionPolicyParamRule, ...UniversalActionPolicyParamRule[]];
|
|
88
|
+
}
|
|
89
|
+
interface UniversalActionPolicyParamRule {
|
|
90
|
+
condition: UniversalActionPolicyParamCondition;
|
|
91
|
+
calldataOffset: bigint;
|
|
92
|
+
usageLimit?: bigint;
|
|
93
|
+
referenceValue: Hex | bigint;
|
|
94
|
+
}
|
|
95
|
+
type UniversalActionPolicyParamCondition = 'equal' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'notEqual' | 'inRange';
|
|
96
|
+
interface SpendingLimitsPolicy {
|
|
97
|
+
type: 'spending-limits';
|
|
98
|
+
limits: {
|
|
99
|
+
token: Address;
|
|
100
|
+
amount: bigint;
|
|
101
|
+
}[];
|
|
102
|
+
}
|
|
103
|
+
interface TimeFramePolicy {
|
|
104
|
+
type: 'time-frame';
|
|
105
|
+
validUntil: number;
|
|
106
|
+
validAfter: number;
|
|
107
|
+
}
|
|
108
|
+
interface UsageLimitPolicy {
|
|
109
|
+
type: 'usage-limit';
|
|
110
|
+
limit: bigint;
|
|
111
|
+
}
|
|
112
|
+
interface ValueLimitPolicy {
|
|
113
|
+
type: 'value-limit';
|
|
114
|
+
limit: bigint;
|
|
115
|
+
}
|
|
116
|
+
type Policy = SudoPolicy | UniversalActionPolicy | SpendingLimitsPolicy | TimeFramePolicy | UsageLimitPolicy | ValueLimitPolicy;
|
|
117
|
+
interface Action {
|
|
118
|
+
target: Address;
|
|
119
|
+
selector: Hex;
|
|
120
|
+
policies?: [Policy, ...Policy[]];
|
|
121
|
+
}
|
|
122
|
+
interface Session {
|
|
123
|
+
owners: OwnerSet;
|
|
124
|
+
chain?: Chain;
|
|
125
|
+
policies?: [Policy, ...Policy[]];
|
|
126
|
+
actions?: [Action, ...Action[]];
|
|
127
|
+
signing?: {
|
|
128
|
+
allowedContent: {
|
|
129
|
+
domainSeparator: string;
|
|
130
|
+
contentName: string[];
|
|
131
|
+
}[];
|
|
132
|
+
policies?: [Policy, ...Policy[]];
|
|
133
|
+
};
|
|
134
|
+
salt?: Hex;
|
|
135
|
+
}
|
|
136
|
+
interface Recovery {
|
|
137
|
+
guardians: Account[];
|
|
138
|
+
threshold?: number;
|
|
139
|
+
}
|
|
140
|
+
interface ModuleInput {
|
|
141
|
+
type: ModuleType;
|
|
142
|
+
address: Address;
|
|
143
|
+
initData?: Hex;
|
|
144
|
+
deInitData?: Hex;
|
|
145
|
+
additionalContext?: Hex;
|
|
146
|
+
}
|
|
147
|
+
interface RhinestoneAccountConfig {
|
|
148
|
+
account?: AccountProviderConfig;
|
|
149
|
+
owners?: OwnerSet;
|
|
150
|
+
experimental_sessions?: {
|
|
151
|
+
enabled: boolean;
|
|
152
|
+
module?: Address;
|
|
153
|
+
compatibilityFallback?: Address;
|
|
154
|
+
};
|
|
155
|
+
recovery?: Recovery;
|
|
156
|
+
eoa?: Account;
|
|
157
|
+
modules?: ModuleInput[];
|
|
158
|
+
initData?: {
|
|
159
|
+
address: Address;
|
|
160
|
+
factory: Address;
|
|
161
|
+
factoryData: Hex;
|
|
162
|
+
intentExecutorInstalled: boolean;
|
|
163
|
+
} | {
|
|
164
|
+
address: Address;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
interface RhinestoneSDKConfig {
|
|
168
|
+
apiKey?: string;
|
|
169
|
+
provider?: ProviderConfig;
|
|
170
|
+
bundler?: BundlerConfig;
|
|
171
|
+
paymaster?: PaymasterConfig;
|
|
172
|
+
/**
|
|
173
|
+
* @internal
|
|
174
|
+
* Optional orchestrator URL override for internal testing - do not use
|
|
175
|
+
*/
|
|
176
|
+
endpointUrl?: string;
|
|
177
|
+
/**
|
|
178
|
+
* @internal
|
|
179
|
+
* Optional intent executor address override for internal testing - do not use
|
|
180
|
+
*/
|
|
181
|
+
useDevContracts?: boolean;
|
|
182
|
+
}
|
|
183
|
+
type RhinestoneConfig = RhinestoneAccountConfig & RhinestoneSDKConfig;
|
|
184
|
+
type TokenSymbol = 'ETH' | 'WETH' | 'USDC' | 'USDT';
|
|
185
|
+
interface CalldataInput {
|
|
186
|
+
to: Address | TokenSymbol;
|
|
187
|
+
data?: Hex;
|
|
188
|
+
value?: bigint;
|
|
189
|
+
}
|
|
190
|
+
interface CallResolveContext {
|
|
191
|
+
config: RhinestoneConfig;
|
|
192
|
+
chain: Chain;
|
|
193
|
+
accountAddress: Address;
|
|
194
|
+
}
|
|
195
|
+
interface LazyCallInput {
|
|
196
|
+
resolve: (context: CallResolveContext) => Promise<CalldataInput | CalldataInput[]>;
|
|
197
|
+
}
|
|
198
|
+
type CallInput = CalldataInput | LazyCallInput;
|
|
199
|
+
interface Call {
|
|
200
|
+
to: Address;
|
|
201
|
+
data: Hex;
|
|
202
|
+
value: bigint;
|
|
203
|
+
}
|
|
204
|
+
interface TokenRequest {
|
|
205
|
+
address: Address | TokenSymbol;
|
|
206
|
+
amount: bigint;
|
|
207
|
+
}
|
|
208
|
+
type SourceAssetInput = (Address | TokenSymbol)[] | {
|
|
209
|
+
[chainId in number]?: (Address | TokenSymbol)[];
|
|
210
|
+
};
|
|
211
|
+
type OwnerSignerSet = {
|
|
212
|
+
type: 'owner';
|
|
213
|
+
kind: 'ecdsa';
|
|
214
|
+
accounts: Account[];
|
|
215
|
+
module?: Address;
|
|
216
|
+
} | {
|
|
217
|
+
type: 'owner';
|
|
218
|
+
kind: 'passkey';
|
|
219
|
+
accounts: WebAuthnAccount[];
|
|
220
|
+
module?: Address;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'owner';
|
|
223
|
+
kind: 'multi-factor';
|
|
224
|
+
validators: ({
|
|
225
|
+
type: 'ecdsa';
|
|
226
|
+
id: number | Hex;
|
|
227
|
+
accounts: Account[];
|
|
228
|
+
} | {
|
|
229
|
+
type: 'passkey';
|
|
230
|
+
id: number | Hex;
|
|
231
|
+
accounts: WebAuthnAccount[];
|
|
232
|
+
})[];
|
|
233
|
+
module?: Address;
|
|
234
|
+
};
|
|
235
|
+
interface SessionSignerSet {
|
|
236
|
+
type: 'session';
|
|
237
|
+
session: Session;
|
|
238
|
+
enableData?: EnableSessionData;
|
|
239
|
+
}
|
|
240
|
+
interface GuardiansSignerSet {
|
|
241
|
+
type: 'guardians';
|
|
242
|
+
guardians: Account[];
|
|
243
|
+
}
|
|
244
|
+
type SignerSet = OwnerSignerSet | SessionSignerSet | GuardiansSignerSet;
|
|
245
|
+
type Sponsorship = boolean | {
|
|
246
|
+
gas: boolean;
|
|
247
|
+
bridging: boolean;
|
|
248
|
+
swaps: boolean;
|
|
249
|
+
};
|
|
250
|
+
interface BaseTransaction {
|
|
251
|
+
calls?: CallInput[];
|
|
252
|
+
tokenRequests?: TokenRequest[];
|
|
253
|
+
recipient?: RhinestoneAccountConfig | Address;
|
|
254
|
+
gasLimit?: bigint;
|
|
255
|
+
signers?: SignerSet;
|
|
256
|
+
sponsored?: Sponsorship;
|
|
257
|
+
eip7702InitSignature?: Hex;
|
|
258
|
+
sourceAssets?: SourceAssetInput;
|
|
259
|
+
feeAsset?: Address | TokenSymbol;
|
|
260
|
+
settlementLayers?: SettlementLayer[];
|
|
261
|
+
lockFunds?: boolean;
|
|
262
|
+
experimental_accountOverride?: {
|
|
263
|
+
setupOps?: {
|
|
264
|
+
to: Address;
|
|
265
|
+
data: Hex;
|
|
266
|
+
}[];
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
interface SameChainTransaction extends BaseTransaction {
|
|
270
|
+
chain: Chain;
|
|
271
|
+
}
|
|
272
|
+
interface CrossChainTransaction extends BaseTransaction {
|
|
273
|
+
sourceChains?: Chain[];
|
|
274
|
+
targetChain: Chain;
|
|
275
|
+
}
|
|
276
|
+
interface UserOperationTransaction {
|
|
277
|
+
calls: CallInput[];
|
|
278
|
+
gasLimit?: bigint;
|
|
279
|
+
signers?: SignerSet;
|
|
280
|
+
chain: Chain;
|
|
281
|
+
}
|
|
282
|
+
type Transaction = SameChainTransaction | CrossChainTransaction;
|
|
283
|
+
export type { AccountType, SafeAccount, NexusAccount, KernelAccount, StartaleAccount, PassportAccount, EoaAccount, RhinestoneAccountConfig, RhinestoneSDKConfig, RhinestoneConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, UserOperationTransaction, TokenSymbol, CalldataInput, LazyCallInput, CallInput, CallResolveContext, Call, Sponsorship, TokenRequest, SourceAssetInput, OwnerSet, OwnableValidatorConfig, ENSValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, Session, Recovery, ModuleType, ModuleInput, Policy, UniversalActionPolicyParamCondition, };
|
|
284
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,KAAK,CAAA;AAEhF,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,C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AgB,CAAC,EAAE,eAAe,EAAE,CAAA;IACpC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4BAA4B,CAAC,EAAE;QAC7B,QAAQ,CAAC,EAAE;YACT,EAAE,EAAE,OAAO,CAAA;YACX,IAAI,EAAE,GAAG,CAAA;SACV,EAAE,CAAA;KACJ,CAAA;CACF;AAED,UAAU,oBAAqB,SAAQ,eAAe;IACpD,KAAK,EAAE,KAAK,CAAA;CACb;AAED,UAAU,qBAAsB,SAAQ,eAAe;IACrD,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB,WAAW,EAAE,KAAK,CAAA;CACnB;AAED,UAAU,wBAAwB;IAChC,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,KAAK,CAAA;CACb;AAED,KAAK,WAAW,GAAG,oBAAoB,GAAG,qBAAqB,CAAA;AAE/D,YAAY,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EACf,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,IAAI,EACJ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,SAAS,EACT,OAAO,EACP,QAAQ,EACR,UAAU,EACV,WAAW,EACX,MAAM,EACN,mCAAmC,GACpC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Account, Address, Hex } from 'viem';
|
|
2
|
+
import { getSetup as experimental_getModuleSetup } from '../modules';
|
|
3
|
+
import type { AccountProviderConfig, OwnerSet } from '../types';
|
|
4
|
+
declare function experimental_getV0InitData(config: {
|
|
5
|
+
account?: AccountProviderConfig;
|
|
6
|
+
owners?: OwnerSet;
|
|
7
|
+
}): {
|
|
8
|
+
address: Address;
|
|
9
|
+
factory: Address;
|
|
10
|
+
factoryData: Hex;
|
|
11
|
+
intentExecutorInstalled: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare function experimental_getRhinestoneInitData(config: {
|
|
14
|
+
account?: AccountProviderConfig;
|
|
15
|
+
owners?: OwnerSet;
|
|
16
|
+
}): {
|
|
17
|
+
address: Address;
|
|
18
|
+
factory: Address;
|
|
19
|
+
factoryData: Hex;
|
|
20
|
+
intentExecutorInstalled: boolean;
|
|
21
|
+
} | {
|
|
22
|
+
address: Address;
|
|
23
|
+
};
|
|
24
|
+
declare function toViewOnlyAccount(address: Address): Account;
|
|
25
|
+
export { experimental_getV0InitData, experimental_getModuleSetup, experimental_getRhinestoneInitData, toViewOnlyAccount, };
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAGjD,OAAO,EAAE,QAAQ,IAAI,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE/D,iBAAS,0BAA0B,CAAC,MAAM,EAAE;IAC1C,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB,GAAG;IACF,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,GAAG,CAAA;IAChB,uBAAuB,EAAE,OAAO,CAAA;CACjC,CAgBA;AAED,iBAAS,kCAAkC,CAAC,MAAM,EAAE;IAClD,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB,GACG;IACE,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,GAAG,CAAA;IAChB,uBAAuB,EAAE,OAAO,CAAA;CACjC,GACD;IACE,OAAO,EAAE,OAAO,CAAA;CACjB,CAmBJ;AAED,iBAAS,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAcpD;AAED,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,kCAAkC,EAClC,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.experimental_getModuleSetup = void 0;
|
|
4
|
+
exports.experimental_getV0InitData = experimental_getV0InitData;
|
|
5
|
+
exports.experimental_getRhinestoneInitData = experimental_getRhinestoneInitData;
|
|
6
|
+
exports.toViewOnlyAccount = toViewOnlyAccount;
|
|
7
|
+
const accounts_1 = require("viem/accounts");
|
|
8
|
+
const accounts_2 = require("../accounts");
|
|
9
|
+
const modules_1 = require("../modules");
|
|
10
|
+
Object.defineProperty(exports, "experimental_getModuleSetup", { enumerable: true, get: function () { return modules_1.getSetup; } });
|
|
11
|
+
function experimental_getV0InitData(config) {
|
|
12
|
+
const initCode = (0, accounts_2.getV0InitCode)(config);
|
|
13
|
+
if (!initCode) {
|
|
14
|
+
throw new Error('Init code not available');
|
|
15
|
+
}
|
|
16
|
+
if (!('factory' in initCode)) {
|
|
17
|
+
throw new Error('Factory not available');
|
|
18
|
+
}
|
|
19
|
+
const { factory, factoryData } = initCode;
|
|
20
|
+
const address = (0, accounts_2.getAddress)(config);
|
|
21
|
+
return {
|
|
22
|
+
address,
|
|
23
|
+
factory,
|
|
24
|
+
factoryData,
|
|
25
|
+
intentExecutorInstalled: true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function experimental_getRhinestoneInitData(config) {
|
|
29
|
+
const initCode = (0, accounts_2.getInitCode)(config);
|
|
30
|
+
if (!initCode) {
|
|
31
|
+
throw new Error('Init code not available');
|
|
32
|
+
}
|
|
33
|
+
const address = (0, accounts_2.getAddress)(config);
|
|
34
|
+
if ('factory' in initCode) {
|
|
35
|
+
const { factory, factoryData } = initCode;
|
|
36
|
+
return {
|
|
37
|
+
address,
|
|
38
|
+
factory,
|
|
39
|
+
factoryData,
|
|
40
|
+
intentExecutorInstalled: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return {
|
|
45
|
+
address,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function toViewOnlyAccount(address) {
|
|
50
|
+
const errorMessage = 'Signing is not supported for view-only accounts';
|
|
51
|
+
return (0, accounts_1.toAccount)({
|
|
52
|
+
address,
|
|
53
|
+
signMessage: async () => {
|
|
54
|
+
throw new Error(errorMessage);
|
|
55
|
+
},
|
|
56
|
+
signTypedData: async () => {
|
|
57
|
+
throw new Error(errorMessage);
|
|
58
|
+
},
|
|
59
|
+
signTransaction: async () => {
|
|
60
|
+
throw new Error(errorMessage);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WebAuthnAccount } from 'viem/account-abstraction';
|
|
2
|
+
import { type Account } from 'viem/accounts';
|
|
3
|
+
declare const accountA: Account;
|
|
4
|
+
declare const accountB: Account;
|
|
5
|
+
declare const accountC: Account;
|
|
6
|
+
declare const accountD: Account;
|
|
7
|
+
declare const passkeyAccount: WebAuthnAccount;
|
|
8
|
+
declare const MOCK_API_KEY = "MOCK_KEY";
|
|
9
|
+
export { accountA, accountB, accountC, accountD, passkeyAccount, MOCK_API_KEY };
|
|
10
|
+
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../test/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,OAAO,EAAuB,MAAM,eAAe,CAAA;AAEjE,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,cAAc,EAAE,eAMpB,CAAA;AAEF,QAAA,MAAM,YAAY,aAAa,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MOCK_API_KEY = exports.passkeyAccount = exports.accountD = exports.accountC = exports.accountB = exports.accountA = void 0;
|
|
4
|
+
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
|
+
const accounts_1 = require("viem/accounts");
|
|
6
|
+
const accountA = (0, accounts_1.privateKeyToAccount)('0x2be89d993f98bbaab8b83f1a2830cb9414e19662967c7ba2a0f43d2a9125bd6d');
|
|
7
|
+
exports.accountA = accountA;
|
|
8
|
+
const accountB = (0, accounts_1.privateKeyToAccount)('0x39e2fec1a04c088f939d81de8f1abebdebf899a6cfb9968f9b663a7afba8301b');
|
|
9
|
+
exports.accountB = accountB;
|
|
10
|
+
const accountC = (0, accounts_1.privateKeyToAccount)('0xb63c74af219a3949cf95f5e3a3d20b0137425de053bb03e5cc0f46fe0d19f22f');
|
|
11
|
+
exports.accountC = accountC;
|
|
12
|
+
const accountD = (0, accounts_1.privateKeyToAccount)('0xa4aba81871b7b51fff56bfe441ea7f9a4879dd4bc8ce8c15fdb06dc92e63d1d7');
|
|
13
|
+
exports.accountD = accountD;
|
|
14
|
+
const passkeyAccount = (0, account_abstraction_1.toWebAuthnAccount)({
|
|
15
|
+
credential: {
|
|
16
|
+
id: '9IwX9n6cn-l9SzqFzfQXvDHRuTM',
|
|
17
|
+
publicKey: '0x580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
exports.passkeyAccount = passkeyAccount;
|
|
21
|
+
const MOCK_API_KEY = 'MOCK_KEY';
|
|
22
|
+
exports.MOCK_API_KEY = MOCK_API_KEY;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../test/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAIjC,iBAAS,UAAU,CAAC,KAAK,EAAE,KAAK,UAU/B;AAED,iBAAS,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAE7D;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getForkUrl = getForkUrl;
|
|
4
|
+
exports.assertNotNull = assertNotNull;
|
|
5
|
+
const chains_1 = require("viem/chains");
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
function getForkUrl(chain) {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
const alchemyApiKey = import.meta.env.VITE_ALCHEMY_API_KEY;
|
|
10
|
+
if (!alchemyApiKey) {
|
|
11
|
+
throw new Error('VITE_ALCHEMY_API_KEY is not set');
|
|
12
|
+
}
|
|
13
|
+
if (chain.id === chains_1.base.id) {
|
|
14
|
+
return `https://base-mainnet.g.alchemy.com/v2/${alchemyApiKey}`;
|
|
15
|
+
}
|
|
16
|
+
throw new Error(`Unsupported chain: ${chain.id}`);
|
|
17
|
+
}
|
|
18
|
+
function assertNotNull(value) {
|
|
19
|
+
(0, vitest_1.expect)(value).not.toBeNull();
|
|
20
|
+
}
|