@rhinestone/sdk 1.5.0 → 2.0.0-beta.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/dist/src/accounts/error.d.ts +1 -1
- package/dist/src/accounts/error.js +1 -19
- package/dist/src/accounts/index.d.ts +5 -5
- package/dist/src/accounts/index.js +121 -157
- package/dist/src/accounts/json-rpc/index.d.ts +1 -1
- package/dist/src/accounts/json-rpc/index.js +8 -10
- package/dist/src/accounts/json-rpc/providers.d.ts +1 -1
- package/dist/src/accounts/json-rpc/providers.js +4 -7
- package/dist/src/accounts/kernel.d.ts +3 -3
- package/dist/src/accounts/kernel.js +66 -75
- package/dist/src/accounts/nexus.d.ts +3 -3
- package/dist/src/accounts/nexus.js +62 -73
- package/dist/src/accounts/passport.d.ts +3 -3
- package/dist/src/accounts/passport.js +9 -13
- package/dist/src/accounts/safe.d.ts +3 -3
- package/dist/src/accounts/safe.js +54 -63
- package/dist/src/accounts/signing/common.d.ts +2 -2
- package/dist/src/accounts/signing/common.js +30 -36
- package/dist/src/accounts/signing/message.d.ts +2 -2
- package/dist/src/accounts/signing/message.js +10 -12
- package/dist/src/accounts/signing/passkeys.js +11 -17
- package/dist/src/accounts/signing/typedData.d.ts +1 -1
- package/dist/src/accounts/signing/typedData.js +6 -8
- package/dist/src/accounts/startale.d.ts +3 -3
- package/dist/src/accounts/startale.js +37 -47
- package/dist/src/accounts/utils.d.ts +2 -2
- package/dist/src/accounts/utils.js +22 -28
- package/dist/src/accounts/walletClient.js +4 -8
- package/dist/src/actions/compact.d.ts +1 -1
- package/dist/src/actions/compact.js +22 -35
- package/dist/src/actions/deployment.d.ts +1 -1
- package/dist/src/actions/deployment.js +11 -13
- package/dist/src/actions/ecdsa.d.ts +1 -1
- package/dist/src/actions/ecdsa.js +14 -20
- package/dist/src/actions/index.d.ts +2 -2
- package/dist/src/actions/index.js +6 -10
- package/dist/src/actions/mfa.d.ts +1 -1
- package/dist/src/actions/mfa.js +18 -24
- package/dist/src/actions/passkeys.d.ts +2 -2
- package/dist/src/actions/passkeys.js +14 -20
- package/dist/src/actions/recovery.d.ts +1 -1
- package/dist/src/actions/recovery.js +25 -29
- package/dist/src/actions/smart-sessions.d.ts +1 -1
- package/dist/src/actions/smart-sessions.js +8 -12
- package/dist/src/auth/provider.d.ts +1 -1
- package/dist/src/auth/provider.js +1 -4
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.js +10 -54
- package/dist/src/execution/compact.d.ts +3 -3
- package/dist/src/execution/compact.js +10 -18
- package/dist/src/execution/error.js +1 -11
- package/dist/src/execution/index.d.ts +8 -8
- package/dist/src/execution/index.js +50 -65
- package/dist/src/execution/permit2.d.ts +5 -5
- package/dist/src/execution/permit2.js +8 -13
- package/dist/src/execution/singleChainOps.d.ts +2 -2
- package/dist/src/execution/singleChainOps.js +1 -3
- package/dist/src/execution/types.d.ts +1 -1
- package/dist/src/execution/types.js +1 -2
- package/dist/src/execution/utils.d.ts +4 -4
- package/dist/src/execution/utils.js +133 -156
- package/dist/src/index.d.ts +9 -9
- package/dist/src/index.js +55 -66
- package/dist/src/jwt-server/digest.js +3 -6
- package/dist/src/jwt-server/express.d.ts +1 -1
- package/dist/src/jwt-server/express.d.ts.map +1 -1
- package/dist/src/jwt-server/express.js +6 -7
- package/dist/src/jwt-server/handlers.d.ts +1 -1
- package/dist/src/jwt-server/handlers.js +7 -11
- package/dist/src/jwt-server/index.d.ts +7 -7
- package/dist/src/jwt-server/index.js +6 -17
- package/dist/src/jwt-server/jcs.js +1 -4
- package/dist/src/jwt-server/signer.d.ts +1 -1
- package/dist/src/jwt-server/signer.js +10 -13
- package/dist/src/jwt-server/sponsorship.js +2 -7
- package/dist/src/jwt-server/web.d.ts +1 -1
- package/dist/src/jwt-server/web.js +5 -9
- package/dist/src/modules/abi/smart-session-emissary.js +1 -3
- package/dist/src/modules/abi/smart-sessions.js +1 -4
- package/dist/src/modules/chain-abstraction.js +1 -5
- package/dist/src/modules/common.d.ts +1 -1
- package/dist/src/modules/common.js +1 -13
- package/dist/src/modules/index.d.ts +5 -5
- package/dist/src/modules/index.js +35 -50
- package/dist/src/modules/legacy.d.ts +2 -2
- package/dist/src/modules/legacy.js +11 -14
- package/dist/src/modules/read.d.ts +1 -1
- package/dist/src/modules/read.js +11 -15
- package/dist/src/modules/validators/core.d.ts +2 -2
- package/dist/src/modules/validators/core.js +26 -44
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.js +3 -19
- package/dist/src/modules/validators/policies/claim/permit2.d.ts +1 -1
- package/dist/src/modules/validators/policies/claim/permit2.js +39 -44
- package/dist/src/modules/validators/policies/claim/types.js +11 -14
- package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
- package/dist/src/modules/validators/smart-sessions.js +65 -94
- package/dist/src/orchestrator/client.d.ts +2 -2
- package/dist/src/orchestrator/client.js +46 -50
- package/dist/src/orchestrator/consts.d.ts +1 -1
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +2 -8
- package/dist/src/orchestrator/error.js +1 -33
- package/dist/src/orchestrator/index.d.ts +7 -7
- package/dist/src/orchestrator/index.js +7 -56
- package/dist/src/orchestrator/registry.d.ts +2 -2
- package/dist/src/orchestrator/registry.js +19 -33
- package/dist/src/orchestrator/types.js +1 -17
- package/dist/src/orchestrator/utils.js +1 -3
- package/dist/src/types.d.ts +3 -3
- package/dist/src/types.js +1 -2
- package/dist/src/utils/index.d.ts +2 -2
- package/dist/src/utils/index.js +9 -15
- package/package.json +15 -98
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const consts_1 = require("./consts");
|
|
5
|
-
const error_1 = require("./error");
|
|
6
|
-
const utils_1 = require("./utils");
|
|
1
|
+
import { API_VERSION, SDK_VERSION } from './consts.js';
|
|
2
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, } from './error.js';
|
|
3
|
+
import { convertBigIntFields } from './utils.js';
|
|
7
4
|
function parseTokenAmountsRecord(record) {
|
|
8
5
|
return Object.fromEntries(Object.entries(record).map(([addr, amount]) => [
|
|
9
6
|
addr,
|
|
10
7
|
BigInt(amount),
|
|
11
8
|
]));
|
|
12
9
|
}
|
|
13
|
-
class Orchestrator {
|
|
10
|
+
export class Orchestrator {
|
|
14
11
|
serverUrl;
|
|
15
12
|
authProvider;
|
|
16
13
|
extraHeaders;
|
|
@@ -52,7 +49,7 @@ class Orchestrator {
|
|
|
52
49
|
return portfolio;
|
|
53
50
|
}
|
|
54
51
|
async getIntentRoute(input) {
|
|
55
|
-
const body =
|
|
52
|
+
const body = convertBigIntFields(input);
|
|
56
53
|
return await this.fetch(`${this.serverUrl}/intents/route`, {
|
|
57
54
|
method: 'POST',
|
|
58
55
|
headers: await this.getHeaders(),
|
|
@@ -63,7 +60,7 @@ class Orchestrator {
|
|
|
63
60
|
const response = await fetch(`${this.serverUrl}/intents/split`, {
|
|
64
61
|
method: 'POST',
|
|
65
62
|
headers: await this.getHeaders(),
|
|
66
|
-
body: JSON.stringify(
|
|
63
|
+
body: JSON.stringify(convertBigIntFields({
|
|
67
64
|
chainId: input.chain.id,
|
|
68
65
|
tokens: input.tokens,
|
|
69
66
|
settlementLayers: input.settlementLayers,
|
|
@@ -88,7 +85,7 @@ class Orchestrator {
|
|
|
88
85
|
}
|
|
89
86
|
if (response.status === 422 &&
|
|
90
87
|
errorData.error === 'INSUFFICIENT_LIQUIDITY') {
|
|
91
|
-
throw new
|
|
88
|
+
throw new InsufficientLiquidityError({
|
|
92
89
|
availableIntents: errorData.availableIntents.map(parseTokenAmountsRecord),
|
|
93
90
|
unfillable: parseTokenAmountsRecord(errorData.unfillable),
|
|
94
91
|
traceId: errorData.traceId,
|
|
@@ -102,10 +99,10 @@ class Orchestrator {
|
|
|
102
99
|
headers: {},
|
|
103
100
|
},
|
|
104
101
|
});
|
|
105
|
-
throw new
|
|
102
|
+
throw new OrchestratorError({ message: 'Unexpected error' });
|
|
106
103
|
}
|
|
107
104
|
async submitIntent(signedIntentOpUnformatted, dryRun, policyContext) {
|
|
108
|
-
const signedIntentOp =
|
|
105
|
+
const signedIntentOp = convertBigIntFields(signedIntentOpUnformatted);
|
|
109
106
|
if (dryRun) {
|
|
110
107
|
signedIntentOp.options = {
|
|
111
108
|
dryRun: true,
|
|
@@ -130,8 +127,8 @@ class Orchestrator {
|
|
|
130
127
|
const auth = await this.authProvider.getHeaders();
|
|
131
128
|
return {
|
|
132
129
|
'Content-Type': 'application/json',
|
|
133
|
-
'x-sdk-version':
|
|
134
|
-
'x-api-version':
|
|
130
|
+
'x-sdk-version': SDK_VERSION,
|
|
131
|
+
'x-api-version': API_VERSION,
|
|
135
132
|
...auth,
|
|
136
133
|
...this.extraHeaders,
|
|
137
134
|
};
|
|
@@ -140,7 +137,7 @@ class Orchestrator {
|
|
|
140
137
|
const auth = await this.authProvider.getSubmitHeaders(intentInput, isSponsored);
|
|
141
138
|
return {
|
|
142
139
|
'Content-Type': 'application/json',
|
|
143
|
-
'x-sdk-version':
|
|
140
|
+
'x-sdk-version': SDK_VERSION,
|
|
144
141
|
...auth,
|
|
145
142
|
...this.extraHeaders,
|
|
146
143
|
};
|
|
@@ -218,13 +215,13 @@ class Orchestrator {
|
|
|
218
215
|
if (status === 429) {
|
|
219
216
|
const retryAfter = headers?.retryAfter;
|
|
220
217
|
const context = { traceId, retryAfter };
|
|
221
|
-
throw new
|
|
218
|
+
throw new RateLimitedError({
|
|
222
219
|
...baseParams,
|
|
223
220
|
context,
|
|
224
221
|
});
|
|
225
222
|
}
|
|
226
223
|
if (status === 503) {
|
|
227
|
-
throw new
|
|
224
|
+
throw new ServiceUnavailableError(baseParams);
|
|
228
225
|
}
|
|
229
226
|
if (message) {
|
|
230
227
|
this.parseErrorMessage(message, baseParams);
|
|
@@ -238,36 +235,36 @@ class Orchestrator {
|
|
|
238
235
|
}
|
|
239
236
|
switch (status) {
|
|
240
237
|
case 400:
|
|
241
|
-
throw new
|
|
238
|
+
throw new BadRequestError({
|
|
242
239
|
...baseParams,
|
|
243
240
|
context: { traceId, errors },
|
|
244
241
|
message: message,
|
|
245
242
|
});
|
|
246
243
|
case 401:
|
|
247
244
|
if (message === 'Authentication is required') {
|
|
248
|
-
throw new
|
|
245
|
+
throw new AuthenticationRequiredError(baseParams);
|
|
249
246
|
}
|
|
250
|
-
throw new
|
|
247
|
+
throw new UnauthorizedError(baseParams);
|
|
251
248
|
case 403:
|
|
252
|
-
throw new
|
|
249
|
+
throw new ForbiddenError(baseParams);
|
|
253
250
|
case 404:
|
|
254
|
-
throw new
|
|
251
|
+
throw new ResourceNotFoundError(baseParams);
|
|
255
252
|
case 409:
|
|
256
|
-
throw new
|
|
253
|
+
throw new ConflictError(baseParams);
|
|
257
254
|
case 500:
|
|
258
255
|
if (errors && errors.length > 0) {
|
|
259
256
|
const mergedParams = {
|
|
260
257
|
...baseParams,
|
|
261
258
|
context: { ...errors[0].context, traceId },
|
|
262
259
|
};
|
|
263
|
-
throw new
|
|
260
|
+
throw new OrchestratorError({
|
|
264
261
|
...mergedParams,
|
|
265
262
|
message: errors[0].message || 'Internal Server Error',
|
|
266
263
|
});
|
|
267
264
|
}
|
|
268
|
-
throw new
|
|
265
|
+
throw new InternalServerError(baseParams);
|
|
269
266
|
default:
|
|
270
|
-
throw new
|
|
267
|
+
throw new OrchestratorError({
|
|
271
268
|
...baseParams,
|
|
272
269
|
message: message || errorType,
|
|
273
270
|
});
|
|
@@ -276,19 +273,19 @@ class Orchestrator {
|
|
|
276
273
|
}
|
|
277
274
|
parseErrorMessage(message, errorParams) {
|
|
278
275
|
if (message === 'Insufficient balance') {
|
|
279
|
-
throw new
|
|
276
|
+
throw new InsufficientBalanceError(errorParams);
|
|
280
277
|
}
|
|
281
278
|
else if (message === 'Unsupported chain id' ||
|
|
282
279
|
message === 'Unsupported chain ids') {
|
|
283
|
-
throw new
|
|
280
|
+
throw new UnsupportedChainIdError(errorParams);
|
|
284
281
|
}
|
|
285
282
|
else if (message.startsWith('Unsupported chain ')) {
|
|
286
283
|
const chainIdMatch = message.match(/Unsupported chain (\d+)/);
|
|
287
284
|
if (chainIdMatch) {
|
|
288
285
|
const chainId = parseInt(chainIdMatch[1], 10);
|
|
289
|
-
throw new
|
|
286
|
+
throw new UnsupportedChainError(chainId, errorParams);
|
|
290
287
|
}
|
|
291
|
-
throw new
|
|
288
|
+
throw new UnsupportedChainIdError(errorParams);
|
|
292
289
|
}
|
|
293
290
|
else if (message.includes('Unsupported token') &&
|
|
294
291
|
message.includes('for chain')) {
|
|
@@ -296,70 +293,70 @@ class Orchestrator {
|
|
|
296
293
|
if (tokenMatch) {
|
|
297
294
|
const tokenSymbol = tokenMatch[1];
|
|
298
295
|
const chainId = parseInt(tokenMatch[2], 10);
|
|
299
|
-
throw new
|
|
296
|
+
throw new UnsupportedTokenError(tokenSymbol, chainId, errorParams);
|
|
300
297
|
}
|
|
301
|
-
throw new
|
|
298
|
+
throw new OrchestratorError({ message, ...errorParams });
|
|
302
299
|
}
|
|
303
300
|
else if (message === 'Unsupported token addresses') {
|
|
304
301
|
// generic unsupported tokens without specific symbol/chain context
|
|
305
|
-
throw new
|
|
302
|
+
throw new BadRequestError({ message, ...errorParams });
|
|
306
303
|
}
|
|
307
304
|
else if (message.includes('not supported on chain')) {
|
|
308
305
|
const tokenMatch = message.match(/Token (.+) not supported on chain (\d+)/);
|
|
309
306
|
if (tokenMatch) {
|
|
310
307
|
const tokenAddress = tokenMatch[1];
|
|
311
308
|
const chainId = parseInt(tokenMatch[2], 10);
|
|
312
|
-
throw new
|
|
309
|
+
throw new TokenNotSupportedError(tokenAddress, chainId, errorParams);
|
|
313
310
|
}
|
|
314
|
-
throw new
|
|
311
|
+
throw new OrchestratorError({ message, ...errorParams });
|
|
315
312
|
}
|
|
316
313
|
else if (message === 'Authentication is required') {
|
|
317
|
-
throw new
|
|
314
|
+
throw new AuthenticationRequiredError(errorParams);
|
|
318
315
|
}
|
|
319
316
|
else if (message === 'Invalid API key') {
|
|
320
|
-
throw new
|
|
317
|
+
throw new InvalidApiKeyError(errorParams);
|
|
321
318
|
}
|
|
322
319
|
else if (message === 'Insufficient permissions') {
|
|
323
|
-
throw new
|
|
320
|
+
throw new ForbiddenError(errorParams);
|
|
324
321
|
}
|
|
325
322
|
else if (message === 'Invalid bundle signature') {
|
|
326
|
-
throw new
|
|
323
|
+
throw new InvalidIntentSignatureError(errorParams);
|
|
327
324
|
}
|
|
328
325
|
else if (message === 'Invalid checksum signature') {
|
|
329
|
-
throw new
|
|
326
|
+
throw new InvalidIntentSignatureError(errorParams);
|
|
330
327
|
}
|
|
331
328
|
else if (message === 'Only one target token amount can be unset' ||
|
|
332
329
|
message === 'Only one max-out transfer is allowed') {
|
|
333
|
-
throw new
|
|
330
|
+
throw new OnlyOneTargetTokenAmountCanBeUnsetError(errorParams);
|
|
334
331
|
}
|
|
335
332
|
else if (message === 'No valid settlement plan found for the given transfers' ||
|
|
336
333
|
message === 'No valid transfers sent for settlement quotes' ||
|
|
337
334
|
message === 'No Path Found') {
|
|
338
|
-
throw new
|
|
335
|
+
throw new NoPathFoundError(errorParams);
|
|
339
336
|
}
|
|
340
337
|
else if (message === 'Emissary is not enabled' ||
|
|
341
338
|
message === 'Emissary is not the expected address') {
|
|
342
|
-
throw new
|
|
339
|
+
throw new ForbiddenError(errorParams);
|
|
343
340
|
}
|
|
344
341
|
else if (message.includes('No such intent with nonce') ||
|
|
345
342
|
message === 'Order bundle not found') {
|
|
346
|
-
throw new
|
|
343
|
+
throw new IntentNotFoundError(errorParams);
|
|
347
344
|
}
|
|
348
345
|
else if (message === 'Could not retrieve a valid quote from any aggregator') {
|
|
349
|
-
throw new
|
|
346
|
+
throw new NoPathFoundError(errorParams);
|
|
350
347
|
}
|
|
351
348
|
else if (message === 'No aggregators available for swap') {
|
|
352
|
-
throw new
|
|
349
|
+
throw new InternalServerError(errorParams);
|
|
353
350
|
}
|
|
354
351
|
else if (message === 'entity.parse.failed' ||
|
|
355
352
|
message === 'entity.too.large' ||
|
|
356
353
|
message === 'encoding.unsupported') {
|
|
357
|
-
throw new
|
|
354
|
+
throw new BodyParserError({ message, ...errorParams });
|
|
358
355
|
}
|
|
359
356
|
else if (message === 'Bundle simulation failed') {
|
|
360
357
|
const simulations = errorParams.context.error.simulations;
|
|
361
358
|
const { traceId, errorType, statusCode, context } = errorParams;
|
|
362
|
-
throw new
|
|
359
|
+
throw new SimulationFailedError({
|
|
363
360
|
message,
|
|
364
361
|
context,
|
|
365
362
|
errorType,
|
|
@@ -369,8 +366,7 @@ class Orchestrator {
|
|
|
369
366
|
});
|
|
370
367
|
}
|
|
371
368
|
else {
|
|
372
|
-
throw new
|
|
369
|
+
throw new OrchestratorError({ message, ...errorParams });
|
|
373
370
|
}
|
|
374
371
|
}
|
|
375
372
|
}
|
|
376
|
-
exports.Orchestrator = Orchestrator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const PROD_ORCHESTRATOR_URL = "https://v1.orchestrator.rhinestone.dev";
|
|
2
2
|
declare const RHINESTONE_SPOKE_POOL_ADDRESS = "0x000000000060f6e853447881951574cdd0663530";
|
|
3
|
-
declare const SDK_VERSION = "
|
|
3
|
+
declare const SDK_VERSION = "2.0.0-beta.0";
|
|
4
4
|
declare const API_VERSION = "2026-01.alps";
|
|
5
5
|
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|
|
6
6
|
//# 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,2CAA2C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../orchestrator/consts.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,qBAAqB,2CAA2C,CAAA;AACtE,QAAA,MAAM,6BAA6B,+CACW,CAAA;AAE9C,QAAA,MAAM,WAAW,iBAAiB,CAAA;AAClC,QAAA,MAAM,WAAW,iBAAiB,CAAA;AAElC,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,WAAW,EACX,WAAW,GACZ,CAAA"}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.API_VERSION = exports.SDK_VERSION = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.PROD_ORCHESTRATOR_URL = void 0;
|
|
4
1
|
const PROD_ORCHESTRATOR_URL = 'https://v1.orchestrator.rhinestone.dev';
|
|
5
|
-
exports.PROD_ORCHESTRATOR_URL = PROD_ORCHESTRATOR_URL;
|
|
6
2
|
const RHINESTONE_SPOKE_POOL_ADDRESS = '0x000000000060f6e853447881951574cdd0663530';
|
|
7
|
-
|
|
8
|
-
const SDK_VERSION = '1.5.0';
|
|
9
|
-
exports.SDK_VERSION = SDK_VERSION;
|
|
3
|
+
const SDK_VERSION = '2.0.0-beta.0';
|
|
10
4
|
const API_VERSION = '2026-01.alps';
|
|
11
|
-
|
|
5
|
+
export { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS, SDK_VERSION, API_VERSION, };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimulationFailedError = exports.BodyParserError = exports.InternalServerError = exports.UnprocessableEntityError = exports.BadRequestError = exports.ConflictError = exports.ResourceNotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.ServiceUnavailableError = exports.RateLimitedError = exports.SchemaValidationError = exports.IntentNotFoundError = exports.NoPathFoundError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.AuthenticationRequiredError = exports.TokenNotSupportedError = exports.UnsupportedTokenError = exports.UnsupportedChainError = exports.UnsupportedChainIdError = exports.InsufficientBalanceError = exports.InsufficientLiquidityError = exports.OrchestratorError = void 0;
|
|
4
|
-
exports.isOrchestratorError = isOrchestratorError;
|
|
5
|
-
exports.isRetryable = isRetryable;
|
|
6
|
-
exports.isAuthError = isAuthError;
|
|
7
|
-
exports.isValidationError = isValidationError;
|
|
8
|
-
exports.isRateLimited = isRateLimited;
|
|
9
1
|
class OrchestratorError extends Error {
|
|
10
2
|
_message;
|
|
11
3
|
_context;
|
|
@@ -36,7 +28,6 @@ class OrchestratorError extends Error {
|
|
|
36
28
|
return this._statusCode;
|
|
37
29
|
}
|
|
38
30
|
}
|
|
39
|
-
exports.OrchestratorError = OrchestratorError;
|
|
40
31
|
class InsufficientBalanceError extends OrchestratorError {
|
|
41
32
|
constructor(params) {
|
|
42
33
|
super({
|
|
@@ -45,7 +36,6 @@ class InsufficientBalanceError extends OrchestratorError {
|
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
38
|
}
|
|
48
|
-
exports.InsufficientBalanceError = InsufficientBalanceError;
|
|
49
39
|
class UnsupportedChainIdError extends OrchestratorError {
|
|
50
40
|
constructor(params) {
|
|
51
41
|
super({
|
|
@@ -54,7 +44,6 @@ class UnsupportedChainIdError extends OrchestratorError {
|
|
|
54
44
|
});
|
|
55
45
|
}
|
|
56
46
|
}
|
|
57
|
-
exports.UnsupportedChainIdError = UnsupportedChainIdError;
|
|
58
47
|
class UnsupportedChainError extends OrchestratorError {
|
|
59
48
|
constructor(chainId, params) {
|
|
60
49
|
super({
|
|
@@ -63,7 +52,6 @@ class UnsupportedChainError extends OrchestratorError {
|
|
|
63
52
|
});
|
|
64
53
|
}
|
|
65
54
|
}
|
|
66
|
-
exports.UnsupportedChainError = UnsupportedChainError;
|
|
67
55
|
class UnsupportedTokenError extends OrchestratorError {
|
|
68
56
|
constructor(tokenSymbol, chainId, params) {
|
|
69
57
|
super({
|
|
@@ -72,7 +60,6 @@ class UnsupportedTokenError extends OrchestratorError {
|
|
|
72
60
|
});
|
|
73
61
|
}
|
|
74
62
|
}
|
|
75
|
-
exports.UnsupportedTokenError = UnsupportedTokenError;
|
|
76
63
|
class TokenNotSupportedError extends OrchestratorError {
|
|
77
64
|
constructor(tokenAddress, chainId, params) {
|
|
78
65
|
super({
|
|
@@ -81,7 +68,6 @@ class TokenNotSupportedError extends OrchestratorError {
|
|
|
81
68
|
});
|
|
82
69
|
}
|
|
83
70
|
}
|
|
84
|
-
exports.TokenNotSupportedError = TokenNotSupportedError;
|
|
85
71
|
class AuthenticationRequiredError extends OrchestratorError {
|
|
86
72
|
constructor(params) {
|
|
87
73
|
super({
|
|
@@ -90,7 +76,6 @@ class AuthenticationRequiredError extends OrchestratorError {
|
|
|
90
76
|
});
|
|
91
77
|
}
|
|
92
78
|
}
|
|
93
|
-
exports.AuthenticationRequiredError = AuthenticationRequiredError;
|
|
94
79
|
class InvalidApiKeyError extends OrchestratorError {
|
|
95
80
|
constructor(params) {
|
|
96
81
|
super({
|
|
@@ -99,7 +84,6 @@ class InvalidApiKeyError extends OrchestratorError {
|
|
|
99
84
|
});
|
|
100
85
|
}
|
|
101
86
|
}
|
|
102
|
-
exports.InvalidApiKeyError = InvalidApiKeyError;
|
|
103
87
|
class InvalidIntentSignatureError extends OrchestratorError {
|
|
104
88
|
constructor(params) {
|
|
105
89
|
super({
|
|
@@ -108,7 +92,6 @@ class InvalidIntentSignatureError extends OrchestratorError {
|
|
|
108
92
|
});
|
|
109
93
|
}
|
|
110
94
|
}
|
|
111
|
-
exports.InvalidIntentSignatureError = InvalidIntentSignatureError;
|
|
112
95
|
class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
|
|
113
96
|
constructor(params) {
|
|
114
97
|
super({
|
|
@@ -117,7 +100,6 @@ class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
|
|
|
117
100
|
});
|
|
118
101
|
}
|
|
119
102
|
}
|
|
120
|
-
exports.OnlyOneTargetTokenAmountCanBeUnsetError = OnlyOneTargetTokenAmountCanBeUnsetError;
|
|
121
103
|
class NoPathFoundError extends OrchestratorError {
|
|
122
104
|
constructor(params) {
|
|
123
105
|
super({
|
|
@@ -126,7 +108,6 @@ class NoPathFoundError extends OrchestratorError {
|
|
|
126
108
|
});
|
|
127
109
|
}
|
|
128
110
|
}
|
|
129
|
-
exports.NoPathFoundError = NoPathFoundError;
|
|
130
111
|
class IntentNotFoundError extends OrchestratorError {
|
|
131
112
|
constructor(params) {
|
|
132
113
|
super({
|
|
@@ -135,7 +116,6 @@ class IntentNotFoundError extends OrchestratorError {
|
|
|
135
116
|
});
|
|
136
117
|
}
|
|
137
118
|
}
|
|
138
|
-
exports.IntentNotFoundError = IntentNotFoundError;
|
|
139
119
|
class SchemaValidationError extends OrchestratorError {
|
|
140
120
|
constructor(params) {
|
|
141
121
|
super({
|
|
@@ -144,7 +124,6 @@ class SchemaValidationError extends OrchestratorError {
|
|
|
144
124
|
});
|
|
145
125
|
}
|
|
146
126
|
}
|
|
147
|
-
exports.SchemaValidationError = SchemaValidationError;
|
|
148
127
|
class RateLimitedError extends OrchestratorError {
|
|
149
128
|
constructor(params) {
|
|
150
129
|
super({
|
|
@@ -153,7 +132,6 @@ class RateLimitedError extends OrchestratorError {
|
|
|
153
132
|
});
|
|
154
133
|
}
|
|
155
134
|
}
|
|
156
|
-
exports.RateLimitedError = RateLimitedError;
|
|
157
135
|
class ServiceUnavailableError extends OrchestratorError {
|
|
158
136
|
constructor(params) {
|
|
159
137
|
super({
|
|
@@ -162,7 +140,6 @@ class ServiceUnavailableError extends OrchestratorError {
|
|
|
162
140
|
});
|
|
163
141
|
}
|
|
164
142
|
}
|
|
165
|
-
exports.ServiceUnavailableError = ServiceUnavailableError;
|
|
166
143
|
class UnauthorizedError extends OrchestratorError {
|
|
167
144
|
constructor(params) {
|
|
168
145
|
super({
|
|
@@ -171,7 +148,6 @@ class UnauthorizedError extends OrchestratorError {
|
|
|
171
148
|
});
|
|
172
149
|
}
|
|
173
150
|
}
|
|
174
|
-
exports.UnauthorizedError = UnauthorizedError;
|
|
175
151
|
class ForbiddenError extends OrchestratorError {
|
|
176
152
|
constructor(params) {
|
|
177
153
|
super({
|
|
@@ -180,7 +156,6 @@ class ForbiddenError extends OrchestratorError {
|
|
|
180
156
|
});
|
|
181
157
|
}
|
|
182
158
|
}
|
|
183
|
-
exports.ForbiddenError = ForbiddenError;
|
|
184
159
|
class ResourceNotFoundError extends OrchestratorError {
|
|
185
160
|
constructor(params) {
|
|
186
161
|
super({
|
|
@@ -189,7 +164,6 @@ class ResourceNotFoundError extends OrchestratorError {
|
|
|
189
164
|
});
|
|
190
165
|
}
|
|
191
166
|
}
|
|
192
|
-
exports.ResourceNotFoundError = ResourceNotFoundError;
|
|
193
167
|
class ConflictError extends OrchestratorError {
|
|
194
168
|
constructor(params) {
|
|
195
169
|
super({
|
|
@@ -198,7 +172,6 @@ class ConflictError extends OrchestratorError {
|
|
|
198
172
|
});
|
|
199
173
|
}
|
|
200
174
|
}
|
|
201
|
-
exports.ConflictError = ConflictError;
|
|
202
175
|
class BadRequestError extends OrchestratorError {
|
|
203
176
|
constructor(params) {
|
|
204
177
|
super({
|
|
@@ -207,7 +180,6 @@ class BadRequestError extends OrchestratorError {
|
|
|
207
180
|
});
|
|
208
181
|
}
|
|
209
182
|
}
|
|
210
|
-
exports.BadRequestError = BadRequestError;
|
|
211
183
|
class UnprocessableEntityError extends OrchestratorError {
|
|
212
184
|
constructor(params) {
|
|
213
185
|
super({
|
|
@@ -216,7 +188,6 @@ class UnprocessableEntityError extends OrchestratorError {
|
|
|
216
188
|
});
|
|
217
189
|
}
|
|
218
190
|
}
|
|
219
|
-
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
220
191
|
class InternalServerError extends OrchestratorError {
|
|
221
192
|
constructor(params) {
|
|
222
193
|
super({
|
|
@@ -225,7 +196,6 @@ class InternalServerError extends OrchestratorError {
|
|
|
225
196
|
});
|
|
226
197
|
}
|
|
227
198
|
}
|
|
228
|
-
exports.InternalServerError = InternalServerError;
|
|
229
199
|
class BodyParserError extends OrchestratorError {
|
|
230
200
|
constructor(params) {
|
|
231
201
|
super({
|
|
@@ -234,7 +204,6 @@ class BodyParserError extends OrchestratorError {
|
|
|
234
204
|
});
|
|
235
205
|
}
|
|
236
206
|
}
|
|
237
|
-
exports.BodyParserError = BodyParserError;
|
|
238
207
|
class SimulationFailedError extends OrchestratorError {
|
|
239
208
|
constructor(params) {
|
|
240
209
|
super({
|
|
@@ -243,7 +212,6 @@ class SimulationFailedError extends OrchestratorError {
|
|
|
243
212
|
});
|
|
244
213
|
}
|
|
245
214
|
}
|
|
246
|
-
exports.SimulationFailedError = SimulationFailedError;
|
|
247
215
|
class InsufficientLiquidityError extends OrchestratorError {
|
|
248
216
|
availableIntents;
|
|
249
217
|
unfillable;
|
|
@@ -258,7 +226,6 @@ class InsufficientLiquidityError extends OrchestratorError {
|
|
|
258
226
|
this.unfillable = params.unfillable;
|
|
259
227
|
}
|
|
260
228
|
}
|
|
261
|
-
exports.InsufficientLiquidityError = InsufficientLiquidityError;
|
|
262
229
|
function isOrchestratorError(error) {
|
|
263
230
|
return error instanceof OrchestratorError;
|
|
264
231
|
}
|
|
@@ -281,3 +248,4 @@ function isRetryable(error) {
|
|
|
281
248
|
return false;
|
|
282
249
|
return error.statusCode === 500 || error.statusCode === 503;
|
|
283
250
|
}
|
|
251
|
+
export { isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, OrchestratorError, InsufficientLiquidityError, InsufficientBalanceError, UnsupportedChainIdError, UnsupportedChainError, UnsupportedTokenError, TokenNotSupportedError, AuthenticationRequiredError, InvalidApiKeyError, InvalidIntentSignatureError, OnlyOneTargetTokenAmountCanBeUnsetError, NoPathFoundError, IntentNotFoundError, SchemaValidationError, RateLimitedError, ServiceUnavailableError, UnauthorizedError, ForbiddenError, ResourceNotFoundError, ConflictError, BadRequestError, UnprocessableEntityError, InternalServerError, BodyParserError, SimulationFailedError, };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { AuthProvider } from '../auth/provider';
|
|
2
|
-
import { Orchestrator } from './client';
|
|
3
|
-
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
4
|
-
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
|
|
5
|
-
import { getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
6
|
-
import type { ApprovalRequired, AuxiliaryFunds, Execution, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, TokenRequirements, WrapRequired } from './types';
|
|
7
|
-
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types';
|
|
1
|
+
import type { AuthProvider } from '../auth/provider.js';
|
|
2
|
+
import { Orchestrator } from './client.js';
|
|
3
|
+
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
4
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error.js';
|
|
5
|
+
import { getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry.js';
|
|
6
|
+
import type { ApprovalRequired, AuxiliaryFunds, Execution, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, TokenRequirements, WrapRequired } from './types.js';
|
|
7
|
+
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types.js';
|
|
8
8
|
declare function getOrchestrator(authProvider: AuthProvider, orchestratorUrl?: string, headers?: Record<string, string>): Orchestrator;
|
|
9
9
|
export type { AuxiliaryFunds, Execution, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementLayer, SignedIntentOp, SplitIntentsInput, SplitIntentsResult, SupportedChain, TokenConfig, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, };
|
|
10
10
|
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getTokenDecimals, getSupportedTokens, getAllSupportedChainsAndTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
@@ -1,58 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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, "AuthenticationRequiredError", { enumerable: true, get: function () { return error_1.AuthenticationRequiredError; } });
|
|
11
|
-
Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return error_1.BadRequestError; } });
|
|
12
|
-
Object.defineProperty(exports, "BodyParserError", { enumerable: true, get: function () { return error_1.BodyParserError; } });
|
|
13
|
-
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function () { return error_1.ConflictError; } });
|
|
14
|
-
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return error_1.ForbiddenError; } });
|
|
15
|
-
Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return error_1.InsufficientBalanceError; } });
|
|
16
|
-
Object.defineProperty(exports, "InsufficientLiquidityError", { enumerable: true, get: function () { return error_1.InsufficientLiquidityError; } });
|
|
17
|
-
Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return error_1.IntentNotFoundError; } });
|
|
18
|
-
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
19
|
-
Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return error_1.InvalidApiKeyError; } });
|
|
20
|
-
Object.defineProperty(exports, "InvalidIntentSignatureError", { enumerable: true, get: function () { return error_1.InvalidIntentSignatureError; } });
|
|
21
|
-
Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return error_1.isAuthError; } });
|
|
22
|
-
Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return error_1.isOrchestratorError; } });
|
|
23
|
-
Object.defineProperty(exports, "isRateLimited", { enumerable: true, get: function () { return error_1.isRateLimited; } });
|
|
24
|
-
Object.defineProperty(exports, "isRetryable", { enumerable: true, get: function () { return error_1.isRetryable; } });
|
|
25
|
-
Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return error_1.isValidationError; } });
|
|
26
|
-
Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return error_1.NoPathFoundError; } });
|
|
27
|
-
Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return error_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
|
|
28
|
-
Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return error_1.OrchestratorError; } });
|
|
29
|
-
Object.defineProperty(exports, "RateLimitedError", { enumerable: true, get: function () { return error_1.RateLimitedError; } });
|
|
30
|
-
Object.defineProperty(exports, "ResourceNotFoundError", { enumerable: true, get: function () { return error_1.ResourceNotFoundError; } });
|
|
31
|
-
Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return error_1.SchemaValidationError; } });
|
|
32
|
-
Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return error_1.ServiceUnavailableError; } });
|
|
33
|
-
Object.defineProperty(exports, "SimulationFailedError", { enumerable: true, get: function () { return error_1.SimulationFailedError; } });
|
|
34
|
-
Object.defineProperty(exports, "TokenNotSupportedError", { enumerable: true, get: function () { return error_1.TokenNotSupportedError; } });
|
|
35
|
-
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return error_1.UnauthorizedError; } });
|
|
36
|
-
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
37
|
-
Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return error_1.UnsupportedChainError; } });
|
|
38
|
-
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
|
|
39
|
-
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
|
|
40
|
-
const registry_1 = require("./registry");
|
|
41
|
-
Object.defineProperty(exports, "getAllSupportedChainsAndTokens", { enumerable: true, get: function () { return registry_1.getAllSupportedChainsAndTokens; } });
|
|
42
|
-
Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
|
|
43
|
-
Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
|
|
44
|
-
Object.defineProperty(exports, "getTokenDecimals", { enumerable: true, get: function () { return registry_1.getTokenDecimals; } });
|
|
45
|
-
Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
|
|
46
|
-
Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
|
|
47
|
-
Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
|
|
48
|
-
const types_1 = require("./types");
|
|
49
|
-
Object.defineProperty(exports, "INTENT_STATUS_CLAIMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_CLAIMED; } });
|
|
50
|
-
Object.defineProperty(exports, "INTENT_STATUS_COMPLETED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_COMPLETED; } });
|
|
51
|
-
Object.defineProperty(exports, "INTENT_STATUS_EXPIRED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_EXPIRED; } });
|
|
52
|
-
Object.defineProperty(exports, "INTENT_STATUS_FAILED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FAILED; } });
|
|
53
|
-
Object.defineProperty(exports, "INTENT_STATUS_FILLED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FILLED; } });
|
|
54
|
-
Object.defineProperty(exports, "INTENT_STATUS_PENDING", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PENDING; } });
|
|
55
|
-
Object.defineProperty(exports, "INTENT_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PRECONFIRMED; } });
|
|
1
|
+
import { Orchestrator } from './client.js';
|
|
2
|
+
import { PROD_ORCHESTRATOR_URL, RHINESTONE_SPOKE_POOL_ADDRESS } from './consts.js';
|
|
3
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, IntentNotFoundError, InternalServerError, InvalidApiKeyError, InvalidIntentSignatureError, isAuthError, isOrchestratorError, isRateLimited, isRetryable, isValidationError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, RateLimitedError, ResourceNotFoundError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, TokenNotSupportedError, UnauthorizedError, UnprocessableEntityError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, } from './error.js';
|
|
4
|
+
import { getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenDecimals, getTokenSymbol, getWethAddress, isTokenAddressSupported, } from './registry.js';
|
|
5
|
+
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, } from './types.js';
|
|
56
6
|
function getOrchestrator(authProvider, orchestratorUrl, headers) {
|
|
57
|
-
return new
|
|
7
|
+
return new Orchestrator(orchestratorUrl ?? PROD_ORCHESTRATOR_URL, authProvider, headers);
|
|
58
8
|
}
|
|
9
|
+
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_CLAIMED, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, InsufficientLiquidityError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getTokenDecimals, getSupportedTokens, getAllSupportedChainsAndTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Address, type Chain } from 'viem';
|
|
2
|
-
import type { TokenSymbol } from '../types';
|
|
3
|
-
import type { TokenConfig } from './types';
|
|
2
|
+
import type { TokenSymbol } from '../types.js';
|
|
3
|
+
import type { TokenConfig } from './types.js';
|
|
4
4
|
declare function getSupportedChainIds(): number[];
|
|
5
5
|
declare function getWethAddress(chain: Chain): Address;
|
|
6
6
|
declare function getWrappedTokenAddress(chain: Chain): Address;
|