@rhinestone/sdk 1.0.0-alpha.1 → 1.0.0-alpha.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 (102) hide show
  1. package/dist/src/accounts/error.d.ts.map +1 -1
  2. package/dist/src/accounts/error.js +2 -0
  3. package/dist/src/accounts/index.d.ts +15 -8
  4. package/dist/src/accounts/index.d.ts.map +1 -1
  5. package/dist/src/accounts/index.js +204 -164
  6. package/dist/src/accounts/index.test.js +2 -2
  7. package/dist/src/accounts/kernel.d.ts +7 -9
  8. package/dist/src/accounts/kernel.d.ts.map +1 -1
  9. package/dist/src/accounts/kernel.js +0 -9
  10. package/dist/src/accounts/kernel.test.js +6 -6
  11. package/dist/src/accounts/nexus.d.ts +14 -13
  12. package/dist/src/accounts/nexus.d.ts.map +1 -1
  13. package/dist/src/accounts/nexus.js +91 -88
  14. package/dist/src/accounts/nexus.test.js +10 -10
  15. package/dist/src/accounts/safe.d.ts +4 -6
  16. package/dist/src/accounts/safe.d.ts.map +1 -1
  17. package/dist/src/accounts/safe.js +20 -30
  18. package/dist/src/accounts/safe.test.js +6 -6
  19. package/dist/src/accounts/startale.d.ts +20 -0
  20. package/dist/src/accounts/startale.d.ts.map +1 -0
  21. package/dist/src/accounts/startale.js +100 -0
  22. package/dist/src/accounts/startale.test.d.ts +2 -0
  23. package/dist/src/accounts/startale.test.d.ts.map +1 -0
  24. package/dist/src/accounts/startale.test.js +97 -0
  25. package/dist/src/accounts/utils.d.ts +4 -3
  26. package/dist/src/accounts/utils.d.ts.map +1 -1
  27. package/dist/src/accounts/utils.js +44 -0
  28. package/dist/src/actions/index.d.ts +17 -7
  29. package/dist/src/actions/index.d.ts.map +1 -1
  30. package/dist/src/actions/index.js +108 -15
  31. package/dist/src/actions/index.test.js +35 -17
  32. package/dist/src/actions/smart-session.d.ts +2 -2
  33. package/dist/src/actions/smart-session.d.ts.map +1 -1
  34. package/dist/src/execution/compact.d.ts +6 -3
  35. package/dist/src/execution/compact.d.ts.map +1 -1
  36. package/dist/src/execution/compact.js +44 -1
  37. package/dist/src/execution/error.d.ts +2 -9
  38. package/dist/src/execution/error.d.ts.map +1 -1
  39. package/dist/src/execution/error.js +4 -13
  40. package/dist/src/execution/index.d.ts +2 -3
  41. package/dist/src/execution/index.d.ts.map +1 -1
  42. package/dist/src/execution/index.js +34 -49
  43. package/dist/src/execution/smart-session.d.ts +1 -1
  44. package/dist/src/execution/smart-session.d.ts.map +1 -1
  45. package/dist/src/execution/smart-session.js +12 -17
  46. package/dist/src/execution/utils.d.ts +13 -11
  47. package/dist/src/execution/utils.d.ts.map +1 -1
  48. package/dist/src/execution/utils.js +141 -85
  49. package/dist/src/index.d.ts +14 -14
  50. package/dist/src/index.d.ts.map +1 -1
  51. package/dist/src/index.js +24 -20
  52. package/dist/src/modules/index.d.ts +3 -7
  53. package/dist/src/modules/index.d.ts.map +1 -1
  54. package/dist/src/modules/index.js +1 -10
  55. package/dist/src/modules/index.test.js +2 -2
  56. package/dist/src/modules/omni-account.d.ts +1 -4
  57. package/dist/src/modules/omni-account.d.ts.map +1 -1
  58. package/dist/src/modules/omni-account.js +2 -8
  59. package/dist/src/modules/read.d.ts +5 -6
  60. package/dist/src/modules/read.d.ts.map +1 -1
  61. package/dist/src/modules/read.js +6 -37
  62. package/dist/src/modules/validators/core.d.ts +6 -7
  63. package/dist/src/modules/validators/core.d.ts.map +1 -1
  64. package/dist/src/modules/validators/core.js +83 -8
  65. package/dist/src/modules/validators/core.test.js +4 -4
  66. package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
  67. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
  68. package/dist/src/modules/validators/smart-sessions.js +7 -6
  69. package/dist/src/modules/validators/smart-sessions.test.js +4 -4
  70. package/dist/src/orchestrator/client.d.ts +1 -0
  71. package/dist/src/orchestrator/client.d.ts.map +1 -1
  72. package/dist/src/orchestrator/client.js +136 -94
  73. package/dist/src/orchestrator/consts.d.ts +3 -3
  74. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  75. package/dist/src/orchestrator/consts.js +4 -4
  76. package/dist/src/orchestrator/index.d.ts +2 -2
  77. package/dist/src/orchestrator/index.d.ts.map +1 -1
  78. package/dist/src/orchestrator/index.js +1 -7
  79. package/dist/src/orchestrator/registry.d.ts +31 -12
  80. package/dist/src/orchestrator/registry.d.ts.map +1 -1
  81. package/dist/src/orchestrator/registry.js +57 -380
  82. package/dist/src/orchestrator/registry.json +365 -0
  83. package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
  84. package/dist/src/orchestrator/registry.test.js +137 -0
  85. package/dist/src/orchestrator/types.d.ts +69 -14
  86. package/dist/src/orchestrator/types.d.ts.map +1 -1
  87. package/dist/src/orchestrator/utils.d.ts.map +1 -1
  88. package/dist/src/orchestrator/utils.js +2 -2
  89. package/dist/src/types.d.ts +41 -21
  90. package/dist/src/types.d.ts.map +1 -1
  91. package/dist/test/consts.d.ts +2 -2
  92. package/dist/test/consts.d.ts.map +1 -1
  93. package/package.json +1 -1
  94. package/dist/src/actions/registry.d.ts +0 -7
  95. package/dist/src/actions/registry.d.ts.map +0 -1
  96. package/dist/src/actions/registry.js +0 -7
  97. package/dist/src/actions/registry.test.d.ts.map +0 -1
  98. package/dist/src/actions/registry.test.js +0 -25
  99. package/dist/src/modules/registry.d.ts +0 -13
  100. package/dist/src/modules/registry.d.ts.map +0 -1
  101. package/dist/src/modules/registry.js +0 -67
  102. /package/dist/src/{actions → orchestrator}/registry.test.d.ts +0 -0
@@ -54,7 +54,17 @@ class Orchestrator {
54
54
  }
55
55
  async getMaxTokenAmount(userAddress, destinationChainId, destinationTokenAddress, destinationGasUnits) {
56
56
  const intentCost = await this.getIntentCost({
57
- account: userAddress,
57
+ account: {
58
+ address: userAddress,
59
+ accountType: 'ERC7579',
60
+ setupOps: [
61
+ {
62
+ to: viem_1.zeroAddress,
63
+ data: '0x',
64
+ },
65
+ ],
66
+ delegations: {},
67
+ },
58
68
  destinationExecutions: [],
59
69
  destinationChainId,
60
70
  destinationGasUnits,
@@ -63,9 +73,6 @@ class Orchestrator {
63
73
  tokenAddress: destinationTokenAddress,
64
74
  },
65
75
  ],
66
- smartAccount: {
67
- accountType: 'ERC7579',
68
- },
69
76
  });
70
77
  if (!intentCost.hasFulfilledAll) {
71
78
  return 0n;
@@ -82,47 +89,71 @@ class Orchestrator {
82
89
  return tokenReceived.destinationAmount;
83
90
  }
84
91
  async getIntentCost(input) {
85
- const response = await axios_1.default.post(`${this.serverUrl}/intents/cost`, {
86
- ...(0, utils_1.convertBigIntFields)({
87
- ...input,
88
- tokenTransfers: input.tokenTransfers.map((transfer) => ({
89
- tokenAddress: transfer.tokenAddress,
90
- })),
91
- }),
92
- }, {
93
- headers: {
94
- 'x-api-key': this.apiKey,
95
- },
96
- });
97
- return response.data;
92
+ try {
93
+ const response = await axios_1.default.post(`${this.serverUrl}/intents/cost`, {
94
+ ...(0, utils_1.convertBigIntFields)({
95
+ ...input,
96
+ tokenTransfers: input.tokenTransfers.map((transfer) => ({
97
+ tokenAddress: transfer.tokenAddress,
98
+ })),
99
+ }),
100
+ }, {
101
+ headers: {
102
+ 'x-api-key': this.apiKey,
103
+ },
104
+ });
105
+ return response.data;
106
+ }
107
+ catch (error) {
108
+ this.parseError(error);
109
+ throw new Error('Failed to get intent cost');
110
+ }
98
111
  }
99
112
  async getIntentRoute(input) {
100
- const response = await axios_1.default.post(`${this.serverUrl}/intents/route`, {
101
- ...(0, utils_1.convertBigIntFields)(input),
102
- }, {
103
- headers: {
104
- 'x-api-key': this.apiKey,
105
- },
106
- });
107
- return response.data;
113
+ try {
114
+ const response = await axios_1.default.post(`${this.serverUrl}/intents/route`, {
115
+ ...(0, utils_1.convertBigIntFields)(input),
116
+ }, {
117
+ headers: {
118
+ 'x-api-key': this.apiKey,
119
+ },
120
+ });
121
+ return response.data;
122
+ }
123
+ catch (error) {
124
+ this.parseError(error);
125
+ throw new Error('Failed to get intent route');
126
+ }
108
127
  }
109
128
  async submitIntent(signedIntentOp) {
110
- const response = await axios_1.default.post(`${this.serverUrl}/intent-operations`, {
111
- signedIntentOp: (0, utils_1.convertBigIntFields)(signedIntentOp),
112
- }, {
113
- headers: {
114
- 'x-api-key': this.apiKey,
115
- },
116
- });
117
- return response.data;
129
+ try {
130
+ const response = await axios_1.default.post(`${this.serverUrl}/intent-operations`, {
131
+ signedIntentOp: (0, utils_1.convertBigIntFields)(signedIntentOp),
132
+ }, {
133
+ headers: {
134
+ 'x-api-key': this.apiKey,
135
+ },
136
+ });
137
+ return response.data;
138
+ }
139
+ catch (error) {
140
+ this.parseError(error);
141
+ throw new Error('Failed to submit intent');
142
+ }
118
143
  }
119
144
  async getIntentOpStatus(intentId) {
120
- const response = await axios_1.default.get(`${this.serverUrl}/intent-operation/${intentId.toString()}/status`, {
121
- headers: {
122
- 'x-api-key': this.apiKey,
123
- },
124
- });
125
- return response.data;
145
+ try {
146
+ const response = await axios_1.default.get(`${this.serverUrl}/intent-operation/${intentId.toString()}/status`, {
147
+ headers: {
148
+ 'x-api-key': this.apiKey,
149
+ },
150
+ });
151
+ return response.data;
152
+ }
153
+ catch (error) {
154
+ this.parseError(error);
155
+ throw new Error('Failed to get intent op status');
156
+ }
126
157
  }
127
158
  parseError(error) {
128
159
  if (error.response) {
@@ -156,7 +187,15 @@ class Orchestrator {
156
187
  }
157
188
  let context = {};
158
189
  if (error.response.data) {
159
- const { errors, traceId } = error.response.data;
190
+ const { errors, traceId, message } = error.response.data;
191
+ if (message) {
192
+ const mainErrorParams = {
193
+ context: { traceId },
194
+ errorType,
195
+ traceId,
196
+ };
197
+ this.parseErrorMessage(message, mainErrorParams);
198
+ }
160
199
  for (const err of errors) {
161
200
  let errorMessage = `Rhinestone Error: ${err.message}`;
162
201
  if (errorType) {
@@ -177,60 +216,7 @@ class Orchestrator {
177
216
  errorType,
178
217
  traceId,
179
218
  };
180
- if (message === 'Insufficient balance') {
181
- throw new error_1.InsufficientBalanceError(finalErrorParams);
182
- }
183
- else if (message === 'Unsupported chain id') {
184
- throw new error_1.UnsupportedChainIdError(finalErrorParams);
185
- }
186
- else if (message.startsWith('Unsupported chain ')) {
187
- const chainIdMatch = message.match(/Unsupported chain (\d+)/);
188
- if (chainIdMatch) {
189
- const chainId = parseInt(chainIdMatch[1], 10);
190
- throw new error_1.UnsupportedChainError(chainId, finalErrorParams);
191
- }
192
- throw new error_1.UnsupportedChainIdError(finalErrorParams);
193
- }
194
- else if (message.includes('Unsupported token') &&
195
- message.includes('for chain')) {
196
- const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
197
- if (tokenMatch) {
198
- const tokenSymbol = tokenMatch[1];
199
- const chainId = parseInt(tokenMatch[2], 10);
200
- throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, finalErrorParams);
201
- }
202
- throw new error_1.OrchestratorError({ message, ...finalErrorParams });
203
- }
204
- else if (message.includes('not supported on chain')) {
205
- const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
206
- if (tokenMatch) {
207
- const tokenAddress = tokenMatch[1];
208
- const chainId = parseInt(tokenMatch[2], 10);
209
- throw new error_1.TokenNotSupportedError(tokenAddress, chainId, finalErrorParams);
210
- }
211
- throw new error_1.OrchestratorError({ message, ...finalErrorParams });
212
- }
213
- else if (message === 'Authentication is required') {
214
- throw new error_1.AuthenticationRequiredError(finalErrorParams);
215
- }
216
- else if (message === 'Invalid API key') {
217
- throw new error_1.InvalidApiKeyError(finalErrorParams);
218
- }
219
- else if (message === 'Invalid bundle signature') {
220
- throw new error_1.InvalidIntentSignatureError(finalErrorParams);
221
- }
222
- else if (message === 'Only one target token amount can be unset') {
223
- throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(finalErrorParams);
224
- }
225
- else if (message === 'No Path Found') {
226
- throw new error_1.NoPathFoundError(finalErrorParams);
227
- }
228
- else if (message === 'Order bundle not found') {
229
- throw new error_1.IntentNotFoundError(finalErrorParams);
230
- }
231
- else {
232
- throw new error_1.OrchestratorError({ message, ...finalErrorParams });
233
- }
219
+ this.parseErrorMessage(message, finalErrorParams);
234
220
  }
235
221
  }
236
222
  else {
@@ -238,5 +224,61 @@ class Orchestrator {
238
224
  }
239
225
  }
240
226
  }
227
+ parseErrorMessage(message, errorParams) {
228
+ if (message === 'Insufficient balance') {
229
+ throw new error_1.InsufficientBalanceError(errorParams);
230
+ }
231
+ else if (message === 'Unsupported chain id') {
232
+ throw new error_1.UnsupportedChainIdError(errorParams);
233
+ }
234
+ else if (message.startsWith('Unsupported chain ')) {
235
+ const chainIdMatch = message.match(/Unsupported chain (\d+)/);
236
+ if (chainIdMatch) {
237
+ const chainId = parseInt(chainIdMatch[1], 10);
238
+ throw new error_1.UnsupportedChainError(chainId, errorParams);
239
+ }
240
+ throw new error_1.UnsupportedChainIdError(errorParams);
241
+ }
242
+ else if (message.includes('Unsupported token') &&
243
+ message.includes('for chain')) {
244
+ const tokenMatch = message.match(/Unsupported token (\w+) for chain (\d+)/);
245
+ if (tokenMatch) {
246
+ const tokenSymbol = tokenMatch[1];
247
+ const chainId = parseInt(tokenMatch[2], 10);
248
+ throw new error_1.UnsupportedTokenError(tokenSymbol, chainId, errorParams);
249
+ }
250
+ throw new error_1.OrchestratorError({ message, ...errorParams });
251
+ }
252
+ else if (message.includes('not supported on chain')) {
253
+ const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
254
+ if (tokenMatch) {
255
+ const tokenAddress = tokenMatch[1];
256
+ const chainId = parseInt(tokenMatch[2], 10);
257
+ throw new error_1.TokenNotSupportedError(tokenAddress, chainId, errorParams);
258
+ }
259
+ throw new error_1.OrchestratorError({ message, ...errorParams });
260
+ }
261
+ else if (message === 'Authentication is required') {
262
+ throw new error_1.AuthenticationRequiredError(errorParams);
263
+ }
264
+ else if (message === 'Invalid API key') {
265
+ throw new error_1.InvalidApiKeyError(errorParams);
266
+ }
267
+ else if (message === 'Invalid bundle signature') {
268
+ throw new error_1.InvalidIntentSignatureError(errorParams);
269
+ }
270
+ else if (message === 'Only one target token amount can be unset') {
271
+ throw new error_1.OnlyOneTargetTokenAmountCanBeUnsetError(errorParams);
272
+ }
273
+ else if (message === 'No Path Found') {
274
+ throw new error_1.NoPathFoundError(errorParams);
275
+ }
276
+ else if (message === 'Order bundle not found') {
277
+ throw new error_1.IntentNotFoundError(errorParams);
278
+ }
279
+ else {
280
+ throw new error_1.OrchestratorError({ message, ...errorParams });
281
+ }
282
+ }
241
283
  }
242
284
  exports.Orchestrator = Orchestrator;
@@ -1,5 +1,5 @@
1
- declare const PROD_ORCHESTRATOR_URL = "https://dev.v1.orchestrator.rhinestone.dev";
2
- declare const DEV_ORCHESTRATOR_URL = "https://dev.v1.orchestrator.rhinestone.dev";
1
+ declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
2
+ declare const STAGING_ORCHESTRATOR_URL = "https://staging.v1.orchestrator.rhinestone.dev";
3
3
  declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
4
- export { PROD_ORCHESTRATOR_URL, DEV_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
4
+ export { PROD_ORCHESTRATOR_URL, STAGING_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, };
5
5
  //# sourceMappingURL=consts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,+CAA+C,CAAA;AAC1E,QAAA,MAAM,oBAAoB,+CAA+C,CAAA;AACzE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,CAAA"}
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,wBAAwB,mDACoB,CAAA;AAClD,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,GAC9B,CAAA"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
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://dev.v1.orchestrator.rhinestone.dev';
3
+ exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.STAGING_ORCHESTRATOR_URL = exports.PROD_ORCHESTRATOR_URL = void 0;
4
+ const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
5
5
  exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
6
- const DEV_ORCHESTRATOR_URL = 'https://dev.v1.orchestrator.rhinestone.dev';
7
- exports.DEV_ORCHESTRATOR_URL = DEV_ORCHESTRATOR_URL;
6
+ const STAGING_ORCHESTRATOR_URL = 'https://staging.v1.orchestrator.rhinestone.dev';
7
+ exports.STAGING_ORCHESTRATOR_URL = STAGING_ORCHESTRATOR_URL;
8
8
  const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
9
9
  exports.RHINESTONE_SPOKE_POOL_ADDRESS = RHINESTONE_SPOKE_POOL_ADDRESS;
@@ -1,11 +1,11 @@
1
1
  import { Orchestrator } from './client';
2
2
  import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
3
3
  import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
4
- import { getHookAddress, getRhinestoneSpokePoolAddress, getSameChainModuleAddress, getSupportedTokens, getTargetModuleAddress, getTokenAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
4
+ import { getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
5
5
  import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig } from './types';
6
6
  import { INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN } from './types';
7
7
  import { getIntentOpHash } from './utils';
8
8
  declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
9
9
  export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, };
10
- export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getIntentOpHash, getWethAddress, getTokenBalanceSlot, getTokenRootBalanceSlot, getTokenSymbol, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, };
10
+ export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getIntentOpHash, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, };
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,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,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,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACZ,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,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC,iBAAS,eAAe,CACtB,MAAM,EAAE,MAAM,EACd,eAAe,CAAC,EAAE,MAAM,GACvB,YAAY,CAEd;AAED,YAAY,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,SAAS,GACV,CAAA;AACD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,iCAAiC,EACjC,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,YAAY,EACZ,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,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,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,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,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACxB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.getIntentOpHash = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
3
+ exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.getIntentOpHash = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
4
4
  exports.getOrchestrator = getOrchestrator;
5
5
  const client_1 = require("./client");
6
6
  Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
@@ -21,14 +21,8 @@ Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get:
21
21
  Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
22
22
  Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
23
23
  const registry_1 = require("./registry");
24
- Object.defineProperty(exports, "getHookAddress", { enumerable: true, get: function () { return registry_1.getHookAddress; } });
25
- Object.defineProperty(exports, "getRhinestoneSpokePoolAddress", { enumerable: true, get: function () { return registry_1.getRhinestoneSpokePoolAddress; } });
26
- Object.defineProperty(exports, "getSameChainModuleAddress", { enumerable: true, get: function () { return registry_1.getSameChainModuleAddress; } });
27
24
  Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
28
- Object.defineProperty(exports, "getTargetModuleAddress", { enumerable: true, get: function () { return registry_1.getTargetModuleAddress; } });
29
25
  Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
30
- Object.defineProperty(exports, "getTokenBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenBalanceSlot; } });
31
- Object.defineProperty(exports, "getTokenRootBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenRootBalanceSlot; } });
32
26
  Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
33
27
  Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
34
28
  Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
@@ -1,20 +1,39 @@
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" | "0x5aea5775959fbc2557cc8789bc1bf90a239d9a91";
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;
1
+ import { type Address, type Chain } from 'viem';
2
+ import type { TokenSymbol } from '../types';
3
+ import type { TokenConfig } from './types';
4
+ interface TokenEntry {
5
+ symbol: string;
6
+ address: Address;
7
+ decimals: number;
8
+ balanceSlot: number | null;
9
+ }
10
+ interface ChainContracts {
11
+ spokepool: Address;
12
+ hook: Address;
13
+ originModule: Address;
14
+ targetModule: Address;
15
+ sameChainModule: Address;
16
+ }
17
+ interface ChainEntry {
18
+ name: string;
19
+ contracts: ChainContracts;
20
+ tokens: TokenEntry[];
21
+ }
22
+ interface Registry {
23
+ [chainId: string]: ChainEntry;
24
+ }
25
+ declare function getSupportedChainIds(): number[];
26
+ declare function getWethAddress(chain: Chain): Address;
10
27
  declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
11
- declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
28
+ declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
12
29
  declare function getChainById(chainId: number): Chain | undefined;
13
30
  declare function isTestnet(chainId: number): boolean;
14
31
  declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
15
32
  declare function getSupportedTokens(chainId: number): TokenConfig[];
16
33
  declare function getDefaultAccountAccessList(onTestnets?: boolean): {
17
- chainIds: (11155111 | 84532 | 421614 | 11155420)[] | (1 | 8453 | 42161 | 10)[];
34
+ chainIds: number[];
18
35
  };
19
- export { getTokenSymbol, getTokenAddress, getTokenRootBalanceSlot, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, getSupportedTokens, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, };
36
+ declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
37
+ export { getTokenSymbol, getTokenAddress, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
38
+ export type { TokenEntry, ChainContracts, ChainEntry, Registry };
20
39
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +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;AAeb,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,yXAuCnC;AAqED,iBAAS,uBAAuB,CAC9B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CA4Lf;AAED,iBAAS,mBAAmB,CAC1B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,OAAO,GACtB,GAAG,CAg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