@charterlabs/rhinestone-sdk 0.2.7-dev.4 → 0.2.9
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/README.md +46 -8
- package/dist/src/accounts/error.d.ts +4 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +9 -1
- package/dist/src/accounts/index.d.ts +13 -3
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +62 -6
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -1
- package/dist/src/accounts/json-rpc/index.js +4 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.test.js +33 -0
- package/dist/src/accounts/json-rpc/providers.d.ts +2 -1
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -1
- package/dist/src/accounts/json-rpc/providers.js +8 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.test.js +43 -0
- package/dist/src/accounts/kernel.d.ts +9 -2
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +13 -0
- package/dist/src/accounts/nexus.d.ts +9 -2
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +15 -1
- package/dist/src/accounts/passport.d.ts +12 -0
- package/dist/src/accounts/passport.d.ts.map +1 -0
- package/dist/src/accounts/passport.js +173 -0
- package/dist/src/accounts/safe.d.ts +9 -2
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +15 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +26 -5
- package/dist/src/accounts/signing/message.js +1 -1
- package/dist/src/accounts/startale.d.ts +9 -2
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +15 -0
- package/dist/src/accounts/walletClient.d.ts +27 -0
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +77 -0
- package/dist/src/actions/smart-sessions.d.ts +14 -0
- package/dist/src/actions/smart-sessions.d.ts.map +1 -0
- package/dist/src/actions/smart-sessions.js +16 -0
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +18 -1
- package/dist/src/execution/compact.d.ts +3 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +3 -3
- package/dist/src/execution/error.d.ts +8 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +10 -1
- package/dist/src/execution/index.d.ts +10 -4
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +85 -12
- package/dist/src/execution/permit2.d.ts +2 -2
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +28 -19
- package/dist/src/execution/singleChainOps.d.ts +28 -0
- package/dist/src/execution/singleChainOps.d.ts.map +1 -0
- package/dist/src/execution/singleChainOps.js +32 -0
- package/dist/src/execution/smart-session.d.ts +5 -7
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +114 -229
- package/dist/src/execution/types.d.ts +2 -1
- package/dist/src/execution/types.d.ts.map +1 -1
- package/dist/src/execution/utils.d.ts +16 -9
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +151 -76
- package/dist/src/index.d.ts +18 -19
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -25
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +1 -1
- package/dist/src/modules/index.test.js +1 -1
- package/dist/src/modules/read.js +2 -2
- package/dist/src/modules/validators/core.d.ts +5 -3
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +39 -2
- package/dist/src/modules/validators/smart-sessions.d.ts +8 -8
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +29 -80
- package/dist/src/modules/validators/smart-sessions.test.js +4 -5
- package/dist/src/orchestrator/client.d.ts +3 -2
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +230 -172
- package/dist/src/orchestrator/error.d.ts +137 -1
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +137 -1
- package/dist/src/orchestrator/index.d.ts +6 -6
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +19 -3
- package/dist/src/orchestrator/registry.d.ts +6 -2
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +16 -64
- package/dist/src/orchestrator/registry.test.js +24 -24
- package/dist/src/orchestrator/types.d.ts +63 -43
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +9 -5
- package/dist/src/types.d.ts +42 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +3 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +5 -0
- package/package.json +4 -4
- package/dist/src/actions/smart-session.d.ts +0 -11
- package/dist/src/actions/smart-session.d.ts.map +0 -1
- package/dist/src/actions/smart-session.js +0 -13
- package/dist/src/execution/smart-session.test.d.ts +0 -2
- package/dist/src/execution/smart-session.test.d.ts.map +0 -1
- package/dist/src/execution/smart-session.test.js +0 -34
|
@@ -1,24 +1,44 @@
|
|
|
1
|
+
import type { Address, Hex } from 'viem';
|
|
2
|
+
interface Simulation {
|
|
3
|
+
success: boolean;
|
|
4
|
+
call: {
|
|
5
|
+
chainId: number;
|
|
6
|
+
to: Address;
|
|
7
|
+
data: Hex;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
details: {
|
|
11
|
+
stateOverride: unknown[];
|
|
12
|
+
blockNumber: string;
|
|
13
|
+
relayer: string;
|
|
14
|
+
simulationUrl: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
1
17
|
declare class OrchestratorError extends Error {
|
|
2
18
|
private readonly _message;
|
|
3
19
|
private readonly _context;
|
|
4
20
|
private readonly _errorType;
|
|
5
21
|
private readonly _traceId;
|
|
22
|
+
private readonly _statusCode?;
|
|
6
23
|
constructor(params?: {
|
|
7
24
|
message?: string;
|
|
8
25
|
context?: any;
|
|
9
26
|
errorType?: string;
|
|
10
27
|
traceId?: string;
|
|
28
|
+
statusCode?: number;
|
|
11
29
|
});
|
|
12
30
|
get message(): string;
|
|
13
31
|
get context(): any;
|
|
14
32
|
get errorType(): string;
|
|
15
33
|
get traceId(): string;
|
|
34
|
+
get statusCode(): number | undefined;
|
|
16
35
|
}
|
|
17
36
|
declare class InsufficientBalanceError extends OrchestratorError {
|
|
18
37
|
constructor(params?: {
|
|
19
38
|
context?: any;
|
|
20
39
|
errorType?: string;
|
|
21
40
|
traceId?: string;
|
|
41
|
+
statusCode?: number;
|
|
22
42
|
});
|
|
23
43
|
}
|
|
24
44
|
declare class UnsupportedChainIdError extends OrchestratorError {
|
|
@@ -26,6 +46,7 @@ declare class UnsupportedChainIdError extends OrchestratorError {
|
|
|
26
46
|
context?: any;
|
|
27
47
|
errorType?: string;
|
|
28
48
|
traceId?: string;
|
|
49
|
+
statusCode?: number;
|
|
29
50
|
});
|
|
30
51
|
}
|
|
31
52
|
declare class UnsupportedChainError extends OrchestratorError {
|
|
@@ -33,6 +54,7 @@ declare class UnsupportedChainError extends OrchestratorError {
|
|
|
33
54
|
context?: any;
|
|
34
55
|
errorType?: string;
|
|
35
56
|
traceId?: string;
|
|
57
|
+
statusCode?: number;
|
|
36
58
|
});
|
|
37
59
|
}
|
|
38
60
|
declare class UnsupportedTokenError extends OrchestratorError {
|
|
@@ -40,6 +62,7 @@ declare class UnsupportedTokenError extends OrchestratorError {
|
|
|
40
62
|
context?: any;
|
|
41
63
|
errorType?: string;
|
|
42
64
|
traceId?: string;
|
|
65
|
+
statusCode?: number;
|
|
43
66
|
});
|
|
44
67
|
}
|
|
45
68
|
declare class TokenNotSupportedError extends OrchestratorError {
|
|
@@ -47,6 +70,7 @@ declare class TokenNotSupportedError extends OrchestratorError {
|
|
|
47
70
|
context?: any;
|
|
48
71
|
errorType?: string;
|
|
49
72
|
traceId?: string;
|
|
73
|
+
statusCode?: number;
|
|
50
74
|
});
|
|
51
75
|
}
|
|
52
76
|
declare class AuthenticationRequiredError extends OrchestratorError {
|
|
@@ -54,6 +78,7 @@ declare class AuthenticationRequiredError extends OrchestratorError {
|
|
|
54
78
|
context?: any;
|
|
55
79
|
errorType?: string;
|
|
56
80
|
traceId?: string;
|
|
81
|
+
statusCode?: number;
|
|
57
82
|
});
|
|
58
83
|
}
|
|
59
84
|
declare class InvalidApiKeyError extends OrchestratorError {
|
|
@@ -61,6 +86,7 @@ declare class InvalidApiKeyError extends OrchestratorError {
|
|
|
61
86
|
context?: any;
|
|
62
87
|
errorType?: string;
|
|
63
88
|
traceId?: string;
|
|
89
|
+
statusCode?: number;
|
|
64
90
|
});
|
|
65
91
|
}
|
|
66
92
|
declare class InvalidIntentSignatureError extends OrchestratorError {
|
|
@@ -68,6 +94,7 @@ declare class InvalidIntentSignatureError extends OrchestratorError {
|
|
|
68
94
|
context?: any;
|
|
69
95
|
errorType?: string;
|
|
70
96
|
traceId?: string;
|
|
97
|
+
statusCode?: number;
|
|
71
98
|
});
|
|
72
99
|
}
|
|
73
100
|
declare class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
|
|
@@ -75,6 +102,7 @@ declare class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError
|
|
|
75
102
|
context?: any;
|
|
76
103
|
errorType?: string;
|
|
77
104
|
traceId?: string;
|
|
105
|
+
statusCode?: number;
|
|
78
106
|
});
|
|
79
107
|
}
|
|
80
108
|
declare class NoPathFoundError extends OrchestratorError {
|
|
@@ -82,6 +110,7 @@ declare class NoPathFoundError extends OrchestratorError {
|
|
|
82
110
|
context?: any;
|
|
83
111
|
errorType?: string;
|
|
84
112
|
traceId?: string;
|
|
113
|
+
statusCode?: number;
|
|
85
114
|
});
|
|
86
115
|
}
|
|
87
116
|
declare class IntentNotFoundError extends OrchestratorError {
|
|
@@ -89,8 +118,115 @@ declare class IntentNotFoundError extends OrchestratorError {
|
|
|
89
118
|
context?: any;
|
|
90
119
|
errorType?: string;
|
|
91
120
|
traceId?: string;
|
|
121
|
+
statusCode?: number;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
declare class SchemaValidationError extends OrchestratorError {
|
|
125
|
+
constructor(params?: {
|
|
126
|
+
message?: string;
|
|
127
|
+
context?: any;
|
|
128
|
+
errorType?: string;
|
|
129
|
+
traceId?: string;
|
|
130
|
+
statusCode?: number;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
declare class RateLimitedError extends OrchestratorError {
|
|
134
|
+
constructor(params?: {
|
|
135
|
+
context?: any;
|
|
136
|
+
errorType?: string;
|
|
137
|
+
traceId?: string;
|
|
138
|
+
statusCode?: number;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
declare class ServiceUnavailableError extends OrchestratorError {
|
|
142
|
+
constructor(params?: {
|
|
143
|
+
context?: any;
|
|
144
|
+
errorType?: string;
|
|
145
|
+
traceId?: string;
|
|
146
|
+
statusCode?: number;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
declare class UnauthorizedError extends OrchestratorError {
|
|
150
|
+
constructor(params?: {
|
|
151
|
+
context?: any;
|
|
152
|
+
errorType?: string;
|
|
153
|
+
traceId?: string;
|
|
154
|
+
statusCode?: number;
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
declare class ForbiddenError extends OrchestratorError {
|
|
158
|
+
constructor(params?: {
|
|
159
|
+
context?: any;
|
|
160
|
+
errorType?: string;
|
|
161
|
+
traceId?: string;
|
|
162
|
+
statusCode?: number;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
declare class ResourceNotFoundError extends OrchestratorError {
|
|
166
|
+
constructor(params?: {
|
|
167
|
+
context?: any;
|
|
168
|
+
errorType?: string;
|
|
169
|
+
traceId?: string;
|
|
170
|
+
statusCode?: number;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
declare class ConflictError extends OrchestratorError {
|
|
174
|
+
constructor(params?: {
|
|
175
|
+
context?: any;
|
|
176
|
+
errorType?: string;
|
|
177
|
+
traceId?: string;
|
|
178
|
+
statusCode?: number;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
declare class BadRequestError extends OrchestratorError {
|
|
182
|
+
constructor(params?: {
|
|
183
|
+
message?: string;
|
|
184
|
+
context?: any;
|
|
185
|
+
errorType?: string;
|
|
186
|
+
traceId?: string;
|
|
187
|
+
statusCode?: number;
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
declare class UnprocessableEntityError extends OrchestratorError {
|
|
191
|
+
constructor(params?: {
|
|
192
|
+
message?: string;
|
|
193
|
+
context?: any;
|
|
194
|
+
errorType?: string;
|
|
195
|
+
traceId?: string;
|
|
196
|
+
statusCode?: number;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
declare class InternalServerError extends OrchestratorError {
|
|
200
|
+
constructor(params?: {
|
|
201
|
+
context?: any;
|
|
202
|
+
errorType?: string;
|
|
203
|
+
traceId?: string;
|
|
204
|
+
statusCode?: number;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
declare class BodyParserError extends OrchestratorError {
|
|
208
|
+
constructor(params?: {
|
|
209
|
+
message?: string;
|
|
210
|
+
context?: any;
|
|
211
|
+
errorType?: string;
|
|
212
|
+
traceId?: string;
|
|
213
|
+
statusCode?: number;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
declare class SimulationFailedError extends OrchestratorError {
|
|
217
|
+
constructor(params?: {
|
|
218
|
+
message?: string;
|
|
219
|
+
context?: any;
|
|
220
|
+
errorType?: string;
|
|
221
|
+
traceId?: string;
|
|
222
|
+
statusCode?: number;
|
|
223
|
+
simulations?: Simulation[];
|
|
92
224
|
});
|
|
93
225
|
}
|
|
94
226
|
declare function isOrchestratorError(error: Error): error is OrchestratorError;
|
|
95
|
-
|
|
227
|
+
declare function isRateLimited(error: unknown): error is RateLimitedError;
|
|
228
|
+
declare function isValidationError(error: unknown): boolean;
|
|
229
|
+
declare function isAuthError(error: unknown): boolean;
|
|
230
|
+
declare function isRetryable(error: unknown): boolean;
|
|
231
|
+
export { isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, OrchestratorError, InsufficientBalanceError, UnsupportedChainIdError, UnsupportedChainError, UnsupportedTokenError, TokenNotSupportedError, AuthenticationRequiredError, InvalidApiKeyError, InvalidIntentSignatureError, OnlyOneTargetTokenAmountCanBeUnsetError, NoPathFoundError, IntentNotFoundError, SchemaValidationError, RateLimitedError, ServiceUnavailableError, UnauthorizedError, ForbiddenError, ResourceNotFoundError, ConflictError, BadRequestError, UnprocessableEntityError, InternalServerError, BodyParserError, SimulationFailedError, };
|
|
96
232
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,cAAM,iBAAkB,SAAQ,KAAK;IACnC,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;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAExC,UA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C,EAAE,MAAM,CAAA;QACnB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;KAC3B;CAMF;AAED,iBAAS,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,iBAAiB,CAErE;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAKhE;AAED,iBAAS,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGlD;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK5C;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAG5C;AAED,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,2BAA2B,EAC3B,uCAAuC,EACvC,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACtB,CAAA"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntentNotFoundError = exports.NoPathFoundError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.AuthenticationRequiredError = exports.TokenNotSupportedError = exports.UnsupportedTokenError = exports.UnsupportedChainError = exports.UnsupportedChainIdError = exports.InsufficientBalanceError = exports.OrchestratorError = void 0;
|
|
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.OrchestratorError = void 0;
|
|
4
4
|
exports.isOrchestratorError = isOrchestratorError;
|
|
5
|
+
exports.isRetryable = isRetryable;
|
|
6
|
+
exports.isAuthError = isAuthError;
|
|
7
|
+
exports.isValidationError = isValidationError;
|
|
8
|
+
exports.isRateLimited = isRateLimited;
|
|
5
9
|
class OrchestratorError extends Error {
|
|
6
10
|
_message;
|
|
7
11
|
_context;
|
|
8
12
|
_errorType;
|
|
9
13
|
_traceId;
|
|
14
|
+
_statusCode;
|
|
10
15
|
constructor(params) {
|
|
11
16
|
super();
|
|
12
17
|
this._message = params?.message || 'OrchestratorError ';
|
|
13
18
|
this._context = params?.context || {};
|
|
14
19
|
this._errorType = params?.errorType || 'Unknown';
|
|
15
20
|
this._traceId = params?.traceId || '';
|
|
21
|
+
this._statusCode = params?.statusCode;
|
|
16
22
|
}
|
|
17
23
|
get message() {
|
|
18
24
|
return this._message;
|
|
@@ -26,6 +32,9 @@ class OrchestratorError extends Error {
|
|
|
26
32
|
get traceId() {
|
|
27
33
|
return this._traceId;
|
|
28
34
|
}
|
|
35
|
+
get statusCode() {
|
|
36
|
+
return this._statusCode;
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
exports.OrchestratorError = OrchestratorError;
|
|
31
40
|
class InsufficientBalanceError extends OrchestratorError {
|
|
@@ -127,6 +136,133 @@ class IntentNotFoundError extends OrchestratorError {
|
|
|
127
136
|
}
|
|
128
137
|
}
|
|
129
138
|
exports.IntentNotFoundError = IntentNotFoundError;
|
|
139
|
+
class SchemaValidationError extends OrchestratorError {
|
|
140
|
+
constructor(params) {
|
|
141
|
+
super({
|
|
142
|
+
message: params?.message || 'Schema validation error',
|
|
143
|
+
...params,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.SchemaValidationError = SchemaValidationError;
|
|
148
|
+
class RateLimitedError extends OrchestratorError {
|
|
149
|
+
constructor(params) {
|
|
150
|
+
super({
|
|
151
|
+
message: 'Too Many Requests',
|
|
152
|
+
...params,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.RateLimitedError = RateLimitedError;
|
|
157
|
+
class ServiceUnavailableError extends OrchestratorError {
|
|
158
|
+
constructor(params) {
|
|
159
|
+
super({
|
|
160
|
+
message: 'Service Unavailable',
|
|
161
|
+
...params,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.ServiceUnavailableError = ServiceUnavailableError;
|
|
166
|
+
class UnauthorizedError extends OrchestratorError {
|
|
167
|
+
constructor(params) {
|
|
168
|
+
super({
|
|
169
|
+
message: 'Unauthorized',
|
|
170
|
+
...params,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.UnauthorizedError = UnauthorizedError;
|
|
175
|
+
class ForbiddenError extends OrchestratorError {
|
|
176
|
+
constructor(params) {
|
|
177
|
+
super({
|
|
178
|
+
message: 'Forbidden',
|
|
179
|
+
...params,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.ForbiddenError = ForbiddenError;
|
|
184
|
+
class ResourceNotFoundError extends OrchestratorError {
|
|
185
|
+
constructor(params) {
|
|
186
|
+
super({
|
|
187
|
+
message: 'Not Found',
|
|
188
|
+
...params,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.ResourceNotFoundError = ResourceNotFoundError;
|
|
193
|
+
class ConflictError extends OrchestratorError {
|
|
194
|
+
constructor(params) {
|
|
195
|
+
super({
|
|
196
|
+
message: 'Conflict',
|
|
197
|
+
...params,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.ConflictError = ConflictError;
|
|
202
|
+
class BadRequestError extends OrchestratorError {
|
|
203
|
+
constructor(params) {
|
|
204
|
+
super({
|
|
205
|
+
message: params?.message || 'Bad Request',
|
|
206
|
+
...params,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.BadRequestError = BadRequestError;
|
|
211
|
+
class UnprocessableEntityError extends OrchestratorError {
|
|
212
|
+
constructor(params) {
|
|
213
|
+
super({
|
|
214
|
+
message: params?.message || 'Unprocessable Entity',
|
|
215
|
+
...params,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
220
|
+
class InternalServerError extends OrchestratorError {
|
|
221
|
+
constructor(params) {
|
|
222
|
+
super({
|
|
223
|
+
message: 'Internal Server Error',
|
|
224
|
+
...params,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.InternalServerError = InternalServerError;
|
|
229
|
+
class BodyParserError extends OrchestratorError {
|
|
230
|
+
constructor(params) {
|
|
231
|
+
super({
|
|
232
|
+
message: params?.message || 'Body parser error',
|
|
233
|
+
...params,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.BodyParserError = BodyParserError;
|
|
238
|
+
class SimulationFailedError extends OrchestratorError {
|
|
239
|
+
constructor(params) {
|
|
240
|
+
super({
|
|
241
|
+
message: params?.message || 'Simulation failed',
|
|
242
|
+
...params,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.SimulationFailedError = SimulationFailedError;
|
|
130
247
|
function isOrchestratorError(error) {
|
|
131
248
|
return error instanceof OrchestratorError;
|
|
132
249
|
}
|
|
250
|
+
function isRateLimited(error) {
|
|
251
|
+
return (error instanceof RateLimitedError ||
|
|
252
|
+
(error instanceof OrchestratorError && error.statusCode === 429));
|
|
253
|
+
}
|
|
254
|
+
function isValidationError(error) {
|
|
255
|
+
if (!(error instanceof OrchestratorError))
|
|
256
|
+
return false;
|
|
257
|
+
return error.statusCode === 400 || error.statusCode === 422;
|
|
258
|
+
}
|
|
259
|
+
function isAuthError(error) {
|
|
260
|
+
if (!(error instanceof OrchestratorError))
|
|
261
|
+
return false;
|
|
262
|
+
return (error.statusCode === 401 || error instanceof AuthenticationRequiredError);
|
|
263
|
+
}
|
|
264
|
+
function isRetryable(error) {
|
|
265
|
+
if (!(error instanceof OrchestratorError))
|
|
266
|
+
return false;
|
|
267
|
+
return error.statusCode === 500 || error.statusCode === 503;
|
|
268
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Orchestrator } from './client';
|
|
2
2
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
|
-
import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
|
|
4
|
-
import { getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
|
-
import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio,
|
|
6
|
-
import { INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED,
|
|
3
|
+
import { AuthenticationRequiredError, BadRequestError, BodyParserError, ConflictError, ForbiddenError, InsufficientBalanceError, 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';
|
|
4
|
+
import { getAllSupportedChainsAndTokens, getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
|
+
import type { ApprovalRequired, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementLayer, SignedIntentOp, SupportedChain, TokenConfig, TokenRequirements, WrapRequired } from './types';
|
|
6
|
+
import { INTENT_STATUS_CLAIMED, INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED } from './types';
|
|
7
7
|
declare function getOrchestrator(apiKey?: string, orchestratorUrl?: string): Orchestrator;
|
|
8
|
-
export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute,
|
|
9
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED,
|
|
8
|
+
export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementLayer, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, };
|
|
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, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, InternalServerError, ResourceNotFoundError, RateLimitedError, SchemaValidationError, ServiceUnavailableError, SimulationFailedError, UnprocessableEntityError, UnauthorizedError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, getAllSupportedChainsAndTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
10
10
|
//# 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,kBAAkB,EAClB,eAAe,EACf,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,
|
|
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,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,E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ACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,8BAA8B,EAC9B,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,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.getTokenSymbol = exports.getWethAddress = 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.
|
|
3
|
+
exports.isTokenAddressSupported = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.getAllSupportedChainsAndTokens = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.UnauthorizedError = exports.UnprocessableEntityError = exports.SimulationFailedError = exports.ServiceUnavailableError = exports.SchemaValidationError = exports.RateLimitedError = exports.ResourceNotFoundError = exports.InternalServerError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.ForbiddenError = exports.ConflictError = exports.BodyParserError = exports.BadRequestError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_CLAIMED = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_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; } });
|
|
@@ -8,33 +8,49 @@ const consts_1 = require("./consts");
|
|
|
8
8
|
Object.defineProperty(exports, "RHINESTONE_SPOKE_POOL_ADDRESS", { enumerable: true, get: function () { return consts_1.RHINESTONE_SPOKE_POOL_ADDRESS; } });
|
|
9
9
|
const error_1 = require("./error");
|
|
10
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; } });
|
|
11
15
|
Object.defineProperty(exports, "InsufficientBalanceError", { enumerable: true, get: function () { return error_1.InsufficientBalanceError; } });
|
|
12
16
|
Object.defineProperty(exports, "IntentNotFoundError", { enumerable: true, get: function () { return error_1.IntentNotFoundError; } });
|
|
17
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
13
18
|
Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return error_1.InvalidApiKeyError; } });
|
|
14
19
|
Object.defineProperty(exports, "InvalidIntentSignatureError", { enumerable: true, get: function () { return error_1.InvalidIntentSignatureError; } });
|
|
20
|
+
Object.defineProperty(exports, "isAuthError", { enumerable: true, get: function () { return error_1.isAuthError; } });
|
|
15
21
|
Object.defineProperty(exports, "isOrchestratorError", { enumerable: true, get: function () { return error_1.isOrchestratorError; } });
|
|
22
|
+
Object.defineProperty(exports, "isRateLimited", { enumerable: true, get: function () { return error_1.isRateLimited; } });
|
|
23
|
+
Object.defineProperty(exports, "isRetryable", { enumerable: true, get: function () { return error_1.isRetryable; } });
|
|
24
|
+
Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return error_1.isValidationError; } });
|
|
16
25
|
Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return error_1.NoPathFoundError; } });
|
|
17
26
|
Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return error_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
|
|
18
27
|
Object.defineProperty(exports, "OrchestratorError", { enumerable: true, get: function () { return error_1.OrchestratorError; } });
|
|
28
|
+
Object.defineProperty(exports, "RateLimitedError", { enumerable: true, get: function () { return error_1.RateLimitedError; } });
|
|
29
|
+
Object.defineProperty(exports, "ResourceNotFoundError", { enumerable: true, get: function () { return error_1.ResourceNotFoundError; } });
|
|
30
|
+
Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return error_1.SchemaValidationError; } });
|
|
31
|
+
Object.defineProperty(exports, "ServiceUnavailableError", { enumerable: true, get: function () { return error_1.ServiceUnavailableError; } });
|
|
32
|
+
Object.defineProperty(exports, "SimulationFailedError", { enumerable: true, get: function () { return error_1.SimulationFailedError; } });
|
|
19
33
|
Object.defineProperty(exports, "TokenNotSupportedError", { enumerable: true, get: function () { return error_1.TokenNotSupportedError; } });
|
|
34
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return error_1.UnauthorizedError; } });
|
|
35
|
+
Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, get: function () { return error_1.UnprocessableEntityError; } });
|
|
20
36
|
Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return error_1.UnsupportedChainError; } });
|
|
21
37
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
|
|
22
38
|
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
|
|
23
39
|
const registry_1 = require("./registry");
|
|
40
|
+
Object.defineProperty(exports, "getAllSupportedChainsAndTokens", { enumerable: true, get: function () { return registry_1.getAllSupportedChainsAndTokens; } });
|
|
24
41
|
Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
|
|
25
42
|
Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
|
|
26
43
|
Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
|
|
27
44
|
Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
|
|
28
45
|
Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
|
|
29
46
|
const types_1 = require("./types");
|
|
47
|
+
Object.defineProperty(exports, "INTENT_STATUS_CLAIMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_CLAIMED; } });
|
|
30
48
|
Object.defineProperty(exports, "INTENT_STATUS_COMPLETED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_COMPLETED; } });
|
|
31
49
|
Object.defineProperty(exports, "INTENT_STATUS_EXPIRED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_EXPIRED; } });
|
|
32
50
|
Object.defineProperty(exports, "INTENT_STATUS_FAILED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FAILED; } });
|
|
33
51
|
Object.defineProperty(exports, "INTENT_STATUS_FILLED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FILLED; } });
|
|
34
|
-
Object.defineProperty(exports, "INTENT_STATUS_PARTIALLY_COMPLETED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PARTIALLY_COMPLETED; } });
|
|
35
52
|
Object.defineProperty(exports, "INTENT_STATUS_PENDING", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PENDING; } });
|
|
36
53
|
Object.defineProperty(exports, "INTENT_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PRECONFIRMED; } });
|
|
37
|
-
Object.defineProperty(exports, "INTENT_STATUS_UNKNOWN", { enumerable: true, get: function () { return types_1.INTENT_STATUS_UNKNOWN; } });
|
|
38
54
|
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
39
55
|
return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
|
|
40
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
2
|
import type { TokenSymbol } from '../types';
|
|
3
3
|
import type { TokenConfig } from './types';
|
|
4
4
|
declare function getSupportedChainIds(): number[];
|
|
@@ -13,5 +13,9 @@ declare function getDefaultAccountAccessList(onTestnets?: boolean): {
|
|
|
13
13
|
chainIds: number[];
|
|
14
14
|
};
|
|
15
15
|
declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
|
|
16
|
-
|
|
16
|
+
declare function getAllSupportedChainsAndTokens(): {
|
|
17
|
+
chainId: number;
|
|
18
|
+
tokens: TokenConfig[];
|
|
19
|
+
}[];
|
|
20
|
+
export { getTokenSymbol, getTokenAddress, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, getAllSupportedChainsAndTokens, };
|
|
17
21
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MAAM,CAAA;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,iBAAS,oBAAoB,IAAI,MAAM,EAAE,CAExC;AAMD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAc7C;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAgBtE;AAED,iBAAS,eAAe,CACtB,KAAK,EAAE,WAAW,GAAG,OAAO,EAC5B,OAAO,EAAE,MAAM,GACd,OAAO,CAMT;AAED,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAM5C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAG3C;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAU3E;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAU1D;AAED,iBAAS,2BAA2B,CAAC,UAAU,CAAC,EAAE,OAAO;;EAaxD;AAED,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,WAAW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