@renegade-fi/renegade-sdk 0.1.7 → 0.1.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 +3 -3
- package/dist/client.js +569 -0
- package/dist/client.js.map +1 -0
- package/dist/http.js +209 -0
- package/dist/http.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/types/client.d.ts +230 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/fixedPoint.js +37 -0
- package/dist/types/fixedPoint.js.map +1 -0
- package/dist/types/http.d.ts +85 -0
- package/dist/types/http.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/malleableMatch.js +330 -0
- package/dist/types/malleableMatch.js.map +1 -0
- package/dist/types/types/fixedPoint.d.ts +13 -0
- package/dist/types/types/fixedPoint.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +126 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/malleableMatch.d.ts +199 -0
- package/dist/types/types/malleableMatch.d.ts.map +1 -0
- package/dist/types/version.d.ts +7 -0
- package/dist/types/version.d.ts.map +1 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/package.json +33 -32
- package/src/client.ts +98 -10
- package/src/http.ts +14 -5
- package/{index.ts → src/index.ts} +13 -13
- package/src/types/index.ts +20 -1
- package/src/types/malleableMatch.ts +2 -2
- package/src/version.ts +2 -2
- package/LICENSE +0 -21
- package/biome.json +0 -44
- package/examples/base_sepolia_match.ts +0 -117
- package/examples/basic.ts +0 -117
- package/examples/malleable_external_match.ts +0 -193
- package/examples/order_book_depth.ts +0 -41
- package/examples/shared_bundle.ts +0 -112
- package/scripts/update-version.sh +0 -30
- package/tsconfig.build.json +0 -11
- package/tsconfig.json +0 -28
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ A TypeScript client for interacting with the Renegade Darkpool's External Match
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Using npm
|
|
9
|
-
npm install renegade-sdk
|
|
9
|
+
npm install @renegade-fi/renegade-sdk
|
|
10
10
|
|
|
11
11
|
# Using yarn
|
|
12
|
-
yarn add renegade-sdk
|
|
12
|
+
yarn add @renegade-fi/renegade-sdk
|
|
13
13
|
|
|
14
14
|
# Using bun
|
|
15
|
-
bun add renegade-sdk
|
|
15
|
+
bun add @renegade-fi/renegade-sdk
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client for interacting with the Renegade external matching API.
|
|
3
|
+
*
|
|
4
|
+
* This client handles authentication and provides methods for requesting quotes,
|
|
5
|
+
* assembling matches, and executing trades.
|
|
6
|
+
*/
|
|
7
|
+
import { RelayerHttpClient } from "./http.js";
|
|
8
|
+
import { MalleableExternalMatchResponse, } from "./types/index.js";
|
|
9
|
+
import { VERSION } from "./version.js";
|
|
10
|
+
// Constants for API URLs
|
|
11
|
+
const ARBITRUM_SEPOLIA_BASE_URL = "https://arbitrum-sepolia.auth-server.renegade.fi";
|
|
12
|
+
const ARBITRUM_ONE_BASE_URL = "https://arbitrum-one.auth-server.renegade.fi";
|
|
13
|
+
const BASE_SEPOLIA_BASE_URL = "https://base-sepolia.auth-server.renegade.fi";
|
|
14
|
+
const BASE_MAINNET_BASE_URL = "https://base-mainnet.auth-server.renegade.fi";
|
|
15
|
+
const ARBITRUM_SEPOLIA_RELAYER_URL = "https://arbitrum-sepolia.relayer.renegade.fi";
|
|
16
|
+
const ARBITRUM_ONE_RELAYER_URL = "https://arbitrum-one.relayer.renegade.fi";
|
|
17
|
+
const BASE_SEPOLIA_RELAYER_URL = "https://base-sepolia.relayer.renegade.fi";
|
|
18
|
+
const BASE_MAINNET_RELAYER_URL = "https://base-mainnet.relayer.renegade.fi";
|
|
19
|
+
// Header constants
|
|
20
|
+
const RENEGADE_API_KEY_HEADER = "x-renegade-api-key";
|
|
21
|
+
const RENEGADE_SDK_VERSION_HEADER = "x-renegade-sdk-version";
|
|
22
|
+
// API Routes
|
|
23
|
+
const REQUEST_EXTERNAL_QUOTE_ROUTE = "/v0/matching-engine/quote";
|
|
24
|
+
const ASSEMBLE_EXTERNAL_MATCH_ROUTE = "/v0/matching-engine/assemble-external-match";
|
|
25
|
+
/**
|
|
26
|
+
* The route used to assemble an external match into a malleable bundle
|
|
27
|
+
*/
|
|
28
|
+
const ASSEMBLE_MALLEABLE_EXTERNAL_MATCH_ROUTE = "/v0/matching-engine/assemble-malleable-external-match";
|
|
29
|
+
const ORDER_BOOK_DEPTH_ROUTE = "/v0/order_book/depth";
|
|
30
|
+
/** Returns the supported tokens list */
|
|
31
|
+
const SUPPORTED_TOKENS_ROUTE = "/v0/supported-tokens";
|
|
32
|
+
/** Returns the token prices */
|
|
33
|
+
const TOKEN_PRICES_ROUTE = "/v0/token-prices";
|
|
34
|
+
// Query Parameters
|
|
35
|
+
const DISABLE_GAS_SPONSORSHIP_QUERY_PARAM = "disable_gas_sponsorship";
|
|
36
|
+
const GAS_REFUND_ADDRESS_QUERY_PARAM = "refund_address";
|
|
37
|
+
const REFUND_NATIVE_ETH_QUERY_PARAM = "refund_native_eth";
|
|
38
|
+
/**
|
|
39
|
+
* Get the SDK version string.
|
|
40
|
+
*
|
|
41
|
+
* @returns The SDK version prefixed with "typescript-v"
|
|
42
|
+
*/
|
|
43
|
+
function getSdkVersion() {
|
|
44
|
+
return `typescript-v${VERSION}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for requesting a quote.
|
|
48
|
+
*/
|
|
49
|
+
export class RequestQuoteOptions {
|
|
50
|
+
constructor() {
|
|
51
|
+
Object.defineProperty(this, "disableGasSponsorship", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: false
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(this, "gasRefundAddress", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: void 0
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(this, "refundNativeEth", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: false
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create a new instance of RequestQuoteOptions.
|
|
72
|
+
*/
|
|
73
|
+
static new() {
|
|
74
|
+
return new RequestQuoteOptions();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Set whether gas sponsorship should be disabled.
|
|
78
|
+
*/
|
|
79
|
+
withGasSponsorshipDisabled(disableGasSponsorship) {
|
|
80
|
+
this.disableGasSponsorship = disableGasSponsorship;
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Set the gas refund address.
|
|
85
|
+
*/
|
|
86
|
+
withGasRefundAddress(gasRefundAddress) {
|
|
87
|
+
this.gasRefundAddress = gasRefundAddress;
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Set whether to refund in native ETH.
|
|
92
|
+
*/
|
|
93
|
+
withRefundNativeEth(refundNativeEth) {
|
|
94
|
+
this.refundNativeEth = refundNativeEth;
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Build the request path with query parameters.
|
|
99
|
+
*/
|
|
100
|
+
buildRequestPath() {
|
|
101
|
+
const params = new URLSearchParams();
|
|
102
|
+
params.set(DISABLE_GAS_SPONSORSHIP_QUERY_PARAM, this.disableGasSponsorship.toString());
|
|
103
|
+
if (this.gasRefundAddress) {
|
|
104
|
+
params.set(GAS_REFUND_ADDRESS_QUERY_PARAM, this.gasRefundAddress);
|
|
105
|
+
}
|
|
106
|
+
if (this.refundNativeEth) {
|
|
107
|
+
params.set(REFUND_NATIVE_ETH_QUERY_PARAM, this.refundNativeEth.toString());
|
|
108
|
+
}
|
|
109
|
+
return `${REQUEST_EXTERNAL_QUOTE_ROUTE}?${params.toString()}`;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Options for assembling an external match.
|
|
114
|
+
*/
|
|
115
|
+
export class AssembleExternalMatchOptions {
|
|
116
|
+
constructor() {
|
|
117
|
+
Object.defineProperty(this, "doGasEstimation", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
configurable: true,
|
|
120
|
+
writable: true,
|
|
121
|
+
value: false
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(this, "allowShared", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
configurable: true,
|
|
126
|
+
writable: true,
|
|
127
|
+
value: false
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(this, "receiverAddress", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
configurable: true,
|
|
132
|
+
writable: true,
|
|
133
|
+
value: void 0
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(this, "updatedOrder", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
configurable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
value: void 0
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(this, "requestGasSponsorship", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
configurable: true,
|
|
144
|
+
writable: true,
|
|
145
|
+
value: false
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(this, "gasRefundAddress", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
configurable: true,
|
|
150
|
+
writable: true,
|
|
151
|
+
value: void 0
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Create a new instance of AssembleExternalMatchOptions.
|
|
156
|
+
*/
|
|
157
|
+
static new() {
|
|
158
|
+
return new AssembleExternalMatchOptions();
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Set whether to do gas estimation.
|
|
162
|
+
*/
|
|
163
|
+
withGasEstimation(doGasEstimation) {
|
|
164
|
+
this.doGasEstimation = doGasEstimation;
|
|
165
|
+
return this;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Set whether to allow shared gas sponsorship.
|
|
169
|
+
*/
|
|
170
|
+
withAllowShared(allowShared) {
|
|
171
|
+
this.allowShared = allowShared;
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Set the receiver address.
|
|
176
|
+
*/
|
|
177
|
+
withReceiverAddress(receiverAddress) {
|
|
178
|
+
this.receiverAddress = receiverAddress;
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Set the updated order.
|
|
183
|
+
*/
|
|
184
|
+
withUpdatedOrder(updatedOrder) {
|
|
185
|
+
this.updatedOrder = updatedOrder;
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Set whether to request gas sponsorship.
|
|
190
|
+
* @deprecated Request gas sponsorship when requesting a quote instead
|
|
191
|
+
*/
|
|
192
|
+
withGasSponsorship(requestGasSponsorship) {
|
|
193
|
+
this.requestGasSponsorship = requestGasSponsorship;
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Set the gas refund address.
|
|
198
|
+
* @deprecated Request gas sponsorship when requesting a quote instead
|
|
199
|
+
*/
|
|
200
|
+
withGasRefundAddress(gasRefundAddress) {
|
|
201
|
+
this.gasRefundAddress = gasRefundAddress;
|
|
202
|
+
return this;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Build the request path with query parameters.
|
|
206
|
+
*/
|
|
207
|
+
buildRequestPath() {
|
|
208
|
+
// If no query parameters are needed, return the base path
|
|
209
|
+
if (!this.requestGasSponsorship && !this.gasRefundAddress) {
|
|
210
|
+
return ASSEMBLE_EXTERNAL_MATCH_ROUTE;
|
|
211
|
+
}
|
|
212
|
+
const params = new URLSearchParams();
|
|
213
|
+
if (this.requestGasSponsorship) {
|
|
214
|
+
// We only write this query parameter if it was explicitly set
|
|
215
|
+
params.set(DISABLE_GAS_SPONSORSHIP_QUERY_PARAM, (!this.requestGasSponsorship).toString());
|
|
216
|
+
}
|
|
217
|
+
if (this.gasRefundAddress) {
|
|
218
|
+
params.set(GAS_REFUND_ADDRESS_QUERY_PARAM, this.gasRefundAddress);
|
|
219
|
+
}
|
|
220
|
+
return `${ASSEMBLE_EXTERNAL_MATCH_ROUTE}?${params.toString()}`;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Options for assembling a malleable external match.
|
|
225
|
+
*/
|
|
226
|
+
export class AssembleMalleableExternalMatchOptions extends AssembleExternalMatchOptions {
|
|
227
|
+
/**
|
|
228
|
+
* Create a new instance of AssembleExternalMatchOptions.
|
|
229
|
+
*/
|
|
230
|
+
static new() {
|
|
231
|
+
return new AssembleMalleableExternalMatchOptions();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Build the request path with query parameters.
|
|
235
|
+
*/
|
|
236
|
+
buildRequestPath() {
|
|
237
|
+
// If no query parameters are needed, return the base path
|
|
238
|
+
if (!this.requestGasSponsorship && !this.gasRefundAddress) {
|
|
239
|
+
return ASSEMBLE_MALLEABLE_EXTERNAL_MATCH_ROUTE;
|
|
240
|
+
}
|
|
241
|
+
const params = new URLSearchParams();
|
|
242
|
+
if (this.requestGasSponsorship) {
|
|
243
|
+
// We only write this query parameter if it was explicitly set
|
|
244
|
+
params.set(DISABLE_GAS_SPONSORSHIP_QUERY_PARAM, (!this.requestGasSponsorship).toString());
|
|
245
|
+
}
|
|
246
|
+
if (this.gasRefundAddress) {
|
|
247
|
+
params.set(GAS_REFUND_ADDRESS_QUERY_PARAM, this.gasRefundAddress);
|
|
248
|
+
}
|
|
249
|
+
return `${ASSEMBLE_MALLEABLE_EXTERNAL_MATCH_ROUTE}?${params.toString()}`;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Error thrown by the ExternalMatchClient.
|
|
254
|
+
*/
|
|
255
|
+
export class ExternalMatchClientError extends Error {
|
|
256
|
+
constructor(message, statusCode) {
|
|
257
|
+
super(message);
|
|
258
|
+
Object.defineProperty(this, "statusCode", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
configurable: true,
|
|
261
|
+
writable: true,
|
|
262
|
+
value: void 0
|
|
263
|
+
});
|
|
264
|
+
this.name = "ExternalMatchClientError";
|
|
265
|
+
this.statusCode = statusCode;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Client for interacting with the Renegade external matching API.
|
|
270
|
+
*/
|
|
271
|
+
export class ExternalMatchClient {
|
|
272
|
+
/**
|
|
273
|
+
* Initialize a new ExternalMatchClient.
|
|
274
|
+
*
|
|
275
|
+
* @param apiKey The API key for authentication
|
|
276
|
+
* @param apiSecret The API secret for request signing
|
|
277
|
+
* @param baseUrl The base URL of the Renegade API
|
|
278
|
+
*/
|
|
279
|
+
constructor(apiKey, apiSecret, baseUrl, relayerUrl) {
|
|
280
|
+
Object.defineProperty(this, "apiKey", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
configurable: true,
|
|
283
|
+
writable: true,
|
|
284
|
+
value: void 0
|
|
285
|
+
});
|
|
286
|
+
Object.defineProperty(this, "httpClient", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
configurable: true,
|
|
289
|
+
writable: true,
|
|
290
|
+
value: void 0
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(this, "relayerHttpClient", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
configurable: true,
|
|
295
|
+
writable: true,
|
|
296
|
+
value: void 0
|
|
297
|
+
});
|
|
298
|
+
this.apiKey = apiKey;
|
|
299
|
+
this.httpClient = new RelayerHttpClient(baseUrl, apiSecret);
|
|
300
|
+
this.relayerHttpClient = new RelayerHttpClient(relayerUrl);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Create a new client configured for the Arbitrum Sepolia testnet.
|
|
304
|
+
*
|
|
305
|
+
* @deprecated Use {@link ExternalMatchClient.newArbitrumSepoliaClient} instead
|
|
306
|
+
*/
|
|
307
|
+
static newSepoliaClient(apiKey, apiSecret) {
|
|
308
|
+
return ExternalMatchClient.newArbitrumSepoliaClient(apiKey, apiSecret);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Create a new client configured for the Arbitrum Sepolia testnet.
|
|
312
|
+
*
|
|
313
|
+
* @param apiKey The API key for authentication
|
|
314
|
+
* @param apiSecret The API secret for request signing
|
|
315
|
+
* @param relayerUrl The relayer URL for the client
|
|
316
|
+
* @returns A new ExternalMatchClient configured for Sepolia
|
|
317
|
+
*/
|
|
318
|
+
static newArbitrumSepoliaClient(apiKey, apiSecret) {
|
|
319
|
+
return new ExternalMatchClient(apiKey, apiSecret, ARBITRUM_SEPOLIA_BASE_URL, ARBITRUM_SEPOLIA_RELAYER_URL);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Create a new client configured for the Base Sepolia testnet.
|
|
323
|
+
*
|
|
324
|
+
* @param apiKey The API key for authentication
|
|
325
|
+
* @param apiSecret The API secret for request signing
|
|
326
|
+
* @returns A new ExternalMatchClient configured for Sepolia
|
|
327
|
+
*/
|
|
328
|
+
static newBaseSepoliaClient(apiKey, apiSecret) {
|
|
329
|
+
return new ExternalMatchClient(apiKey, apiSecret, BASE_SEPOLIA_BASE_URL, BASE_SEPOLIA_RELAYER_URL);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Create a new client configured for the Arbitrum One mainnet.
|
|
333
|
+
*
|
|
334
|
+
* @deprecated Use {@link ExternalMatchClient.newArbitrumOneClient} instead
|
|
335
|
+
*/
|
|
336
|
+
static newMainnetClient(apiKey, apiSecret) {
|
|
337
|
+
return ExternalMatchClient.newArbitrumOneClient(apiKey, apiSecret);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Create a new client configured for the Arbitrum One mainnet.
|
|
341
|
+
*
|
|
342
|
+
* @param apiKey The API key for authentication
|
|
343
|
+
* @param apiSecret The API secret for request signing
|
|
344
|
+
* @returns A new ExternalMatchClient configured for mainnet
|
|
345
|
+
*/
|
|
346
|
+
static newArbitrumOneClient(apiKey, apiSecret) {
|
|
347
|
+
return new ExternalMatchClient(apiKey, apiSecret, ARBITRUM_ONE_BASE_URL, ARBITRUM_ONE_RELAYER_URL);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Create a new client configured for the Base mainnet.
|
|
351
|
+
*
|
|
352
|
+
* @param apiKey The API key for authentication
|
|
353
|
+
* @param apiSecret The API secret for request signing
|
|
354
|
+
* @returns A new ExternalMatchClient configured for mainnet
|
|
355
|
+
*/
|
|
356
|
+
static newBaseMainnetClient(apiKey, apiSecret) {
|
|
357
|
+
return new ExternalMatchClient(apiKey, apiSecret, BASE_MAINNET_BASE_URL, BASE_MAINNET_RELAYER_URL);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Request a quote for the given order.
|
|
361
|
+
*
|
|
362
|
+
* @param order The order to request a quote for
|
|
363
|
+
* @returns A promise that resolves to a signed quote if one is available, null otherwise
|
|
364
|
+
* @throws ExternalMatchClientError if the request fails
|
|
365
|
+
*/
|
|
366
|
+
async requestQuote(order) {
|
|
367
|
+
return this.requestQuoteWithOptions(order, RequestQuoteOptions.new());
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Request a quote for the given order with custom options.
|
|
371
|
+
*
|
|
372
|
+
* @param order The order to request a quote for
|
|
373
|
+
* @param options Custom options for the quote request
|
|
374
|
+
* @returns A promise that resolves to a signed quote if one is available, null otherwise
|
|
375
|
+
* @throws ExternalMatchClientError if the request fails
|
|
376
|
+
*/
|
|
377
|
+
async requestQuoteWithOptions(order, options) {
|
|
378
|
+
const request = {
|
|
379
|
+
external_order: order,
|
|
380
|
+
};
|
|
381
|
+
const path = options.buildRequestPath();
|
|
382
|
+
const headers = this.getHeaders();
|
|
383
|
+
try {
|
|
384
|
+
const response = await this.httpClient.post(path, request, headers);
|
|
385
|
+
// Handle 204 No Content (no quotes available)
|
|
386
|
+
if (response.status === 204 || !response.data) {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
const quoteResp = response.data;
|
|
390
|
+
const signedQuote = {
|
|
391
|
+
quote: quoteResp.signed_quote.quote,
|
|
392
|
+
signature: quoteResp.signed_quote.signature,
|
|
393
|
+
gas_sponsorship_info: quoteResp.gas_sponsorship_info,
|
|
394
|
+
};
|
|
395
|
+
return signedQuote;
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
// Handle HTTP-related errors from fetch implementation
|
|
399
|
+
if (error.status === 204) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
throw new ExternalMatchClientError(error.message || "Failed to request quote", error.status);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Assemble a quote into a match bundle with default options.
|
|
407
|
+
*
|
|
408
|
+
* @param quote The signed quote to assemble
|
|
409
|
+
* @returns A promise that resolves to a match response if assembly succeeds, null otherwise
|
|
410
|
+
* @throws ExternalMatchClientError if the request fails
|
|
411
|
+
*/
|
|
412
|
+
async assembleQuote(quote) {
|
|
413
|
+
return this.assembleQuoteWithOptions(quote, AssembleExternalMatchOptions.new());
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Assemble a quote into a match bundle with custom options.
|
|
417
|
+
*
|
|
418
|
+
* @param quote The signed quote to assemble
|
|
419
|
+
* @param options Custom options for quote assembly
|
|
420
|
+
* @returns A promise that resolves to a match response if assembly succeeds, null otherwise
|
|
421
|
+
* @throws ExternalMatchClientError if the request fails
|
|
422
|
+
*/
|
|
423
|
+
async assembleQuoteWithOptions(quote, options) {
|
|
424
|
+
const signedQuote = {
|
|
425
|
+
quote: quote.quote,
|
|
426
|
+
signature: quote.signature,
|
|
427
|
+
};
|
|
428
|
+
const request = {
|
|
429
|
+
do_gas_estimation: options.doGasEstimation,
|
|
430
|
+
allow_shared: options.allowShared,
|
|
431
|
+
receiver_address: options.receiverAddress,
|
|
432
|
+
signed_quote: signedQuote,
|
|
433
|
+
updated_order: options.updatedOrder,
|
|
434
|
+
};
|
|
435
|
+
const path = options.buildRequestPath();
|
|
436
|
+
const headers = this.getHeaders();
|
|
437
|
+
try {
|
|
438
|
+
const response = await this.httpClient.post(path, request, headers);
|
|
439
|
+
// Handle 204 No Content
|
|
440
|
+
if (response.status === 204 || !response.data) {
|
|
441
|
+
return null;
|
|
442
|
+
}
|
|
443
|
+
return response.data;
|
|
444
|
+
}
|
|
445
|
+
catch (error) {
|
|
446
|
+
// Handle HTTP-related errors from fetch implementation
|
|
447
|
+
if (error.status === 204) {
|
|
448
|
+
return null;
|
|
449
|
+
}
|
|
450
|
+
throw new ExternalMatchClientError(error.message || "Failed to assemble quote", error.status);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Assemble a quote into a malleable match bundle with default options.
|
|
455
|
+
*
|
|
456
|
+
* @param quote The signed quote to assemble
|
|
457
|
+
* @returns A promise that resolves to a match response if assembly succeeds, null otherwise
|
|
458
|
+
* @throws ExternalMatchClientError if the request fails
|
|
459
|
+
*/
|
|
460
|
+
async assembleMalleableQuote(quote) {
|
|
461
|
+
return this.assembleMalleableQuoteWithOptions(quote, AssembleMalleableExternalMatchOptions.new());
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Assemble a quote into a malleable match bundle with custom options.
|
|
465
|
+
*/
|
|
466
|
+
async assembleMalleableQuoteWithOptions(quote, options) {
|
|
467
|
+
const signedQuote = {
|
|
468
|
+
quote: quote.quote,
|
|
469
|
+
signature: quote.signature,
|
|
470
|
+
};
|
|
471
|
+
const request = {
|
|
472
|
+
do_gas_estimation: options.doGasEstimation,
|
|
473
|
+
allow_shared: options.allowShared,
|
|
474
|
+
receiver_address: options.receiverAddress,
|
|
475
|
+
signed_quote: signedQuote,
|
|
476
|
+
updated_order: options.updatedOrder,
|
|
477
|
+
};
|
|
478
|
+
const path = options.buildRequestPath();
|
|
479
|
+
const headers = this.getHeaders();
|
|
480
|
+
try {
|
|
481
|
+
const response = await this.httpClient.post(path, request, headers);
|
|
482
|
+
// Handle 204 No Content
|
|
483
|
+
if (response.status === 204 || !response.data) {
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
486
|
+
return new MalleableExternalMatchResponse(response.data.match_bundle, response.data.gas_sponsored, response.data.gas_sponsorship_info, response.data.base_amount);
|
|
487
|
+
}
|
|
488
|
+
catch (error) {
|
|
489
|
+
// Handle HTTP-related errors from fetch implementation
|
|
490
|
+
if (error.status === 204) {
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
throw new ExternalMatchClientError(error.message || "Failed to assemble quote", error.status);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Get order book depth for a given base token mint.
|
|
498
|
+
*
|
|
499
|
+
* @param mint The base token mint address
|
|
500
|
+
* @returns A promise that resolves to the order book depth
|
|
501
|
+
* @throws ExternalMatchClientError if the request fails
|
|
502
|
+
*/
|
|
503
|
+
async getOrderBookDepth(mint) {
|
|
504
|
+
const path = `${ORDER_BOOK_DEPTH_ROUTE}/${mint}`;
|
|
505
|
+
const headers = this.getHeaders();
|
|
506
|
+
try {
|
|
507
|
+
const response = await this.httpClient.get(path, headers);
|
|
508
|
+
if (response.status !== 200 || !response.data) {
|
|
509
|
+
throw new ExternalMatchClientError("Failed to get order book depth", response.status);
|
|
510
|
+
}
|
|
511
|
+
return response.data;
|
|
512
|
+
}
|
|
513
|
+
catch (error) {
|
|
514
|
+
throw new ExternalMatchClientError(error.message || "Failed to get order book depth", error.status);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Get a list of supported tokens for external matches
|
|
519
|
+
*/
|
|
520
|
+
async getSupportedTokens() {
|
|
521
|
+
const path = `${SUPPORTED_TOKENS_ROUTE}`;
|
|
522
|
+
const headers = this.getHeaders();
|
|
523
|
+
try {
|
|
524
|
+
const response = await this.relayerHttpClient.get(path, headers);
|
|
525
|
+
if (response.status !== 200 || !response.data) {
|
|
526
|
+
throw new ExternalMatchClientError("Failed to get supported tokens", response.status);
|
|
527
|
+
}
|
|
528
|
+
return response.data;
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
throw new ExternalMatchClientError(error.message || "Failed to get supported tokens", error.status);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Get a list of token prices
|
|
536
|
+
*/
|
|
537
|
+
async getTokenPrices() {
|
|
538
|
+
const path = `${TOKEN_PRICES_ROUTE}`;
|
|
539
|
+
const headers = this.getHeaders();
|
|
540
|
+
try {
|
|
541
|
+
const response = await this.relayerHttpClient.get(path, headers);
|
|
542
|
+
if (response.status !== 200 || !response.data) {
|
|
543
|
+
throw new ExternalMatchClientError("Failed to get token prices", response.status);
|
|
544
|
+
}
|
|
545
|
+
return {
|
|
546
|
+
...response.data,
|
|
547
|
+
token_prices: response.data.token_prices.map((tokenPrice) => ({
|
|
548
|
+
...tokenPrice,
|
|
549
|
+
price: Number.parseFloat(tokenPrice.price.toString()),
|
|
550
|
+
})),
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
catch (error) {
|
|
554
|
+
throw new ExternalMatchClientError(error.message || "Failed to get token prices", error.status);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Get the headers required for API requests.
|
|
559
|
+
*
|
|
560
|
+
* @returns Headers containing the API key and SDK version
|
|
561
|
+
*/
|
|
562
|
+
getHeaders() {
|
|
563
|
+
return {
|
|
564
|
+
[RENEGADE_API_KEY_HEADER]: this.apiKey,
|
|
565
|
+
[RENEGADE_SDK_VERSION_HEADER]: getSdkVersion(),
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAOH,8BAA8B,GAMjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,yBAAyB;AACzB,MAAM,yBAAyB,GAAG,kDAAkD,CAAC;AACrF,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AAC7E,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AAC7E,MAAM,qBAAqB,GAAG,8CAA8C,CAAC;AAE7E,MAAM,4BAA4B,GAAG,8CAA8C,CAAC;AACpF,MAAM,wBAAwB,GAAG,0CAA0C,CAAC;AAC5E,MAAM,wBAAwB,GAAG,0CAA0C,CAAC;AAC5E,MAAM,wBAAwB,GAAG,0CAA0C,CAAC;AAE5E,mBAAmB;AACnB,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AACrD,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AAE7D,aAAa;AACb,MAAM,4BAA4B,GAAG,2BAA2B,CAAC;AACjE,MAAM,6BAA6B,GAAG,6CAA6C,CAAC;AACpF;;GAEG;AACH,MAAM,uCAAuC,GACzC,uDAAuD,CAAC;AAC5D,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AACtD,wCAAwC;AACxC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AACtD,+BAA+B;AAC/B,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAE9C,mBAAmB;AACnB,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;AACtE,MAAM,8BAA8B,GAAG,gBAAgB,CAAC;AACxD,MAAM,6BA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