@rhinestone/sdk 0.2.0 → 0.3.0
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 +7 -19
- package/dist/accounts/index.d.ts +15535 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +242 -0
- package/dist/accounts/nexus.d.ts +23281 -0
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/accounts/nexus.js +230 -0
- package/dist/accounts/safe.d.ts +15 -0
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{services/account → accounts}/safe.js +36 -37
- package/dist/accounts/utils.d.ts +27 -0
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/accounts/utils.js +155 -0
- package/dist/examples/abi/weth.d.ts +214 -0
- package/dist/examples/abi/weth.d.ts.map +1 -0
- package/dist/examples/abi/weth.js +279 -0
- package/dist/examples/cross-chain-ss.d.ts +1 -0
- package/dist/examples/cross-chain-ss.d.ts.map +1 -0
- package/dist/{example.js → examples/cross-chain-ss.js} +70 -44
- package/dist/examples/omni-account.d.ts +1 -0
- package/dist/examples/omni-account.d.ts.map +1 -0
- package/dist/examples/omni-account.js +169 -0
- package/dist/examples/smart-sessions.d.ts +1 -0
- package/dist/examples/smart-sessions.d.ts.map +1 -0
- package/dist/examples/smart-sessions.js +216 -0
- package/dist/execution/index.d.ts +31 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +222 -0
- package/dist/execution/smart-session.d.ts +14 -0
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +83 -0
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/modules/abi/smart-sessions.d.ts +42 -0
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/abi/smart-sessions.js +128 -0
- package/dist/modules/common.d.ts +16 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/common.js +5 -0
- package/dist/modules/index.d.ts +33 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +129 -0
- package/dist/modules/omni-account.d.ts +9 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/omni-account.js +7 -0
- package/dist/modules/validators.d.ts +31 -0
- package/dist/modules/validators.d.ts.map +1 -0
- package/dist/modules/validators.js +518 -0
- package/dist/{services/orchestrator → orchestrator}/client.d.ts +2 -5
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/orchestrator/consts.d.ts +4 -0
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/orchestrator/consts.js +3 -0
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts +9 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +10 -0
- package/dist/orchestrator/registry.d.ts +5 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/registry.js +187 -0
- package/dist/{services/orchestrator → orchestrator}/types.d.ts +39 -23
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +7 -0
- package/dist/orchestrator/utils.d.ts +11 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/{services/orchestrator → orchestrator}/utils.js +20 -6
- package/dist/types.d.ts +70 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/example.d.ts +0 -1
- package/dist/example.d.ts.map +0 -1
- package/dist/services/account/index.d.ts +0 -13
- package/dist/services/account/index.d.ts.map +0 -1
- package/dist/services/account/index.js +0 -54
- package/dist/services/account/nexus.d.ts +0 -9
- package/dist/services/account/nexus.d.ts.map +0 -1
- package/dist/services/account/nexus.js +0 -67
- package/dist/services/account/safe.d.ts +0 -9
- package/dist/services/account/safe.d.ts.map +0 -1
- package/dist/services/modules.d.ts +0 -32
- package/dist/services/modules.d.ts.map +0 -1
- package/dist/services/modules.js +0 -166
- package/dist/services/orchestrator/client.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.d.ts +0 -6
- package/dist/services/orchestrator/consts.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.js +0 -4
- package/dist/services/orchestrator/error.d.ts.map +0 -1
- package/dist/services/orchestrator/index.d.ts +0 -8
- package/dist/services/orchestrator/index.d.ts.map +0 -1
- package/dist/services/orchestrator/index.js +0 -9
- package/dist/services/orchestrator/types.d.ts.map +0 -1
- package/dist/services/orchestrator/types.js +0 -6
- package/dist/services/orchestrator/utils.d.ts +0 -7
- package/dist/services/orchestrator/utils.d.ts.map +0 -1
- package/dist/services/transaction.d.ts +0 -6
- package/dist/services/transaction.d.ts.map +0 -1
- package/dist/services/transaction.js +0 -93
- /package/dist/{services/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EAQL,YAAY,EACZ,GAAG,EAEJ,MAAM,MAAM,CAAA;AAGb,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AA0BrE,iBAAe,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;;;;;;;;;GAS3D;AAED,iBAAe,UAAU,CAAC,MAAM,EAAE,uBAAuB,0BAgBxD;AAED,iBAAe,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,oBAiBtE;AAED,iBAAe,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,iBAMxE;AAED,iBAAe,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,iBAKxE;AAED,iBAAe,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,sCAU/D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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA9Epq/B;AAED,iBAAe,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,0BAYhE;AAqDD,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,2BAA2B,EAC3B,IAAI,GACL,CAAA"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { createPublicClient, http, createWalletClient, size, keccak256, encodePacked, slice, concat, } from 'viem';
|
|
2
|
+
import { getWebauthnValidatorSignature, isRip7212SupportedNetwork, } from '../modules';
|
|
3
|
+
import { getOwnerValidator, getSmartSessionValidator, } from '../modules/validators';
|
|
4
|
+
import { getDeployArgs as getSafeDeployArgs, getSmartAccount as getSafeSmartAccount, get7702InitCalls as get7702SafeInitCalls, get7702SmartAccount as get7702SafeAccount, getSessionSmartAccount as getSafeSessionSmartAccount, } from './safe';
|
|
5
|
+
import { getDeployArgs as getNexusDeployArgs, getSmartAccount as getNexusSmartAccount, get7702InitCalls as get7702NexusInitCalls, get7702SmartAccount as get7702NexusAccount, getSessionSmartAccount as getNexusSessionSmartAccount, } from './nexus';
|
|
6
|
+
import { getBundlerClient } from './utils';
|
|
7
|
+
async function getDeployArgs(config) {
|
|
8
|
+
switch (config.account.type) {
|
|
9
|
+
case 'safe': {
|
|
10
|
+
return getSafeDeployArgs(config);
|
|
11
|
+
}
|
|
12
|
+
case 'nexus': {
|
|
13
|
+
return getNexusDeployArgs(config);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function getAddress(config) {
|
|
18
|
+
if (is7702(config)) {
|
|
19
|
+
if (!config.eoa) {
|
|
20
|
+
throw new Error('EIP-7702 accounts must have an EOA account');
|
|
21
|
+
}
|
|
22
|
+
return config.eoa.address;
|
|
23
|
+
}
|
|
24
|
+
const { factory, salt, hashedInitcode } = await getDeployArgs(config);
|
|
25
|
+
const hash = keccak256(encodePacked(['bytes1', 'address', 'bytes32', 'bytes'], ['0xff', factory, salt, hashedInitcode]));
|
|
26
|
+
const address = slice(hash, 12, 32);
|
|
27
|
+
return address;
|
|
28
|
+
}
|
|
29
|
+
async function isDeployed(chain, config) {
|
|
30
|
+
const publicClient = createPublicClient({
|
|
31
|
+
chain: chain,
|
|
32
|
+
transport: http(),
|
|
33
|
+
});
|
|
34
|
+
const address = await getAddress(config);
|
|
35
|
+
const code = await publicClient.getCode({
|
|
36
|
+
address,
|
|
37
|
+
});
|
|
38
|
+
if (!code) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (code.startsWith('0xef0100') && code.length === 48) {
|
|
42
|
+
// Defensive check to ensure there's no storage conflict; can be lifted in the future
|
|
43
|
+
throw new Error('Existing EIP-7702 accounts are not yet supported');
|
|
44
|
+
}
|
|
45
|
+
return size(code) > 0;
|
|
46
|
+
}
|
|
47
|
+
async function deploySource(chain, config) {
|
|
48
|
+
if (is7702(config)) {
|
|
49
|
+
return deploy7702Self(chain, config);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return deployStandaloneSelf(chain, config);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function deployTarget(chain, config) {
|
|
56
|
+
if (is7702(config)) {
|
|
57
|
+
return deploy7702WithBundler(chain, config);
|
|
58
|
+
}
|
|
59
|
+
// No need to deploy manually outside of EIP-7702
|
|
60
|
+
}
|
|
61
|
+
async function getBundleInitCode(config) {
|
|
62
|
+
if (is7702(config)) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const { factory, factoryData } = await getDeployArgs(config);
|
|
67
|
+
if (!factory || !factoryData) {
|
|
68
|
+
throw new Error('Factory args not available');
|
|
69
|
+
}
|
|
70
|
+
return encodePacked(['address', 'bytes'], [factory, factoryData]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async function deploy7702Self(chain, config) {
|
|
74
|
+
if (!config.eoa) {
|
|
75
|
+
throw new Error('EIP-7702 accounts must have an EOA account');
|
|
76
|
+
}
|
|
77
|
+
const { implementation, initializationCallData } = await getDeployArgs(config);
|
|
78
|
+
if (!initializationCallData) {
|
|
79
|
+
throw new Error(`Initialization call data not available for ${config.account.type}`);
|
|
80
|
+
}
|
|
81
|
+
const publicClient = createPublicClient({
|
|
82
|
+
chain,
|
|
83
|
+
transport: http(),
|
|
84
|
+
});
|
|
85
|
+
const accountClient = createWalletClient({
|
|
86
|
+
account: config.eoa,
|
|
87
|
+
chain,
|
|
88
|
+
transport: http(),
|
|
89
|
+
});
|
|
90
|
+
const authorization = await accountClient.signAuthorization({
|
|
91
|
+
contractAddress: implementation,
|
|
92
|
+
executor: 'self',
|
|
93
|
+
});
|
|
94
|
+
const hash = await accountClient.sendTransaction({
|
|
95
|
+
chain,
|
|
96
|
+
authorizationList: [authorization],
|
|
97
|
+
to: config.eoa.address,
|
|
98
|
+
data: initializationCallData,
|
|
99
|
+
});
|
|
100
|
+
await publicClient.waitForTransactionReceipt({ hash });
|
|
101
|
+
}
|
|
102
|
+
async function deployStandaloneSelf(chain, config) {
|
|
103
|
+
const deployer = config.deployerAccount;
|
|
104
|
+
const { factory, factoryData } = await getDeployArgs(config);
|
|
105
|
+
const publicClient = createPublicClient({
|
|
106
|
+
chain: chain,
|
|
107
|
+
transport: http(),
|
|
108
|
+
});
|
|
109
|
+
const client = createWalletClient({
|
|
110
|
+
account: deployer,
|
|
111
|
+
chain: chain,
|
|
112
|
+
transport: http(),
|
|
113
|
+
});
|
|
114
|
+
const tx = await client.sendTransaction({
|
|
115
|
+
to: factory,
|
|
116
|
+
data: factoryData,
|
|
117
|
+
});
|
|
118
|
+
await publicClient.waitForTransactionReceipt({ hash: tx });
|
|
119
|
+
}
|
|
120
|
+
async function deploy7702WithBundler(chain, config) {
|
|
121
|
+
if (!config.eoa) {
|
|
122
|
+
throw new Error('EIP-7702 accounts must have an EOA account');
|
|
123
|
+
}
|
|
124
|
+
const { implementation } = await getDeployArgs(config);
|
|
125
|
+
const publicClient = createPublicClient({
|
|
126
|
+
chain,
|
|
127
|
+
transport: http(),
|
|
128
|
+
});
|
|
129
|
+
const accountClient = createWalletClient({
|
|
130
|
+
account: config.eoa,
|
|
131
|
+
chain,
|
|
132
|
+
transport: http(),
|
|
133
|
+
});
|
|
134
|
+
const bundlerClient = getBundlerClient(config, publicClient);
|
|
135
|
+
const fundingClient = createWalletClient({
|
|
136
|
+
account: config.deployerAccount,
|
|
137
|
+
chain,
|
|
138
|
+
transport: http(),
|
|
139
|
+
});
|
|
140
|
+
const authorization = await accountClient.signAuthorization({
|
|
141
|
+
contractAddress: implementation,
|
|
142
|
+
});
|
|
143
|
+
// Will be replaced by a bundler in the future
|
|
144
|
+
const authTxHash = await fundingClient.sendTransaction({
|
|
145
|
+
chain: publicClient.chain,
|
|
146
|
+
authorizationList: [authorization],
|
|
147
|
+
});
|
|
148
|
+
await publicClient.waitForTransactionReceipt({ hash: authTxHash });
|
|
149
|
+
// Init the account
|
|
150
|
+
const smartAccount = await get7702SmartAccount(config, publicClient);
|
|
151
|
+
const initCalls = await get7702InitCalls(config);
|
|
152
|
+
const opHash = await bundlerClient.sendUserOperation({
|
|
153
|
+
account: smartAccount,
|
|
154
|
+
calls: initCalls,
|
|
155
|
+
});
|
|
156
|
+
await bundlerClient.waitForUserOperationReceipt({
|
|
157
|
+
hash: opHash,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async function getSmartAccount(config, client, chain) {
|
|
161
|
+
switch (config.account.type) {
|
|
162
|
+
case 'safe': {
|
|
163
|
+
return getSafeSmartAccount();
|
|
164
|
+
}
|
|
165
|
+
case 'nexus': {
|
|
166
|
+
const address = await getAddress(config);
|
|
167
|
+
const ownerValidator = getOwnerValidator(config);
|
|
168
|
+
const signFn = (hash) => sign(config.owners, chain, hash);
|
|
169
|
+
return getNexusSmartAccount(client, address, config.owners, ownerValidator.address, signFn);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async function getSmartSessionSmartAccount(config, client, chain, session) {
|
|
174
|
+
switch (config.account.type) {
|
|
175
|
+
case 'safe': {
|
|
176
|
+
return getSafeSessionSmartAccount();
|
|
177
|
+
}
|
|
178
|
+
case 'nexus': {
|
|
179
|
+
const address = await getAddress(config);
|
|
180
|
+
const smartSessionValidator = getSmartSessionValidator(config);
|
|
181
|
+
if (!smartSessionValidator) {
|
|
182
|
+
throw new Error('Smart sessions are not enabled for this account');
|
|
183
|
+
}
|
|
184
|
+
const signFn = (hash) => sign(session.owners, chain, hash);
|
|
185
|
+
return getNexusSessionSmartAccount(client, address, session, smartSessionValidator.address, signFn);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
async function sign(validators, chain, hash) {
|
|
190
|
+
switch (validators.type) {
|
|
191
|
+
case 'ecdsa': {
|
|
192
|
+
const signatures = await Promise.all(validators.accounts.map((account) => signEcdsa(account, hash)));
|
|
193
|
+
return concat(signatures);
|
|
194
|
+
}
|
|
195
|
+
case 'passkey': {
|
|
196
|
+
return await signPasskey(validators.account, chain, hash);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
async function signEcdsa(account, hash) {
|
|
201
|
+
if (!account.signMessage) {
|
|
202
|
+
throw new Error('Signing not supported for the account');
|
|
203
|
+
}
|
|
204
|
+
return await account.signMessage({ message: { raw: hash } });
|
|
205
|
+
}
|
|
206
|
+
async function signPasskey(account, chain, hash) {
|
|
207
|
+
const { webauthn, signature } = await account.sign({ hash });
|
|
208
|
+
const usePrecompiled = isRip7212SupportedNetwork(chain);
|
|
209
|
+
const encodedSignature = getWebauthnValidatorSignature({
|
|
210
|
+
webauthn,
|
|
211
|
+
signature,
|
|
212
|
+
usePrecompiled,
|
|
213
|
+
});
|
|
214
|
+
return encodedSignature;
|
|
215
|
+
}
|
|
216
|
+
async function get7702SmartAccount(config, client) {
|
|
217
|
+
if (!config.eoa) {
|
|
218
|
+
throw new Error('EIP-7702 accounts must have an EOA account');
|
|
219
|
+
}
|
|
220
|
+
switch (config.account.type) {
|
|
221
|
+
case 'safe': {
|
|
222
|
+
return get7702SafeAccount();
|
|
223
|
+
}
|
|
224
|
+
case 'nexus': {
|
|
225
|
+
return get7702NexusAccount(config.eoa, client);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
async function get7702InitCalls(config) {
|
|
230
|
+
switch (config.account.type) {
|
|
231
|
+
case 'safe': {
|
|
232
|
+
return get7702SafeInitCalls();
|
|
233
|
+
}
|
|
234
|
+
case 'nexus': {
|
|
235
|
+
return get7702NexusInitCalls(config);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function is7702(config) {
|
|
240
|
+
return config.eoa !== undefined;
|
|
241
|
+
}
|
|
242
|
+
export { getDeployArgs, getBundleInitCode, getAddress, isDeployed, deploySource, deployTarget, getSmartAccount, getSmartSessionSmartAccount, sign, };
|