@rhinestone/sdk 0.7.8 → 0.7.10

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.
Files changed (48) hide show
  1. package/dist/cjs/modules/abi/smart-sessions.d.ts +42 -0
  2. package/dist/cjs/modules/abi/smart-sessions.d.ts.map +1 -0
  3. package/dist/cjs/modules/abi/smart-sessions.js +131 -0
  4. package/dist/cjs/modules/common.d.ts +16 -0
  5. package/dist/cjs/modules/common.d.ts.map +1 -0
  6. package/dist/cjs/modules/common.js +11 -0
  7. package/dist/cjs/modules/index.d.ts +33 -0
  8. package/dist/cjs/modules/index.d.ts.map +1 -0
  9. package/dist/cjs/modules/index.js +153 -0
  10. package/dist/cjs/modules/omni-account.d.ts +9 -0
  11. package/dist/cjs/modules/omni-account.d.ts.map +1 -0
  12. package/dist/cjs/modules/omni-account.js +15 -0
  13. package/dist/cjs/modules/validators/core.d.ts +23 -0
  14. package/dist/cjs/modules/validators/core.d.ts.map +1 -0
  15. package/dist/cjs/modules/validators/core.js +118 -0
  16. package/dist/cjs/modules/validators/index.d.ts +4 -0
  17. package/dist/cjs/modules/validators/index.d.ts.map +1 -0
  18. package/dist/cjs/modules/validators/index.js +17 -0
  19. package/dist/cjs/modules/validators/smart-sessions.d.ts +29 -0
  20. package/dist/cjs/modules/validators/smart-sessions.d.ts.map +1 -0
  21. package/dist/cjs/modules/validators/smart-sessions.js +426 -0
  22. package/dist/cjs/orchestrator/client.d.ts +29 -0
  23. package/dist/cjs/orchestrator/client.d.ts.map +1 -0
  24. package/dist/cjs/orchestrator/client.js +250 -0
  25. package/dist/cjs/orchestrator/consts.d.ts +5 -0
  26. package/dist/cjs/orchestrator/consts.d.ts.map +1 -0
  27. package/dist/cjs/orchestrator/consts.js +9 -0
  28. package/dist/cjs/orchestrator/error.d.ts +18 -0
  29. package/dist/cjs/orchestrator/error.d.ts.map +1 -0
  30. package/dist/cjs/orchestrator/error.js +33 -0
  31. package/dist/cjs/orchestrator/index.d.ts +11 -0
  32. package/dist/cjs/orchestrator/index.d.ts.map +1 -0
  33. package/dist/cjs/orchestrator/index.js +40 -0
  34. package/dist/cjs/orchestrator/registry.d.ts +17 -0
  35. package/dist/cjs/orchestrator/registry.d.ts.map +1 -0
  36. package/dist/cjs/orchestrator/registry.js +358 -0
  37. package/dist/cjs/orchestrator/types.d.ts +222 -0
  38. package/dist/cjs/orchestrator/types.d.ts.map +1 -0
  39. package/dist/cjs/orchestrator/types.js +19 -0
  40. package/dist/cjs/orchestrator/utils.d.ts +29 -0
  41. package/dist/cjs/orchestrator/utils.d.ts.map +1 -0
  42. package/dist/cjs/orchestrator/utils.js +316 -0
  43. package/dist/cjs/types.d.ts +113 -0
  44. package/dist/cjs/types.d.ts.map +1 -0
  45. package/dist/cjs/types.js +2 -0
  46. package/dist/src/execution/index.d.ts.map +1 -1
  47. package/dist/src/execution/index.js +4 -5
  48. package/package.json +6 -1
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Orchestrator = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const viem_1 = require("viem");
9
+ const error_1 = require("./error");
10
+ const utils_1 = require("./utils");
11
+ class Orchestrator {
12
+ serverUrl;
13
+ apiKey;
14
+ constructor(serverUrl, apiKey) {
15
+ this.serverUrl = serverUrl;
16
+ this.apiKey = apiKey;
17
+ }
18
+ async getPortfolio(userAddress, filter) {
19
+ try {
20
+ const response = await axios_1.default.get(`${this.serverUrl}/accounts/${userAddress}/portfolio`, {
21
+ params: {
22
+ chainIds: filter?.chainIds,
23
+ tokens: filter?.tokens
24
+ ? Object.entries(filter.tokens)
25
+ .map(([chainId, tokens]) => tokens.map((token) => `${chainId}:${token}`))
26
+ .reduce(viem_1.concat, [])
27
+ : undefined,
28
+ },
29
+ headers: {
30
+ 'x-api-key': this.apiKey,
31
+ },
32
+ });
33
+ return response.data.portfolio.map((balance) => {
34
+ return {
35
+ ...balance,
36
+ balance: BigInt(balance.balance),
37
+ tokenChainBalance: balance.tokenChainBalance.map((chainBalance) => {
38
+ return {
39
+ ...chainBalance,
40
+ balance: BigInt(chainBalance.balance),
41
+ };
42
+ }),
43
+ };
44
+ });
45
+ }
46
+ catch (error) {
47
+ this.parseError(error);
48
+ throw new Error('Failed to get portfolio');
49
+ }
50
+ }
51
+ async getMaxTokenAmount(userAddress, targetChainId, targetTokenAddress, targetGasUnits) {
52
+ const intentCost = await this.getIntentCost({
53
+ targetChainId,
54
+ targetGasUnits,
55
+ tokenTransfers: [
56
+ {
57
+ tokenAddress: targetTokenAddress,
58
+ },
59
+ ],
60
+ }, userAddress);
61
+ if (!intentCost.hasFulfilledAll) {
62
+ return 0n;
63
+ }
64
+ const tokenReceived = intentCost.tokensReceived.find((token) => token.tokenAddress.toLowerCase() === targetTokenAddress.toLowerCase());
65
+ if (!tokenReceived) {
66
+ return 0n;
67
+ }
68
+ const tokenAmount = tokenReceived.targetAmount;
69
+ if (tokenAmount < 0n) {
70
+ throw new Error(`Balance not available. Make sure the account is deployed`);
71
+ }
72
+ return tokenReceived.targetAmount;
73
+ }
74
+ async getIntentCost(intent, userAddress) {
75
+ try {
76
+ const response = await axios_1.default.post(`${this.serverUrl}/accounts/${userAddress}/bundles/cost`, {
77
+ ...(0, utils_1.convertBigIntFields)(intent),
78
+ }, {
79
+ headers: {
80
+ 'x-api-key': this.apiKey,
81
+ },
82
+ });
83
+ return (0, utils_1.parseOrderCostResult)(response.data);
84
+ }
85
+ catch (error) {
86
+ this.parseError(error);
87
+ throw new Error(error);
88
+ }
89
+ }
90
+ async getOrderPath(intent, userAddress) {
91
+ try {
92
+ const response = await axios_1.default.post(`${this.serverUrl}/accounts/${userAddress}/bundles/path`, {
93
+ ...(0, utils_1.convertBigIntFields)(intent),
94
+ }, {
95
+ headers: {
96
+ 'x-api-key': this.apiKey,
97
+ },
98
+ });
99
+ return response.data.orderBundles.map((orderPath) => {
100
+ return {
101
+ orderBundle: (0, utils_1.parseCompactResponse)(orderPath.orderBundle),
102
+ injectedExecutions: orderPath.injectedExecutions.map((exec) => {
103
+ return {
104
+ ...exec,
105
+ value: BigInt(exec.value),
106
+ };
107
+ }),
108
+ intentCost: (0, utils_1.parseOrderCost)(orderPath.intentCost),
109
+ };
110
+ });
111
+ }
112
+ catch (error) {
113
+ this.parseError(error);
114
+ throw new Error(error);
115
+ }
116
+ }
117
+ async postSignedOrderBundle(signedOrderBundles) {
118
+ try {
119
+ const bundles = signedOrderBundles.map((signedOrderBundle) => {
120
+ return {
121
+ signedOrderBundle: (0, utils_1.convertBigIntFields)(signedOrderBundle.signedOrderBundle),
122
+ initCode: signedOrderBundle.initCode,
123
+ userOp: signedOrderBundle.userOp
124
+ ? (0, utils_1.convertBigIntFields)(signedOrderBundle.userOp)
125
+ : undefined,
126
+ };
127
+ });
128
+ const response = await axios_1.default.post(`${this.serverUrl}/bundles`, {
129
+ bundles,
130
+ }, {
131
+ headers: {
132
+ 'x-api-key': this.apiKey,
133
+ },
134
+ });
135
+ return response.data.bundleResults.map((bundleResult) => {
136
+ return {
137
+ ...bundleResult,
138
+ bundleId: BigInt(bundleResult.bundleId),
139
+ };
140
+ });
141
+ }
142
+ catch (error) {
143
+ this.parseError(error);
144
+ throw new Error('Failed to post order bundle');
145
+ }
146
+ }
147
+ async getBundleStatus(bundleId) {
148
+ try {
149
+ const response = await axios_1.default.get(`${this.serverUrl}/bundles/${bundleId.toString()}`, {
150
+ headers: {
151
+ 'x-api-key': this.apiKey,
152
+ },
153
+ });
154
+ response.data.claims = response.data.claims.map((claim) => {
155
+ return {
156
+ ...claim,
157
+ depositId: BigInt(claim.depositId),
158
+ };
159
+ });
160
+ return response.data;
161
+ }
162
+ catch (error) {
163
+ this.parseError(error);
164
+ throw new Error('Failed to get bundle status');
165
+ }
166
+ }
167
+ async getPendingBundles(count = 20, offset = 0) {
168
+ try {
169
+ const response = await axios_1.default.get(`${this.serverUrl}/bundles/events`, {
170
+ params: {
171
+ count,
172
+ offset,
173
+ },
174
+ headers: {
175
+ 'x-api-key': this.apiKey,
176
+ },
177
+ });
178
+ const { events: pendingBundles, nextOffset } = response.data;
179
+ return {
180
+ pendingBundles: pendingBundles.map(utils_1.parsePendingBundleEvent),
181
+ nextOffset,
182
+ };
183
+ }
184
+ catch (error) {
185
+ this.parseError(error);
186
+ throw new Error('Failed to get pending bundles');
187
+ }
188
+ }
189
+ parseError(error) {
190
+ if (error.response) {
191
+ let errorType;
192
+ if (error.response.status) {
193
+ switch (error.response.status) {
194
+ case 400:
195
+ errorType = 'Bad Request';
196
+ break;
197
+ case 401:
198
+ errorType = 'Unauthorized';
199
+ break;
200
+ case 403:
201
+ errorType = 'Forbidden';
202
+ break;
203
+ case 404:
204
+ errorType = 'Not Found';
205
+ break;
206
+ case 409:
207
+ errorType = 'Conflict';
208
+ break;
209
+ case 422:
210
+ errorType = 'Unprocessable Entity';
211
+ break;
212
+ case 500:
213
+ errorType = 'Internal Server Error';
214
+ break;
215
+ default:
216
+ errorType = 'Unknown';
217
+ }
218
+ }
219
+ let context = {};
220
+ if (error.response.data) {
221
+ const { errors, traceId } = error.response.data;
222
+ for (const err of errors) {
223
+ let errorMessage = `Rhinestone Error: ${err.message}`;
224
+ if (errorType) {
225
+ errorMessage += ` (${errorType})`;
226
+ }
227
+ if (traceId) {
228
+ errorMessage += ` [Trace ID: ${traceId}]`;
229
+ context.traceId = traceId;
230
+ }
231
+ console.error(errorMessage);
232
+ if (err.context) {
233
+ console.error(`Context: ${JSON.stringify(err.context, undefined, 4)}`);
234
+ }
235
+ context = { ...context, ...err.context };
236
+ }
237
+ }
238
+ else {
239
+ console.error(error);
240
+ }
241
+ throw new error_1.OrchestratorError({
242
+ message: error.response.data.errors[0].message,
243
+ context,
244
+ errorType,
245
+ traceId: context.traceId,
246
+ });
247
+ }
248
+ }
249
+ }
250
+ exports.Orchestrator = Orchestrator;
@@ -0,0 +1,5 @@
1
+ declare const PROD_ORCHESTRATOR_URL = "https://orchestrator.rhinestone.wtf";
2
+ declare const DEV_ORCHESTRATOR_URL = "https://dev.orchestrator.rhinestone.wtf";
3
+ declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
4
+ export { PROD_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
5
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,wCAAwC,CAAA;AACnE,QAAA,MAAM,oBAAoB,4CAA4C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.DEV_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
4
+ const PROD_ORCHESTRATOR_URL = 'https://orchestrator.rhinestone.wtf';
5
+ exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
6
+ const DEV_ORCHESTRATOR_URL = 'https://dev.orchestrator.rhinestone.wtf';
7
+ exports.DEV_ORCHESTRATOR_URL = DEV_ORCHESTRATOR_URL;
8
+ const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
9
+ exports.RHINESTONE_SPOKE_POOL_ADDRESS = RHINESTONE_SPOKE_POOL_ADDRESS;
@@ -0,0 +1,18 @@
1
+ export declare class OrchestratorError extends Error {
2
+ private readonly _message;
3
+ private readonly _context;
4
+ private readonly _errorType;
5
+ private readonly _traceId;
6
+ constructor(params?: {
7
+ message?: string;
8
+ context?: any;
9
+ errorType?: string;
10
+ traceId?: string;
11
+ });
12
+ get message(): string;
13
+ get context(): any;
14
+ get errorType(): string;
15
+ get traceId(): string;
16
+ }
17
+ export declare function isOrchestratorError(error: Error): error is OrchestratorError;
18
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,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,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,iBAAiB,CAE5E"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrchestratorError = void 0;
4
+ exports.isOrchestratorError = isOrchestratorError;
5
+ class OrchestratorError extends Error {
6
+ _message;
7
+ _context;
8
+ _errorType;
9
+ _traceId;
10
+ constructor(params) {
11
+ super();
12
+ this._message = params?.message || 'OrchestratorError ';
13
+ this._context = params?.context || {};
14
+ this._errorType = params?.errorType || 'Unknown';
15
+ this._traceId = params?.traceId || '';
16
+ }
17
+ get message() {
18
+ return this._message;
19
+ }
20
+ get context() {
21
+ return this._context;
22
+ }
23
+ get errorType() {
24
+ return this._errorType;
25
+ }
26
+ get traceId() {
27
+ return this._traceId;
28
+ }
29
+ }
30
+ exports.OrchestratorError = OrchestratorError;
31
+ function isOrchestratorError(error) {
32
+ return error instanceof OrchestratorError;
33
+ }
@@ -0,0 +1,11 @@
1
+ import { Orchestrator } from './client';
2
+ import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
3
+ import { isOrchestratorError, OrchestratorError } from './error';
4
+ import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getSupportedTokens, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
5
+ import type { BundleResult, Execution, MetaIntent, MultiChainCompact, OrderCost, OrderCostResult, OrderFeeInput, OrderPath, PostOrderBundleResult, SignedMultiChainCompact, UserTokenBalance } from './types';
6
+ import { BUNDLE_STATUS_COMPLETED, BUNDLE_STATUS_EXPIRED, BUNDLE_STATUS_FAILED, BUNDLE_STATUS_FILLED, BUNDLE_STATUS_PARTIALLY_COMPLETED, BUNDLE_STATUS_PENDING, BUNDLE_STATUS_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN } from './types';
7
+ import { applyInjectedExecutions, BundleStatusEnum, getEmptyUserOp, getOrderBundleHash } from './utils';
8
+ declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
9
+ export type { Execution, BundleResult, MetaIntent, MultiChainCompact, OrderPath, SignedMultiChainCompact, PostOrderBundleResult, OrderCost, OrderCostResult, OrderFeeInput, UserTokenBalance, };
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_PRECONFIRMED, BUNDLE_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, OrchestratorError, getOrchestrator, getOrderBundleHash, getEmptyUserOp, getWethAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, applyInjectedExecutions, };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,EACL,cAAc,EACd,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAEhB,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,EACrB,SAAS,EACT,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,CAAA;AACD,OAAO,EACL,gBAAgB,IAAI,YAAY,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GACxB,CAAA"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyInjectedExecutions = exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getRhinestoneSpokePoolAddress = exports.getTargetModuleAddress = exports.getSameChainModuleAddress = exports.getHookAddress = exports.getTokenSymbol = exports.getTokenRootBalanceSlot = exports.getTokenBalanceSlot = exports.getWethAddress = exports.getEmptyUserOp = exports.getOrderBundleHash = exports.OrchestratorError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.BUNDLE_STATUS_UNKNOWN = exports.BUNDLE_STATUS_PRECONFIRMED = exports.BUNDLE_STATUS_FAILED = exports.BUNDLE_STATUS_FILLED = exports.BUNDLE_STATUS_COMPLETED = exports.BUNDLE_STATUS_PARTIALLY_COMPLETED = exports.BUNDLE_STATUS_EXPIRED = exports.BUNDLE_STATUS_PENDING = exports.BundleStatus = void 0;
4
+ exports.getOrchestrator = getOrchestrator;
5
+ const client_1 = require("./client");
6
+ Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
7
+ const consts_1 = require("./consts");
8
+ Object.defineProperty(exports, "RHINESTONE_SPOKE_POOL_ADDRESS", { enumerable: true, get: function () { return consts_1.RHINESTONE_SPOKE_POOL_ADDRESS; } });
9
+ const error_1 = require("./error");
10
+ Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return error_1.isOrchestratorError; } });
11
+ Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return error_1.OrchestratorError; } });
12
+ const registry_1 = require("./registry");
13
+ Object.defineProperty(exports, "getHookAddress", { enumerable: true, get: function () { return registry_1.getHookAddress; } });
14
+ Object.defineProperty(exports, "getRhinestoneSpokePoolAddress", { enumerable: true, get: function () { return registry_1.getRhinestoneSpokePoolAddress; } });
15
+ Object.defineProperty(exports, "getSameChainModuleAddress", { enumerable: true, get: function () { return registry_1.getSameChainModuleAddress; } });
16
+ Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
17
+ Object.defineProperty(exports, "getTargetModuleAddress", { enumerable: true, get: function () { return registry_1.getTargetModuleAddress; } });
18
+ Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
19
+ Object.defineProperty(exports, "getTokenBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenBalanceSlot; } });
20
+ Object.defineProperty(exports, "getTokenRootBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenRootBalanceSlot; } });
21
+ Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
22
+ Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
23
+ Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
24
+ const types_1 = require("./types");
25
+ Object.defineProperty(exports, "BUNDLE_STATUS_COMPLETED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_COMPLETED; } });
26
+ Object.defineProperty(exports, "BUNDLE_STATUS_EXPIRED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_EXPIRED; } });
27
+ Object.defineProperty(exports, "BUNDLE_STATUS_FAILED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_FAILED; } });
28
+ Object.defineProperty(exports, "BUNDLE_STATUS_FILLED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_FILLED; } });
29
+ Object.defineProperty(exports, "BUNDLE_STATUS_PARTIALLY_COMPLETED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PARTIALLY_COMPLETED; } });
30
+ Object.defineProperty(exports, "BUNDLE_STATUS_PENDING", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PENDING; } });
31
+ Object.defineProperty(exports, "BUNDLE_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_PRECONFIRMED; } });
32
+ Object.defineProperty(exports, "BUNDLE_STATUS_UNKNOWN", { enumerable: true, get: function () { return types_1.BUNDLE_STATUS_UNKNOWN; } });
33
+ const utils_1 = require("./utils");
34
+ Object.defineProperty(exports, "applyInjectedExecutions", { enumerable: true, get: function () { return utils_1.applyInjectedExecutions; } });
35
+ Object.defineProperty(exports, "BundleStatus", { enumerable: true, get: function () { return utils_1.BundleStatusEnum; } });
36
+ Object.defineProperty(exports, "getEmptyUserOp", { enumerable: true, get: function () { return utils_1.getEmptyUserOp; } });
37
+ Object.defineProperty(exports, "getOrderBundleHash", { enumerable: true, get: function () { return utils_1.getOrderBundleHash; } });
38
+ function getOrchestrator(apiKey, orchestratorUrl) {
39
+ return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
40
+ }
@@ -0,0 +1,17 @@
1
+ import { type Address, type Chain, type Hex } from 'viem';
2
+ import { TokenConfig } from './types';
3
+ declare function getWethAddress(chain: Chain): "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14" | "0x4200000000000000000000000000000000000006" | "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" | "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73" | "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619" | "0x52eF3d68BaB452a294342DC3e5f464d7f610f72E";
4
+ declare function getTokenRootBalanceSlot(chain: Chain, tokenAddress: Address): bigint | null;
5
+ declare function getTokenBalanceSlot(tokenSymbol: string, chainId: number, accountAddress: Address): Hex;
6
+ declare function getHookAddress(_chainId?: number): Address;
7
+ declare function getSameChainModuleAddress(_chainId?: number): Address;
8
+ declare function getTargetModuleAddress(_chainId?: number): Address;
9
+ declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
10
+ declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
11
+ declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
12
+ declare function getChainById(chainId: number): Chain | undefined;
13
+ declare function isTestnet(chainId: number): boolean;
14
+ declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
15
+ declare function getSupportedTokens(chainId: number): TokenConfig[];
16
+ export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, };
17
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAGT,MAAM,MAAM,CAAA;AAcb,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,0UAoCnC;AAwCD,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CAqJf;AAED,iBAAS,mBAAmB,CAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,OAAO,GACtB,GAAG,CAgBL;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,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,WAMjC;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAW3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAkB1D;AAkBD,OAAO,EACL,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,uBAAuB,GACxB,CAAA"}