@xchainjs/xchain-thorchain 0.28.10 → 0.28.11

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
@@ -4354,56 +4354,64 @@ var indexMinimal = {};
4354
4354
 
4355
4355
  var minimal$1 = {};
4356
4356
 
4357
- var aspromise = asPromise;
4357
+ var aspromise;
4358
+ var hasRequiredAspromise;
4359
+
4360
+ function requireAspromise () {
4361
+ if (hasRequiredAspromise) return aspromise;
4362
+ hasRequiredAspromise = 1;
4363
+ aspromise = asPromise;
4358
4364
 
4359
- /**
4360
- * Callback as used by {@link util.asPromise}.
4361
- * @typedef asPromiseCallback
4362
- * @type {function}
4363
- * @param {Error|null} error Error, if any
4364
- * @param {...*} params Additional arguments
4365
- * @returns {undefined}
4366
- */
4365
+ /**
4366
+ * Callback as used by {@link util.asPromise}.
4367
+ * @typedef asPromiseCallback
4368
+ * @type {function}
4369
+ * @param {Error|null} error Error, if any
4370
+ * @param {...*} params Additional arguments
4371
+ * @returns {undefined}
4372
+ */
4367
4373
 
4368
- /**
4369
- * Returns a promise from a node-style callback function.
4370
- * @memberof util
4371
- * @param {asPromiseCallback} fn Function to call
4372
- * @param {*} ctx Function context
4373
- * @param {...*} params Function arguments
4374
- * @returns {Promise<*>} Promisified function
4375
- */
4376
- function asPromise(fn, ctx/*, varargs */) {
4377
- var params = new Array(arguments.length - 1),
4378
- offset = 0,
4379
- index = 2,
4380
- pending = true;
4381
- while (index < arguments.length)
4382
- params[offset++] = arguments[index++];
4383
- return new Promise(function executor(resolve, reject) {
4384
- params[offset] = function callback(err/*, varargs */) {
4385
- if (pending) {
4386
- pending = false;
4387
- if (err)
4388
- reject(err);
4389
- else {
4390
- var params = new Array(arguments.length - 1),
4391
- offset = 0;
4392
- while (offset < params.length)
4393
- params[offset++] = arguments[offset];
4394
- resolve.apply(null, params);
4395
- }
4396
- }
4397
- };
4398
- try {
4399
- fn.apply(ctx || null, params);
4400
- } catch (err) {
4401
- if (pending) {
4402
- pending = false;
4403
- reject(err);
4404
- }
4405
- }
4406
- });
4374
+ /**
4375
+ * Returns a promise from a node-style callback function.
4376
+ * @memberof util
4377
+ * @param {asPromiseCallback} fn Function to call
4378
+ * @param {*} ctx Function context
4379
+ * @param {...*} params Function arguments
4380
+ * @returns {Promise<*>} Promisified function
4381
+ */
4382
+ function asPromise(fn, ctx/*, varargs */) {
4383
+ var params = new Array(arguments.length - 1),
4384
+ offset = 0,
4385
+ index = 2,
4386
+ pending = true;
4387
+ while (index < arguments.length)
4388
+ params[offset++] = arguments[index++];
4389
+ return new Promise(function executor(resolve, reject) {
4390
+ params[offset] = function callback(err/*, varargs */) {
4391
+ if (pending) {
4392
+ pending = false;
4393
+ if (err)
4394
+ reject(err);
4395
+ else {
4396
+ var params = new Array(arguments.length - 1),
4397
+ offset = 0;
4398
+ while (offset < params.length)
4399
+ params[offset++] = arguments[offset];
4400
+ resolve.apply(null, params);
4401
+ }
4402
+ }
4403
+ };
4404
+ try {
4405
+ fn.apply(ctx || null, params);
4406
+ } catch (err) {
4407
+ if (pending) {
4408
+ pending = false;
4409
+ reject(err);
4410
+ }
4411
+ }
4412
+ });
4413
+ }
4414
+ return aspromise;
4407
4415
  }
4408
4416
 
4409
4417
  var base64$1 = {};
@@ -4983,21 +4991,29 @@ function requireFloat () {
4983
4991
  return float;
4984
4992
  }
4985
4993
 
4986
- var inquire_1 = inquire;
4994
+ var inquire_1;
4995
+ var hasRequiredInquire;
4996
+
4997
+ function requireInquire () {
4998
+ if (hasRequiredInquire) return inquire_1;
4999
+ hasRequiredInquire = 1;
5000
+ inquire_1 = inquire;
4987
5001
 
4988
- /**
4989
- * Requires a module only if available.
4990
- * @memberof util
4991
- * @param {string} moduleName Module to require
4992
- * @returns {?Object} Required module if available and not empty, otherwise `null`
4993
- */
4994
- function inquire(moduleName) {
4995
- try {
4996
- var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
4997
- if (mod && (mod.length || Object.keys(mod).length))
4998
- return mod;
4999
- } catch (e) {} // eslint-disable-line no-empty
5000
- return null;
5002
+ /**
5003
+ * Requires a module only if available.
5004
+ * @memberof util
5005
+ * @param {string} moduleName Module to require
5006
+ * @returns {?Object} Required module if available and not empty, otherwise `null`
5007
+ */
5008
+ function inquire(moduleName) {
5009
+ try {
5010
+ var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
5011
+ if (mod && (mod.length || Object.keys(mod).length))
5012
+ return mod;
5013
+ } catch (e) {} // eslint-disable-line no-empty
5014
+ return null;
5015
+ }
5016
+ return inquire_1;
5001
5017
  }
5002
5018
 
5003
5019
  var utf8$2 = {};
@@ -5389,7 +5405,7 @@ function requireMinimal () {
5389
5405
  var util = exports;
5390
5406
 
5391
5407
  // used to return a Promise where callback is omitted
5392
- util.asPromise = aspromise;
5408
+ util.asPromise = requireAspromise();
5393
5409
 
5394
5410
  // converts to / from base64 encoded strings
5395
5411
  util.base64 = requireBase64();
@@ -5401,7 +5417,7 @@ function requireMinimal () {
5401
5417
  util.float = requireFloat();
5402
5418
 
5403
5419
  // requires modules optionally and hides the call from bundlers
5404
- util.inquire = inquire_1;
5420
+ util.inquire = requireInquire();
5405
5421
 
5406
5422
  // converts to / from utf8 encoded strings
5407
5423
  util.utf8 = requireUtf8();
@@ -10404,21 +10420,19 @@ class Client extends BaseXChainClient {
10404
10420
  }
10405
10421
  catch (error) {
10406
10422
  for (const fallback of FallBackUrls) {
10407
- for (const network of Object.keys(fallback)) {
10408
- try {
10409
- const networkObj = fallback[network];
10410
- const clientUrl = networkObj.node;
10411
- const cosmosClient = new CosmosSDKClient({
10412
- server: Array.isArray(clientUrl) ? clientUrl[0] : clientUrl,
10413
- chainId: this.getChainId(network),
10414
- prefix: getPrefix(network),
10415
- });
10416
- const tx = yield cosmosClient.txsHashGet(txId);
10417
- return tx;
10418
- }
10419
- catch (error) {
10420
- // Handle specific error if needed
10421
- }
10423
+ try {
10424
+ const networkObj = fallback[this.network];
10425
+ const clientUrl = networkObj.node;
10426
+ const cosmosClient = new CosmosSDKClient({
10427
+ server: Array.isArray(clientUrl) ? clientUrl[0] : clientUrl,
10428
+ chainId: this.getChainId(this.network),
10429
+ prefix: getPrefix(this.network),
10430
+ });
10431
+ const tx = yield cosmosClient.txsHashGet(txId);
10432
+ return tx;
10433
+ }
10434
+ catch (error) {
10435
+ // Handle specific error if needed
10422
10436
  }
10423
10437
  }
10424
10438
  return null;