@rhinestone/sdk 1.0.41-alpha.0 → 1.0.41
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 +114 -0
- package/dist/src/accounts/error.d.ts.map +1 -0
- package/dist/src/accounts/error.js +174 -0
- package/dist/src/accounts/index.d.ts +50 -0
- package/dist/src/accounts/index.d.ts.map +1 -0
- package/dist/src/accounts/index.js +669 -0
- package/dist/src/accounts/index.test.d.ts +2 -0
- package/dist/src/accounts/index.test.d.ts.map +1 -0
- package/dist/src/accounts/index.test.js +33 -0
- package/dist/src/accounts/json-rpc/index.d.ts +5 -0
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.js +20 -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 +5 -0
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.js +22 -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 +29 -0
- package/dist/src/accounts/kernel.d.ts.map +1 -0
- package/dist/src/accounts/kernel.js +297 -0
- package/dist/src/accounts/kernel.test.d.ts +2 -0
- package/dist/src/accounts/kernel.test.d.ts.map +1 -0
- package/dist/src/accounts/kernel.test.js +132 -0
- package/dist/src/accounts/nexus.d.ts +35 -0
- package/dist/src/accounts/nexus.d.ts.map +1 -0
- package/dist/src/accounts/nexus.js +471 -0
- package/dist/src/accounts/nexus.test.d.ts +2 -0
- package/dist/src/accounts/nexus.test.d.ts.map +1 -0
- package/dist/src/accounts/nexus.test.js +118 -0
- 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 +35 -0
- package/dist/src/accounts/safe.d.ts.map +1 -0
- package/dist/src/accounts/safe.js +365 -0
- package/dist/src/accounts/safe.test.d.ts +2 -0
- package/dist/src/accounts/safe.test.d.ts.map +1 -0
- package/dist/src/accounts/safe.test.js +118 -0
- package/dist/src/accounts/signing/common.d.ts +27 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -0
- package/dist/src/accounts/signing/common.js +183 -0
- package/dist/src/accounts/signing/message.d.ts +5 -0
- package/dist/src/accounts/signing/message.d.ts.map +1 -0
- package/dist/src/accounts/signing/message.js +47 -0
- package/dist/src/accounts/signing/passkeys.d.ts +36 -0
- package/dist/src/accounts/signing/passkeys.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.js +125 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts +2 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.test.js +88 -0
- package/dist/src/accounts/signing/typedData.d.ts +5 -0
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
- package/dist/src/accounts/signing/typedData.js +35 -0
- package/dist/src/accounts/startale.d.ts +27 -0
- package/dist/src/accounts/startale.d.ts.map +1 -0
- package/dist/src/accounts/startale.js +116 -0
- package/dist/src/accounts/startale.test.d.ts +2 -0
- package/dist/src/accounts/startale.test.d.ts.map +1 -0
- package/dist/src/accounts/startale.test.js +92 -0
- package/dist/src/accounts/utils.d.ts +33 -0
- package/dist/src/accounts/utils.d.ts.map +1 -0
- package/dist/src/accounts/utils.js +208 -0
- package/dist/src/accounts/utils.test.d.ts +2 -0
- package/dist/src/accounts/utils.test.d.ts.map +1 -0
- package/dist/src/accounts/utils.test.js +49 -0
- package/dist/src/accounts/walletClient.d.ts +34 -0
- package/dist/src/accounts/walletClient.d.ts.map +1 -0
- package/dist/src/accounts/walletClient.js +121 -0
- package/dist/src/actions/compact.d.ts +13 -0
- package/dist/src/actions/compact.d.ts.map +1 -0
- package/dist/src/actions/compact.js +210 -0
- package/dist/src/actions/deployment.d.ts +19 -0
- package/dist/src/actions/deployment.d.ts.map +1 -0
- package/dist/src/actions/deployment.js +78 -0
- package/dist/src/actions/ecdsa.d.ts +35 -0
- package/dist/src/actions/ecdsa.d.ts.map +1 -0
- package/dist/src/actions/ecdsa.js +114 -0
- package/dist/src/actions/ecdsa.test.d.ts +2 -0
- package/dist/src/actions/ecdsa.test.d.ts.map +1 -0
- package/dist/src/actions/ecdsa.test.js +99 -0
- package/dist/src/actions/index.d.ts +17 -0
- package/dist/src/actions/index.d.ts.map +1 -0
- package/dist/src/actions/index.js +53 -0
- package/dist/src/actions/mfa.d.ts +37 -0
- package/dist/src/actions/mfa.d.ts.map +1 -0
- package/dist/src/actions/mfa.js +133 -0
- package/dist/src/actions/passkeys.d.ts +37 -0
- package/dist/src/actions/passkeys.d.ts.map +1 -0
- package/dist/src/actions/passkeys.js +129 -0
- package/dist/src/actions/passkeys.test.d.ts +2 -0
- package/dist/src/actions/passkeys.test.d.ts.map +1 -0
- package/dist/src/actions/passkeys.test.js +54 -0
- package/dist/src/actions/recovery.d.ts +33 -0
- package/dist/src/actions/recovery.d.ts.map +1 -0
- package/dist/src/actions/recovery.js +193 -0
- package/dist/src/actions/recovery.test.d.ts +2 -0
- package/dist/src/actions/recovery.test.d.ts.map +1 -0
- package/dist/src/actions/recovery.test.js +168 -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 +5 -0
- package/dist/src/errors/index.d.ts.map +1 -0
- package/dist/src/errors/index.js +53 -0
- package/dist/src/execution/compact.d.ts +151 -0
- package/dist/src/execution/compact.d.ts.map +1 -0
- package/dist/src/execution/compact.js +122 -0
- package/dist/src/execution/error.d.ts +61 -0
- package/dist/src/execution/error.d.ts.map +1 -0
- package/dist/src/execution/error.js +87 -0
- package/dist/src/execution/index.d.ts +41 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +233 -0
- package/dist/src/execution/permit2.d.ts +148 -0
- package/dist/src/execution/permit2.d.ts.map +1 -0
- package/dist/src/execution/permit2.js +291 -0
- 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 +13 -0
- package/dist/src/execution/smart-session.d.ts.map +1 -0
- package/dist/src/execution/smart-session.js +178 -0
- package/dist/src/execution/types.d.ts +36 -0
- package/dist/src/execution/types.d.ts.map +1 -0
- package/dist/src/execution/types.js +2 -0
- package/dist/src/execution/utils.d.ts +83 -0
- package/dist/src/execution/utils.d.ts.map +1 -0
- package/dist/src/execution/utils.js +705 -0
- package/dist/src/index.d.ts +74 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +317 -0
- package/dist/src/modules/abi/smart-sessions.d.ts +104 -0
- package/dist/src/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-sessions.js +131 -0
- package/dist/src/modules/chain-abstraction.d.ts +5 -0
- package/dist/src/modules/chain-abstraction.d.ts.map +1 -0
- package/dist/src/modules/chain-abstraction.js +7 -0
- package/dist/src/modules/common.d.ts +30 -0
- package/dist/src/modules/common.d.ts.map +1 -0
- package/dist/src/modules/common.js +42 -0
- package/dist/src/modules/index.d.ts +10 -0
- package/dist/src/modules/index.d.ts.map +1 -0
- package/dist/src/modules/index.js +94 -0
- package/dist/src/modules/index.test.d.ts +2 -0
- package/dist/src/modules/index.test.d.ts.map +1 -0
- package/dist/src/modules/index.test.js +81 -0
- package/dist/src/modules/legacy.d.ts +10 -0
- package/dist/src/modules/legacy.d.ts.map +1 -0
- package/dist/src/modules/legacy.js +65 -0
- package/dist/src/modules/read.d.ts +9 -0
- package/dist/src/modules/read.d.ts.map +1 -0
- package/dist/src/modules/read.js +125 -0
- package/dist/src/modules/validators/core.d.ts +29 -0
- package/dist/src/modules/validators/core.d.ts.map +1 -0
- package/dist/src/modules/validators/core.js +278 -0
- package/dist/src/modules/validators/core.test.d.ts +2 -0
- package/dist/src/modules/validators/core.test.d.ts.map +1 -0
- package/dist/src/modules/validators/core.test.js +101 -0
- package/dist/src/modules/validators/index.d.ts +4 -0
- package/dist/src/modules/validators/index.d.ts.map +1 -0
- package/dist/src/modules/validators/index.js +15 -0
- package/dist/src/modules/validators/smart-sessions.d.ts +96 -0
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions.js +497 -0
- package/dist/src/modules/validators/smart-sessions.test.d.ts +2 -0
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions.test.js +219 -0
- package/dist/src/orchestrator/client.d.ts +27 -0
- package/dist/src/orchestrator/client.d.ts.map +1 -0
- package/dist/src/orchestrator/client.js +354 -0
- package/dist/src/orchestrator/consts.d.ts +5 -0
- package/dist/src/orchestrator/consts.d.ts.map +1 -0
- package/dist/src/orchestrator/consts.js +9 -0
- package/dist/src/orchestrator/error.d.ts +232 -0
- package/dist/src/orchestrator/error.d.ts.map +1 -0
- package/dist/src/orchestrator/error.js +268 -0
- package/dist/src/orchestrator/index.d.ts +10 -0
- package/dist/src/orchestrator/index.d.ts.map +1 -0
- package/dist/src/orchestrator/index.js +57 -0
- package/dist/src/orchestrator/registry.d.ts +22 -0
- package/dist/src/orchestrator/registry.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.js +121 -0
- package/dist/src/orchestrator/registry.test.d.ts +2 -0
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +150 -0
- package/dist/src/orchestrator/types.d.ts +295 -0
- package/dist/src/orchestrator/types.d.ts.map +1 -0
- package/dist/src/orchestrator/types.js +17 -0
- package/dist/src/orchestrator/utils.d.ts +3 -0
- package/dist/src/orchestrator/utils.d.ts.map +1 -0
- package/dist/src/orchestrator/utils.js +24 -0
- package/dist/src/types.d.ts +284 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/utils/index.d.ts +26 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +63 -0
- package/dist/test/consts.d.ts +10 -0
- package/dist/test/consts.d.ts.map +1 -0
- package/dist/test/consts.js +22 -0
- package/dist/test/utils/utils.d.ts +5 -0
- package/dist/test/utils/utils.d.ts.map +1 -0
- package/dist/test/utils/utils.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
}
|
|
17
|
+
declare class OrchestratorError extends Error {
|
|
18
|
+
private readonly _message;
|
|
19
|
+
private readonly _context;
|
|
20
|
+
private readonly _errorType;
|
|
21
|
+
private readonly _traceId;
|
|
22
|
+
private readonly _statusCode?;
|
|
23
|
+
constructor(params?: {
|
|
24
|
+
message?: string;
|
|
25
|
+
context?: any;
|
|
26
|
+
errorType?: string;
|
|
27
|
+
traceId?: string;
|
|
28
|
+
statusCode?: number;
|
|
29
|
+
});
|
|
30
|
+
get message(): string;
|
|
31
|
+
get context(): any;
|
|
32
|
+
get errorType(): string;
|
|
33
|
+
get traceId(): string;
|
|
34
|
+
get statusCode(): number | undefined;
|
|
35
|
+
}
|
|
36
|
+
declare class InsufficientBalanceError extends OrchestratorError {
|
|
37
|
+
constructor(params?: {
|
|
38
|
+
context?: any;
|
|
39
|
+
errorType?: string;
|
|
40
|
+
traceId?: string;
|
|
41
|
+
statusCode?: number;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
declare class UnsupportedChainIdError extends OrchestratorError {
|
|
45
|
+
constructor(params?: {
|
|
46
|
+
context?: any;
|
|
47
|
+
errorType?: string;
|
|
48
|
+
traceId?: string;
|
|
49
|
+
statusCode?: number;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
declare class UnsupportedChainError extends OrchestratorError {
|
|
53
|
+
constructor(chainId: number, params?: {
|
|
54
|
+
context?: any;
|
|
55
|
+
errorType?: string;
|
|
56
|
+
traceId?: string;
|
|
57
|
+
statusCode?: number;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
declare class UnsupportedTokenError extends OrchestratorError {
|
|
61
|
+
constructor(tokenSymbol: string, chainId: number, params?: {
|
|
62
|
+
context?: any;
|
|
63
|
+
errorType?: string;
|
|
64
|
+
traceId?: string;
|
|
65
|
+
statusCode?: number;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
declare class TokenNotSupportedError extends OrchestratorError {
|
|
69
|
+
constructor(tokenAddress: string, chainId: number, params?: {
|
|
70
|
+
context?: any;
|
|
71
|
+
errorType?: string;
|
|
72
|
+
traceId?: string;
|
|
73
|
+
statusCode?: number;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
declare class AuthenticationRequiredError extends OrchestratorError {
|
|
77
|
+
constructor(params?: {
|
|
78
|
+
context?: any;
|
|
79
|
+
errorType?: string;
|
|
80
|
+
traceId?: string;
|
|
81
|
+
statusCode?: number;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
declare class InvalidApiKeyError extends OrchestratorError {
|
|
85
|
+
constructor(params?: {
|
|
86
|
+
context?: any;
|
|
87
|
+
errorType?: string;
|
|
88
|
+
traceId?: string;
|
|
89
|
+
statusCode?: number;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
declare class InvalidIntentSignatureError extends OrchestratorError {
|
|
93
|
+
constructor(params?: {
|
|
94
|
+
context?: any;
|
|
95
|
+
errorType?: string;
|
|
96
|
+
traceId?: string;
|
|
97
|
+
statusCode?: number;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
declare class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
|
|
101
|
+
constructor(params?: {
|
|
102
|
+
context?: any;
|
|
103
|
+
errorType?: string;
|
|
104
|
+
traceId?: string;
|
|
105
|
+
statusCode?: number;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
declare class NoPathFoundError extends OrchestratorError {
|
|
109
|
+
constructor(params?: {
|
|
110
|
+
context?: any;
|
|
111
|
+
errorType?: string;
|
|
112
|
+
traceId?: string;
|
|
113
|
+
statusCode?: number;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
declare class IntentNotFoundError extends OrchestratorError {
|
|
117
|
+
constructor(params?: {
|
|
118
|
+
context?: any;
|
|
119
|
+
errorType?: string;
|
|
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[];
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
declare function isOrchestratorError(error: Error): error is OrchestratorError;
|
|
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, };
|
|
232
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../orchestrator/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE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QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,UAAU,CAAC,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"}
|
|
@@ -0,0 +1,268 @@
|
|
|
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.OrchestratorError = void 0;
|
|
4
|
+
exports.isOrchestratorError = isOrchestratorError;
|
|
5
|
+
exports.isRetryable = isRetryable;
|
|
6
|
+
exports.isAuthError = isAuthError;
|
|
7
|
+
exports.isValidationError = isValidationError;
|
|
8
|
+
exports.isRateLimited = isRateLimited;
|
|
9
|
+
class OrchestratorError extends Error {
|
|
10
|
+
_message;
|
|
11
|
+
_context;
|
|
12
|
+
_errorType;
|
|
13
|
+
_traceId;
|
|
14
|
+
_statusCode;
|
|
15
|
+
constructor(params) {
|
|
16
|
+
super();
|
|
17
|
+
this._message = params?.message || 'OrchestratorError ';
|
|
18
|
+
this._context = params?.context || {};
|
|
19
|
+
this._errorType = params?.errorType || 'Unknown';
|
|
20
|
+
this._traceId = params?.traceId || '';
|
|
21
|
+
this._statusCode = params?.statusCode;
|
|
22
|
+
}
|
|
23
|
+
get message() {
|
|
24
|
+
return this._message;
|
|
25
|
+
}
|
|
26
|
+
get context() {
|
|
27
|
+
return this._context;
|
|
28
|
+
}
|
|
29
|
+
get errorType() {
|
|
30
|
+
return this._errorType;
|
|
31
|
+
}
|
|
32
|
+
get traceId() {
|
|
33
|
+
return this._traceId;
|
|
34
|
+
}
|
|
35
|
+
get statusCode() {
|
|
36
|
+
return this._statusCode;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.OrchestratorError = OrchestratorError;
|
|
40
|
+
class InsufficientBalanceError extends OrchestratorError {
|
|
41
|
+
constructor(params) {
|
|
42
|
+
super({
|
|
43
|
+
message: 'Insufficient balance',
|
|
44
|
+
...params,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.InsufficientBalanceError = InsufficientBalanceError;
|
|
49
|
+
class UnsupportedChainIdError extends OrchestratorError {
|
|
50
|
+
constructor(params) {
|
|
51
|
+
super({
|
|
52
|
+
message: 'Unsupported chain id',
|
|
53
|
+
...params,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.UnsupportedChainIdError = UnsupportedChainIdError;
|
|
58
|
+
class UnsupportedChainError extends OrchestratorError {
|
|
59
|
+
constructor(chainId, params) {
|
|
60
|
+
super({
|
|
61
|
+
message: `Unsupported chain ${chainId}`,
|
|
62
|
+
...params,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.UnsupportedChainError = UnsupportedChainError;
|
|
67
|
+
class UnsupportedTokenError extends OrchestratorError {
|
|
68
|
+
constructor(tokenSymbol, chainId, params) {
|
|
69
|
+
super({
|
|
70
|
+
message: `Unsupported token ${tokenSymbol} for chain ${chainId}`,
|
|
71
|
+
...params,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.UnsupportedTokenError = UnsupportedTokenError;
|
|
76
|
+
class TokenNotSupportedError extends OrchestratorError {
|
|
77
|
+
constructor(tokenAddress, chainId, params) {
|
|
78
|
+
super({
|
|
79
|
+
message: `Token ${tokenAddress} not supported on chain ${chainId}`,
|
|
80
|
+
...params,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.TokenNotSupportedError = TokenNotSupportedError;
|
|
85
|
+
class AuthenticationRequiredError extends OrchestratorError {
|
|
86
|
+
constructor(params) {
|
|
87
|
+
super({
|
|
88
|
+
message: 'Authentication is required',
|
|
89
|
+
...params,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.AuthenticationRequiredError = AuthenticationRequiredError;
|
|
94
|
+
class InvalidApiKeyError extends OrchestratorError {
|
|
95
|
+
constructor(params) {
|
|
96
|
+
super({
|
|
97
|
+
message: 'Invalid API key',
|
|
98
|
+
...params,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.InvalidApiKeyError = InvalidApiKeyError;
|
|
103
|
+
class InvalidIntentSignatureError extends OrchestratorError {
|
|
104
|
+
constructor(params) {
|
|
105
|
+
super({
|
|
106
|
+
message: 'Invalid intent signature',
|
|
107
|
+
...params,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.InvalidIntentSignatureError = InvalidIntentSignatureError;
|
|
112
|
+
class OnlyOneTargetTokenAmountCanBeUnsetError extends OrchestratorError {
|
|
113
|
+
constructor(params) {
|
|
114
|
+
super({
|
|
115
|
+
message: 'Only one target token amount can be unset',
|
|
116
|
+
...params,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.OnlyOneTargetTokenAmountCanBeUnsetError = OnlyOneTargetTokenAmountCanBeUnsetError;
|
|
121
|
+
class NoPathFoundError extends OrchestratorError {
|
|
122
|
+
constructor(params) {
|
|
123
|
+
super({
|
|
124
|
+
message: 'No Path Found',
|
|
125
|
+
...params,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.NoPathFoundError = NoPathFoundError;
|
|
130
|
+
class IntentNotFoundError extends OrchestratorError {
|
|
131
|
+
constructor(params) {
|
|
132
|
+
super({
|
|
133
|
+
message: 'Intent not found',
|
|
134
|
+
...params,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
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;
|
|
247
|
+
function isOrchestratorError(error) {
|
|
248
|
+
return error instanceof OrchestratorError;
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Orchestrator } from './client';
|
|
2
|
+
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
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, getTokenDecimals, 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
|
+
declare function getOrchestrator(apiKey?: string, orchestratorUrl?: string): Orchestrator;
|
|
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, getTokenDecimals, getSupportedTokens, getAllSupportedChainsAndTokens, isOrchestratorError, isRetryable, isAuthError, isValidationError, isRateLimited, isTokenAddressSupported, };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sB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AqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,8BAA8B,EAC9B,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,uBAAuB,GACxB,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTokenAddressSupported = exports.isRateLimited = exports.isValidationError = exports.isAuthError = exports.isRetryable = exports.isOrchestratorError = exports.getAllSupportedChainsAndTokens = exports.getSupportedTokens = exports.getTokenDecimals = 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
|
+
exports.getOrchestrator = getOrchestrator;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
|
|
7
|
+
const consts_1 = require("./consts");
|
|
8
|
+
Object.defineProperty(exports, "RHINESTONE_SPOKE_POOL_ADDRESS", { enumerable: true, get: function () { return consts_1.RHINESTONE_SPOKE_POOL_ADDRESS; } });
|
|
9
|
+
const error_1 = require("./error");
|
|
10
|
+
Object.defineProperty(exports, "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, "IntentNotFoundError", { enumerable: true, get: function () { return error_1.IntentNotFoundError; } });
|
|
17
|
+
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_1.InternalServerError; } });
|
|
18
|
+
Object.defineProperty(exports, "InvalidApiKeyError", { enumerable: true, get: function () { return error_1.InvalidApiKeyError; } });
|
|
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; } });
|
|
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; } });
|
|
25
|
+
Object.defineProperty(exports, "NoPathFoundError", { enumerable: true, get: function () { return error_1.NoPathFoundError; } });
|
|
26
|
+
Object.defineProperty(exports, "OnlyOneTargetTokenAmountCanBeUnsetError", { enumerable: true, get: function () { return error_1.OnlyOneTargetTokenAmountCanBeUnsetError; } });
|
|
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; } });
|
|
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; } });
|
|
36
|
+
Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get: function () { return error_1.UnsupportedChainError; } });
|
|
37
|
+
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
|
|
38
|
+
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
|
|
39
|
+
const registry_1 = require("./registry");
|
|
40
|
+
Object.defineProperty(exports, "getAllSupportedChainsAndTokens", { enumerable: true, get: function () { return registry_1.getAllSupportedChainsAndTokens; } });
|
|
41
|
+
Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
|
|
42
|
+
Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
|
|
43
|
+
Object.defineProperty(exports, "getTokenDecimals", { enumerable: true, get: function () { return registry_1.getTokenDecimals; } });
|
|
44
|
+
Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
|
|
45
|
+
Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
|
|
46
|
+
Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
|
|
47
|
+
const types_1 = require("./types");
|
|
48
|
+
Object.defineProperty(exports, "INTENT_STATUS_CLAIMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_CLAIMED; } });
|
|
49
|
+
Object.defineProperty(exports, "INTENT_STATUS_COMPLETED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_COMPLETED; } });
|
|
50
|
+
Object.defineProperty(exports, "INTENT_STATUS_EXPIRED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_EXPIRED; } });
|
|
51
|
+
Object.defineProperty(exports, "INTENT_STATUS_FAILED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FAILED; } });
|
|
52
|
+
Object.defineProperty(exports, "INTENT_STATUS_FILLED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_FILLED; } });
|
|
53
|
+
Object.defineProperty(exports, "INTENT_STATUS_PENDING", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PENDING; } });
|
|
54
|
+
Object.defineProperty(exports, "INTENT_STATUS_PRECONFIRMED", { enumerable: true, get: function () { return types_1.INTENT_STATUS_PRECONFIRMED; } });
|
|
55
|
+
function getOrchestrator(apiKey, orchestratorUrl) {
|
|
56
|
+
return new client_1.Orchestrator(orchestratorUrl ?? consts_1.PROD_ORCHESTRATOR_URL, apiKey);
|
|
57
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
|
+
import type { TokenSymbol } from '../types';
|
|
3
|
+
import type { TokenConfig } from './types';
|
|
4
|
+
declare function getSupportedChainIds(): number[];
|
|
5
|
+
declare function getWethAddress(chain: Chain): Address;
|
|
6
|
+
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
7
|
+
declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
|
|
8
|
+
declare function getTokenDecimals(tokenSymbol: TokenSymbol, chainId: number): number;
|
|
9
|
+
declare function getChainById(chainId: number): Chain;
|
|
10
|
+
declare function isTestnet(chainId: number): boolean;
|
|
11
|
+
declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
|
|
12
|
+
declare function getSupportedTokens(chainId: number): TokenConfig[];
|
|
13
|
+
declare function getDefaultAccountAccessList(onTestnets?: boolean): {
|
|
14
|
+
chainIds: number[];
|
|
15
|
+
};
|
|
16
|
+
declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
|
|
17
|
+
declare function getAllSupportedChainsAndTokens(): {
|
|
18
|
+
chainId: number;
|
|
19
|
+
tokens: TokenConfig[];
|
|
20
|
+
}[];
|
|
21
|
+
export { getTokenSymbol, getTokenAddress, getTokenDecimals, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, getAllSupportedChainsAndTokens, };
|
|
22
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,MAAM,CAAA;A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