@xchainjs/xchain-thornode 0.3.7 → 0.3.9
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 +389 -55
- 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 +161 -16
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +164 -15
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -140,6 +140,99 @@ const VaultTypeEnum = {
|
|
|
140
140
|
AsgardVault: 'AsgardVault',
|
|
141
141
|
YggdrasilVault: 'YggdrasilVault'
|
|
142
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* BlockApi - axios parameter creator
|
|
145
|
+
* @export
|
|
146
|
+
*/
|
|
147
|
+
const BlockApiAxiosParamCreator = function (configuration) {
|
|
148
|
+
return {
|
|
149
|
+
/**
|
|
150
|
+
* Returns verbose details of the block.
|
|
151
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
152
|
+
* @param {*} [options] Override http request option.
|
|
153
|
+
* @throws {RequiredError}
|
|
154
|
+
*/
|
|
155
|
+
block: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
const localVarPath = `/thorchain/block`;
|
|
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
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* BlockApi - functional programming interface
|
|
181
|
+
* @export
|
|
182
|
+
*/
|
|
183
|
+
const BlockApiFp = function (configuration) {
|
|
184
|
+
const localVarAxiosParamCreator = BlockApiAxiosParamCreator(configuration);
|
|
185
|
+
return {
|
|
186
|
+
/**
|
|
187
|
+
* Returns verbose details of the block.
|
|
188
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
189
|
+
* @param {*} [options] Override http request option.
|
|
190
|
+
* @throws {RequiredError}
|
|
191
|
+
*/
|
|
192
|
+
block(height, options) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.block(height, options);
|
|
195
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* BlockApi - factory interface
|
|
202
|
+
* @export
|
|
203
|
+
*/
|
|
204
|
+
const BlockApiFactory = function (configuration, basePath, axios) {
|
|
205
|
+
const localVarFp = BlockApiFp(configuration);
|
|
206
|
+
return {
|
|
207
|
+
/**
|
|
208
|
+
* Returns verbose details of the block.
|
|
209
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
210
|
+
* @param {*} [options] Override http request option.
|
|
211
|
+
* @throws {RequiredError}
|
|
212
|
+
*/
|
|
213
|
+
block(height, options) {
|
|
214
|
+
return localVarFp.block(height, options).then((request) => request(axios, basePath));
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* BlockApi - object-oriented interface
|
|
220
|
+
* @export
|
|
221
|
+
* @class BlockApi
|
|
222
|
+
* @extends {BaseAPI}
|
|
223
|
+
*/
|
|
224
|
+
class BlockApi extends BaseAPI {
|
|
225
|
+
/**
|
|
226
|
+
* Returns verbose details of the block.
|
|
227
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
228
|
+
* @param {*} [options] Override http request option.
|
|
229
|
+
* @throws {RequiredError}
|
|
230
|
+
* @memberof BlockApi
|
|
231
|
+
*/
|
|
232
|
+
block(height, options) {
|
|
233
|
+
return BlockApiFp(this.configuration).block(height, options).then((request) => request(this.axios, this.basePath));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
143
236
|
/**
|
|
144
237
|
* BorrowersApi - axios parameter creator
|
|
145
238
|
* @export
|
|
@@ -885,6 +978,34 @@ const MimirApiAxiosParamCreator = function (configuration) {
|
|
|
885
978
|
options: localVarRequestOptions,
|
|
886
979
|
};
|
|
887
980
|
}),
|
|
981
|
+
/**
|
|
982
|
+
* Returns current mimir V2 configuration.
|
|
983
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
984
|
+
* @param {*} [options] Override http request option.
|
|
985
|
+
* @throws {RequiredError}
|
|
986
|
+
*/
|
|
987
|
+
mimirV2: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
988
|
+
const localVarPath = `/thorchain/mimirV2`;
|
|
989
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
990
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
991
|
+
let baseOptions;
|
|
992
|
+
if (configuration) {
|
|
993
|
+
baseOptions = configuration.baseOptions;
|
|
994
|
+
}
|
|
995
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
996
|
+
const localVarHeaderParameter = {};
|
|
997
|
+
const localVarQueryParameter = {};
|
|
998
|
+
if (height !== undefined) {
|
|
999
|
+
localVarQueryParameter['height'] = height;
|
|
1000
|
+
}
|
|
1001
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1002
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1003
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
1004
|
+
return {
|
|
1005
|
+
url: toPathString(localVarUrlObj),
|
|
1006
|
+
options: localVarRequestOptions,
|
|
1007
|
+
};
|
|
1008
|
+
}),
|
|
888
1009
|
};
|
|
889
1010
|
};
|
|
890
1011
|
/**
|
|
@@ -956,6 +1077,18 @@ const MimirApiFp = function (configuration) {
|
|
|
956
1077
|
return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
|
|
957
1078
|
});
|
|
958
1079
|
},
|
|
1080
|
+
/**
|
|
1081
|
+
* Returns current mimir V2 configuration.
|
|
1082
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1083
|
+
* @param {*} [options] Override http request option.
|
|
1084
|
+
* @throws {RequiredError}
|
|
1085
|
+
*/
|
|
1086
|
+
mimirV2(height, options) {
|
|
1087
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1088
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.mimirV2(height, options);
|
|
1089
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
|
|
1090
|
+
});
|
|
1091
|
+
},
|
|
959
1092
|
};
|
|
960
1093
|
};
|
|
961
1094
|
/**
|
|
@@ -1012,6 +1145,15 @@ const MimirApiFactory = function (configuration, basePath, axios) {
|
|
|
1012
1145
|
mimirNodes(height, options) {
|
|
1013
1146
|
return localVarFp.mimirNodes(height, options).then((request) => request(axios, basePath));
|
|
1014
1147
|
},
|
|
1148
|
+
/**
|
|
1149
|
+
* Returns current mimir V2 configuration.
|
|
1150
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1151
|
+
* @param {*} [options] Override http request option.
|
|
1152
|
+
* @throws {RequiredError}
|
|
1153
|
+
*/
|
|
1154
|
+
mimirV2(height, options) {
|
|
1155
|
+
return localVarFp.mimirV2(height, options).then((request) => request(axios, basePath));
|
|
1156
|
+
},
|
|
1015
1157
|
};
|
|
1016
1158
|
};
|
|
1017
1159
|
/**
|
|
@@ -1073,6 +1215,16 @@ class MimirApi extends BaseAPI {
|
|
|
1073
1215
|
mimirNodes(height, options) {
|
|
1074
1216
|
return MimirApiFp(this.configuration).mimirNodes(height, options).then((request) => request(this.axios, this.basePath));
|
|
1075
1217
|
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Returns current mimir V2 configuration.
|
|
1220
|
+
* @param {number} [height] optional block height, defaults to current tip
|
|
1221
|
+
* @param {*} [options] Override http request option.
|
|
1222
|
+
* @throws {RequiredError}
|
|
1223
|
+
* @memberof MimirApi
|
|
1224
|
+
*/
|
|
1225
|
+
mimirV2(height, options) {
|
|
1226
|
+
return MimirApiFp(this.configuration).mimirV2(height, options).then((request) => request(this.axios, this.basePath));
|
|
1227
|
+
}
|
|
1076
1228
|
}
|
|
1077
1229
|
/**
|
|
1078
1230
|
* NetworkApi - axios parameter creator
|
|
@@ -2595,14 +2747,13 @@ const QuoteApiAxiosParamCreator = function (configuration) {
|
|
|
2595
2747
|
* @param {string} [destination] the destination address, required to generate memo
|
|
2596
2748
|
* @param {number} [streamingInterval] the interval in which streaming swaps are swapped
|
|
2597
2749
|
* @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
|
|
2598
|
-
* @param {string} [fromAddress] the from address, required if the from asset is a synth
|
|
2599
2750
|
* @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
|
|
2600
2751
|
* @param {number} [affiliateBps] the affiliate fee in basis points
|
|
2601
2752
|
* @param {string} [affiliate] the affiliate (address or thorname)
|
|
2602
2753
|
* @param {*} [options] Override http request option.
|
|
2603
2754
|
* @throws {RequiredError}
|
|
2604
2755
|
*/
|
|
2605
|
-
quoteswap: (height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2756
|
+
quoteswap: (height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
2606
2757
|
const localVarPath = `/thorchain/quote/swap`;
|
|
2607
2758
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2608
2759
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -2634,9 +2785,6 @@ const QuoteApiAxiosParamCreator = function (configuration) {
|
|
|
2634
2785
|
if (streamingQuantity !== undefined) {
|
|
2635
2786
|
localVarQueryParameter['streaming_quantity'] = streamingQuantity;
|
|
2636
2787
|
}
|
|
2637
|
-
if (fromAddress !== undefined) {
|
|
2638
|
-
localVarQueryParameter['from_address'] = fromAddress;
|
|
2639
|
-
}
|
|
2640
2788
|
if (toleranceBps !== undefined) {
|
|
2641
2789
|
localVarQueryParameter['tolerance_bps'] = toleranceBps;
|
|
2642
2790
|
}
|
|
@@ -2737,16 +2885,15 @@ const QuoteApiFp = function (configuration) {
|
|
|
2737
2885
|
* @param {string} [destination] the destination address, required to generate memo
|
|
2738
2886
|
* @param {number} [streamingInterval] the interval in which streaming swaps are swapped
|
|
2739
2887
|
* @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
|
|
2740
|
-
* @param {string} [fromAddress] the from address, required if the from asset is a synth
|
|
2741
2888
|
* @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
|
|
2742
2889
|
* @param {number} [affiliateBps] the affiliate fee in basis points
|
|
2743
2890
|
* @param {string} [affiliate] the affiliate (address or thorname)
|
|
2744
2891
|
* @param {*} [options] Override http request option.
|
|
2745
2892
|
* @throws {RequiredError}
|
|
2746
2893
|
*/
|
|
2747
|
-
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2894
|
+
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
|
|
2748
2895
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2749
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2896
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options);
|
|
2750
2897
|
return createRequestFunction(localVarAxiosArgs, globalAxios__default["default"], BASE_PATH, configuration);
|
|
2751
2898
|
});
|
|
2752
2899
|
},
|
|
@@ -2821,15 +2968,14 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
|
|
|
2821
2968
|
* @param {string} [destination] the destination address, required to generate memo
|
|
2822
2969
|
* @param {number} [streamingInterval] the interval in which streaming swaps are swapped
|
|
2823
2970
|
* @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
|
|
2824
|
-
* @param {string} [fromAddress] the from address, required if the from asset is a synth
|
|
2825
2971
|
* @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
|
|
2826
2972
|
* @param {number} [affiliateBps] the affiliate fee in basis points
|
|
2827
2973
|
* @param {string} [affiliate] the affiliate (address or thorname)
|
|
2828
2974
|
* @param {*} [options] Override http request option.
|
|
2829
2975
|
* @throws {RequiredError}
|
|
2830
2976
|
*/
|
|
2831
|
-
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2832
|
-
return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2977
|
+
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
|
|
2978
|
+
return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
|
|
2833
2979
|
},
|
|
2834
2980
|
};
|
|
2835
2981
|
};
|
|
@@ -2906,7 +3052,6 @@ class QuoteApi extends BaseAPI {
|
|
|
2906
3052
|
* @param {string} [destination] the destination address, required to generate memo
|
|
2907
3053
|
* @param {number} [streamingInterval] the interval in which streaming swaps are swapped
|
|
2908
3054
|
* @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
|
|
2909
|
-
* @param {string} [fromAddress] the from address, required if the from asset is a synth
|
|
2910
3055
|
* @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
|
|
2911
3056
|
* @param {number} [affiliateBps] the affiliate fee in basis points
|
|
2912
3057
|
* @param {string} [affiliate] the affiliate (address or thorname)
|
|
@@ -2914,8 +3059,8 @@ class QuoteApi extends BaseAPI {
|
|
|
2914
3059
|
* @throws {RequiredError}
|
|
2915
3060
|
* @memberof QuoteApi
|
|
2916
3061
|
*/
|
|
2917
|
-
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
2918
|
-
return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity,
|
|
3062
|
+
quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
|
|
3063
|
+
return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
|
|
2919
3064
|
}
|
|
2920
3065
|
}
|
|
2921
3066
|
/**
|
|
@@ -4282,7 +4427,7 @@ class VaultsApi extends BaseAPI {
|
|
|
4282
4427
|
* Thornode API
|
|
4283
4428
|
* Thornode REST API.
|
|
4284
4429
|
*
|
|
4285
|
-
* The version of the OpenAPI document: 1.
|
|
4430
|
+
* The version of the OpenAPI document: 1.124.0
|
|
4286
4431
|
* Contact: devs@thorchain.org
|
|
4287
4432
|
*
|
|
4288
4433
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -4317,6 +4462,10 @@ class Configuration {
|
|
|
4317
4462
|
|
|
4318
4463
|
const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
|
|
4319
4464
|
|
|
4465
|
+
exports.BlockApi = BlockApi;
|
|
4466
|
+
exports.BlockApiAxiosParamCreator = BlockApiAxiosParamCreator;
|
|
4467
|
+
exports.BlockApiFactory = BlockApiFactory;
|
|
4468
|
+
exports.BlockApiFp = BlockApiFp;
|
|
4320
4469
|
exports.BorrowersApi = BorrowersApi;
|
|
4321
4470
|
exports.BorrowersApiAxiosParamCreator = BorrowersApiAxiosParamCreator;
|
|
4322
4471
|
exports.BorrowersApiFactory = BorrowersApiFactory;
|