@rhinestone/sdk 0.4.1 → 0.4.2
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/index.d.ts +144 -144
- package/dist/src/accounts/nexus.d.ts +216 -216
- package/dist/src/accounts/safe.d.ts +144 -144
- package/dist/src/orchestrator/index.d.ts +4 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +2 -2
- package/dist/src/orchestrator/registry.d.ts +5 -1
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +82 -1
- package/package.json +5 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Orchestrator } from './client';
|
|
2
2
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
3
|
import { OrchestratorError } from './error';
|
|
4
|
-
import { getTokenBalanceSlot, getWethAddress } from './registry';
|
|
5
|
-
import type { BundleResult, MetaIntent, OrderPath, SignedMultiChainCompact } from './types';
|
|
4
|
+
import { getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress } from './registry';
|
|
5
|
+
import type { BundleResult, MetaIntent, OrderPath, PostOrderBundleResult, SignedMultiChainCompact } from './types';
|
|
6
6
|
import { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING } from './types';
|
|
7
7
|
import { getEmptyUserOp, getOrderBundleHash } from './utils';
|
|
8
8
|
declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
|
|
9
|
-
export type { BundleResult, MetaIntent, OrderPath, SignedMultiChainCompact };
|
|
10
|
-
export { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, };
|
|
9
|
+
export type { BundleResult, MetaIntent, OrderPath, SignedMultiChainCompact, PostOrderBundleResult, };
|
|
10
|
+
export { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAoB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAoB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5D,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,YAAY,EACZ,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,qBAAqB,GACtB,CAAA;AACD,OAAO,EACL,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,GAChB,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Orchestrator } from './client';
|
|
2
2
|
import { ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
3
|
import { OrchestratorError } from './error';
|
|
4
|
-
import { getTokenBalanceSlot, getWethAddress } from './registry';
|
|
4
|
+
import { getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress, } from './registry';
|
|
5
5
|
import { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, } from './types';
|
|
6
6
|
import { getEmptyUserOp, getOrderBundleHash } from './utils';
|
|
7
7
|
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
8
8
|
return new Orchestrator(orchestratorUrl ?? ORCHESTRATOR_URL, apiKey);
|
|
9
9
|
}
|
|
10
|
-
export { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, };
|
|
10
|
+
export { BUNDLE_STATUS_FAILED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Address, Chain } from 'viem';
|
|
2
2
|
declare function getWethAddress(chain: Chain): "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14" | "0x4200000000000000000000000000000000000006" | "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" | "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73" | "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619" | "0x52eF3d68BaB452a294342DC3e5f464d7f610f72E";
|
|
3
3
|
declare function getTokenBalanceSlot(chain: Chain, tokenAddress: Address): bigint | null;
|
|
4
|
-
|
|
4
|
+
declare function getHookAddress(): string;
|
|
5
|
+
declare function getSameChainModuleAddress(): string;
|
|
6
|
+
declare function getTargetModuleAddress(): string;
|
|
7
|
+
declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
|
|
8
|
+
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, };
|
|
5
9
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAe,MAAM,MAAM,CAAA;AAclD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,0UAoCnC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAe,MAAM,MAAM,CAAA;AAclD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,0UAoCnC;AAwCD,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CAqJf;AAED,iBAAS,cAAc,WAEtB;AAED,iBAAS,yBAAyB,WAEjC;AAED,iBAAS,sBAAsB,WAE9B;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAetE;AAsBD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,GACvB,CAAA"}
|
|
@@ -37,6 +37,43 @@ function getWethAddress(chain) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
function getUsdcAddress(chain) {
|
|
41
|
+
switch (chain.id) {
|
|
42
|
+
case mainnet.id: {
|
|
43
|
+
return '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48';
|
|
44
|
+
}
|
|
45
|
+
case sepolia.id: {
|
|
46
|
+
return '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238';
|
|
47
|
+
}
|
|
48
|
+
case base.id: {
|
|
49
|
+
return '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
50
|
+
}
|
|
51
|
+
case baseSepolia.id: {
|
|
52
|
+
return '0x036CbD53842c5426634e7929541eC2318f3dCF7e';
|
|
53
|
+
}
|
|
54
|
+
case arbitrum.id: {
|
|
55
|
+
return '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';
|
|
56
|
+
}
|
|
57
|
+
case arbitrumSepolia.id: {
|
|
58
|
+
return '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';
|
|
59
|
+
}
|
|
60
|
+
case optimism.id: {
|
|
61
|
+
return '0x0b2c639c533813f4aa9d7837caf62653d097ff85';
|
|
62
|
+
}
|
|
63
|
+
case optimismSepolia.id: {
|
|
64
|
+
return '0x5fd84259d66Cd46123540766Be93DFE6D43130D7';
|
|
65
|
+
}
|
|
66
|
+
case polygon.id: {
|
|
67
|
+
return '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359';
|
|
68
|
+
}
|
|
69
|
+
case polygonAmoy.id: {
|
|
70
|
+
return '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582';
|
|
71
|
+
}
|
|
72
|
+
default: {
|
|
73
|
+
throw new Error(`Unsupported chain ${chain.id}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
40
77
|
function getTokenBalanceSlot(chain, tokenAddress) {
|
|
41
78
|
switch (chain.id) {
|
|
42
79
|
case mainnet.id: {
|
|
@@ -184,4 +221,48 @@ function getTokenBalanceSlot(chain, tokenAddress) {
|
|
|
184
221
|
}
|
|
185
222
|
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chain.id}`);
|
|
186
223
|
}
|
|
187
|
-
|
|
224
|
+
function getHookAddress() {
|
|
225
|
+
return '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
226
|
+
}
|
|
227
|
+
function getSameChainModuleAddress() {
|
|
228
|
+
return '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
229
|
+
}
|
|
230
|
+
function getTargetModuleAddress() {
|
|
231
|
+
return '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
232
|
+
}
|
|
233
|
+
function getTokenAddress(tokenSymbol, chainId) {
|
|
234
|
+
if (tokenSymbol === 'ETH') {
|
|
235
|
+
return zeroAddress;
|
|
236
|
+
}
|
|
237
|
+
const chain = getChainById(chainId);
|
|
238
|
+
if (!chain) {
|
|
239
|
+
throw new Error(`Unsupported chain ${chainId}`);
|
|
240
|
+
}
|
|
241
|
+
if (tokenSymbol === 'WETH') {
|
|
242
|
+
return getWethAddress(chain);
|
|
243
|
+
}
|
|
244
|
+
if (tokenSymbol === 'USDC') {
|
|
245
|
+
return getUsdcAddress(chain);
|
|
246
|
+
}
|
|
247
|
+
throw new Error(`Unsupported token symbol ${tokenSymbol}`);
|
|
248
|
+
}
|
|
249
|
+
function getChainById(chainId) {
|
|
250
|
+
const supportedChains = [
|
|
251
|
+
mainnet,
|
|
252
|
+
sepolia,
|
|
253
|
+
base,
|
|
254
|
+
baseSepolia,
|
|
255
|
+
arbitrum,
|
|
256
|
+
arbitrumSepolia,
|
|
257
|
+
optimism,
|
|
258
|
+
optimismSepolia,
|
|
259
|
+
polygon,
|
|
260
|
+
polygonAmoy,
|
|
261
|
+
];
|
|
262
|
+
for (const chain of supportedChains) {
|
|
263
|
+
if (chain.id === chainId) {
|
|
264
|
+
return chain;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhinestone/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "End-to-end chain abstraction and modularity toolkit",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rhinestone",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./orchestrator": {
|
|
23
|
+
"types": "./dist/orchestrator/index.d.ts",
|
|
24
|
+
"import": "./dist/orchestrator/index.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"files": [
|