@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/index.esm.js CHANGED
@@ -132,6 +132,99 @@ const VaultTypeEnum = {
132
132
  AsgardVault: 'AsgardVault',
133
133
  YggdrasilVault: 'YggdrasilVault'
134
134
  };
135
+ /**
136
+ * BlockApi - axios parameter creator
137
+ * @export
138
+ */
139
+ const BlockApiAxiosParamCreator = function (configuration) {
140
+ return {
141
+ /**
142
+ * Returns verbose details of the block.
143
+ * @param {number} [height] optional block height, defaults to current tip
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ */
147
+ block: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
148
+ const localVarPath = `/thorchain/block`;
149
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
150
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
151
+ let baseOptions;
152
+ if (configuration) {
153
+ baseOptions = configuration.baseOptions;
154
+ }
155
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
156
+ const localVarHeaderParameter = {};
157
+ const localVarQueryParameter = {};
158
+ if (height !== undefined) {
159
+ localVarQueryParameter['height'] = height;
160
+ }
161
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
162
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
163
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
164
+ return {
165
+ url: toPathString(localVarUrlObj),
166
+ options: localVarRequestOptions,
167
+ };
168
+ }),
169
+ };
170
+ };
171
+ /**
172
+ * BlockApi - functional programming interface
173
+ * @export
174
+ */
175
+ const BlockApiFp = function (configuration) {
176
+ const localVarAxiosParamCreator = BlockApiAxiosParamCreator(configuration);
177
+ return {
178
+ /**
179
+ * Returns verbose details of the block.
180
+ * @param {number} [height] optional block height, defaults to current tip
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ */
184
+ block(height, options) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.block(height, options);
187
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
188
+ });
189
+ },
190
+ };
191
+ };
192
+ /**
193
+ * BlockApi - factory interface
194
+ * @export
195
+ */
196
+ const BlockApiFactory = function (configuration, basePath, axios) {
197
+ const localVarFp = BlockApiFp(configuration);
198
+ return {
199
+ /**
200
+ * Returns verbose details of the block.
201
+ * @param {number} [height] optional block height, defaults to current tip
202
+ * @param {*} [options] Override http request option.
203
+ * @throws {RequiredError}
204
+ */
205
+ block(height, options) {
206
+ return localVarFp.block(height, options).then((request) => request(axios, basePath));
207
+ },
208
+ };
209
+ };
210
+ /**
211
+ * BlockApi - object-oriented interface
212
+ * @export
213
+ * @class BlockApi
214
+ * @extends {BaseAPI}
215
+ */
216
+ class BlockApi extends BaseAPI {
217
+ /**
218
+ * Returns verbose details of the block.
219
+ * @param {number} [height] optional block height, defaults to current tip
220
+ * @param {*} [options] Override http request option.
221
+ * @throws {RequiredError}
222
+ * @memberof BlockApi
223
+ */
224
+ block(height, options) {
225
+ return BlockApiFp(this.configuration).block(height, options).then((request) => request(this.axios, this.basePath));
226
+ }
227
+ }
135
228
  /**
136
229
  * BorrowersApi - axios parameter creator
137
230
  * @export
@@ -877,6 +970,34 @@ const MimirApiAxiosParamCreator = function (configuration) {
877
970
  options: localVarRequestOptions,
878
971
  };
879
972
  }),
973
+ /**
974
+ * Returns current mimir V2 configuration.
975
+ * @param {number} [height] optional block height, defaults to current tip
976
+ * @param {*} [options] Override http request option.
977
+ * @throws {RequiredError}
978
+ */
979
+ mimirV2: (height, options = {}) => __awaiter(this, void 0, void 0, function* () {
980
+ const localVarPath = `/thorchain/mimirV2`;
981
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
982
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
983
+ let baseOptions;
984
+ if (configuration) {
985
+ baseOptions = configuration.baseOptions;
986
+ }
987
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
988
+ const localVarHeaderParameter = {};
989
+ const localVarQueryParameter = {};
990
+ if (height !== undefined) {
991
+ localVarQueryParameter['height'] = height;
992
+ }
993
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
994
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
995
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
996
+ return {
997
+ url: toPathString(localVarUrlObj),
998
+ options: localVarRequestOptions,
999
+ };
1000
+ }),
880
1001
  };
881
1002
  };
882
1003
  /**
@@ -948,6 +1069,18 @@ const MimirApiFp = function (configuration) {
948
1069
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
949
1070
  });
950
1071
  },
1072
+ /**
1073
+ * Returns current mimir V2 configuration.
1074
+ * @param {number} [height] optional block height, defaults to current tip
1075
+ * @param {*} [options] Override http request option.
1076
+ * @throws {RequiredError}
1077
+ */
1078
+ mimirV2(height, options) {
1079
+ return __awaiter(this, void 0, void 0, function* () {
1080
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.mimirV2(height, options);
1081
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
1082
+ });
1083
+ },
951
1084
  };
952
1085
  };
953
1086
  /**
@@ -1004,6 +1137,15 @@ const MimirApiFactory = function (configuration, basePath, axios) {
1004
1137
  mimirNodes(height, options) {
1005
1138
  return localVarFp.mimirNodes(height, options).then((request) => request(axios, basePath));
1006
1139
  },
1140
+ /**
1141
+ * Returns current mimir V2 configuration.
1142
+ * @param {number} [height] optional block height, defaults to current tip
1143
+ * @param {*} [options] Override http request option.
1144
+ * @throws {RequiredError}
1145
+ */
1146
+ mimirV2(height, options) {
1147
+ return localVarFp.mimirV2(height, options).then((request) => request(axios, basePath));
1148
+ },
1007
1149
  };
1008
1150
  };
1009
1151
  /**
@@ -1065,6 +1207,16 @@ class MimirApi extends BaseAPI {
1065
1207
  mimirNodes(height, options) {
1066
1208
  return MimirApiFp(this.configuration).mimirNodes(height, options).then((request) => request(this.axios, this.basePath));
1067
1209
  }
1210
+ /**
1211
+ * Returns current mimir V2 configuration.
1212
+ * @param {number} [height] optional block height, defaults to current tip
1213
+ * @param {*} [options] Override http request option.
1214
+ * @throws {RequiredError}
1215
+ * @memberof MimirApi
1216
+ */
1217
+ mimirV2(height, options) {
1218
+ return MimirApiFp(this.configuration).mimirV2(height, options).then((request) => request(this.axios, this.basePath));
1219
+ }
1068
1220
  }
1069
1221
  /**
1070
1222
  * NetworkApi - axios parameter creator
@@ -2587,14 +2739,13 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2587
2739
  * @param {string} [destination] the destination address, required to generate memo
2588
2740
  * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2589
2741
  * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2590
- * @param {string} [fromAddress] the from address, required if the from asset is a synth
2591
2742
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2592
2743
  * @param {number} [affiliateBps] the affiliate fee in basis points
2593
2744
  * @param {string} [affiliate] the affiliate (address or thorname)
2594
2745
  * @param {*} [options] Override http request option.
2595
2746
  * @throws {RequiredError}
2596
2747
  */
2597
- quoteswap: (height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2748
+ quoteswap: (height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options = {}) => __awaiter(this, void 0, void 0, function* () {
2598
2749
  const localVarPath = `/thorchain/quote/swap`;
2599
2750
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
2600
2751
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -2626,9 +2777,6 @@ const QuoteApiAxiosParamCreator = function (configuration) {
2626
2777
  if (streamingQuantity !== undefined) {
2627
2778
  localVarQueryParameter['streaming_quantity'] = streamingQuantity;
2628
2779
  }
2629
- if (fromAddress !== undefined) {
2630
- localVarQueryParameter['from_address'] = fromAddress;
2631
- }
2632
2780
  if (toleranceBps !== undefined) {
2633
2781
  localVarQueryParameter['tolerance_bps'] = toleranceBps;
2634
2782
  }
@@ -2729,16 +2877,15 @@ const QuoteApiFp = function (configuration) {
2729
2877
  * @param {string} [destination] the destination address, required to generate memo
2730
2878
  * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2731
2879
  * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2732
- * @param {string} [fromAddress] the from address, required if the from asset is a synth
2733
2880
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2734
2881
  * @param {number} [affiliateBps] the affiliate fee in basis points
2735
2882
  * @param {string} [affiliate] the affiliate (address or thorname)
2736
2883
  * @param {*} [options] Override http request option.
2737
2884
  * @throws {RequiredError}
2738
2885
  */
2739
- quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2886
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
2740
2887
  return __awaiter(this, void 0, void 0, function* () {
2741
- const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options);
2888
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options);
2742
2889
  return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
2743
2890
  });
2744
2891
  },
@@ -2813,15 +2960,14 @@ const QuoteApiFactory = function (configuration, basePath, axios) {
2813
2960
  * @param {string} [destination] the destination address, required to generate memo
2814
2961
  * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2815
2962
  * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2816
- * @param {string} [fromAddress] the from address, required if the from asset is a synth
2817
2963
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2818
2964
  * @param {number} [affiliateBps] the affiliate fee in basis points
2819
2965
  * @param {string} [affiliate] the affiliate (address or thorname)
2820
2966
  * @param {*} [options] Override http request option.
2821
2967
  * @throws {RequiredError}
2822
2968
  */
2823
- quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2824
- return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2969
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
2970
+ return localVarFp.quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options).then((request) => request(axios, basePath));
2825
2971
  },
2826
2972
  };
2827
2973
  };
@@ -2898,7 +3044,6 @@ class QuoteApi extends BaseAPI {
2898
3044
  * @param {string} [destination] the destination address, required to generate memo
2899
3045
  * @param {number} [streamingInterval] the interval in which streaming swaps are swapped
2900
3046
  * @param {number} [streamingQuantity] the quantity of swaps within a streaming swap
2901
- * @param {string} [fromAddress] the from address, required if the from asset is a synth
2902
3047
  * @param {number} [toleranceBps] the maximum basis points from the current feeless swap price to set the limit in the generated memo
2903
3048
  * @param {number} [affiliateBps] the affiliate fee in basis points
2904
3049
  * @param {string} [affiliate] the affiliate (address or thorname)
@@ -2906,8 +3051,8 @@ class QuoteApi extends BaseAPI {
2906
3051
  * @throws {RequiredError}
2907
3052
  * @memberof QuoteApi
2908
3053
  */
2909
- quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options) {
2910
- return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, fromAddress, toleranceBps, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
3054
+ quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options) {
3055
+ return QuoteApiFp(this.configuration).quoteswap(height, fromAsset, toAsset, amount, destination, streamingInterval, streamingQuantity, toleranceBps, affiliateBps, affiliate, options).then((request) => request(this.axios, this.basePath));
2911
3056
  }
2912
3057
  }
2913
3058
  /**
@@ -4274,7 +4419,7 @@ class VaultsApi extends BaseAPI {
4274
4419
  * Thornode API
4275
4420
  * Thornode REST API.
4276
4421
  *
4277
- * The version of the OpenAPI document: 1.121.0
4422
+ * The version of the OpenAPI document: 1.124.0
4278
4423
  * Contact: devs@thorchain.org
4279
4424
  *
4280
4425
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4309,5 +4454,5 @@ class Configuration {
4309
4454
 
4310
4455
  const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
4311
4456
 
4312
- export { BorrowersApi, BorrowersApiAxiosParamCreator, BorrowersApiFactory, BorrowersApiFp, Configuration, HealthApi, HealthApiAxiosParamCreator, HealthApiFactory, HealthApiFp, InvariantsApi, InvariantsApiAxiosParamCreator, InvariantsApiFactory, InvariantsApiFp, LiquidityProvidersApi, LiquidityProvidersApiAxiosParamCreator, LiquidityProvidersApiFactory, LiquidityProvidersApiFp, MimirApi, MimirApiAxiosParamCreator, MimirApiFactory, MimirApiFp, NetworkApi, NetworkApiAxiosParamCreator, NetworkApiFactory, NetworkApiFp, NodeStatusEnum, NodesApi, NodesApiAxiosParamCreator, NodesApiFactory, NodesApiFp, ObservedTxStatusEnum, POLApi, POLApiAxiosParamCreator, POLApiFactory, POLApiFp, PoolsApi, PoolsApiAxiosParamCreator, PoolsApiFactory, PoolsApiFp, QueueApi, QueueApiAxiosParamCreator, QueueApiFactory, QueueApiFp, QuoteApi, QuoteApiAxiosParamCreator, QuoteApiFactory, QuoteApiFp, SaversApi, SaversApiAxiosParamCreator, SaversApiFactory, SaversApiFp, StreamingSwapApi, StreamingSwapApiAxiosParamCreator, StreamingSwapApiFactory, StreamingSwapApiFp, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };
4457
+ export { BlockApi, BlockApiAxiosParamCreator, BlockApiFactory, BlockApiFp, BorrowersApi, BorrowersApiAxiosParamCreator, BorrowersApiFactory, BorrowersApiFp, Configuration, HealthApi, HealthApiAxiosParamCreator, HealthApiFactory, HealthApiFp, InvariantsApi, InvariantsApiAxiosParamCreator, InvariantsApiFactory, InvariantsApiFp, LiquidityProvidersApi, LiquidityProvidersApiAxiosParamCreator, LiquidityProvidersApiFactory, LiquidityProvidersApiFp, MimirApi, MimirApiAxiosParamCreator, MimirApiFactory, MimirApiFp, NetworkApi, NetworkApiAxiosParamCreator, NetworkApiFactory, NetworkApiFp, NodeStatusEnum, NodesApi, NodesApiAxiosParamCreator, NodesApiFactory, NodesApiFp, ObservedTxStatusEnum, POLApi, POLApiAxiosParamCreator, POLApiFactory, POLApiFp, PoolsApi, PoolsApiAxiosParamCreator, PoolsApiFactory, PoolsApiFp, QueueApi, QueueApiAxiosParamCreator, QueueApiFactory, QueueApiFp, QuoteApi, QuoteApiAxiosParamCreator, QuoteApiFactory, QuoteApiFp, SaversApi, SaversApiAxiosParamCreator, SaversApiFactory, SaversApiFp, StreamingSwapApi, StreamingSwapApiAxiosParamCreator, StreamingSwapApiFactory, StreamingSwapApiFp, THORNODE_API_9R_URL, TSSApi, TSSApiAxiosParamCreator, TSSApiFactory, TSSApiFp, ThornamesApi, ThornamesApiAxiosParamCreator, ThornamesApiFactory, ThornamesApiFp, TransactionsApi, TransactionsApiAxiosParamCreator, TransactionsApiFactory, TransactionsApiFp, VaultTypeEnum, VaultsApi, VaultsApiAxiosParamCreator, VaultsApiFactory, VaultsApiFp };
4313
4458
  //# sourceMappingURL=index.esm.js.map