@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.esm.js CHANGED
@@ -132,6 +132,179 @@ const VaultTypeEnum = {
132
132
  AsgardVault: 'AsgardVault',
133
133
  YggdrasilVault: 'YggdrasilVault'
134
134
  };
135
+ /**
136
+ * BorrowersApi - axios parameter creator
137
+ * @export
138
+ */
139
+ const BorrowersApiAxiosParamCreator = function (configuration) {
140
+ return {
141
+ /**
142
+ * Returns the borrower position given the pool and address.
143
+ * @param {string} asset
144
+ * @param {string} address
145
+ * @param {number} [height] optional block height, defaults to current tip
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ */
149
+ borrower: (asset, address, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
150
+ // verify required parameter 'asset' is not null or undefined
151
+ assertParamExists('borrower', 'asset', asset);
152
+ // verify required parameter 'address' is not null or undefined
153
+ assertParamExists('borrower', 'address', address);
154
+ const localVarPath = `/thorchain/pool/{asset}/borrower/{address}`
155
+ .replace(`{${"asset"}}`, encodeURIComponent(String(asset)))
156
+ .replace(`{${"address"}}`, encodeURIComponent(String(address)));
157
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
158
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
159
+ let baseOptions;
160
+ if (configuration) {
161
+ baseOptions = configuration.baseOptions;
162
+ }
163
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
164
+ const localVarHeaderParameter = {};
165
+ const localVarQueryParameter = {};
166
+ if (height !== undefined) {
167
+ localVarQueryParameter['height'] = height;
168
+ }
169
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
170
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
171
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
172
+ return {
173
+ url: toPathString(localVarUrlObj),
174
+ options: localVarRequestOptions,
175
+ };
176
+ }),
177
+ /**
178
+ * Returns all borrowers for the given pool.
179
+ * @param {string} asset
180
+ * @param {number} [height] optional block height, defaults to current tip
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ */
184
+ borrowers: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
185
+ // verify required parameter 'asset' is not null or undefined
186
+ assertParamExists('borrowers', 'asset', asset);
187
+ const localVarPath = `/thorchain/pool/{asset}/borrowers`
188
+ .replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
189
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
190
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
191
+ let baseOptions;
192
+ if (configuration) {
193
+ baseOptions = configuration.baseOptions;
194
+ }
195
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
196
+ const localVarHeaderParameter = {};
197
+ const localVarQueryParameter = {};
198
+ if (height !== undefined) {
199
+ localVarQueryParameter['height'] = height;
200
+ }
201
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
202
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
203
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
204
+ return {
205
+ url: toPathString(localVarUrlObj),
206
+ options: localVarRequestOptions,
207
+ };
208
+ }),
209
+ };
210
+ };
211
+ /**
212
+ * BorrowersApi - functional programming interface
213
+ * @export
214
+ */
215
+ const BorrowersApiFp = function (configuration) {
216
+ const localVarAxiosParamCreator = BorrowersApiAxiosParamCreator(configuration);
217
+ return {
218
+ /**
219
+ * Returns the borrower position given the pool and address.
220
+ * @param {string} asset
221
+ * @param {string} address
222
+ * @param {number} [height] optional block height, defaults to current tip
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ */
226
+ borrower(asset, address, height, options) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.borrower(asset, address, height, options);
229
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
230
+ });
231
+ },
232
+ /**
233
+ * Returns all borrowers for the given pool.
234
+ * @param {string} asset
235
+ * @param {number} [height] optional block height, defaults to current tip
236
+ * @param {*} [options] Override http request option.
237
+ * @throws {RequiredError}
238
+ */
239
+ borrowers(asset, height, options) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.borrowers(asset, height, options);
242
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
243
+ });
244
+ },
245
+ };
246
+ };
247
+ /**
248
+ * BorrowersApi - factory interface
249
+ * @export
250
+ */
251
+ const BorrowersApiFactory = function (configuration, basePath, axios) {
252
+ const localVarFp = BorrowersApiFp(configuration);
253
+ return {
254
+ /**
255
+ * Returns the borrower position given the pool and address.
256
+ * @param {string} asset
257
+ * @param {string} address
258
+ * @param {number} [height] optional block height, defaults to current tip
259
+ * @param {*} [options] Override http request option.
260
+ * @throws {RequiredError}
261
+ */
262
+ borrower(asset, address, height, options) {
263
+ return localVarFp.borrower(asset, address, height, options).then((request) => request(axios, basePath));
264
+ },
265
+ /**
266
+ * Returns all borrowers for the given pool.
267
+ * @param {string} asset
268
+ * @param {number} [height] optional block height, defaults to current tip
269
+ * @param {*} [options] Override http request option.
270
+ * @throws {RequiredError}
271
+ */
272
+ borrowers(asset, height, options) {
273
+ return localVarFp.borrowers(asset, height, options).then((request) => request(axios, basePath));
274
+ },
275
+ };
276
+ };
277
+ /**
278
+ * BorrowersApi - object-oriented interface
279
+ * @export
280
+ * @class BorrowersApi
281
+ * @extends {BaseAPI}
282
+ */
283
+ class BorrowersApi extends BaseAPI {
284
+ /**
285
+ * Returns the borrower position given the pool and address.
286
+ * @param {string} asset
287
+ * @param {string} address
288
+ * @param {number} [height] optional block height, defaults to current tip
289
+ * @param {*} [options] Override http request option.
290
+ * @throws {RequiredError}
291
+ * @memberof BorrowersApi
292
+ */
293
+ borrower(asset, address, height, options) {
294
+ return BorrowersApiFp(this.configuration).borrower(asset, address, height, options).then((request) => request(this.axios, this.basePath));
295
+ }
296
+ /**
297
+ * Returns all borrowers for the given pool.
298
+ * @param {string} asset
299
+ * @param {number} [height] optional block height, defaults to current tip
300
+ * @param {*} [options] Override http request option.
301
+ * @throws {RequiredError}
302
+ * @memberof BorrowersApi
303
+ */
304
+ borrowers(asset, height, options) {
305
+ return BorrowersApiFp(this.configuration).borrowers(asset, height, options).then((request) => request(this.axios, this.basePath));
306
+ }
307
+ }
135
308
  /**
136
309
  * HealthApi - axios parameter creator
137
310
  * @export
@@ -218,6 +391,165 @@ class HealthApi extends BaseAPI {
218
391
  return HealthApiFp(this.configuration).ping(options).then((request) => request(this.axios, this.basePath));
219
392
  }
220
393
  }
394
+ /**
395
+ * InvariantsApi - axios parameter creator
396
+ * @export
397
+ */
398
+ const InvariantsApiAxiosParamCreator = function (configuration) {
399
+ return {
400
+ /**
401
+ * Returns result of running the given invariant.
402
+ * @param {string} invariant
403
+ * @param {number} [height] optional block height, defaults to current tip
404
+ * @param {*} [options] Override http request option.
405
+ * @throws {RequiredError}
406
+ */
407
+ invariant: (invariant, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
408
+ // verify required parameter 'invariant' is not null or undefined
409
+ assertParamExists('invariant', 'invariant', invariant);
410
+ const localVarPath = `/thorchain/invariant/{invariant}`
411
+ .replace(`{${"invariant"}}`, encodeURIComponent(String(invariant)));
412
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
413
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
414
+ let baseOptions;
415
+ if (configuration) {
416
+ baseOptions = configuration.baseOptions;
417
+ }
418
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
419
+ const localVarHeaderParameter = {};
420
+ const localVarQueryParameter = {};
421
+ if (height !== undefined) {
422
+ localVarQueryParameter['height'] = height;
423
+ }
424
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
425
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
426
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
427
+ return {
428
+ url: toPathString(localVarUrlObj),
429
+ options: localVarRequestOptions,
430
+ };
431
+ }),
432
+ /**
433
+ * Returns a list of available invariants.
434
+ * @param {number} [height] optional block height, defaults to current tip
435
+ * @param {*} [options] Override http request option.
436
+ * @throws {RequiredError}
437
+ */
438
+ invariants: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
439
+ const localVarPath = `/thorchain/invariants`;
440
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
441
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
442
+ let baseOptions;
443
+ if (configuration) {
444
+ baseOptions = configuration.baseOptions;
445
+ }
446
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
447
+ const localVarHeaderParameter = {};
448
+ const localVarQueryParameter = {};
449
+ if (height !== undefined) {
450
+ localVarQueryParameter['height'] = height;
451
+ }
452
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
453
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
454
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
455
+ return {
456
+ url: toPathString(localVarUrlObj),
457
+ options: localVarRequestOptions,
458
+ };
459
+ }),
460
+ };
461
+ };
462
+ /**
463
+ * InvariantsApi - functional programming interface
464
+ * @export
465
+ */
466
+ const InvariantsApiFp = function (configuration) {
467
+ const localVarAxiosParamCreator = InvariantsApiAxiosParamCreator(configuration);
468
+ return {
469
+ /**
470
+ * Returns result of running the given invariant.
471
+ * @param {string} invariant
472
+ * @param {number} [height] optional block height, defaults to current tip
473
+ * @param {*} [options] Override http request option.
474
+ * @throws {RequiredError}
475
+ */
476
+ invariant(invariant, height, options) {
477
+ return __awaiter(this, void 0, void 0, function* () {
478
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.invariant(invariant, height, options);
479
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
480
+ });
481
+ },
482
+ /**
483
+ * Returns a list of available invariants.
484
+ * @param {number} [height] optional block height, defaults to current tip
485
+ * @param {*} [options] Override http request option.
486
+ * @throws {RequiredError}
487
+ */
488
+ invariants(height, options) {
489
+ return __awaiter(this, void 0, void 0, function* () {
490
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.invariants(height, options);
491
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
492
+ });
493
+ },
494
+ };
495
+ };
496
+ /**
497
+ * InvariantsApi - factory interface
498
+ * @export
499
+ */
500
+ const InvariantsApiFactory = function (configuration, basePath, axios) {
501
+ const localVarFp = InvariantsApiFp(configuration);
502
+ return {
503
+ /**
504
+ * Returns result of running the given invariant.
505
+ * @param {string} invariant
506
+ * @param {number} [height] optional block height, defaults to current tip
507
+ * @param {*} [options] Override http request option.
508
+ * @throws {RequiredError}
509
+ */
510
+ invariant(invariant, height, options) {
511
+ return localVarFp.invariant(invariant, height, options).then((request) => request(axios, basePath));
512
+ },
513
+ /**
514
+ * Returns a list of available invariants.
515
+ * @param {number} [height] optional block height, defaults to current tip
516
+ * @param {*} [options] Override http request option.
517
+ * @throws {RequiredError}
518
+ */
519
+ invariants(height, options) {
520
+ return localVarFp.invariants(height, options).then((request) => request(axios, basePath));
521
+ },
522
+ };
523
+ };
524
+ /**
525
+ * InvariantsApi - object-oriented interface
526
+ * @export
527
+ * @class InvariantsApi
528
+ * @extends {BaseAPI}
529
+ */
530
+ class InvariantsApi extends BaseAPI {
531
+ /**
532
+ * Returns result of running the given invariant.
533
+ * @param {string} invariant
534
+ * @param {number} [height] optional block height, defaults to current tip
535
+ * @param {*} [options] Override http request option.
536
+ * @throws {RequiredError}
537
+ * @memberof InvariantsApi
538
+ */
539
+ invariant(invariant, height, options) {
540
+ return InvariantsApiFp(this.configuration).invariant(invariant, height, options).then((request) => request(this.axios, this.basePath));
541
+ }
542
+ /**
543
+ * Returns a list of available invariants.
544
+ * @param {number} [height] optional block height, defaults to current tip
545
+ * @param {*} [options] Override http request option.
546
+ * @throws {RequiredError}
547
+ * @memberof InvariantsApi
548
+ */
549
+ invariants(height, options) {
550
+ return InvariantsApiFp(this.configuration).invariants(height, options).then((request) => request(this.axios, this.basePath));
551
+ }
552
+ }
221
553
  /**
222
554
  * LiquidityProvidersApi - axios parameter creator
223
555
  * @export
@@ -1755,6 +2087,34 @@ const QueueApiAxiosParamCreator = function (configuration) {
1755
2087
  options: localVarRequestOptions,
1756
2088
  };
1757
2089
  }),
2090
+ /**
2091
+ * Returns the swap queue.
2092
+ * @param {number} [height] optional block height, defaults to current tip
2093
+ * @param {*} [options] Override http request option.
2094
+ * @throws {RequiredError}
2095
+ */
2096
+ queueSwap: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
2097
+ const localVarPath = `/thorchain/queue/swap`;
2098
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2099
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2100
+ let baseOptions;
2101
+ if (configuration) {
2102
+ baseOptions = configuration.baseOptions;
2103
+ }
2104
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2105
+ const localVarHeaderParameter = {};
2106
+ const localVarQueryParameter = {};
2107
+ if (height !== undefined) {
2108
+ localVarQueryParameter['height'] = height;
2109
+ }
2110
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2111
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2112
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2113
+ return {
2114
+ url: toPathString(localVarUrlObj),
2115
+ options: localVarRequestOptions,
2116
+ };
2117
+ }),
1758
2118
  };
1759
2119
  };
1760
2120
  /**
@@ -1800,6 +2160,18 @@ const QueueApiFp = function (configuration) {
1800
2160
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1801
2161
  });
1802
2162
  },
2163
+ /**
2164
+ * Returns the swap queue.
2165
+ * @param {number} [height] optional block height, defaults to current tip
2166
+ * @param {*} [options] Override http request option.
2167
+ * @throws {RequiredError}
2168
+ */
2169
+ queueSwap(height, options) {
2170
+ return __awaiter(this, void 0, void 0, function* () {
2171
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.queueSwap(height, options);
2172
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2173
+ });
2174
+ },
1803
2175
  };
1804
2176
  };
1805
2177
  /**
@@ -1836,6 +2208,15 @@ const QueueApiFactory = function (configuration, basePath, axios) {
1836
2208
  queueScheduled(height, options) {
1837
2209
  return localVarFp.queueScheduled(height, options).then((request) => request(axios, basePath));
1838
2210
  },
2211
+ /**
2212
+ * Returns the swap queue.
2213
+ * @param {number} [height] optional block height, defaults to current tip
2214
+ * @param {*} [options] Override http request option.
2215
+ * @throws {RequiredError}
2216
+ */
2217
+ queueSwap(height, options) {
2218
+ return localVarFp.queueSwap(height, options).then((request) => request(axios, basePath));
2219
+ },
1839
2220
  };
1840
2221
  };
1841
2222
  /**
@@ -1875,6 +2256,16 @@ class QueueApi extends BaseAPI {
1875
2256
  queueScheduled(height, options) {
1876
2257
  return QueueApiFp(this.configuration).queueScheduled(height, options).then((request) => request(this.axios, this.basePath));
1877
2258
  }
2259
+ /**
2260
+ * Returns the swap queue.
2261
+ * @param {number} [height] optional block height, defaults to current tip
2262
+ * @param {*} [options] Override http request option.
2263
+ * @throws {RequiredError}
2264
+ * @memberof QueueApi
2265
+ */
2266
+ queueSwap(height, options) {
2267
+ return QueueApiFp(this.configuration).queueSwap(height, options).then((request) => request(this.axios, this.basePath));
2268
+ }
1878
2269
  }
1879
2270
  /**
1880
2271
  * QuoteApi - axios parameter creator
@@ -1882,6 +2273,110 @@ class QueueApi extends BaseAPI {
1882
2273
  */
1883
2274
  const QuoteApiAxiosParamCreator = function (configuration) {
1884
2275
  return {
2276
+ /**
2277
+ * Provide a quote estimate for the provided loan close.
2278
+ * @param {number} [height] optional block height, defaults to current tip
2279
+ * @param {string} [asset] the asset used to repay the loan
2280
+ * @param {number} [amount] the asset amount in 1e8 decimals
2281
+ * @param {string} [loanAsset] the collateral asset of the loan
2282
+ * @param {string} [loanOwner] the owner of the loan collateral
2283
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2284
+ * @param {*} [options] Override http request option.
2285
+ * @throws {RequiredError}
2286
+ */
2287
+ quoteloanclose: (height, asset, amount, loanAsset, loanOwner, minOut, options = {}) => __awaiter(this, void 0, void 0, function* () {
2288
+ const localVarPath = `/thorchain/quote/loan/close`;
2289
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2290
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2291
+ let baseOptions;
2292
+ if (configuration) {
2293
+ baseOptions = configuration.baseOptions;
2294
+ }
2295
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2296
+ const localVarHeaderParameter = {};
2297
+ const localVarQueryParameter = {};
2298
+ if (height !== undefined) {
2299
+ localVarQueryParameter['height'] = height;
2300
+ }
2301
+ if (asset !== undefined) {
2302
+ localVarQueryParameter['asset'] = asset;
2303
+ }
2304
+ if (amount !== undefined) {
2305
+ localVarQueryParameter['amount'] = amount;
2306
+ }
2307
+ if (loanAsset !== undefined) {
2308
+ localVarQueryParameter['loan_asset'] = loanAsset;
2309
+ }
2310
+ if (loanOwner !== undefined) {
2311
+ localVarQueryParameter['loan_owner'] = loanOwner;
2312
+ }
2313
+ if (minOut !== undefined) {
2314
+ localVarQueryParameter['min_out'] = minOut;
2315
+ }
2316
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2317
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2318
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2319
+ return {
2320
+ url: toPathString(localVarUrlObj),
2321
+ options: localVarRequestOptions,
2322
+ };
2323
+ }),
2324
+ /**
2325
+ * Provide a quote estimate for the provided loan open.
2326
+ * @param {number} [height] optional block height, defaults to current tip
2327
+ * @param {string} [asset] the collateral asset
2328
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2329
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2330
+ * @param {string} [destination] the destination address, required to generate memo
2331
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2332
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2333
+ * @param {string} [affiliate] the affiliate (address or thorname)
2334
+ * @param {*} [options] Override http request option.
2335
+ * @throws {RequiredError}
2336
+ */
2337
+ quoteloanopen: (height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2338
+ const localVarPath = `/thorchain/quote/loan/open`;
2339
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2340
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2341
+ let baseOptions;
2342
+ if (configuration) {
2343
+ baseOptions = configuration.baseOptions;
2344
+ }
2345
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2346
+ const localVarHeaderParameter = {};
2347
+ const localVarQueryParameter = {};
2348
+ if (height !== undefined) {
2349
+ localVarQueryParameter['height'] = height;
2350
+ }
2351
+ if (asset !== undefined) {
2352
+ localVarQueryParameter['asset'] = asset;
2353
+ }
2354
+ if (amount !== undefined) {
2355
+ localVarQueryParameter['amount'] = amount;
2356
+ }
2357
+ if (targetAsset !== undefined) {
2358
+ localVarQueryParameter['target_asset'] = targetAsset;
2359
+ }
2360
+ if (destination !== undefined) {
2361
+ localVarQueryParameter['destination'] = destination;
2362
+ }
2363
+ if (minOut !== undefined) {
2364
+ localVarQueryParameter['min_out'] = minOut;
2365
+ }
2366
+ if (affiliateBps !== undefined) {
2367
+ localVarQueryParameter['affiliate_bps'] = affiliateBps;
2368
+ }
2369
+ if (affiliate !== undefined) {
2370
+ localVarQueryParameter['affiliate'] = affiliate;
2371
+ }
2372
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2373
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2374
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2375
+ return {
2376
+ url: toPathString(localVarUrlObj),
2377
+ options: localVarRequestOptions,
2378
+ };
2379
+ }),
1885
2380
  /**
1886
2381
  * Provide a quote estimate for the provided saver deposit.
1887
2382
  * @param {number} [height] optional block height, defaults to current tip
@@ -2027,6 +2522,42 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2027
2522
  const QuoteApiFp = function (configuration) {
2028
2523
  const localVarAxiosParamCreator = QuoteApiAxiosParamCreator(configuration);
2029
2524
  return {
2525
+ /**
2526
+ * Provide a quote estimate for the provided loan close.
2527
+ * @param {number} [height] optional block height, defaults to current tip
2528
+ * @param {string} [asset] the asset used to repay the loan
2529
+ * @param {number} [amount] the asset amount in 1e8 decimals
2530
+ * @param {string} [loanAsset] the collateral asset of the loan
2531
+ * @param {string} [loanOwner] the owner of the loan collateral
2532
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2533
+ * @param {*} [options] Override http request option.
2534
+ * @throws {RequiredError}
2535
+ */
2536
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2537
+ return __awaiter(this, void 0, void 0, function* () {
2538
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options);
2539
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2540
+ });
2541
+ },
2542
+ /**
2543
+ * Provide a quote estimate for the provided loan open.
2544
+ * @param {number} [height] optional block height, defaults to current tip
2545
+ * @param {string} [asset] the collateral asset
2546
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2547
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2548
+ * @param {string} [destination] the destination address, required to generate memo
2549
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2550
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2551
+ * @param {string} [affiliate] the affiliate (address or thorname)
2552
+ * @param {*} [options] Override http request option.
2553
+ * @throws {RequiredError}
2554
+ */
2555
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2556
+ return __awaiter(this, void 0, void 0, function* () {
2557
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options);
2558
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2559
+ });
2560
+ },
2030
2561
  /**
2031
2562
  * Provide a quote estimate for the provided saver deposit.
2032
2563
  * @param {number} [height] optional block height, defaults to current tip
@@ -2085,6 +2616,36 @@ const QuoteApiFp = function (configuration) {
2085
2616
  const QuoteApiFactory = function (configuration, basePath, axios) {
2086
2617
  const localVarFp = QuoteApiFp(configuration);
2087
2618
  return {
2619
+ /**
2620
+ * Provide a quote estimate for the provided loan close.
2621
+ * @param {number} [height] optional block height, defaults to current tip
2622
+ * @param {string} [asset] the asset used to repay the loan
2623
+ * @param {number} [amount] the asset amount in 1e8 decimals
2624
+ * @param {string} [loanAsset] the collateral asset of the loan
2625
+ * @param {string} [loanOwner] the owner of the loan collateral
2626
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2627
+ * @param {*} [options] Override http request option.
2628
+ * @throws {RequiredError}
2629
+ */
2630
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2631
+ return localVarFp.quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options).then((request) => request(axios, basePath));
2632
+ },
2633
+ /**
2634
+ * Provide a quote estimate for the provided loan open.
2635
+ * @param {number} [height] optional block height, defaults to current tip
2636
+ * @param {string} [asset] the collateral asset
2637
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2638
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2639
+ * @param {string} [destination] the destination address, required to generate memo
2640
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2641
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2642
+ * @param {string} [affiliate] the affiliate (address or thorname)
2643
+ * @param {*} [options] Override http request option.
2644
+ * @throws {RequiredError}
2645
+ */
2646
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2647
+ return localVarFp.quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2648
+ },
2088
2649
  /**
2089
2650
  * Provide a quote estimate for the provided saver deposit.
2090
2651
  * @param {number} [height] optional block height, defaults to current tip
@@ -2134,6 +2695,38 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
2134
2695
  * @extends {BaseAPI}
2135
2696
  */
2136
2697
  class QuoteApi extends BaseAPI {
2698
+ /**
2699
+ * Provide a quote estimate for the provided loan close.
2700
+ * @param {number} [height] optional block height, defaults to current tip
2701
+ * @param {string} [asset] the asset used to repay the loan
2702
+ * @param {number} [amount] the asset amount in 1e8 decimals
2703
+ * @param {string} [loanAsset] the collateral asset of the loan
2704
+ * @param {string} [loanOwner] the owner of the loan collateral
2705
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2706
+ * @param {*} [options] Override http request option.
2707
+ * @throws {RequiredError}
2708
+ * @memberof QuoteApi
2709
+ */
2710
+ quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options) {
2711
+ return QuoteApiFp(this.configuration).quoteloanclose(height, asset, amount, loanAsset, loanOwner, minOut, options).then((request) => request(this.axios, this.basePath));
2712
+ }
2713
+ /**
2714
+ * Provide a quote estimate for the provided loan open.
2715
+ * @param {number} [height] optional block height, defaults to current tip
2716
+ * @param {string} [asset] the collateral asset
2717
+ * @param {number} [amount] the collateral asset amount in 1e8 decimals
2718
+ * @param {string} [targetAsset] the target asset to receive (loan denominated in TOR regardless)
2719
+ * @param {string} [destination] the destination address, required to generate memo
2720
+ * @param {string} [minOut] the minimum amount of the target asset to accept
2721
+ * @param {number} [affiliateBps] the affiliate fee in basis points
2722
+ * @param {string} [affiliate] the affiliate (address or thorname)
2723
+ * @param {*} [options] Override http request option.
2724
+ * @throws {RequiredError}
2725
+ * @memberof QuoteApi
2726
+ */
2727
+ quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options) {
2728
+ return QuoteApiFp(this.configuration).quoteloanopen(height, asset, amount, targetAsset, destination, minOut, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
2729
+ }
2137
2730
  /**
2138
2731
  * Provide a quote estimate for the provided saver deposit.
2139
2732
  * @param {number} [height] optional block height, defaults to current tip
@@ -3143,7 +3736,7 @@ const VaultsApiAxiosParamCreator = function (configuration) {
3143
3736
  vault: (pubkey, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
3144
3737
  // verify required parameter 'pubkey' is not null or undefined
3145
3738
  assertParamExists('vault', 'pubkey', pubkey);
3146
- const localVarPath = `/thorchain/vaults/{pubkey}`
3739
+ const localVarPath = `/thorchain/vault/{pubkey}`
3147
3740
  .replace(`{${"pubkey"}}`, encodeURIComponent(String(pubkey)));
3148
3741
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
3149
3742
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -3383,7 +3976,7 @@ class VaultsApi extends BaseAPI {
3383
3976
  * Thornode API
3384
3977
  * Thornode REST API.
3385
3978
  *
3386
- * The version of the OpenAPI document: 1.105.0
3979
+ * The version of the OpenAPI document: 1.108.3
3387
3980
  * Contact: devs@thorchain.org
3388
3981
  *
3389
3982
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -3418,4 +4011,4 @@ class Configuration {
3418
4011
 
3419
4012
  const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
3420
4013
 
3421
- export { Configuration, HealthApi, HealthApiAxiosParamCreator, HealthApiFactory, HealthApiFp, LiquidityProvidersApi, LiquidityProvidersApiAxiosParamCreator, LiquidityProvidersApiFactory, LiquidityProvidersApiFp, MimirApi, MimirApiAxiosParamCreator, MimirApiFactory, MimirApiFp, NetworkApi, NetworkApiAxiosParamCreator, NetworkApiFactory, NetworkApiFp, NodeStatusEnum, NodesApi, NodesApiAxiosParamCreator, NodesApiFactory, NodesApiFp, ObservedTxStatusEnum, POLApi, POLApiAxiosParamCreator, POLApiFactory, POLApiFp, PoolsApi, PoolsApiAxiosParamCreator, PoolsApiFactory, PoolsApiFp, QueueApi, QueueApiAxiosParamCreator, QueueApiFactory, QueueApiFp, QuoteApi, QuoteApiAxiosParamCreator, QuoteApiFactory, QuoteApiFp, SaversApi, SaversApiAxiosParamCreator, SaversApiFactory, SaversApiFp, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };
4014
+ export { BorrowersApi, BorrowersApiAxiosParamCreator, BorrowersApiFactory, BorrowersApiFp, Configuration, HealthApi, HealthApiAxiosParamCreator, HealthApiFactory, HealthApiFp, InvariantsApi, InvariantsApiAxiosParamCreator, InvariantsApiFactory, InvariantsApiFp, LiquidityProvidersApi, LiquidityProvidersApiAxiosParamCreator, LiquidityProvidersApiFactory, LiquidityProvidersApiFp, MimirApi, MimirApiAxiosParamCreator, MimirApiFactory, MimirApiFp, NetworkApi, NetworkApiAxiosParamCreator, NetworkApiFactory, NetworkApiFp, NodeStatusEnum, NodesApi, NodesApiAxiosParamCreator, NodesApiFactory, NodesApiFp, ObservedTxStatusEnum, POLApi, POLApiAxiosParamCreator, POLApiFactory, POLApiFp, PoolsApi, PoolsApiAxiosParamCreator, PoolsApiFactory, PoolsApiFp, QueueApi, QueueApiAxiosParamCreator, QueueApiFactory, QueueApiFp, QuoteApi, QuoteApiAxiosParamCreator, QuoteApiFactory, QuoteApiFp, SaversApi, SaversApiAxiosParamCreator, SaversApiFactory, SaversApiFp, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };