@xchainjs/xchain-thornode 0.1.0-alpha4 → 0.1.0
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 +388 -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 +180 -15
- package/lib/index.js +183 -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.97.2
|
|
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.97.2
|
|
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.97.2
|
|
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.97.2
|
|
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
|
/**
|
|
@@ -126,6 +132,165 @@ const VaultTypeEnum = {
|
|
|
126
132
|
AsgardVault: 'AsgardVault',
|
|
127
133
|
YggdrasilVault: 'YggdrasilVault'
|
|
128
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* BucketsApi - axios parameter creator
|
|
137
|
+
* @export
|
|
138
|
+
*/
|
|
139
|
+
const BucketsApiAxiosParamCreator = function (configuration) {
|
|
140
|
+
return {
|
|
141
|
+
/**
|
|
142
|
+
* Returns the bucket information for the provided asset.
|
|
143
|
+
* @param {string} asset
|
|
144
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
145
|
+
* @param {*} [options] Override http request option.
|
|
146
|
+
* @throws {RequiredError}
|
|
147
|
+
*/
|
|
148
|
+
bucket: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
149
|
+
// verify required parameter 'asset' is not null or undefined
|
|
150
|
+
assertParamExists('bucket', 'asset', asset);
|
|
151
|
+
const localVarPath = `/thorchain/bucket/{asset}`
|
|
152
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
|
|
153
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
154
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
155
|
+
let baseOptions;
|
|
156
|
+
if (configuration) {
|
|
157
|
+
baseOptions = configuration.baseOptions;
|
|
158
|
+
}
|
|
159
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
160
|
+
const localVarHeaderParameter = {};
|
|
161
|
+
const localVarQueryParameter = {};
|
|
162
|
+
if (height !== undefined) {
|
|
163
|
+
localVarQueryParameter['height'] = height;
|
|
164
|
+
}
|
|
165
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
166
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
167
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
168
|
+
return {
|
|
169
|
+
url: toPathString(localVarUrlObj),
|
|
170
|
+
options: localVarRequestOptions,
|
|
171
|
+
};
|
|
172
|
+
}),
|
|
173
|
+
/**
|
|
174
|
+
* Returns the bucket information for all assets.
|
|
175
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
176
|
+
* @param {*} [options] Override http request option.
|
|
177
|
+
* @throws {RequiredError}
|
|
178
|
+
*/
|
|
179
|
+
buckets: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
const localVarPath = `/thorchain/buckets`;
|
|
181
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
182
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
183
|
+
let baseOptions;
|
|
184
|
+
if (configuration) {
|
|
185
|
+
baseOptions = configuration.baseOptions;
|
|
186
|
+
}
|
|
187
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
188
|
+
const localVarHeaderParameter = {};
|
|
189
|
+
const localVarQueryParameter = {};
|
|
190
|
+
if (height !== undefined) {
|
|
191
|
+
localVarQueryParameter['height'] = height;
|
|
192
|
+
}
|
|
193
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
194
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
195
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
196
|
+
return {
|
|
197
|
+
url: toPathString(localVarUrlObj),
|
|
198
|
+
options: localVarRequestOptions,
|
|
199
|
+
};
|
|
200
|
+
}),
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* BucketsApi - functional programming interface
|
|
205
|
+
* @export
|
|
206
|
+
*/
|
|
207
|
+
const BucketsApiFp = function (configuration) {
|
|
208
|
+
const localVarAxiosParamCreator = BucketsApiAxiosParamCreator(configuration);
|
|
209
|
+
return {
|
|
210
|
+
/**
|
|
211
|
+
* Returns the bucket information for the provided asset.
|
|
212
|
+
* @param {string} asset
|
|
213
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
214
|
+
* @param {*} [options] Override http request option.
|
|
215
|
+
* @throws {RequiredError}
|
|
216
|
+
*/
|
|
217
|
+
bucket(asset, height, options) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.bucket(asset, height, options);
|
|
220
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
/**
|
|
224
|
+
* Returns the bucket information for all assets.
|
|
225
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
226
|
+
* @param {*} [options] Override http request option.
|
|
227
|
+
* @throws {RequiredError}
|
|
228
|
+
*/
|
|
229
|
+
buckets(height, options) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.buckets(height, options);
|
|
232
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* BucketsApi - factory interface
|
|
239
|
+
* @export
|
|
240
|
+
*/
|
|
241
|
+
const BucketsApiFactory = function (configuration, basePath, axios) {
|
|
242
|
+
const localVarFp = BucketsApiFp(configuration);
|
|
243
|
+
return {
|
|
244
|
+
/**
|
|
245
|
+
* Returns the bucket information for the provided asset.
|
|
246
|
+
* @param {string} asset
|
|
247
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
248
|
+
* @param {*} [options] Override http request option.
|
|
249
|
+
* @throws {RequiredError}
|
|
250
|
+
*/
|
|
251
|
+
bucket(asset, height, options) {
|
|
252
|
+
return localVarFp.bucket(asset, height, options).then((request) => request(axios, basePath));
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Returns the bucket information for all assets.
|
|
256
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
257
|
+
* @param {*} [options] Override http request option.
|
|
258
|
+
* @throws {RequiredError}
|
|
259
|
+
*/
|
|
260
|
+
buckets(height, options) {
|
|
261
|
+
return localVarFp.buckets(height, options).then((request) => request(axios, basePath));
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* BucketsApi - object-oriented interface
|
|
267
|
+
* @export
|
|
268
|
+
* @class BucketsApi
|
|
269
|
+
* @extends {BaseAPI}
|
|
270
|
+
*/
|
|
271
|
+
class BucketsApi extends BaseAPI {
|
|
272
|
+
/**
|
|
273
|
+
* Returns the bucket information for the provided asset.
|
|
274
|
+
* @param {string} asset
|
|
275
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
276
|
+
* @param {*} [options] Override http request option.
|
|
277
|
+
* @throws {RequiredError}
|
|
278
|
+
* @memberof BucketsApi
|
|
279
|
+
*/
|
|
280
|
+
bucket(asset, height, options) {
|
|
281
|
+
return BucketsApiFp(this.configuration).bucket(asset, height, options).then((request) => request(this.axios, this.basePath));
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Returns the bucket information for all assets.
|
|
285
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
286
|
+
* @param {*} [options] Override http request option.
|
|
287
|
+
* @throws {RequiredError}
|
|
288
|
+
* @memberof BucketsApi
|
|
289
|
+
*/
|
|
290
|
+
buckets(height, options) {
|
|
291
|
+
return BucketsApiFp(this.configuration).buckets(height, options).then((request) => request(this.axios, this.basePath));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
129
294
|
/**
|
|
130
295
|
* HealthApi - axios parameter creator
|
|
131
296
|
* @export
|
|
@@ -2704,7 +2869,7 @@ class VaultsApi extends BaseAPI {
|
|
|
2704
2869
|
* Thornode API
|
|
2705
2870
|
* Thornode REST API.
|
|
2706
2871
|
*
|
|
2707
|
-
* The version of the OpenAPI document: 1.
|
|
2872
|
+
* The version of the OpenAPI document: 1.97.2
|
|
2708
2873
|
* Contact: devs@thorchain.org
|
|
2709
2874
|
*
|
|
2710
2875
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2739,4 +2904,4 @@ class Configuration {
|
|
|
2739
2904
|
|
|
2740
2905
|
const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
|
|
2741
2906
|
|
|
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 };
|
|
2907
|
+
export { BucketsApi, BucketsApiAxiosParamCreator, BucketsApiFactory, BucketsApiFp, 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
|
@@ -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
|
/**
|
|
@@ -134,6 +140,165 @@ const VaultTypeEnum = {
|
|
|
134
140
|
AsgardVault: 'AsgardVault',
|
|
135
141
|
YggdrasilVault: 'YggdrasilVault'
|
|
136
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* BucketsApi - axios parameter creator
|
|
145
|
+
* @export
|
|
146
|
+
*/
|
|
147
|
+
const BucketsApiAxiosParamCreator = function (configuration) {
|
|
148
|
+
return {
|
|
149
|
+
/**
|
|
150
|
+
* Returns the bucket information for the provided asset.
|
|
151
|
+
* @param {string} asset
|
|
152
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
153
|
+
* @param {*} [options] Override http request option.
|
|
154
|
+
* @throws {RequiredError}
|
|
155
|
+
*/
|
|
156
|
+
bucket: (asset, height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
// verify required parameter 'asset' is not null or undefined
|
|
158
|
+
assertParamExists('bucket', 'asset', asset);
|
|
159
|
+
const localVarPath = `/thorchain/bucket/{asset}`
|
|
160
|
+
.replace(`{${"asset"}}`, encodeURIComponent(String(asset)));
|
|
161
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
162
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
163
|
+
let baseOptions;
|
|
164
|
+
if (configuration) {
|
|
165
|
+
baseOptions = configuration.baseOptions;
|
|
166
|
+
}
|
|
167
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
168
|
+
const localVarHeaderParameter = {};
|
|
169
|
+
const localVarQueryParameter = {};
|
|
170
|
+
if (height !== undefined) {
|
|
171
|
+
localVarQueryParameter['height'] = height;
|
|
172
|
+
}
|
|
173
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
174
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
175
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
176
|
+
return {
|
|
177
|
+
url: toPathString(localVarUrlObj),
|
|
178
|
+
options: localVarRequestOptions,
|
|
179
|
+
};
|
|
180
|
+
}),
|
|
181
|
+
/**
|
|
182
|
+
* Returns the bucket information for all assets.
|
|
183
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
184
|
+
* @param {*} [options] Override http request option.
|
|
185
|
+
* @throws {RequiredError}
|
|
186
|
+
*/
|
|
187
|
+
buckets: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
const localVarPath = `/thorchain/buckets`;
|
|
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
|
+
* BucketsApi - functional programming interface
|
|
213
|
+
* @export
|
|
214
|
+
*/
|
|
215
|
+
const BucketsApiFp = function (configuration) {
|
|
216
|
+
const localVarAxiosParamCreator = BucketsApiAxiosParamCreator(configuration);
|
|
217
|
+
return {
|
|
218
|
+
/**
|
|
219
|
+
* Returns the bucket information for the provided asset.
|
|
220
|
+
* @param {string} asset
|
|
221
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
222
|
+
* @param {*} [options] Override http request option.
|
|
223
|
+
* @throws {RequiredError}
|
|
224
|
+
*/
|
|
225
|
+
bucket(asset, height, options) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.bucket(asset, height, options);
|
|
228
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
/**
|
|
232
|
+
* Returns the bucket information for all assets.
|
|
233
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
234
|
+
* @param {*} [options] Override http request option.
|
|
235
|
+
* @throws {RequiredError}
|
|
236
|
+
*/
|
|
237
|
+
buckets(height, options) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.buckets(height, options);
|
|
240
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default['default'], BASE_PATH, configuration);
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* BucketsApi - factory interface
|
|
247
|
+
* @export
|
|
248
|
+
*/
|
|
249
|
+
const BucketsApiFactory = function (configuration, basePath, axios) {
|
|
250
|
+
const localVarFp = BucketsApiFp(configuration);
|
|
251
|
+
return {
|
|
252
|
+
/**
|
|
253
|
+
* Returns the bucket information for the provided asset.
|
|
254
|
+
* @param {string} asset
|
|
255
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
256
|
+
* @param {*} [options] Override http request option.
|
|
257
|
+
* @throws {RequiredError}
|
|
258
|
+
*/
|
|
259
|
+
bucket(asset, height, options) {
|
|
260
|
+
return localVarFp.bucket(asset, height, options).then((request) => request(axios, basePath));
|
|
261
|
+
},
|
|
262
|
+
/**
|
|
263
|
+
* Returns the bucket information for all assets.
|
|
264
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
265
|
+
* @param {*} [options] Override http request option.
|
|
266
|
+
* @throws {RequiredError}
|
|
267
|
+
*/
|
|
268
|
+
buckets(height, options) {
|
|
269
|
+
return localVarFp.buckets(height, options).then((request) => request(axios, basePath));
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* BucketsApi - object-oriented interface
|
|
275
|
+
* @export
|
|
276
|
+
* @class BucketsApi
|
|
277
|
+
* @extends {BaseAPI}
|
|
278
|
+
*/
|
|
279
|
+
class BucketsApi extends BaseAPI {
|
|
280
|
+
/**
|
|
281
|
+
* Returns the bucket information for the provided asset.
|
|
282
|
+
* @param {string} asset
|
|
283
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
284
|
+
* @param {*} [options] Override http request option.
|
|
285
|
+
* @throws {RequiredError}
|
|
286
|
+
* @memberof BucketsApi
|
|
287
|
+
*/
|
|
288
|
+
bucket(asset, height, options) {
|
|
289
|
+
return BucketsApiFp(this.configuration).bucket(asset, height, options).then((request) => request(this.axios, this.basePath));
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Returns the bucket information for all assets.
|
|
293
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
294
|
+
* @param {*} [options] Override http request option.
|
|
295
|
+
* @throws {RequiredError}
|
|
296
|
+
* @memberof BucketsApi
|
|
297
|
+
*/
|
|
298
|
+
buckets(height, options) {
|
|
299
|
+
return BucketsApiFp(this.configuration).buckets(height, options).then((request) => request(this.axios, this.basePath));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
137
302
|
/**
|
|
138
303
|
* HealthApi - axios parameter creator
|
|
139
304
|
* @export
|
|
@@ -2712,7 +2877,7 @@ class VaultsApi extends BaseAPI {
|
|
|
2712
2877
|
* Thornode API
|
|
2713
2878
|
* Thornode REST API.
|
|
2714
2879
|
*
|
|
2715
|
-
* The version of the OpenAPI document: 1.
|
|
2880
|
+
* The version of the OpenAPI document: 1.97.2
|
|
2716
2881
|
* Contact: devs@thorchain.org
|
|
2717
2882
|
*
|
|
2718
2883
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2747,6 +2912,10 @@ class Configuration {
|
|
|
2747
2912
|
|
|
2748
2913
|
const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
|
|
2749
2914
|
|
|
2915
|
+
exports.BucketsApi = BucketsApi;
|
|
2916
|
+
exports.BucketsApiAxiosParamCreator = BucketsApiAxiosParamCreator;
|
|
2917
|
+
exports.BucketsApiFactory = BucketsApiFactory;
|
|
2918
|
+
exports.BucketsApiFp = BucketsApiFp;
|
|
2750
2919
|
exports.Configuration = Configuration;
|
|
2751
2920
|
exports.HealthApi = HealthApi;
|
|
2752
2921
|
exports.HealthApiAxiosParamCreator = HealthApiAxiosParamCreator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-thornode",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
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.97.2/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
|