@xchainjs/xchain-thornode 0.1.0-alpha3 → 0.1.0-alpha4

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/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # v0.0.1.0-alpha4 (2022-08-20)
2
+
3
+ ## Update
4
+
5
+ - Update to latest THORNode 1.95.0
6
+ - Generate files from `*.yaml` (to avoid extra step of convertion to `*.json`)
7
+ - Remove `yamljs`
8
+
9
+ # v0.0.1.0-alpha3 (2022-07-21)
10
+
11
+ ???
12
+
13
+ # v0.0.1.0-alpha2 (2022-07-7)
14
+
15
+ ## Fix
16
+
17
+ - Fix `OutboundProcess and ScheduledOutbound` exported interfaces, by preprocessing yaml->json (https://github.com/OpenAPITools/openapi-generator/issues/1593)
18
+
19
+ # v0.0.1.0-alpha (2022-07-4)
20
+
21
+ ## Module Created
package/README.md CHANGED
@@ -4,10 +4,9 @@ Thornode Module for XChainJS Clients
4
4
 
5
5
  ## Modules
6
6
 
7
- Thornode module has been created using openapi-generator-cli to auto-generate rest api reading from "https://thornode.ninerealms.com/thorchain/doc/openapi.yaml"
7
+ Thornode module has been created using openapi-generator-cli to auto-generate rest api reading from "https://gitlab.com/thorchain/thornode/-/raw/release-{version}/openapi/openapi.yaml"
8
8
  This library exposes all the Api's outlined in the swagger doc "https://thornode.ninerealms.com/thorchain/doc"
9
9
 
10
-
11
10
  ## Installation
12
11
 
13
12
  ```
@@ -15,6 +14,7 @@ yarn add @xchainjs/xchain-thornode
15
14
  ```
16
15
 
17
16
  ## Examples
17
+
18
18
  Request data from MimirApi
19
19
 
20
20
  ```
@@ -692,6 +692,43 @@ export declare const ObservedTxStatusEnum: {
692
692
  readonly Incomplete: "incomplete";
693
693
  };
694
694
  export declare type ObservedTxStatusEnum = typeof ObservedTxStatusEnum[keyof typeof ObservedTxStatusEnum];
695
+ /**
696
+ *
697
+ * @export
698
+ * @interface POLResponse
699
+ */
700
+ export interface POLResponse {
701
+ /**
702
+ * total amount of RUNE deposited into the pools
703
+ * @type {string}
704
+ * @memberof POLResponse
705
+ */
706
+ 'rune_deposited': string;
707
+ /**
708
+ * total amount of RUNE withdrawn from the pools
709
+ * @type {string}
710
+ * @memberof POLResponse
711
+ */
712
+ 'rune_withdrawn': string;
713
+ /**
714
+ * total value of protocol\'s LP position in RUNE value
715
+ * @type {string}
716
+ * @memberof POLResponse
717
+ */
718
+ 'value': string;
719
+ /**
720
+ * profit and loss of protocol owned liquidity
721
+ * @type {string}
722
+ * @memberof POLResponse
723
+ */
724
+ 'pnl': string;
725
+ /**
726
+ * current amount of rune deposited
727
+ * @type {string}
728
+ * @memberof POLResponse
729
+ */
730
+ 'current_deposit': string;
731
+ }
695
732
  /**
696
733
  *
697
734
  * @export
@@ -1938,6 +1975,61 @@ export declare class NodesApi extends BaseAPI {
1938
1975
  */
1939
1976
  nodes(height?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<Node[], any>>;
1940
1977
  }
1978
+ /**
1979
+ * POLApi - axios parameter creator
1980
+ * @export
1981
+ */
1982
+ export declare const POLApiAxiosParamCreator: (configuration?: Configuration | undefined) => {
1983
+ /**
1984
+ * Returns protocol owned liquidity overview statistics.
1985
+ * @param {number} [height] optional block height, defaults to current tip
1986
+ * @param {*} [options] Override http request option.
1987
+ * @throws {RequiredError}
1988
+ */
1989
+ pol: (height?: number | undefined, options?: AxiosRequestConfig) => Promise<RequestArgs>;
1990
+ };
1991
+ /**
1992
+ * POLApi - functional programming interface
1993
+ * @export
1994
+ */
1995
+ export declare const POLApiFp: (configuration?: Configuration | undefined) => {
1996
+ /**
1997
+ * Returns protocol owned liquidity overview statistics.
1998
+ * @param {number} [height] optional block height, defaults to current tip
1999
+ * @param {*} [options] Override http request option.
2000
+ * @throws {RequiredError}
2001
+ */
2002
+ pol(height?: number | undefined, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<POLResponse>>;
2003
+ };
2004
+ /**
2005
+ * POLApi - factory interface
2006
+ * @export
2007
+ */
2008
+ export declare const POLApiFactory: (configuration?: Configuration | undefined, basePath?: string | undefined, axios?: AxiosInstance | undefined) => {
2009
+ /**
2010
+ * Returns protocol owned liquidity overview statistics.
2011
+ * @param {number} [height] optional block height, defaults to current tip
2012
+ * @param {*} [options] Override http request option.
2013
+ * @throws {RequiredError}
2014
+ */
2015
+ pol(height?: number | undefined, options?: any): AxiosPromise<POLResponse>;
2016
+ };
2017
+ /**
2018
+ * POLApi - object-oriented interface
2019
+ * @export
2020
+ * @class POLApi
2021
+ * @extends {BaseAPI}
2022
+ */
2023
+ export declare class POLApi extends BaseAPI {
2024
+ /**
2025
+ * Returns protocol owned liquidity overview statistics.
2026
+ * @param {number} [height] optional block height, defaults to current tip
2027
+ * @param {*} [options] Override http request option.
2028
+ * @throws {RequiredError}
2029
+ * @memberof POLApi
2030
+ */
2031
+ pol(height?: number, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<POLResponse, any>>;
2032
+ }
1941
2033
  /**
1942
2034
  * PoolsApi - axios parameter creator
1943
2035
  * @export
@@ -2194,7 +2286,7 @@ export declare const TSSApiFp: (configuration?: Configuration | undefined) => {
2194
2286
  * @param {*} [options] Override http request option.
2195
2287
  * @throws {RequiredError}
2196
2288
  */
2197
- keysignPubkey(height: number, pubkey: string, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<KeysignResponse>>;
2289
+ keysignPubkey(height: number, pubkey: string, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<void>>;
2198
2290
  /**
2199
2291
  * Returns keygen and keysign metrics for current vaults.
2200
2292
  * @param {number} [height] optional block height, defaults to current tip
@@ -2230,7 +2322,7 @@ export declare const TSSApiFactory: (configuration?: Configuration | undefined,
2230
2322
  * @param {*} [options] Override http request option.
2231
2323
  * @throws {RequiredError}
2232
2324
  */
2233
- keysignPubkey(height: number, pubkey: string, options?: any): AxiosPromise<KeysignResponse>;
2325
+ keysignPubkey(height: number, pubkey: string, options?: any): AxiosPromise<void>;
2234
2326
  /**
2235
2327
  * Returns keygen and keysign metrics for current vaults.
2236
2328
  * @param {number} [height] optional block height, defaults to current tip
@@ -2270,7 +2362,7 @@ export declare class TSSApi extends BaseAPI {
2270
2362
  * @throws {RequiredError}
2271
2363
  * @memberof TSSApi
2272
2364
  */
2273
- keysignPubkey(height: number, pubkey: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<KeysignResponse, any>>;
2365
+ keysignPubkey(height: number, pubkey: string, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
2274
2366
  /**
2275
2367
  * Returns keygen and keysign metrics for current vaults.
2276
2368
  * @param {number} [height] optional block height, defaults to current tip
package/lib/index.esm.js CHANGED
@@ -1407,6 +1407,99 @@ class NodesApi extends BaseAPI {
1407
1407
  return NodesApiFp(this.configuration).nodes(height, options).then((request) => request(this.axios, this.basePath));
1408
1408
  }
1409
1409
  }
1410
+ /**
1411
+ * POLApi - axios parameter creator
1412
+ * @export
1413
+ */
1414
+ const POLApiAxiosParamCreator = function (configuration) {
1415
+ return {
1416
+ /**
1417
+ * Returns protocol owned liquidity overview statistics.
1418
+ * @param {number} [height] optional block height, defaults to current tip
1419
+ * @param {*} [options] Override http request option.
1420
+ * @throws {RequiredError}
1421
+ */
1422
+ pol: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
1423
+ const localVarPath = `/thorchain/pol`;
1424
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1425
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1426
+ let baseOptions;
1427
+ if (configuration) {
1428
+ baseOptions = configuration.baseOptions;
1429
+ }
1430
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1431
+ const localVarHeaderParameter = {};
1432
+ const localVarQueryParameter = {};
1433
+ if (height !== undefined) {
1434
+ localVarQueryParameter['height'] = height;
1435
+ }
1436
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1437
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1438
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1439
+ return {
1440
+ url: toPathString(localVarUrlObj),
1441
+ options: localVarRequestOptions,
1442
+ };
1443
+ }),
1444
+ };
1445
+ };
1446
+ /**
1447
+ * POLApi - functional programming interface
1448
+ * @export
1449
+ */
1450
+ const POLApiFp = function (configuration) {
1451
+ const localVarAxiosParamCreator = POLApiAxiosParamCreator(configuration);
1452
+ return {
1453
+ /**
1454
+ * Returns protocol owned liquidity overview statistics.
1455
+ * @param {number} [height] optional block height, defaults to current tip
1456
+ * @param {*} [options] Override http request option.
1457
+ * @throws {RequiredError}
1458
+ */
1459
+ pol(height, options) {
1460
+ return __awaiter(this, void 0, void 0, function* () {
1461
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pol(height, options);
1462
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1463
+ });
1464
+ },
1465
+ };
1466
+ };
1467
+ /**
1468
+ * POLApi - factory interface
1469
+ * @export
1470
+ */
1471
+ const POLApiFactory = function (configuration, basePath, axios) {
1472
+ const localVarFp = POLApiFp(configuration);
1473
+ return {
1474
+ /**
1475
+ * Returns protocol owned liquidity overview statistics.
1476
+ * @param {number} [height] optional block height, defaults to current tip
1477
+ * @param {*} [options] Override http request option.
1478
+ * @throws {RequiredError}
1479
+ */
1480
+ pol(height, options) {
1481
+ return localVarFp.pol(height, options).then((request) => request(axios, basePath));
1482
+ },
1483
+ };
1484
+ };
1485
+ /**
1486
+ * POLApi - object-oriented interface
1487
+ * @export
1488
+ * @class POLApi
1489
+ * @extends {BaseAPI}
1490
+ */
1491
+ class POLApi extends BaseAPI {
1492
+ /**
1493
+ * Returns protocol owned liquidity overview statistics.
1494
+ * @param {number} [height] optional block height, defaults to current tip
1495
+ * @param {*} [options] Override http request option.
1496
+ * @throws {RequiredError}
1497
+ * @memberof POLApi
1498
+ */
1499
+ pol(height, options) {
1500
+ return POLApiFp(this.configuration).pol(height, options).then((request) => request(this.axios, this.basePath));
1501
+ }
1502
+ }
1410
1503
  /**
1411
1504
  * PoolsApi - axios parameter creator
1412
1505
  * @export
@@ -2646,4 +2739,4 @@ class Configuration {
2646
2739
 
2647
2740
  const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
2648
2741
 
2649
- export { Configuration, HealthApi, HealthApiAxiosParamCreator, HealthApiFactory, HealthApiFp, LiquidityProvidersApi, LiquidityProvidersApiAxiosParamCreator, LiquidityProvidersApiFactory, LiquidityProvidersApiFp, MimirApi, MimirApiAxiosParamCreator, MimirApiFactory, MimirApiFp, NetworkApi, NetworkApiAxiosParamCreator, NetworkApiFactory, NetworkApiFp, NodeStatusEnum, NodesApi, NodesApiAxiosParamCreator, NodesApiFactory, NodesApiFp, ObservedTxStatusEnum, PoolsApi, PoolsApiAxiosParamCreator, PoolsApiFactory, PoolsApiFp, QueueApi, QueueApiAxiosParamCreator, QueueApiFactory, QueueApiFp, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };
2742
+ 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, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };
package/lib/index.js CHANGED
@@ -1415,6 +1415,99 @@ class NodesApi extends BaseAPI {
1415
1415
  return NodesApiFp(this.configuration).nodes(height, options).then((request) => request(this.axios, this.basePath));
1416
1416
  }
1417
1417
  }
1418
+ /**
1419
+ * POLApi - axios parameter creator
1420
+ * @export
1421
+ */
1422
+ const POLApiAxiosParamCreator = function (configuration) {
1423
+ return {
1424
+ /**
1425
+ * Returns protocol owned liquidity overview statistics.
1426
+ * @param {number} [height] optional block height, defaults to current tip
1427
+ * @param {*} [options] Override http request option.
1428
+ * @throws {RequiredError}
1429
+ */
1430
+ pol: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
1431
+ const localVarPath = `/thorchain/pol`;
1432
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1433
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1434
+ let baseOptions;
1435
+ if (configuration) {
1436
+ baseOptions = configuration.baseOptions;
1437
+ }
1438
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1439
+ const localVarHeaderParameter = {};
1440
+ const localVarQueryParameter = {};
1441
+ if (height !== undefined) {
1442
+ localVarQueryParameter['height'] = height;
1443
+ }
1444
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1445
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1446
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1447
+ return {
1448
+ url: toPathString(localVarUrlObj),
1449
+ options: localVarRequestOptions,
1450
+ };
1451
+ }),
1452
+ };
1453
+ };
1454
+ /**
1455
+ * POLApi - functional programming interface
1456
+ * @export
1457
+ */
1458
+ const POLApiFp = function (configuration) {
1459
+ const localVarAxiosParamCreator = POLApiAxiosParamCreator(configuration);
1460
+ return {
1461
+ /**
1462
+ * Returns protocol owned liquidity overview statistics.
1463
+ * @param {number} [height] optional block height, defaults to current tip
1464
+ * @param {*} [options] Override http request option.
1465
+ * @throws {RequiredError}
1466
+ */
1467
+ pol(height, options) {
1468
+ return __awaiter(this, void 0, void 0, function* () {
1469
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.pol(height, options);
1470
+ return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
1471
+ });
1472
+ },
1473
+ };
1474
+ };
1475
+ /**
1476
+ * POLApi - factory interface
1477
+ * @export
1478
+ */
1479
+ const POLApiFactory = function (configuration, basePath, axios) {
1480
+ const localVarFp = POLApiFp(configuration);
1481
+ return {
1482
+ /**
1483
+ * Returns protocol owned liquidity overview statistics.
1484
+ * @param {number} [height] optional block height, defaults to current tip
1485
+ * @param {*} [options] Override http request option.
1486
+ * @throws {RequiredError}
1487
+ */
1488
+ pol(height, options) {
1489
+ return localVarFp.pol(height, options).then((request) => request(axios, basePath));
1490
+ },
1491
+ };
1492
+ };
1493
+ /**
1494
+ * POLApi - object-oriented interface
1495
+ * @export
1496
+ * @class POLApi
1497
+ * @extends {BaseAPI}
1498
+ */
1499
+ class POLApi extends BaseAPI {
1500
+ /**
1501
+ * Returns protocol owned liquidity overview statistics.
1502
+ * @param {number} [height] optional block height, defaults to current tip
1503
+ * @param {*} [options] Override http request option.
1504
+ * @throws {RequiredError}
1505
+ * @memberof POLApi
1506
+ */
1507
+ pol(height, options) {
1508
+ return POLApiFp(this.configuration).pol(height, options).then((request) => request(this.axios, this.basePath));
1509
+ }
1510
+ }
1418
1511
  /**
1419
1512
  * PoolsApi - axios parameter creator
1420
1513
  * @export
@@ -2677,6 +2770,10 @@ exports.NodesApiAxiosParamCreator = NodesApiAxiosParamCreator;
2677
2770
  exports.NodesApiFactory = NodesApiFactory;
2678
2771
  exports.NodesApiFp = NodesApiFp;
2679
2772
  exports.ObservedTxStatusEnum = ObservedTxStatusEnum;
2773
+ exports.POLApi = POLApi;
2774
+ exports.POLApiAxiosParamCreator = POLApiAxiosParamCreator;
2775
+ exports.POLApiFactory = POLApiFactory;
2776
+ exports.POLApiFp = POLApiFp;
2680
2777
  exports.PoolsApi = PoolsApi;
2681
2778
  exports.PoolsApiAxiosParamCreator = PoolsApiAxiosParamCreator;
2682
2779
  exports.PoolsApiFactory = PoolsApiFactory;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thornode",
3
- "version": "0.1.0-alpha3",
3
+ "version": "0.1.0-alpha4",
4
4
  "license": "MIT",
5
5
  "description": "Thornode module that exposes all thornode functions using openapi-generator-cli",
6
6
  "keywords": [
@@ -29,14 +29,11 @@
29
29
  "lint": "eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0",
30
30
  "prepublishOnly": "yarn run build",
31
31
  "test": "jest --passWithNoTests",
32
- "generate:types": "yarn clean:types:thornode && yarn generate:types:convertToJson && yarn generate:types:thornode && yarn clean:types:tempFiles",
33
- "generate:types:convertToJson": "curl 'https://gitlab.com/thorchain/thornode/-/raw/357456ea9e71cb2e846157b169bb5581b4075d0f/openapi/openapi.yaml' > ./input.yaml && yaml2json ./input.yaml --pretty > ./input.json",
34
- "generate:types:thornode": "TS_POST_PROCESS_FILE=./node_modules/.bin/prettier openapi-generator-cli generate -i ./input.json -g typescript-axios -o ./src/generated/thornodeApi --reserved-words-mappings in=in",
35
- "clean:types:tempFiles": "rimraf ./input.yaml ./input.json",
32
+ "generate:types": "yarn clean:types:thornode && yarn generate:types:thornode",
33
+ "generate:types:thornode": "TS_POST_PROCESS_FILE=./node_modules/.bin/prettier openapi-generator-cli generate -i https://gitlab.com/thorchain/thornode/-/raw/release-1.95.0/openapi/openapi.yaml -g typescript-axios -o ./src/generated/thornodeApi --skip-validate-spec",
36
34
  "clean:types:thornode": "rimraf ./src/generated/thornodeApi"
37
35
  },
38
36
  "devDependencies": {
39
- "yamljs": "^0.3.0",
40
37
  "@openapitools/openapi-generator-cli": "^2.5.1",
41
38
  "rimraf": "~3.0.2"
42
39
  },