@xchainjs/xchain-thornode 0.3.7 → 0.3.8

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.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
@@ -4282,7 +4375,7 @@ class VaultsApi extends BaseAPI {
4282
4375
  * Thornode API
4283
4376
  * Thornode REST API.
4284
4377
  *
4285
- * The version of the OpenAPI document: 1.121.0
4378
+ * The version of the OpenAPI document: 1.122.0
4286
4379
  * Contact: devs@thorchain.org
4287
4380
  *
4288
4381
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -4317,6 +4410,10 @@ class Configuration {
4317
4410
 
4318
4411
  const THORNODE_API_9R_URL = 'https://thornode.ninerealms.com/';
4319
4412
 
4413
+ exports.BlockApi = BlockApi;
4414
+ exports.BlockApiAxiosParamCreator = BlockApiAxiosParamCreator;
4415
+ exports.BlockApiFactory = BlockApiFactory;
4416
+ exports.BlockApiFp = BlockApiFp;
4320
4417
  exports.BorrowersApi = BorrowersApi;
4321
4418
  exports.BorrowersApiAxiosParamCreator = BorrowersApiAxiosParamCreator;
4322
4419
  exports.BorrowersApiFactory = BorrowersApiFactory;