@xchainjs/xchain-thornode 0.2.1 → 0.2.3

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/lib/index.js CHANGED
@@ -140,6 +140,179 @@ const VaultTypeEnum = {
140
140
  AsgardVault: 'AsgardVault',
141
141
  YggdrasilVault: 'YggdrasilVault'
142
142
  };
143
+ /**
144
+ * BorrowersApi - axios parameter creator
145
+ * @export
146
+ */
147
+ const BorrowersApiAxiosParamCreator = function (configuration) {
148
+ return {
149
+ /**
150
+ * Returns the borrower position given the pool and address.
151
+ * @param {string} asset
152
+ * @param {string} address
153
+ * @param {number} [height] optional block height, defaults to current tip
154
+ * @param {*} [options] Override http request option.
155
+ * @throws {RequiredError}
156
+ */
157
+ borrower: (asset, address, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
158
+ // verify required parameter 'asset' is not null or undefined
159
+ assertParamExists('borrower', 'asset', asset);
160
+ // verify required parameter 'address' is not null or undefined
161
+ assertParamExists('borrower', 'address', address);
162
+ const localVarPath = `/thorchain/pool/{asset}/borrower/{address}`
163
+ .replace(`{${"asset"}}`, encodeURIComponent(String(asset)))
164
+ .replace(`{${"address"}}`, encodeURIComponent(String(address)));
165
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
166
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
167
+ let baseOptions;
168
+ if (configuration) {
169
+ baseOptions = configuration.baseOptions;
170
+ }
171
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
172
+ const localVarHeaderParameter = {};
173
+ const localVarQueryParameter = {};
174
+ if (height !== undefined) {
175
+ localVarQueryParameter['height'] = height;
176
+ }
177
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
178
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
179
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
180
+ return {
181
+ url: toPathString(localVarUrlObj),
182
+ options: localVarRequestOptions,
183
+ };
184
+ }),
185
+ /**
186
+ * Returns all borrowers for the given pool.
187
+ * @param {string} asset
188
+ * @param {number} [height] optional block height, defaults to current tip
189
+ * @param {*} [options] Override http request option.
190
+ * @throws {RequiredError}
191
+ */
192
+ borrowers: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
193
+ // verify required parameter 'asset' is not null or undefined
194
+ assertParamExists('borrowers', 'asset', asset);
195
+ const localVarPath = `/thorchain/pool/{asset}/borrowers`
196
+ .replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
197
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
198
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
199
+ let baseOptions;
200
+ if (configuration) {
201
+ baseOptions = configuration.baseOptions;
202
+ }
203
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
204
+ const localVarHeaderParameter = {};
205
+ const localVarQueryParameter = {};
206
+ if (height !== undefined) {
207
+ localVarQueryParameter['height'] = height;
208
+ }
209
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
210
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
211
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
212
+ return {
213
+ url: toPathString(localVarUrlObj),
214
+ options: localVarRequestOptions,
215
+ };
216
+ }),
217
+ };
218
+ };
219
+ /**
220
+ * BorrowersApi - functional programming interface
221
+ * @export
222
+ */
223
+ const BorrowersApiFp = function (configuration) {
224
+ const localVarAxiosParamCreator = BorrowersApiAxiosParamCreator(configuration);
225
+ return {
226
+ /**
227
+ * Returns the borrower position given the pool and address.
228
+ * @param {string} asset
229
+ * @param {string} address
230
+ * @param {number} [height] optional block height, defaults to current tip
231
+ * @param {*} [options] Override http request option.
232
+ * @throws {RequiredError}
233
+ */
234
+ borrower(asset, address, height, options) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.borrower(asset, address, height, options);
237
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
238
+ });
239
+ },
240
+ /**
241
+ * Returns all borrowers for the given pool.
242
+ * @param {string} asset
243
+ * @param {number} [height] optional block height, defaults to current tip
244
+ * @param {*} [options] Override http request option.
245
+ * @throws {RequiredError}
246
+ */
247
+ borrowers(asset, height, options) {
248
+ return __awaiter(this, void 0, void 0, function* () {
249
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.borrowers(asset, height, options);
250
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
251
+ });
252
+ },
253
+ };
254
+ };
255
+ /**
256
+ * BorrowersApi - factory interface
257
+ * @export
258
+ */
259
+ const BorrowersApiFactory = function (configuration, basePath, axios) {
260
+ const localVarFp = BorrowersApiFp(configuration);
261
+ return {
262
+ /**
263
+ * Returns the borrower position given the pool and address.
264
+ * @param {string} asset
265
+ * @param {string} address
266
+ * @param {number} [height] optional block height, defaults to current tip
267
+ * @param {*} [options] Override http request option.
268
+ * @throws {RequiredError}
269
+ */
270
+ borrower(asset, address, height, options) {
271
+ return localVarFp.borrower(asset, address, height, options).then((request) => request(axios, basePath));
272
+ },
273
+ /**
274
+ * Returns all borrowers for the given pool.
275
+ * @param {string} asset
276
+ * @param {number} [height] optional block height, defaults to current tip
277
+ * @param {*} [options] Override http request option.
278
+ * @throws {RequiredError}
279
+ */
280
+ borrowers(asset, height, options) {
281
+ return localVarFp.borrowers(asset, height, options).then((request) => request(axios, basePath));
282
+ },
283
+ };
284
+ };
285
+ /**
286
+ * BorrowersApi - object-oriented interface
287
+ * @export
288
+ * @class BorrowersApi
289
+ * @extends {BaseAPI}
290
+ */
291
+ class BorrowersApi extends BaseAPI {
292
+ /**
293
+ * Returns the borrower position given the pool and address.
294
+ * @param {string} asset
295
+ * @param {string} address
296
+ * @param {number} [height] optional block height, defaults to current tip
297
+ * @param {*} [options] Override http request option.
298
+ * @throws {RequiredError}
299
+ * @memberof BorrowersApi
300
+ */
301
+ borrower(asset, address, height, options) {
302
+ return BorrowersApiFp(this.configuration).borrower(asset, address, height, options).then((request) => request(this.axios, this.basePath));
303
+ }
304
+ /**
305
+ * Returns all borrowers for the given pool.
306
+ * @param {string} asset
307
+ * @param {number} [height] optional block height, defaults to current tip
308
+ * @param {*} [options] Override http request option.
309
+ * @throws {RequiredError}
310
+ * @memberof BorrowersApi
311
+ */
312
+ borrowers(asset, height, options) {
313
+ return BorrowersApiFp(this.configuration).borrowers(asset, height, options).then((request) => request(this.axios, this.basePath));
314
+ }
315
+ }
143
316
  /**
144
317
  * HealthApi - axios parameter creator
145
318
  * @export
@@ -226,6 +399,165 @@ class HealthApi extends BaseAPI {
226
399
  return HealthApiFp(this.configuration).ping(options).then((request) => request(this.axios, this.basePath));
227
400
  }
228
401
  }
402
+ /**
403
+ * InvariantsApi - axios parameter creator
404
+ * @export
405
+ */
406
+ const InvariantsApiAxiosParamCreator = function (configuration) {
407
+ return {
408
+ /**
409
+ * Returns result of running the given invariant.
410
+ * @param {string} invariant
411
+ * @param {number} [height] optional block height, defaults to current tip
412
+ * @param {*} [options] Override http request option.
413
+ * @throws {RequiredError}
414
+ */
415
+ invariant: (invariant, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
416
+ // verify required parameter 'invariant' is not null or undefined
417
+ assertParamExists('invariant', 'invariant', invariant);
418
+ const localVarPath = `/thorchain/invariant/{invariant}`
419
+ .replace(`{${"invariant"}}`, encodeURIComponent(String(invariant)));
420
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
421
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
422
+ let baseOptions;
423
+ if (configuration) {
424
+ baseOptions = configuration.baseOptions;
425
+ }
426
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
427
+ const localVarHeaderParameter = {};
428
+ const localVarQueryParameter = {};
429
+ if (height !== undefined) {
430
+ localVarQueryParameter['height'] = height;
431
+ }
432
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
433
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
434
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
435
+ return {
436
+ url: toPathString(localVarUrlObj),
437
+ options: localVarRequestOptions,
438
+ };
439
+ }),
440
+ /**
441
+ * Returns a list of available invariants.
442
+ * @param {number} [height] optional block height, defaults to current tip
443
+ * @param {*} [options] Override http request option.
444
+ * @throws {RequiredError}
445
+ */
446
+ invariants: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
447
+ const localVarPath = `/thorchain/invariants`;
448
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
449
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
450
+ let baseOptions;
451
+ if (configuration) {
452
+ baseOptions = configuration.baseOptions;
453
+ }
454
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
455
+ const localVarHeaderParameter = {};
456
+ const localVarQueryParameter = {};
457
+ if (height !== undefined) {
458
+ localVarQueryParameter['height'] = height;
459
+ }
460
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
461
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
462
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
463
+ return {
464
+ url: toPathString(localVarUrlObj),
465
+ options: localVarRequestOptions,
466
+ };
467
+ }),
468
+ };
469
+ };
470
+ /**
471
+ * InvariantsApi - functional programming interface
472
+ * @export
473
+ */
474
+ const InvariantsApiFp = function (configuration) {
475
+ const localVarAxiosParamCreator = InvariantsApiAxiosParamCreator(configuration);
476
+ return {
477
+ /**
478
+ * Returns result of running the given invariant.
479
+ * @param {string} invariant
480
+ * @param {number} [height] optional block height, defaults to current tip
481
+ * @param {*} [options] Override http request option.
482
+ * @throws {RequiredError}
483
+ */
484
+ invariant(invariant, height, options) {
485
+ return __awaiter(this, void 0, void 0, function* () {
486
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.invariant(invariant, height, options);
487
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
488
+ });
489
+ },
490
+ /**
491
+ * Returns a list of available invariants.
492
+ * @param {number} [height] optional block height, defaults to current tip
493
+ * @param {*} [options] Override http request option.
494
+ * @throws {RequiredError}
495
+ */
496
+ invariants(height, options) {
497
+ return __awaiter(this, void 0, void 0, function* () {
498
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.invariants(height, options);
499
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
500
+ });
501
+ },
502
+ };
503
+ };
504
+ /**
505
+ * InvariantsApi - factory interface
506
+ * @export
507
+ */
508
+ const InvariantsApiFactory = function (configuration, basePath, axios) {
509
+ const localVarFp = InvariantsApiFp(configuration);
510
+ return {
511
+ /**
512
+ * Returns result of running the given invariant.
513
+ * @param {string} invariant
514
+ * @param {number} [height] optional block height, defaults to current tip
515
+ * @param {*} [options] Override http request option.
516
+ * @throws {RequiredError}
517
+ */
518
+ invariant(invariant, height, options) {
519
+ return localVarFp.invariant(invariant, height, options).then((request) => request(axios, basePath));
520
+ },
521
+ /**
522
+ * Returns a list of available invariants.
523
+ * @param {number} [height] optional block height, defaults to current tip
524
+ * @param {*} [options] Override http request option.
525
+ * @throws {RequiredError}
526
+ */
527
+ invariants(height, options) {
528
+ return localVarFp.invariants(height, options).then((request) => request(axios, basePath));
529
+ },
530
+ };
531
+ };
532
+ /**
533
+ * InvariantsApi - object-oriented interface
534
+ * @export
535
+ * @class InvariantsApi
536
+ * @extends {BaseAPI}
537
+ */
538
+ class InvariantsApi extends BaseAPI {
539
+ /**
540
+ * Returns result of running the given invariant.
541
+ * @param {string} invariant
542
+ * @param {number} [height] optional block height, defaults to current tip
543
+ * @param {*} [options] Override http request option.
544
+ * @throws {RequiredError}
545
+ * @memberof InvariantsApi
546
+ */
547
+ invariant(invariant, height, options) {
548
+ return InvariantsApiFp(this.configuration).invariant(invariant, height, options).then((request) => request(this.axios, this.basePath));
549
+ }
550
+ /**
551
+ * Returns a list of available invariants.
552
+ * @param {number} [height] optional block height, defaults to current tip
553
+ * @param {*} [options] Override http request option.
554
+ * @throws {RequiredError}
555
+ * @memberof InvariantsApi
556
+ */
557
+ invariants(height, options) {
558
+ return InvariantsApiFp(this.configuration).invariants(height, options).then((request) => request(this.axios, this.basePath));
559
+ }
560
+ }
229
561
  /**
230
562
  * LiquidityProvidersApi - axios parameter creator
231
563
  * @export
@@ -1763,6 +2095,34 @@ const QueueApiAxiosParamCreator = function (configuration) {
1763
2095
  options: localVarRequestOptions,
1764
2096
  };
1765
2097
  }),
2098
+ /**
2099
+ * Returns the swap queue.
2100
+ * @param {number} [height] optional block height, defaults to current tip
2101
+ * @param {*} [options] Override http request option.
2102
+ * @throws {RequiredError}
2103
+ */
2104
+ queueSwap: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
2105
+ const localVarPath = `/thorchain/queue/swap`;
2106
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2107
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2108
+ let baseOptions;
2109
+ if (configuration) {
2110
+ baseOptions = configuration.baseOptions;
2111
+ }
2112
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2113
+ const localVarHeaderParameter = {};
2114
+ const localVarQueryParameter = {};
2115
+ if (height !== undefined) {
2116
+ localVarQueryParameter['height'] = height;
2117
+ }
2118
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2119
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2120
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2121
+ return {
2122
+ url: toPathString(localVarUrlObj),
2123
+ options: localVarRequestOptions,
2124
+ };
2125
+ }),
1766
2126
  };
1767
2127
  };
1768
2128
  /**
@@ -1808,6 +2168,18 @@ const QueueApiFp = function (configuration) {
1808
2168
  return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
1809
2169
  });
1810
2170
  },
2171
+ /**
2172
+ * Returns the swap queue.
2173
+ * @param {number} [height] optional block height, defaults to current tip
2174
+ * @param {*} [options] Override http request option.
2175
+ * @throws {RequiredError}
2176
+ */
2177
+ queueSwap(height, options) {
2178
+ return __awaiter(this, void 0, void 0, function* () {
2179
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.queueSwap(height, options);
2180
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
2181
+ });
2182
+ },
1811
2183
  };
1812
2184
  };
1813
2185
  /**
@@ -1844,6 +2216,15 @@ const QueueApiFactory = function (configuration, basePath, axios) {
1844
2216
  queueScheduled(height, options) {
1845
2217
  return localVarFp.queueScheduled(height, options).then((request) => request(axios, basePath));
1846
2218
  },
2219
+ /**
2220
+ * Returns the swap queue.
2221
+ * @param {number} [height] optional block height, defaults to current tip
2222
+ * @param {*} [options] Override http request option.
2223
+ * @throws {RequiredError}
2224
+ */
2225
+ queueSwap(height, options) {
2226
+ return localVarFp.queueSwap(height, options).then((request) => request(axios, basePath));
2227
+ },
1847
2228
  };
1848
2229
  };
1849
2230
  /**
@@ -1883,6 +2264,16 @@ class QueueApi extends BaseAPI {
1883
2264
  queueScheduled(height, options) {
1884
2265
  return QueueApiFp(this.configuration).queueScheduled(height, options).then((request) => request(this.axios, this.basePath));
1885
2266
  }
2267
+ /**
2268
+ * Returns the swap queue.
2269
+ * @param {number} [height] optional block height, defaults to current tip
2270
+ * @param {*} [options] Override http request option.
2271
+ * @throws {RequiredError}
2272
+ * @memberof QueueApi
2273
+ */
2274
+ queueSwap(height, options) {
2275
+ return QueueApiFp(this.configuration).queueSwap(height, options).then((request) => request(this.axios, this.basePath));
2276
+ }
1886
2277
  }
1887
2278
  /**
1888
2279
  * QuoteApi - axios parameter creator
@@ -1890,6 +2281,110 @@ class QueueApi extends BaseAPI {
1890
2281
  */
1891
2282
  const QuoteApiAxiosParamCreator = function (configuration) {
1892
2283
  return {
2284
+ /**
2285
+ * Provide a quote estimate for the provided loan close.
2286
+ * @param {number} [height] optional block height, defaults to current tip
2287
+ * @param {string} [asset] the asset used to repay the loan
2288
+ * @param {number} [amount] the asset amount in 1e8 decimals
2289
+ * @param {string} [loanAsset] the collateral asset of the loan
2290
+ * @param {string} [loanOwner] the owner of the loan collateral
2291
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2292
+ * @param {*} [options] Override http request option.
2293
+ * @throws {RequiredError}
2294
+ */
2295
+ quoteloanclose: (height, asset, amount, loanAsset, loanOwner, minOut, options = {}) => __awaiter(this, void 0, void 0, function* () {
2296
+ const localVarPath = `/thorchain/quote/loan/close`;
2297
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2298
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2299
+ let baseOptions;
2300
+ if (configuration) {
2301
+ baseOptions = configuration.baseOptions;
2302
+ }
2303
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2304
+ const localVarHeaderParameter = {};
2305
+ const localVarQueryParameter = {};
2306
+ if (height !== undefined) {
2307
+ localVarQueryParameter['height'] = height;
2308
+ }
2309
+ if (asset !== undefined) {
2310
+ localVarQueryParameter['asset'] = asset;
2311
+ }
2312
+ if (amount !== undefined) {
2313
+ localVarQueryParameter['amount'] = amount;
2314
+ }
2315
+ if (loanAsset !== undefined) {
2316
+ localVarQueryParameter['loan_asset'] = loanAsset;
2317
+ }
2318
+ if (loanOwner !== undefined) {
2319
+ localVarQueryParameter['loan_owner'] = loanOwner;
2320
+ }
2321
+ if (minOut !== undefined) {
2322
+ localVarQueryParameter['min_out'] = minOut;
2323
+ }
2324
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2325
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2326
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2327
+ return {
2328
+ url: toPathString(localVarUrlObj),
2329
+ options: localVarRequestOptions,
2330
+ };
2331
+ }),
2332
+ /**
2333
+ * Provide a quote estimate for the provided loan open.
2334
+ * @param {number} [height] optional block height, defaults to current tip
2335
+ * @param {string} [asset] the collateral asset
2336
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2337
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2338
+ * @param {string} [destination] the destination address, required to generate memo
2339
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2340
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2341
+ * @param {string} [affiliate] the affiliate (address or thorname)
2342
+ * @param {*} [options] Override http request option.
2343
+ * @throws {RequiredError}
2344
+ */
2345
+ quoteloanopen: (height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2346
+ const localVarPath = `/thorchain/quote/loan/open`;
2347
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2348
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2349
+ let baseOptions;
2350
+ if (configuration) {
2351
+ baseOptions = configuration.baseOptions;
2352
+ }
2353
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2354
+ const localVarHeaderParameter = {};
2355
+ const localVarQueryParameter = {};
2356
+ if (height !== undefined) {
2357
+ localVarQueryParameter['height'] = height;
2358
+ }
2359
+ if (asset !== undefined) {
2360
+ localVarQueryParameter['asset'] = asset;
2361
+ }
2362
+ if (amount !== undefined) {
2363
+ localVarQueryParameter['amount'] = amount;
2364
+ }
2365
+ if (targetAsset !== undefined) {
2366
+ localVarQueryParameter['target_asset'] = targetAsset;
2367
+ }
2368
+ if (destination !== undefined) {
2369
+ localVarQueryParameter['destination'] = destination;
2370
+ }
2371
+ if (minOut !== undefined) {
2372
+ localVarQueryParameter['min_out'] = minOut;
2373
+ }
2374
+ if (affiliateBps !== undefined) {
2375
+ localVarQueryParameter['affiliate_bps'] = affiliateBps;
2376
+ }
2377
+ if (affiliate !== undefined) {
2378
+ localVarQueryParameter['affiliate'] = affiliate;
2379
+ }
2380
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2381
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2382
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2383
+ return {
2384
+ url: toPathString(localVarUrlObj),
2385
+ options: localVarRequestOptions,
2386
+ };
2387
+ }),
1893
2388
  /**
1894
2389
  * Provide a quote estimate for the provided saver deposit.
1895
2390
  * @param {number} [height] optional block height, defaults to current tip
@@ -2035,6 +2530,42 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2035
2530
  const QuoteApiFp = function (configuration) {
2036
2531
  const localVarAxiosParamCreator = QuoteApiAxiosParamCreator(configuration);
2037
2532
  return {
2533
+ /**
2534
+ * Provide a quote estimate for the provided loan close.
2535
+ * @param {number} [height] optional block height, defaults to current tip
2536
+ * @param {string} [asset] the asset used to repay the loan
2537
+ * @param {number} [amount] the asset amount in 1e8 decimals
2538
+ * @param {string} [loanAsset] the collateral asset of the loan
2539
+ * @param {string} [loanOwner] the owner of the loan collateral
2540
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2541
+ * @param {*} [options] Override http request option.
2542
+ * @throws {RequiredError}
2543
+ */
2544
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2545
+ return __awaiter(this, void 0, void 0, function* () {
2546
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options);
2547
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
2548
+ });
2549
+ },
2550
+ /**
2551
+ * Provide a quote estimate for the provided loan open.
2552
+ * @param {number} [height] optional block height, defaults to current tip
2553
+ * @param {string} [asset] the collateral asset
2554
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2555
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2556
+ * @param {string} [destination] the destination address, required to generate memo
2557
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2558
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2559
+ * @param {string} [affiliate] the affiliate (address or thorname)
2560
+ * @param {*} [options] Override http request option.
2561
+ * @throws {RequiredError}
2562
+ */
2563
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2564
+ return __awaiter(this, void 0, void 0, function* () {
2565
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options);
2566
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
2567
+ });
2568
+ },
2038
2569
  /**
2039
2570
  * Provide a quote estimate for the provided saver deposit.
2040
2571
  * @param {number} [height] optional block height, defaults to current tip
@@ -2093,6 +2624,36 @@ const QuoteApiFp = function (configuration) {
2093
2624
  const QuoteApiFactory = function (configuration, basePath, axios) {
2094
2625
  const localVarFp = QuoteApiFp(configuration);
2095
2626
  return {
2627
+ /**
2628
+ * Provide a quote estimate for the provided loan close.
2629
+ * @param {number} [height] optional block height, defaults to current tip
2630
+ * @param {string} [asset] the asset used to repay the loan
2631
+ * @param {number} [amount] the asset amount in 1e8 decimals
2632
+ * @param {string} [loanAsset] the collateral asset of the loan
2633
+ * @param {string} [loanOwner] the owner of the loan collateral
2634
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2635
+ * @param {*} [options] Override http request option.
2636
+ * @throws {RequiredError}
2637
+ */
2638
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2639
+ return localVarFp.quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options).then((request) => request(axios, basePath));
2640
+ },
2641
+ /**
2642
+ * Provide a quote estimate for the provided loan open.
2643
+ * @param {number} [height] optional block height, defaults to current tip
2644
+ * @param {string} [asset] the collateral asset
2645
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2646
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2647
+ * @param {string} [destination] the destination address, required to generate memo
2648
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2649
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2650
+ * @param {string} [affiliate] the affiliate (address or thorname)
2651
+ * @param {*} [options] Override http request option.
2652
+ * @throws {RequiredError}
2653
+ */
2654
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2655
+ return localVarFp.quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2656
+ },
2096
2657
  /**
2097
2658
  * Provide a quote estimate for the provided saver deposit.
2098
2659
  * @param {number} [height] optional block height, defaults to current tip
@@ -2142,6 +2703,38 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
2142
2703
  * @extends {BaseAPI}
2143
2704
  */
2144
2705
  class QuoteApi extends BaseAPI {
2706
+ /**
2707
+ * Provide a quote estimate for the provided loan close.
2708
+ * @param {number} [height] optional block height, defaults to current tip
2709
+ * @param {string} [asset] the asset used to repay the loan
2710
+ * @param {number} [amount] the asset amount in 1e8 decimals
2711
+ * @param {string} [loanAsset] the collateral asset of the loan
2712
+ * @param {string} [loanOwner] the owner of the loan collateral
2713
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2714
+ * @param {*} [options] Override http request option.
2715
+ * @throws {RequiredError}
2716
+ * @memberof QuoteApi
2717
+ */
2718
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2719
+ return QuoteApiFp(this.configuration).quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options).then((request) => request(this.axios, this.basePath));
2720
+ }
2721
+ /**
2722
+ * Provide a quote estimate for the provided loan open.
2723
+ * @param {number} [height] optional block height, defaults to current tip
2724
+ * @param {string} [asset] the collateral asset
2725
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2726
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2727
+ * @param {string} [destination] the destination address, required to generate memo
2728
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2729
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2730
+ * @param {string} [affiliate] the affiliate (address or thorname)
2731
+ * @param {*} [options] Override http request option.
2732
+ * @throws {RequiredError}
2733
+ * @memberof QuoteApi
2734
+ */
2735
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2736
+ return QuoteApiFp(this.configuration).quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
2737
+ }
2145
2738
  /**
2146
2739
  * Provide a quote estimate for the provided saver deposit.
2147
2740
  * @param {number} [height] optional block height, defaults to current tip
@@ -3151,7 +3744,7 @@ const VaultsApiAxiosParamCreator = function (configuration) {
3151
3744
  vault: (pubkey, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
3152
3745
  // verify required parameter 'pubkey' is not null or undefined
3153
3746
  assertParamExists('vault', 'pubkey', pubkey);
3154
- const localVarPath = `/thorchain/vaults/{pubkey}`
3747
+ const localVarPath = `/thorchain/vault/{pubkey}`
3155
3748
  .replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
3156
3749
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
3157
3750
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -3391,7 +3984,7 @@ class VaultsApi extends BaseAPI {
3391
3984
  * Thornode API
3392
3985
  * Thornode REST API.
3393
3986
  *
3394
- * The version of the OpenAPI document: 1.105.0
3987
+ * The version of the OpenAPI document: 1.108.3
3395
3988
  * Contact: devs@thorchain.org
3396
3989
  *
3397
3990
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -3426,11 +4019,19 @@ class Configuration {
3426
4019
 
3427
4020
  const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
3428
4021
 
4022
+ exports.BorrowersApi = BorrowersApi;
4023
+ exports.BorrowersApiAxiosParamCreator = BorrowersApiAxiosParamCreator;
4024
+ exports.BorrowersApiFactory = BorrowersApiFactory;
4025
+ exports.BorrowersApiFp = BorrowersApiFp;
3429
4026
  exports.Configuration = Configuration;
3430
4027
  exports.HealthApi = HealthApi;
3431
4028
  exports.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator;
3432
4029
  exports.HealthApiFactory = HealthApiFactory;
3433
4030
  exports.HealthApiFp = HealthApiFp;
4031
+ exports.InvariantsApi = InvariantsApi;
4032
+ exports.InvariantsApiAxiosParamCreator = InvariantsApiAxiosParamCreator;
4033
+ exports.InvariantsApiFactory = InvariantsApiFactory;
4034
+ exports.InvariantsApiFp = InvariantsApiFp;
3434
4035
  exports.LiquidityProvidersApi = LiquidityProvidersApi;
3435
4036
  exports.LiquidityProvidersApiAxiosParamCreator = LiquidityProvidersApiAxiosParamCreator;
3436
4037
  exports.LiquidityProvidersApiFactory = LiquidityProvidersApiFactory;