@rhinestone/sdk 0.6.1 → 0.6.3
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/orchestrator/index.d.ts +2 -2
- 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 +3 -1
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +14 -1
- package/package.json +1 -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 { getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress } from './registry';
|
|
4
|
+
import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress } from './registry';
|
|
5
5
|
import type { BundleResult, Execution, MetaIntent, MultiChainCompact, OrderPath, PostOrderBundleResult, SignedMultiChainCompact } from './types';
|
|
6
6
|
import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_UNKNOWN } from './types';
|
|
7
7
|
import { BundleStatusEnum, getEmptyUserOp, getOrderBundleHash } from './utils';
|
|
8
8
|
declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
|
|
9
9
|
export type { Execution, BundleResult, MetaIntent, MultiChainCompact, OrderPath, SignedMultiChainCompact, PostOrderBundleResult, };
|
|
10
|
-
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, };
|
|
10
|
+
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, 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,EACL,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE9E,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,GACtB,CAAA;AACD,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,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
|
+
{"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,6BAA6B,EAC7B,yBAAyB,EACzB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,cAAc,EACf,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE9E,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,uBAAuB,EACvB,qBAAqB,GACtB,CAAA;AACD,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,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 { getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress, } from './registry';
|
|
4
|
+
import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getWethAddress, } from './registry';
|
|
5
5
|
import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_UNKNOWN, } from './types';
|
|
6
6
|
import { BundleStatusEnum, getEmptyUserOp, getOrderBundleHash } from './utils';
|
|
7
7
|
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
8
8
|
return new Orchestrator(orchestratorUrl ?? ORCHESTRATOR_URL, apiKey);
|
|
9
9
|
}
|
|
10
|
-
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getTokenAddress, };
|
|
10
|
+
export { BundleStatusEnum as BundleStatus, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, };
|
|
@@ -4,7 +4,9 @@ declare function getTokenBalanceSlot(chain: Chain, tokenAddress: Address): bigin
|
|
|
4
4
|
declare function getHookAddress(_chainId?: number): Address;
|
|
5
5
|
declare function getSameChainModuleAddress(_chainId?: number): Address;
|
|
6
6
|
declare function getTargetModuleAddress(_chainId?: number): Address;
|
|
7
|
+
declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
|
|
8
|
+
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
7
9
|
declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
|
|
8
10
|
declare function getChainById(chainId: number): Chain | undefined;
|
|
9
|
-
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getChainById, };
|
|
11
|
+
export { getTokenSymbol, getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|
|
10
12
|
//# 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;AAwCD,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CAqJf;AAED,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,iBAAS,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,iBAAS,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAetE;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,qBAkBpC;AAED,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,GACb,CAAA"}
|
|
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,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,iBAAS,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,iBAAS,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,iBAAS,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAEjE;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAWtE;AAED,iBAAS,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAetE;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,qBAkBpC;AAED,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,GACb,CAAA"}
|
|
@@ -230,6 +230,19 @@ function getSameChainModuleAddress(_chainId) {
|
|
|
230
230
|
function getTargetModuleAddress(_chainId) {
|
|
231
231
|
return '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
232
232
|
}
|
|
233
|
+
function getRhinestoneSpokePoolAddress(_chainId) {
|
|
234
|
+
return '0x000000000060f6e853447881951574CDd0663530';
|
|
235
|
+
}
|
|
236
|
+
function getTokenSymbol(tokenAddress, chainId) {
|
|
237
|
+
const knownSymbols = ['ETH', 'WETH', 'USDC'];
|
|
238
|
+
for (const symbol of knownSymbols) {
|
|
239
|
+
const address = getTokenAddress(symbol, chainId);
|
|
240
|
+
if (address.toLowerCase() === tokenAddress.toLowerCase()) {
|
|
241
|
+
return symbol;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chainId}`);
|
|
245
|
+
}
|
|
233
246
|
function getTokenAddress(tokenSymbol, chainId) {
|
|
234
247
|
if (tokenSymbol === 'ETH') {
|
|
235
248
|
return zeroAddress;
|
|
@@ -265,4 +278,4 @@ function getChainById(chainId) {
|
|
|
265
278
|
}
|
|
266
279
|
}
|
|
267
280
|
}
|
|
268
|
-
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getChainById, };
|
|
281
|
+
export { getTokenSymbol, getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|