@xchainjs/xchain-thornode 0.1.0-alpha4 → 0.1.1
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/generated/thornodeApi/api.d.ts +420 -72
- package/lib/generated/thornodeApi/base.d.ts +1 -1
- package/lib/generated/thornodeApi/common.d.ts +1 -1
- package/lib/generated/thornodeApi/configuration.d.ts +1 -1
- package/lib/generated/thornodeApi/index.d.ts +1 -1
- package/lib/index.esm.js +194 -15
- package/lib/index.js +197 -14
- package/package.json +2 -2
- package/CHANGELOG.md +0 -21
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Thornode API
|
|
3
3
|
* Thornode REST API.
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.98.0
|
|
6
6
|
* Contact: devs@thorchain.org
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Thornode API
|
|
3
3
|
* Thornode REST API.
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.98.0
|
|
6
6
|
* Contact: devs@thorchain.org
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Thornode API
|
|
3
3
|
* Thornode REST API.
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.98.0
|
|
6
6
|
* Contact: devs@thorchain.org
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Thornode API
|
|
3
3
|
* Thornode REST API.
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.98.0
|
|
6
6
|
* Contact: devs@thorchain.org
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/lib/index.esm.js
CHANGED
|
@@ -72,25 +72,31 @@ const assertParamExists = function (functionName, paramName, paramValue) {
|
|
|
72
72
|
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
76
|
+
if (typeof parameter === "object") {
|
|
77
|
+
if (Array.isArray(parameter)) {
|
|
78
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (urlSearchParams.has(key)) {
|
|
86
|
+
urlSearchParams.append(key, parameter);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
urlSearchParams.set(key, parameter);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
75
93
|
/**
|
|
76
94
|
*
|
|
77
95
|
* @export
|
|
78
96
|
*/
|
|
79
97
|
const setSearchParams = function (url, ...objects) {
|
|
80
98
|
const searchParams = new URLSearchParams(url.search);
|
|
81
|
-
|
|
82
|
-
for (const key in object) {
|
|
83
|
-
if (Array.isArray(object[key])) {
|
|
84
|
-
searchParams.delete(key);
|
|
85
|
-
for (const item of object[key]) {
|
|
86
|
-
searchParams.append(key, item);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
searchParams.set(key, object[key]);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
99
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
94
100
|
url.search = searchParams.toString();
|
|
95
101
|
};
|
|
96
102
|
/**
|
|
@@ -1870,6 +1876,179 @@ class QueueApi extends BaseAPI {
|
|
|
1870
1876
|
return QueueApiFp(this.configuration).queueScheduled(height, options).then((request) => request(this.axios, this.basePath));
|
|
1871
1877
|
}
|
|
1872
1878
|
}
|
|
1879
|
+
/**
|
|
1880
|
+
* SaversApi - axios parameter creator
|
|
1881
|
+
* @export
|
|
1882
|
+
*/
|
|
1883
|
+
const SaversApiAxiosParamCreator = function (configuration) {
|
|
1884
|
+
return {
|
|
1885
|
+
/**
|
|
1886
|
+
* Returns the saver position given then savers pool and address.
|
|
1887
|
+
* @param {string} asset
|
|
1888
|
+
* @param {string} address
|
|
1889
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1890
|
+
* @param {*} [options] Override http request option.
|
|
1891
|
+
* @throws {RequiredError}
|
|
1892
|
+
*/
|
|
1893
|
+
saver: (asset, address, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1894
|
+
// verify required parameter 'asset' is not null or undefined
|
|
1895
|
+
assertParamExists('saver', 'asset', asset);
|
|
1896
|
+
// verify required parameter 'address' is not null or undefined
|
|
1897
|
+
assertParamExists('saver', 'address', address);
|
|
1898
|
+
const localVarPath = `/thorchain/pool/{asset}/saver/{address}`
|
|
1899
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)))
|
|
1900
|
+
.replace(`{${"address"}}`, encodeURIComponent(String(address)));
|
|
1901
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1902
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1903
|
+
let baseOptions;
|
|
1904
|
+
if (configuration) {
|
|
1905
|
+
baseOptions = configuration.baseOptions;
|
|
1906
|
+
}
|
|
1907
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1908
|
+
const localVarHeaderParameter = {};
|
|
1909
|
+
const localVarQueryParameter = {};
|
|
1910
|
+
if (height !== undefined) {
|
|
1911
|
+
localVarQueryParameter['height'] = height;
|
|
1912
|
+
}
|
|
1913
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1914
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1915
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1916
|
+
return {
|
|
1917
|
+
url: toPathString(localVarUrlObj),
|
|
1918
|
+
options: localVarRequestOptions,
|
|
1919
|
+
};
|
|
1920
|
+
}),
|
|
1921
|
+
/**
|
|
1922
|
+
* Returns all savers for the savers pool.
|
|
1923
|
+
* @param {string} asset
|
|
1924
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1925
|
+
* @param {*} [options] Override http request option.
|
|
1926
|
+
* @throws {RequiredError}
|
|
1927
|
+
*/
|
|
1928
|
+
savers: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1929
|
+
// verify required parameter 'asset' is not null or undefined
|
|
1930
|
+
assertParamExists('savers', 'asset', asset);
|
|
1931
|
+
const localVarPath = `/thorchain/pool/{asset}/savers`
|
|
1932
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
|
|
1933
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1934
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1935
|
+
let baseOptions;
|
|
1936
|
+
if (configuration) {
|
|
1937
|
+
baseOptions = configuration.baseOptions;
|
|
1938
|
+
}
|
|
1939
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1940
|
+
const localVarHeaderParameter = {};
|
|
1941
|
+
const localVarQueryParameter = {};
|
|
1942
|
+
if (height !== undefined) {
|
|
1943
|
+
localVarQueryParameter['height'] = height;
|
|
1944
|
+
}
|
|
1945
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1946
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1947
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1948
|
+
return {
|
|
1949
|
+
url: toPathString(localVarUrlObj),
|
|
1950
|
+
options: localVarRequestOptions,
|
|
1951
|
+
};
|
|
1952
|
+
}),
|
|
1953
|
+
};
|
|
1954
|
+
};
|
|
1955
|
+
/**
|
|
1956
|
+
* SaversApi - functional programming interface
|
|
1957
|
+
* @export
|
|
1958
|
+
*/
|
|
1959
|
+
const SaversApiFp = function (configuration) {
|
|
1960
|
+
const localVarAxiosParamCreator = SaversApiAxiosParamCreator(configuration);
|
|
1961
|
+
return {
|
|
1962
|
+
/**
|
|
1963
|
+
* Returns the saver position given then savers pool and address.
|
|
1964
|
+
* @param {string} asset
|
|
1965
|
+
* @param {string} address
|
|
1966
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1967
|
+
* @param {*} [options] Override http request option.
|
|
1968
|
+
* @throws {RequiredError}
|
|
1969
|
+
*/
|
|
1970
|
+
saver(asset, address, height, options) {
|
|
1971
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1972
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.saver(asset, address, height, options);
|
|
1973
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
1974
|
+
});
|
|
1975
|
+
},
|
|
1976
|
+
/**
|
|
1977
|
+
* Returns all savers for the savers pool.
|
|
1978
|
+
* @param {string} asset
|
|
1979
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1980
|
+
* @param {*} [options] Override http request option.
|
|
1981
|
+
* @throws {RequiredError}
|
|
1982
|
+
*/
|
|
1983
|
+
savers(asset, height, options) {
|
|
1984
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1985
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.savers(asset, height, options);
|
|
1986
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
1987
|
+
});
|
|
1988
|
+
},
|
|
1989
|
+
};
|
|
1990
|
+
};
|
|
1991
|
+
/**
|
|
1992
|
+
* SaversApi - factory interface
|
|
1993
|
+
* @export
|
|
1994
|
+
*/
|
|
1995
|
+
const SaversApiFactory = function (configuration, basePath, axios) {
|
|
1996
|
+
const localVarFp = SaversApiFp(configuration);
|
|
1997
|
+
return {
|
|
1998
|
+
/**
|
|
1999
|
+
* Returns the saver position given then savers pool and address.
|
|
2000
|
+
* @param {string} asset
|
|
2001
|
+
* @param {string} address
|
|
2002
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2003
|
+
* @param {*} [options] Override http request option.
|
|
2004
|
+
* @throws {RequiredError}
|
|
2005
|
+
*/
|
|
2006
|
+
saver(asset, address, height, options) {
|
|
2007
|
+
return localVarFp.saver(asset, address, height, options).then((request) => request(axios, basePath));
|
|
2008
|
+
},
|
|
2009
|
+
/**
|
|
2010
|
+
* Returns all savers for the savers pool.
|
|
2011
|
+
* @param {string} asset
|
|
2012
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2013
|
+
* @param {*} [options] Override http request option.
|
|
2014
|
+
* @throws {RequiredError}
|
|
2015
|
+
*/
|
|
2016
|
+
savers(asset, height, options) {
|
|
2017
|
+
return localVarFp.savers(asset, height, options).then((request) => request(axios, basePath));
|
|
2018
|
+
},
|
|
2019
|
+
};
|
|
2020
|
+
};
|
|
2021
|
+
/**
|
|
2022
|
+
* SaversApi - object-oriented interface
|
|
2023
|
+
* @export
|
|
2024
|
+
* @class SaversApi
|
|
2025
|
+
* @extends {BaseAPI}
|
|
2026
|
+
*/
|
|
2027
|
+
class SaversApi extends BaseAPI {
|
|
2028
|
+
/**
|
|
2029
|
+
* Returns the saver position given then savers pool and address.
|
|
2030
|
+
* @param {string} asset
|
|
2031
|
+
* @param {string} address
|
|
2032
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2033
|
+
* @param {*} [options] Override http request option.
|
|
2034
|
+
* @throws {RequiredError}
|
|
2035
|
+
* @memberof SaversApi
|
|
2036
|
+
*/
|
|
2037
|
+
saver(asset, address, height, options) {
|
|
2038
|
+
return SaversApiFp(this.configuration).saver(asset, address, height, options).then((request) => request(this.axios, this.basePath));
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* Returns all savers for the savers pool.
|
|
2042
|
+
* @param {string} asset
|
|
2043
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2044
|
+
* @param {*} [options] Override http request option.
|
|
2045
|
+
* @throws {RequiredError}
|
|
2046
|
+
* @memberof SaversApi
|
|
2047
|
+
*/
|
|
2048
|
+
savers(asset, height, options) {
|
|
2049
|
+
return SaversApiFp(this.configuration).savers(asset, height, options).then((request) => request(this.axios, this.basePath));
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
1873
2052
|
/**
|
|
1874
2053
|
* TSSApi - axios parameter creator
|
|
1875
2054
|
* @export
|
|
@@ -2704,7 +2883,7 @@ class VaultsApi extends BaseAPI {
|
|
|
2704
2883
|
* Thornode API
|
|
2705
2884
|
* Thornode REST API.
|
|
2706
2885
|
*
|
|
2707
|
-
* The version of the OpenAPI document: 1.
|
|
2886
|
+
* The version of the OpenAPI document: 1.98.0
|
|
2708
2887
|
* Contact: devs@thorchain.org
|
|
2709
2888
|
*
|
|
2710
2889
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2739,4 +2918,4 @@ class Configuration {
|
|
|
2739
2918
|
|
|
2740
2919
|
const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
|
|
2741
2920
|
|
|
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 };
|
|
2921
|
+
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, 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 };
|
package/lib/index.js
CHANGED
|
@@ -80,25 +80,31 @@ const assertParamExists = function (functionName, paramName, paramValue) {
|
|
|
80
80
|
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
84
|
+
if (typeof parameter === "object") {
|
|
85
|
+
if (Array.isArray(parameter)) {
|
|
86
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
if (urlSearchParams.has(key)) {
|
|
94
|
+
urlSearchParams.append(key, parameter);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
urlSearchParams.set(key, parameter);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
83
101
|
/**
|
|
84
102
|
*
|
|
85
103
|
* @export
|
|
86
104
|
*/
|
|
87
105
|
const setSearchParams = function (url, ...objects) {
|
|
88
106
|
const searchParams = new URLSearchParams(url.search);
|
|
89
|
-
|
|
90
|
-
for (const key in object) {
|
|
91
|
-
if (Array.isArray(object[key])) {
|
|
92
|
-
searchParams.delete(key);
|
|
93
|
-
for (const item of object[key]) {
|
|
94
|
-
searchParams.append(key, item);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
searchParams.set(key, object[key]);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
107
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
102
108
|
url.search = searchParams.toString();
|
|
103
109
|
};
|
|
104
110
|
/**
|
|
@@ -1878,6 +1884,179 @@ class QueueApi extends BaseAPI {
|
|
|
1878
1884
|
return QueueApiFp(this.configuration).queueScheduled(height, options).then((request) => request(this.axios, this.basePath));
|
|
1879
1885
|
}
|
|
1880
1886
|
}
|
|
1887
|
+
/**
|
|
1888
|
+
* SaversApi - axios parameter creator
|
|
1889
|
+
* @export
|
|
1890
|
+
*/
|
|
1891
|
+
const SaversApiAxiosParamCreator = function (configuration) {
|
|
1892
|
+
return {
|
|
1893
|
+
/**
|
|
1894
|
+
* Returns the saver position given then savers pool and address.
|
|
1895
|
+
* @param {string} asset
|
|
1896
|
+
* @param {string} address
|
|
1897
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1898
|
+
* @param {*} [options] Override http request option.
|
|
1899
|
+
* @throws {RequiredError}
|
|
1900
|
+
*/
|
|
1901
|
+
saver: (asset, address, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1902
|
+
// verify required parameter 'asset' is not null or undefined
|
|
1903
|
+
assertParamExists('saver', 'asset', asset);
|
|
1904
|
+
// verify required parameter 'address' is not null or undefined
|
|
1905
|
+
assertParamExists('saver', 'address', address);
|
|
1906
|
+
const localVarPath = `/thorchain/pool/{asset}/saver/{address}`
|
|
1907
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)))
|
|
1908
|
+
.replace(`{${"address"}}`, encodeURIComponent(String(address)));
|
|
1909
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1910
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1911
|
+
let baseOptions;
|
|
1912
|
+
if (configuration) {
|
|
1913
|
+
baseOptions = configuration.baseOptions;
|
|
1914
|
+
}
|
|
1915
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1916
|
+
const localVarHeaderParameter = {};
|
|
1917
|
+
const localVarQueryParameter = {};
|
|
1918
|
+
if (height !== undefined) {
|
|
1919
|
+
localVarQueryParameter['height'] = height;
|
|
1920
|
+
}
|
|
1921
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1922
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1923
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1924
|
+
return {
|
|
1925
|
+
url: toPathString(localVarUrlObj),
|
|
1926
|
+
options: localVarRequestOptions,
|
|
1927
|
+
};
|
|
1928
|
+
}),
|
|
1929
|
+
/**
|
|
1930
|
+
* Returns all savers for the savers pool.
|
|
1931
|
+
* @param {string} asset
|
|
1932
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1933
|
+
* @param {*} [options] Override http request option.
|
|
1934
|
+
* @throws {RequiredError}
|
|
1935
|
+
*/
|
|
1936
|
+
savers: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1937
|
+
// verify required parameter 'asset' is not null or undefined
|
|
1938
|
+
assertParamExists('savers', 'asset', asset);
|
|
1939
|
+
const localVarPath = `/thorchain/pool/{asset}/savers`
|
|
1940
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
|
|
1941
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1942
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1943
|
+
let baseOptions;
|
|
1944
|
+
if (configuration) {
|
|
1945
|
+
baseOptions = configuration.baseOptions;
|
|
1946
|
+
}
|
|
1947
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
1948
|
+
const localVarHeaderParameter = {};
|
|
1949
|
+
const localVarQueryParameter = {};
|
|
1950
|
+
if (height !== undefined) {
|
|
1951
|
+
localVarQueryParameter['height'] = height;
|
|
1952
|
+
}
|
|
1953
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1954
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1955
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1956
|
+
return {
|
|
1957
|
+
url: toPathString(localVarUrlObj),
|
|
1958
|
+
options: localVarRequestOptions,
|
|
1959
|
+
};
|
|
1960
|
+
}),
|
|
1961
|
+
};
|
|
1962
|
+
};
|
|
1963
|
+
/**
|
|
1964
|
+
* SaversApi - functional programming interface
|
|
1965
|
+
* @export
|
|
1966
|
+
*/
|
|
1967
|
+
const SaversApiFp = function (configuration) {
|
|
1968
|
+
const localVarAxiosParamCreator = SaversApiAxiosParamCreator(configuration);
|
|
1969
|
+
return {
|
|
1970
|
+
/**
|
|
1971
|
+
* Returns the saver position given then savers pool and address.
|
|
1972
|
+
* @param {string} asset
|
|
1973
|
+
* @param {string} address
|
|
1974
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1975
|
+
* @param {*} [options] Override http request option.
|
|
1976
|
+
* @throws {RequiredError}
|
|
1977
|
+
*/
|
|
1978
|
+
saver(asset, address, height, options) {
|
|
1979
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1980
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.saver(asset, address, height, options);
|
|
1981
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
|
|
1982
|
+
});
|
|
1983
|
+
},
|
|
1984
|
+
/**
|
|
1985
|
+
* Returns all savers for the savers pool.
|
|
1986
|
+
* @param {string} asset
|
|
1987
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1988
|
+
* @param {*} [options] Override http request option.
|
|
1989
|
+
* @throws {RequiredError}
|
|
1990
|
+
*/
|
|
1991
|
+
savers(asset, height, options) {
|
|
1992
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1993
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.savers(asset, height, options);
|
|
1994
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
|
|
1995
|
+
});
|
|
1996
|
+
},
|
|
1997
|
+
};
|
|
1998
|
+
};
|
|
1999
|
+
/**
|
|
2000
|
+
* SaversApi - factory interface
|
|
2001
|
+
* @export
|
|
2002
|
+
*/
|
|
2003
|
+
const SaversApiFactory = function (configuration, basePath, axios) {
|
|
2004
|
+
const localVarFp = SaversApiFp(configuration);
|
|
2005
|
+
return {
|
|
2006
|
+
/**
|
|
2007
|
+
* Returns the saver position given then savers pool and address.
|
|
2008
|
+
* @param {string} asset
|
|
2009
|
+
* @param {string} address
|
|
2010
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2011
|
+
* @param {*} [options] Override http request option.
|
|
2012
|
+
* @throws {RequiredError}
|
|
2013
|
+
*/
|
|
2014
|
+
saver(asset, address, height, options) {
|
|
2015
|
+
return localVarFp.saver(asset, address, height, options).then((request) => request(axios, basePath));
|
|
2016
|
+
},
|
|
2017
|
+
/**
|
|
2018
|
+
* Returns all savers for the savers pool.
|
|
2019
|
+
* @param {string} asset
|
|
2020
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2021
|
+
* @param {*} [options] Override http request option.
|
|
2022
|
+
* @throws {RequiredError}
|
|
2023
|
+
*/
|
|
2024
|
+
savers(asset, height, options) {
|
|
2025
|
+
return localVarFp.savers(asset, height, options).then((request) => request(axios, basePath));
|
|
2026
|
+
},
|
|
2027
|
+
};
|
|
2028
|
+
};
|
|
2029
|
+
/**
|
|
2030
|
+
* SaversApi - object-oriented interface
|
|
2031
|
+
* @export
|
|
2032
|
+
* @class SaversApi
|
|
2033
|
+
* @extends {BaseAPI}
|
|
2034
|
+
*/
|
|
2035
|
+
class SaversApi extends BaseAPI {
|
|
2036
|
+
/**
|
|
2037
|
+
* Returns the saver position given then savers pool and address.
|
|
2038
|
+
* @param {string} asset
|
|
2039
|
+
* @param {string} address
|
|
2040
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2041
|
+
* @param {*} [options] Override http request option.
|
|
2042
|
+
* @throws {RequiredError}
|
|
2043
|
+
* @memberof SaversApi
|
|
2044
|
+
*/
|
|
2045
|
+
saver(asset, address, height, options) {
|
|
2046
|
+
return SaversApiFp(this.configuration).saver(asset, address, height, options).then((request) => request(this.axios, this.basePath));
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Returns all savers for the savers pool.
|
|
2050
|
+
* @param {string} asset
|
|
2051
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
2052
|
+
* @param {*} [options] Override http request option.
|
|
2053
|
+
* @throws {RequiredError}
|
|
2054
|
+
* @memberof SaversApi
|
|
2055
|
+
*/
|
|
2056
|
+
savers(asset, height, options) {
|
|
2057
|
+
return SaversApiFp(this.configuration).savers(asset, height, options).then((request) => request(this.axios, this.basePath));
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
1881
2060
|
/**
|
|
1882
2061
|
* TSSApi - axios parameter creator
|
|
1883
2062
|
* @export
|
|
@@ -2712,7 +2891,7 @@ class VaultsApi extends BaseAPI {
|
|
|
2712
2891
|
* Thornode API
|
|
2713
2892
|
* Thornode REST API.
|
|
2714
2893
|
*
|
|
2715
|
-
* The version of the OpenAPI document: 1.
|
|
2894
|
+
* The version of the OpenAPI document: 1.98.0
|
|
2716
2895
|
* Contact: devs@thorchain.org
|
|
2717
2896
|
*
|
|
2718
2897
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2782,6 +2961,10 @@ exports.QueueApi = QueueApi;
|
|
|
2782
2961
|
exports.QueueApiAxiosParamCreator = QueueApiAxiosParamCreator;
|
|
2783
2962
|
exports.QueueApiFactory = QueueApiFactory;
|
|
2784
2963
|
exports.QueueApiFp = QueueApiFp;
|
|
2964
|
+
exports.SaversApi = SaversApi;
|
|
2965
|
+
exports.SaversApiAxiosParamCreator = SaversApiAxiosParamCreator;
|
|
2966
|
+
exports.SaversApiFactory = SaversApiFactory;
|
|
2967
|
+
exports.SaversApiFp = SaversApiFp;
|
|
2785
2968
|
exports.THORNODE_API_9R_URL = THORNODE_API_9R_URL;
|
|
2786
2969
|
exports.TSSApi = TSSApi;
|
|
2787
2970
|
exports.TSSApiAxiosParamCreator = TSSApiAxiosParamCreator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thornode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Thornode module that exposes all thornode functions using openapi-generator-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prepublishOnly": "yarn run build",
|
|
31
31
|
"test": "jest --passWithNoTests",
|
|
32
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.
|
|
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.98.0/openapi/openapi.yaml -g typescript-axios -o ./src/generated/thornodeApi --skip-validate-spec --generate-alias-as-model",
|
|
34
34
|
"clean:types:thornode": "rimraf ./src/generated/thornodeApi"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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
|