@pendle/sdk-boros 0.3.18 → 0.3.19

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.
@@ -8,6 +8,7 @@ const axios_1 = __importDefault(require("axios"));
8
8
  var ContentType;
9
9
  (function (ContentType) {
10
10
  ContentType["Json"] = "application/json";
11
+ ContentType["JsonApi"] = "application/vnd.api+json";
11
12
  ContentType["FormData"] = "multipart/form-data";
12
13
  ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
13
14
  ContentType["Text"] = "text/plain";
@@ -19,7 +20,10 @@ class HttpClient {
19
20
  secure;
20
21
  format;
21
22
  constructor({ securityWorker, secure, format, ...axiosConfig } = {}) {
22
- this.instance = axios_1.default.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || "https://secrettune.io/core-v2" });
23
+ this.instance = axios_1.default.create({
24
+ ...axiosConfig,
25
+ baseURL: axiosConfig.baseURL || 'https://secrettune.io/core-v2',
26
+ });
23
27
  this.secure = secure;
24
28
  this.format = format;
25
29
  this.securityWorker = securityWorker;
@@ -41,7 +45,7 @@ class HttpClient {
41
45
  };
42
46
  }
43
47
  stringifyFormItem(formItem) {
44
- if (typeof formItem === "object" && formItem !== null) {
48
+ if (typeof formItem === 'object' && formItem !== null) {
45
49
  return JSON.stringify(formItem);
46
50
  }
47
51
  else {
@@ -63,23 +67,23 @@ class HttpClient {
63
67
  }, new FormData());
64
68
  }
65
69
  request = async ({ secure, path, type, query, format, body, ...params }) => {
66
- const secureParams = ((typeof secure === "boolean" ? secure : this.secure) &&
70
+ const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
67
71
  this.securityWorker &&
68
72
  (await this.securityWorker(this.securityData))) ||
69
73
  {};
70
74
  const requestParams = this.mergeRequestParams(params, secureParams);
71
75
  const responseFormat = format || this.format || undefined;
72
- if (type === ContentType.FormData && body && body !== null && typeof body === "object") {
76
+ if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
73
77
  body = this.createFormData(body);
74
78
  }
75
- if (type === ContentType.Text && body && body !== null && typeof body !== "string") {
79
+ if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
76
80
  body = JSON.stringify(body);
77
81
  }
78
82
  return this.instance.request({
79
83
  ...requestParams,
80
84
  headers: {
81
85
  ...(requestParams.headers || {}),
82
- ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
86
+ ...(type ? { 'Content-Type': type } : {}),
83
87
  },
84
88
  params: query,
85
89
  responseType: responseFormat,
@@ -93,313 +97,289 @@ class Sdk extends HttpClient {
93
97
  markets = {
94
98
  marketsControllerGetMarkets: (query, params = {}) => this.request({
95
99
  path: `/v1/markets`,
96
- method: "GET",
100
+ method: 'GET',
97
101
  query: query,
98
- format: "json",
102
+ format: 'json',
99
103
  ...params,
100
104
  }),
101
105
  marketsControllerGetMarketTrades: (query, params = {}) => this.request({
102
106
  path: `/v1/markets/market-trades`,
103
- method: "GET",
107
+ method: 'GET',
104
108
  query: query,
105
- format: "json",
109
+ format: 'json',
106
110
  ...params,
107
111
  }),
108
112
  marketsControllerGetChartData: (query, params = {}) => this.request({
109
113
  path: `/v1/markets/chart`,
110
- method: "GET",
114
+ method: 'GET',
111
115
  query: query,
112
- format: "json",
116
+ format: 'json',
113
117
  ...params,
114
118
  }),
115
119
  marketsControllerGetMarketInfo: (marketId, params = {}) => this.request({
116
120
  path: `/v1/markets/${marketId}`,
117
- method: "GET",
118
- format: "json",
121
+ method: 'GET',
122
+ format: 'json',
119
123
  ...params,
120
124
  }),
121
125
  };
122
126
  orderBooks = {
123
127
  orderBooksControllerGetOrderBooksByMarketId: (marketId, query, params = {}) => this.request({
124
128
  path: `/v1/order-books/${marketId}`,
125
- method: "GET",
129
+ method: 'GET',
126
130
  query: query,
127
- format: "json",
131
+ format: 'json',
128
132
  ...params,
129
133
  }),
130
134
  };
131
135
  amm = {
132
136
  ammControllerGetAllVaultStates: (query, params = {}) => this.request({
133
137
  path: `/v1/amm/summary`,
134
- method: "GET",
138
+ method: 'GET',
135
139
  query: query,
136
- format: "json",
140
+ format: 'json',
137
141
  ...params,
138
142
  }),
139
143
  ammControllerGetSingleVaultState: (query, params = {}) => this.request({
140
144
  path: `/v1/amm/summary/single`,
141
- method: "GET",
145
+ method: 'GET',
142
146
  query: query,
143
- format: "json",
147
+ format: 'json',
144
148
  ...params,
145
149
  }),
146
150
  ammControllerGetVaultApyChart: (query, params = {}) => this.request({
147
151
  path: `/v1/amm/chart`,
148
- method: "GET",
152
+ method: 'GET',
149
153
  query: query,
150
- format: "json",
154
+ format: 'json',
151
155
  ...params,
152
156
  }),
153
157
  ammControllerGetAmmStateByMarketId: (marketId, params = {}) => this.request({
154
158
  path: `/v1/amm/${marketId}`,
155
- method: "GET",
156
- format: "json",
159
+ method: 'GET',
160
+ format: 'json',
157
161
  ...params,
158
162
  }),
159
163
  ammControllerGetAmmInfoByAmmId: (ammId, params = {}) => this.request({
160
164
  path: `/v2/amm/${ammId}`,
161
- method: "GET",
162
- format: "json",
165
+ method: 'GET',
166
+ format: 'json',
163
167
  ...params,
164
168
  }),
165
169
  };
166
170
  simulations = {
167
171
  simulationsControllerGetDeposit: (query, params = {}) => this.request({
168
172
  path: `/v1/simulations/deposit`,
169
- method: "GET",
173
+ method: 'GET',
170
174
  query: query,
171
- format: "json",
175
+ format: 'json',
172
176
  ...params,
173
177
  }),
174
178
  simulationsControllerGetDepositV2: (query, params = {}) => this.request({
175
179
  path: `/v2/simulations/deposit`,
176
- method: "GET",
180
+ method: 'GET',
177
181
  query: query,
178
- format: "json",
182
+ format: 'json',
179
183
  ...params,
180
184
  }),
181
185
  simulationsControllerGetWithdraw: (query, params = {}) => this.request({
182
186
  path: `/v1/simulations/withdraw`,
183
- method: "GET",
187
+ method: 'GET',
184
188
  query: query,
185
- format: "json",
189
+ format: 'json',
186
190
  ...params,
187
191
  }),
188
192
  simulationsControllerGetCashTransfer: (query, params = {}) => this.request({
189
193
  path: `/v1/simulations/cash-transfer`,
190
- method: "GET",
194
+ method: 'GET',
191
195
  query: query,
192
- format: "json",
196
+ format: 'json',
193
197
  ...params,
194
198
  }),
195
199
  simulationsControllerGetPlaceOrderV2: (query, params = {}) => this.request({
196
200
  path: `/v2/simulations/place-order`,
197
- method: "GET",
201
+ method: 'GET',
198
202
  query: query,
199
- format: "json",
203
+ format: 'json',
200
204
  ...params,
201
205
  }),
202
206
  simulationsControllerGetPlaceOrder: (query, params = {}) => this.request({
203
207
  path: `/v1/simulations/place-order`,
204
- method: "GET",
208
+ method: 'GET',
205
209
  query: query,
206
- format: "json",
210
+ format: 'json',
207
211
  ...params,
208
212
  }),
209
213
  simulationsControllerGetCancelOrder: (query, params = {}) => this.request({
210
214
  path: `/v1/simulations/cancel-order`,
211
- method: "GET",
215
+ method: 'GET',
212
216
  query: query,
213
- format: "json",
217
+ format: 'json',
214
218
  ...params,
215
219
  }),
216
220
  simulationsControllerCloseActiveMarketPositionV2: (query, params = {}) => this.request({
217
221
  path: `/v2/simulations/close-active-position`,
218
- method: "GET",
222
+ method: 'GET',
219
223
  query: query,
220
- format: "json",
224
+ format: 'json',
221
225
  ...params,
222
226
  }),
223
227
  simulationsControllerCloseActiveMarketPosition: (query, params = {}) => this.request({
224
228
  path: `/v1/simulations/close-active-position`,
225
- method: "GET",
229
+ method: 'GET',
226
230
  query: query,
227
- format: "json",
231
+ format: 'json',
228
232
  ...params,
229
233
  }),
230
234
  simulationsControllerGetAddLiquiditySingleCashToAmm: (query, params = {}) => this.request({
231
235
  path: `/v1/simulations/add-liquidity-single-cash`,
232
- method: "GET",
236
+ method: 'GET',
233
237
  query: query,
234
- format: "json",
238
+ format: 'json',
235
239
  ...params,
236
240
  }),
237
241
  simulationsControllerGetRemoveLiquiditySingleCashFromAmm: (query, params = {}) => this.request({
238
242
  path: `/v1/simulations/remove-liquidity-single-cash`,
239
- method: "GET",
243
+ method: 'GET',
240
244
  query: query,
241
- format: "json",
245
+ format: 'json',
242
246
  ...params,
243
247
  }),
244
248
  };
245
249
  assets = {
246
250
  assetsControllerGetAllAssets: (params = {}) => this.request({
247
251
  path: `/v1/assets/all`,
248
- method: "GET",
249
- format: "json",
252
+ method: 'GET',
253
+ format: 'json',
250
254
  ...params,
251
255
  }),
252
256
  };
253
257
  calldata = {
254
258
  calldataControllerGetDepositCalldata: (query, params = {}) => this.request({
255
259
  path: `/v1/calldata/deposit`,
256
- method: "GET",
260
+ method: 'GET',
257
261
  query: query,
258
- format: "json",
262
+ format: 'json',
259
263
  ...params,
260
264
  }),
261
265
  calldataControllerGetDepositCalldataV2: (query, params = {}) => this.request({
262
266
  path: `/v2/calldata/deposit`,
263
- method: "GET",
267
+ method: 'GET',
264
268
  query: query,
265
- format: "json",
269
+ format: 'json',
266
270
  ...params,
267
271
  }),
268
272
  calldataControllerGetWithdrawCalldata: (query, params = {}) => this.request({
269
273
  path: `/v1/calldata/withdraw`,
270
- method: "GET",
274
+ method: 'GET',
271
275
  query: query,
272
- format: "json",
276
+ format: 'json',
273
277
  ...params,
274
278
  }),
275
279
  calldataControllerGetWithdrawRequestCalldata: (query, params = {}) => this.request({
276
280
  path: `/v1/calldata/withdraw/request`,
277
- method: "GET",
281
+ method: 'GET',
278
282
  query: query,
279
- format: "json",
283
+ format: 'json',
280
284
  ...params,
281
285
  }),
282
286
  calldataControllerGetWithdrawCancelCalldata: (query, params = {}) => this.request({
283
287
  path: `/v1/calldata/withdraw/cancel`,
284
- method: "GET",
288
+ method: 'GET',
285
289
  query: query,
286
- format: "json",
290
+ format: 'json',
287
291
  ...params,
288
292
  }),
289
293
  calldataControllerGetWithdrawFinalizeCalldata: (query, params = {}) => this.request({
290
294
  path: `/v1/calldata/withdraw/finalize`,
291
- method: "GET",
295
+ method: 'GET',
292
296
  query: query,
293
- format: "json",
297
+ format: 'json',
294
298
  ...params,
295
299
  }),
296
300
  calldataControllerGetPositionTransferCalldata: (query, params = {}) => this.request({
297
301
  path: `/v1/calldata/cash-transfer`,
298
- method: "GET",
302
+ method: 'GET',
299
303
  query: query,
300
- format: "json",
304
+ format: 'json',
301
305
  ...params,
302
306
  }),
303
307
  calldataControllerGetPlaceOrderCalldataV2: (query, params = {}) => this.request({
304
308
  path: `/v2/calldata/place-order`,
305
- method: "GET",
309
+ method: 'GET',
306
310
  query: query,
307
- format: "json",
311
+ format: 'json',
308
312
  ...params,
309
313
  }),
310
314
  calldataControllerGetPlaceOrderCalldata: (query, params = {}) => this.request({
311
315
  path: `/v1/calldata/place-order`,
312
- method: "GET",
316
+ method: 'GET',
313
317
  query: query,
314
- format: "json",
318
+ format: 'json',
315
319
  ...params,
316
320
  }),
317
321
  calldataControllerGetBulkPlaceOrderCalldata: (data, params = {}) => this.request({
318
322
  path: `/v1/calldata/place-orders`,
319
- method: "POST",
323
+ method: 'POST',
320
324
  body: data,
321
325
  type: ContentType.Json,
322
- format: "json",
326
+ format: 'json',
323
327
  ...params,
324
328
  }),
325
329
  calldataControllerGetCancelOrderCalldata: (query, params = {}) => this.request({
326
330
  path: `/v1/calldata/cancel-order`,
327
- method: "GET",
331
+ method: 'GET',
328
332
  query: query,
329
- format: "json",
333
+ format: 'json',
330
334
  ...params,
331
335
  }),
332
336
  calldataControllerGetCloseActiveMarketPositionV2: (query, params = {}) => this.request({
333
337
  path: `/v2/calldata/close-active-position`,
334
- method: "GET",
338
+ method: 'GET',
335
339
  query: query,
336
- format: "json",
340
+ format: 'json',
337
341
  ...params,
338
342
  }),
339
343
  calldataControllerGetCloseActiveMarketPosition: (query, params = {}) => this.request({
340
344
  path: `/v1/calldata/close-active-position`,
341
- method: "GET",
345
+ method: 'GET',
342
346
  query: query,
343
- format: "json",
347
+ format: 'json',
344
348
  ...params,
345
349
  }),
346
350
  calldataControllerGetAddLiquiditySingleCashToAmmCalldata: (query, params = {}) => this.request({
347
351
  path: `/v1/calldata/add-liquidity-single-cash-to-amm`,
348
- method: "GET",
352
+ method: 'GET',
349
353
  query: query,
350
- format: "json",
354
+ format: 'json',
351
355
  ...params,
352
356
  }),
353
357
  calldataControllerGetRemoveLiquiditySingleCashFromAmmCalldata: (query, params = {}) => this.request({
354
358
  path: `/v1/calldata/remove-liquidity-single-cash-from-amm`,
355
- method: "GET",
359
+ method: 'GET',
356
360
  query: query,
357
- format: "json",
361
+ format: 'json',
358
362
  ...params,
359
363
  }),
360
364
  calldataControllerEnterAllMarkets: (query, params = {}) => this.request({
361
365
  path: `/v1/calldata/enter-all-markets`,
362
- method: "GET",
366
+ method: 'GET',
363
367
  query: query,
364
- format: "json",
365
- ...params,
366
- }),
367
- calldataControllerDirectCall: (data, params = {}) => this.request({
368
- path: `/v1/calldata/agent-direct-call`,
369
- method: "POST",
370
- body: data,
371
- type: ContentType.Json,
372
- format: "json",
373
- ...params,
374
- }),
375
- calldataControllerBulkAgentDirectCall: (data, params = {}) => this.request({
376
- path: `/v1/calldata/bulk-agent-direct-call`,
377
- method: "POST",
378
- body: data,
379
- type: ContentType.Json,
380
- format: "json",
381
- ...params,
382
- }),
383
- calldataControllerApproveAgent: (data, params = {}) => this.request({
384
- path: `/v1/calldata/approve-agent`,
385
- method: "POST",
386
- body: data,
387
- type: ContentType.Json,
388
- format: "json",
368
+ format: 'json',
389
369
  ...params,
390
370
  }),
391
371
  };
392
372
  accounts = {
393
373
  accountsControllerGetUserSettings: (query, params = {}) => this.request({
394
374
  path: `/v1/accounts/settings`,
395
- method: "GET",
375
+ method: 'GET',
396
376
  query: query,
397
- format: "json",
377
+ format: 'json',
398
378
  ...params,
399
379
  }),
400
380
  accountsControllerUpdateAccountSettings: (data, params = {}) => this.request({
401
381
  path: `/v1/accounts/settings`,
402
- method: "POST",
382
+ method: 'POST',
403
383
  body: data,
404
384
  type: ContentType.Json,
405
385
  ...params,
@@ -408,145 +388,145 @@ class Sdk extends HttpClient {
408
388
  pnL = {
409
389
  pnlControllerGetPnlTransactions: (query, params = {}) => this.request({
410
390
  path: `/v1/pnl/transactions`,
411
- method: "GET",
391
+ method: 'GET',
412
392
  query: query,
413
- format: "json",
393
+ format: 'json',
414
394
  ...params,
415
395
  }),
416
396
  pnlControllerGetHistoricalPnlChart: (query, params = {}) => this.request({
417
397
  path: `/v1/pnl/historical-chart`,
418
- method: "GET",
398
+ method: 'GET',
419
399
  query: query,
420
- format: "json",
400
+ format: 'json',
421
401
  ...params,
422
402
  }),
423
403
  pnlControllerGetLimitOrders: (query, params = {}) => this.request({
424
404
  path: `/v1/pnl/limit-orders`,
425
- method: "GET",
405
+ method: 'GET',
426
406
  query: query,
427
- format: "json",
407
+ format: 'json',
428
408
  ...params,
429
409
  }),
430
410
  pnlControllerGetFilledLimitOrders: (query, params = {}) => this.request({
431
411
  path: `/v1/pnl/limit-orders/filled`,
432
- method: "GET",
412
+ method: 'GET',
433
413
  query: query,
434
- format: "json",
414
+ format: 'json',
435
415
  ...params,
436
416
  }),
437
417
  pnlControllerGetTransferLogs: (query, params = {}) => this.request({
438
418
  path: `/v1/pnl/transfer-logs`,
439
- method: "GET",
419
+ method: 'GET',
440
420
  query: query,
441
- format: "json",
421
+ format: 'json',
442
422
  ...params,
443
423
  }),
444
424
  };
445
425
  settlement = {
446
426
  settlementControllerGetSettlements: (query, params = {}) => this.request({
447
427
  path: `/v1/settlement/settlements`,
448
- method: "GET",
428
+ method: 'GET',
449
429
  query: query,
450
- format: "json",
430
+ format: 'json',
451
431
  ...params,
452
432
  }),
453
433
  };
454
434
  collaterals = {
455
435
  collateralControllerGetAllCollateralSummary: (query, params = {}) => this.request({
456
436
  path: `/v1/collaterals/summary`,
457
- method: "GET",
437
+ method: 'GET',
458
438
  query: query,
459
- format: "json",
439
+ format: 'json',
460
440
  ...params,
461
441
  }),
462
442
  collateralControllerGetSingleCollateral: (query, params = {}) => this.request({
463
443
  path: `/v1/collaterals/summary/single`,
464
- method: "GET",
444
+ method: 'GET',
465
445
  query: query,
466
- format: "json",
446
+ format: 'json',
467
447
  ...params,
468
448
  }),
469
449
  };
470
450
  portfolio = {
471
451
  portfolioControllerGetBalanceChart: (query, params = {}) => this.request({
472
452
  path: `/v1/portfolios/balance-chart`,
473
- method: "GET",
453
+ method: 'GET',
474
454
  query: query,
475
- format: "json",
455
+ format: 'json',
476
456
  ...params,
477
457
  }),
478
458
  portfolioControllerGetBalanceChartAllTokens: (query, params = {}) => this.request({
479
459
  path: `/v1/portfolios/balance-chart/all`,
480
- method: "GET",
460
+ method: 'GET',
481
461
  query: query,
482
- format: "json",
462
+ format: 'json',
483
463
  ...params,
484
464
  }),
485
465
  };
486
466
  playground = {
487
467
  playgroundControllerGetMarketOrderLogs: (query, params = {}) => this.request({
488
468
  path: `/v1/playground/market-order-logs`,
489
- method: "GET",
469
+ method: 'GET',
490
470
  query: query,
491
- format: "json",
471
+ format: 'json',
492
472
  ...params,
493
473
  }),
494
474
  };
495
475
  referral = {
496
476
  referralControllerGetUserReferralInfo: (userAddress, params = {}) => this.request({
497
477
  path: `/v1/referrals/${userAddress}`,
498
- method: "GET",
499
- format: "json",
478
+ method: 'GET',
479
+ format: 'json',
500
480
  ...params,
501
481
  }),
502
482
  referralControllerCreateReferralCode: (userAddress, data, params = {}) => this.request({
503
483
  path: `/v1/referrals/${userAddress}`,
504
- method: "POST",
484
+ method: 'POST',
505
485
  body: data,
506
486
  type: ContentType.Json,
507
487
  ...params,
508
488
  }),
509
489
  referralControllerCheckReferralExist: (data, params = {}) => this.request({
510
490
  path: `/v1/referrals/check-exist`,
511
- method: "POST",
491
+ method: 'POST',
512
492
  body: data,
513
493
  type: ContentType.Json,
514
- format: "json",
494
+ format: 'json',
515
495
  ...params,
516
496
  }),
517
497
  referralControllerJoinReferralCode: (userAddress, data, params = {}) => this.request({
518
498
  path: `/v1/referrals/${userAddress}/join`,
519
- method: "POST",
499
+ method: 'POST',
520
500
  body: data,
521
501
  type: ContentType.Json,
522
- format: "json",
502
+ format: 'json',
523
503
  ...params,
524
504
  }),
525
505
  referralControllerGetReferralActivities: (userAddress, params = {}) => this.request({
526
506
  path: `/v1/referrals/${userAddress}/referral-activities`,
527
- method: "GET",
528
- format: "json",
507
+ method: 'GET',
508
+ format: 'json',
529
509
  ...params,
530
510
  }),
531
511
  referralControllerGetReferralRewards: (userAddress, params = {}) => this.request({
532
512
  path: `/v1/referrals/${userAddress}/referral-rewards`,
533
- method: "GET",
534
- format: "json",
513
+ method: 'GET',
514
+ format: 'json',
535
515
  ...params,
536
516
  }),
537
517
  };
538
518
  merkels = {
539
519
  merklesControllerGetMerkleByUserAndCampaign: (campaignId, user, params = {}) => this.request({
540
520
  path: `/v1/merkels/${campaignId}/user/${user}`,
541
- method: "GET",
542
- format: "json",
521
+ method: 'GET',
522
+ format: 'json',
543
523
  ...params,
544
524
  }),
545
525
  };
546
526
  admin = {
547
527
  adminControllerTransferMockToken: (data, params = {}) => this.request({
548
528
  path: `/v1/admin/faucet`,
549
- method: "POST",
529
+ method: 'POST',
550
530
  body: data,
551
531
  secure: true,
552
532
  type: ContentType.Json,
@@ -556,25 +536,25 @@ class Sdk extends HttpClient {
556
536
  configs = {
557
537
  configsControllerGetGlobalConfigs: (params = {}) => this.request({
558
538
  path: `/v1/configs`,
559
- method: "GET",
560
- format: "json",
539
+ method: 'GET',
540
+ format: 'json',
561
541
  ...params,
562
542
  }),
563
543
  };
564
544
  incentives = {
565
545
  incentivesControllerGetMakerIncentiveActivities: (maker, params = {}) => this.request({
566
546
  path: `/v1/incentives/maker-incentives/${maker}/activities`,
567
- method: "GET",
568
- format: "json",
547
+ method: 'GET',
548
+ format: 'json',
569
549
  ...params,
570
550
  }),
571
551
  incentivesControllerGetMakerIncentiveRewards: (maker, params = {}) => this.request({
572
552
  path: `/v1/incentives/maker-incentives/${maker}/rewards`,
573
- method: "GET",
574
- format: "json",
553
+ method: 'GET',
554
+ format: 'json',
575
555
  ...params,
576
556
  }),
577
557
  };
578
558
  }
579
559
  exports.Sdk = Sdk;
580
- //# sourceMappingURL=BorosBackendSDK.js.map
560
+ //# sourceMappingURL=BorosCoreSDK.js.map