@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.js CHANGED
@@ -4382,56 +4382,64 @@ var indexMinimal = {};
4382
4382
 
4383
4383
  var minimal$1 = {};
4384
4384
 
4385
- var aspromise = asPromise;
4385
+ var aspromise;
4386
+ var hasRequiredAspromise;
4387
+
4388
+ function requireAspromise () {
4389
+ if (hasRequiredAspromise) return aspromise;
4390
+ hasRequiredAspromise = 1;
4391
+ aspromise = asPromise;
4386
4392
 
4387
- /**
4388
- * Callback as used by {@link util.asPromise}.
4389
- * @typedef asPromiseCallback
4390
- * @type {function}
4391
- * @param {Error|null} error Error, if any
4392
- * @param {...*} params Additional arguments
4393
- * @returns {undefined}
4394
- */
4393
+ /**
4394
+ * Callback as used by {@link util.asPromise}.
4395
+ * @typedef asPromiseCallback
4396
+ * @type {function}
4397
+ * @param {Error|null} error Error, if any
4398
+ * @param {...*} params Additional arguments
4399
+ * @returns {undefined}
4400
+ */
4395
4401
 
4396
- /**
4397
- * Returns a promise from a node-style callback function.
4398
- * @memberof util
4399
- * @param {asPromiseCallback} fn Function to call
4400
- * @param {*} ctx Function context
4401
- * @param {...*} params Function arguments
4402
- * @returns {Promise<*>} Promisified function
4403
- */
4404
- function asPromise(fn, ctx/*, varargs */) {
4405
- var params = new Array(arguments.length - 1),
4406
- offset = 0,
4407
- index = 2,
4408
- pending = true;
4409
- while (index < arguments.length)
4410
- params[offset++] = arguments[index++];
4411
- return new Promise(function executor(resolve, reject) {
4412
- params[offset] = function callback(err/*, varargs */) {
4413
- if (pending) {
4414
- pending = false;
4415
- if (err)
4416
- reject(err);
4417
- else {
4418
- var params = new Array(arguments.length - 1),
4419
- offset = 0;
4420
- while (offset < params.length)
4421
- params[offset++] = arguments[offset];
4422
- resolve.apply(null, params);
4423
- }
4424
- }
4425
- };
4426
- try {
4427
- fn.apply(ctx || null, params);
4428
- } catch (err) {
4429
- if (pending) {
4430
- pending = false;
4431
- reject(err);
4432
- }
4433
- }
4434
- });
4402
+ /**
4403
+ * Returns a promise from a node-style callback function.
4404
+ * @memberof util
4405
+ * @param {asPromiseCallback} fn Function to call
4406
+ * @param {*} ctx Function context
4407
+ * @param {...*} params Function arguments
4408
+ * @returns {Promise<*>} Promisified function
4409
+ */
4410
+ function asPromise(fn, ctx/*, varargs */) {
4411
+ var params = new Array(arguments.length - 1),
4412
+ offset = 0,
4413
+ index = 2,
4414
+ pending = true;
4415
+ while (index < arguments.length)
4416
+ params[offset++] = arguments[index++];
4417
+ return new Promise(function executor(resolve, reject) {
4418
+ params[offset] = function callback(err/*, varargs */) {
4419
+ if (pending) {
4420
+ pending = false;
4421
+ if (err)
4422
+ reject(err);
4423
+ else {
4424
+ var params = new Array(arguments.length - 1),
4425
+ offset = 0;
4426
+ while (offset < params.length)
4427
+ params[offset++] = arguments[offset];
4428
+ resolve.apply(null, params);
4429
+ }
4430
+ }
4431
+ };
4432
+ try {
4433
+ fn.apply(ctx || null, params);
4434
+ } catch (err) {
4435
+ if (pending) {
4436
+ pending = false;
4437
+ reject(err);
4438
+ }
4439
+ }
4440
+ });
4441
+ }
4442
+ return aspromise;
4435
4443
  }
4436
4444
 
4437
4445
  var base64$1 = {};
@@ -5011,21 +5019,29 @@ function requireFloat () {
5011
5019
  return float;
5012
5020
  }
5013
5021
 
5014
- var inquire_1 = inquire;
5022
+ var inquire_1;
5023
+ var hasRequiredInquire;
5024
+
5025
+ function requireInquire () {
5026
+ if (hasRequiredInquire) return inquire_1;
5027
+ hasRequiredInquire = 1;
5028
+ inquire_1 = inquire;
5015
5029
 
5016
- /**
5017
- * Requires a module only if available.
5018
- * @memberof util
5019
- * @param {string} moduleName Module to require
5020
- * @returns {?Object} Required module if available and not empty, otherwise `null`
5021
- */
5022
- function inquire(moduleName) {
5023
- try {
5024
- var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
5025
- if (mod && (mod.length || Object.keys(mod).length))
5026
- return mod;
5027
- } catch (e) {} // eslint-disable-line no-empty
5028
- return null;
5030
+ /**
5031
+ * Requires a module only if available.
5032
+ * @memberof util
5033
+ * @param {string} moduleName Module to require
5034
+ * @returns {?Object} Required module if available and not empty, otherwise `null`
5035
+ */
5036
+ function inquire(moduleName) {
5037
+ try {
5038
+ var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
5039
+ if (mod && (mod.length || Object.keys(mod).length))
5040
+ return mod;
5041
+ } catch (e) {} // eslint-disable-line no-empty
5042
+ return null;
5043
+ }
5044
+ return inquire_1;
5029
5045
  }
5030
5046
 
5031
5047
  var utf8$2 = {};
@@ -5417,7 +5433,7 @@ function requireMinimal () {
5417
5433
  var util = exports;
5418
5434
 
5419
5435
  // used to return a Promise where callback is omitted
5420
- util.asPromise = aspromise;
5436
+ util.asPromise = requireAspromise();
5421
5437
 
5422
5438
  // converts to / from base64 encoded strings
5423
5439
  util.base64 = requireBase64();
@@ -5429,7 +5445,7 @@ function requireMinimal () {
5429
5445
  util.float = requireFloat();
5430
5446
 
5431
5447
  // requires modules optionally and hides the call from bundlers
5432
- util.inquire = inquire_1;
5448
+ util.inquire = requireInquire();
5433
5449
 
5434
5450
  // converts to / from utf8 encoded strings
5435
5451
  util.utf8 = requireUtf8();
@@ -10432,21 +10448,19 @@ class Client extends xchainClient.BaseXChainClient {
10432
10448
  }
10433
10449
  catch (error) {
10434
10450
  for (const fallback of FallBackUrls) {
10435
- for (const network of Object.keys(fallback)) {
10436
- try {
10437
- const networkObj = fallback[network];
10438
- const clientUrl = networkObj.node;
10439
- const cosmosClient = new xchainCosmos.CosmosSDKClient({
10440
- server: Array.isArray(clientUrl) ? clientUrl[0] : clientUrl,
10441
- chainId: this.getChainId(network),
10442
- prefix: getPrefix(network),
10443
- });
10444
- const tx = yield cosmosClient.txsHashGet(txId);
10445
- return tx;
10446
- }
10447
- catch (error) {
10448
- // Handle specific error if needed
10449
- }
10451
+ try {
10452
+ const networkObj = fallback[this.network];
10453
+ const clientUrl = networkObj.node;
10454
+ const cosmosClient = new xchainCosmos.CosmosSDKClient({
10455
+ server: Array.isArray(clientUrl) ? clientUrl[0] : clientUrl,
10456
+ chainId: this.getChainId(this.network),
10457
+ prefix: getPrefix(this.network),
10458
+ });
10459
+ const tx = yield cosmosClient.txsHashGet(txId);
10460
+ return tx;
10461
+ }
10462
+ catch (error) {
10463
+ // Handle specific error if needed
10450
10464
  }
10451
10465
  }
10452
10466
  return null;