@xchainjs/xchain-thorchain 0.28.7 → 0.28.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.esm.js +184 -161
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +184 -161
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.esm.js
CHANGED
|
@@ -4344,8 +4344,8 @@ const FallBackUrls = [
|
|
|
4344
4344
|
rpc: ['https://stagenet-rpc.ninerealms.com'],
|
|
4345
4345
|
},
|
|
4346
4346
|
[Network.Mainnet]: {
|
|
4347
|
-
node: ['https://thornode-v1.ninerealms.com'
|
|
4348
|
-
rpc: ['https://rpc-v1.ninerealms.com'
|
|
4347
|
+
node: ['https://thornode-v1.ninerealms.com'],
|
|
4348
|
+
rpc: ['https://rpc-v1.ninerealms.com'],
|
|
4349
4349
|
},
|
|
4350
4350
|
},
|
|
4351
4351
|
];
|
|
@@ -4959,178 +4959,201 @@ function readUintBE(buf, pos) {
|
|
|
4959
4959
|
| buf[pos + 3]) >>> 0;
|
|
4960
4960
|
}
|
|
4961
4961
|
|
|
4962
|
-
var inquire_1
|
|
4962
|
+
var inquire_1;
|
|
4963
|
+
var hasRequiredInquire;
|
|
4964
|
+
|
|
4965
|
+
function requireInquire () {
|
|
4966
|
+
if (hasRequiredInquire) return inquire_1;
|
|
4967
|
+
hasRequiredInquire = 1;
|
|
4968
|
+
inquire_1 = inquire;
|
|
4963
4969
|
|
|
4964
|
-
/**
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
function inquire(moduleName) {
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4970
|
+
/**
|
|
4971
|
+
* Requires a module only if available.
|
|
4972
|
+
* @memberof util
|
|
4973
|
+
* @param {string} moduleName Module to require
|
|
4974
|
+
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
4975
|
+
*/
|
|
4976
|
+
function inquire(moduleName) {
|
|
4977
|
+
try {
|
|
4978
|
+
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
|
4979
|
+
if (mod && (mod.length || Object.keys(mod).length))
|
|
4980
|
+
return mod;
|
|
4981
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
4982
|
+
return null;
|
|
4983
|
+
}
|
|
4984
|
+
return inquire_1;
|
|
4977
4985
|
}
|
|
4978
4986
|
|
|
4979
4987
|
var utf8$2 = {};
|
|
4980
4988
|
|
|
4981
|
-
|
|
4989
|
+
var hasRequiredUtf8;
|
|
4990
|
+
|
|
4991
|
+
function requireUtf8 () {
|
|
4992
|
+
if (hasRequiredUtf8) return utf8$2;
|
|
4993
|
+
hasRequiredUtf8 = 1;
|
|
4994
|
+
(function (exports) {
|
|
4982
4995
|
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4996
|
+
/**
|
|
4997
|
+
* A minimal UTF8 implementation for number arrays.
|
|
4998
|
+
* @memberof util
|
|
4999
|
+
* @namespace
|
|
5000
|
+
*/
|
|
5001
|
+
var utf8 = exports;
|
|
5002
|
+
|
|
5003
|
+
/**
|
|
5004
|
+
* Calculates the UTF8 byte length of a string.
|
|
5005
|
+
* @param {string} string String
|
|
5006
|
+
* @returns {number} Byte length
|
|
5007
|
+
*/
|
|
5008
|
+
utf8.length = function utf8_length(string) {
|
|
5009
|
+
var len = 0,
|
|
5010
|
+
c = 0;
|
|
5011
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5012
|
+
c = string.charCodeAt(i);
|
|
5013
|
+
if (c < 128)
|
|
5014
|
+
len += 1;
|
|
5015
|
+
else if (c < 2048)
|
|
5016
|
+
len += 2;
|
|
5017
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5018
|
+
++i;
|
|
5019
|
+
len += 4;
|
|
5020
|
+
} else
|
|
5021
|
+
len += 3;
|
|
5022
|
+
}
|
|
5023
|
+
return len;
|
|
5024
|
+
};
|
|
5025
|
+
|
|
5026
|
+
/**
|
|
5027
|
+
* Reads UTF8 bytes as a string.
|
|
5028
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5029
|
+
* @param {number} start Source start
|
|
5030
|
+
* @param {number} end Source end
|
|
5031
|
+
* @returns {string} String read
|
|
5032
|
+
*/
|
|
5033
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5034
|
+
var len = end - start;
|
|
5035
|
+
if (len < 1)
|
|
5036
|
+
return "";
|
|
5037
|
+
var parts = null,
|
|
5038
|
+
chunk = [],
|
|
5039
|
+
i = 0, // char offset
|
|
5040
|
+
t; // temporary
|
|
5041
|
+
while (start < end) {
|
|
5042
|
+
t = buffer[start++];
|
|
5043
|
+
if (t < 128)
|
|
5044
|
+
chunk[i++] = t;
|
|
5045
|
+
else if (t > 191 && t < 224)
|
|
5046
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5047
|
+
else if (t > 239 && t < 365) {
|
|
5048
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5049
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5050
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5051
|
+
} else
|
|
5052
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5053
|
+
if (i > 8191) {
|
|
5054
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5055
|
+
i = 0;
|
|
5056
|
+
}
|
|
5057
|
+
}
|
|
5058
|
+
if (parts) {
|
|
5059
|
+
if (i)
|
|
5060
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5061
|
+
return parts.join("");
|
|
5062
|
+
}
|
|
5063
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5064
|
+
};
|
|
5065
|
+
|
|
5066
|
+
/**
|
|
5067
|
+
* Writes a string as UTF8 bytes.
|
|
5068
|
+
* @param {string} string Source string
|
|
5069
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5070
|
+
* @param {number} offset Destination offset
|
|
5071
|
+
* @returns {number} Bytes written
|
|
5072
|
+
*/
|
|
5073
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5074
|
+
var start = offset,
|
|
5075
|
+
c1, // character 1
|
|
5076
|
+
c2; // character 2
|
|
5077
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5078
|
+
c1 = string.charCodeAt(i);
|
|
5079
|
+
if (c1 < 128) {
|
|
5080
|
+
buffer[offset++] = c1;
|
|
5081
|
+
} else if (c1 < 2048) {
|
|
5082
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5083
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5084
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5085
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5086
|
+
++i;
|
|
5087
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5088
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5089
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5090
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5091
|
+
} else {
|
|
5092
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5093
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5094
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
return offset - start;
|
|
5098
|
+
};
|
|
5099
|
+
} (utf8$2));
|
|
5100
|
+
return utf8$2;
|
|
5101
|
+
}
|
|
5102
|
+
|
|
5103
|
+
var pool_1;
|
|
5104
|
+
var hasRequiredPool;
|
|
5105
|
+
|
|
5106
|
+
function requirePool () {
|
|
5107
|
+
if (hasRequiredPool) return pool_1;
|
|
5108
|
+
hasRequiredPool = 1;
|
|
5109
|
+
pool_1 = pool;
|
|
4989
5110
|
|
|
4990
5111
|
/**
|
|
4991
|
-
*
|
|
4992
|
-
* @
|
|
4993
|
-
* @
|
|
5112
|
+
* An allocator as used by {@link util.pool}.
|
|
5113
|
+
* @typedef PoolAllocator
|
|
5114
|
+
* @type {function}
|
|
5115
|
+
* @param {number} size Buffer size
|
|
5116
|
+
* @returns {Uint8Array} Buffer
|
|
4994
5117
|
*/
|
|
4995
|
-
utf8.length = function utf8_length(string) {
|
|
4996
|
-
var len = 0,
|
|
4997
|
-
c = 0;
|
|
4998
|
-
for (var i = 0; i < string.length; ++i) {
|
|
4999
|
-
c = string.charCodeAt(i);
|
|
5000
|
-
if (c < 128)
|
|
5001
|
-
len += 1;
|
|
5002
|
-
else if (c < 2048)
|
|
5003
|
-
len += 2;
|
|
5004
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5005
|
-
++i;
|
|
5006
|
-
len += 4;
|
|
5007
|
-
} else
|
|
5008
|
-
len += 3;
|
|
5009
|
-
}
|
|
5010
|
-
return len;
|
|
5011
|
-
};
|
|
5012
5118
|
|
|
5013
5119
|
/**
|
|
5014
|
-
*
|
|
5015
|
-
* @
|
|
5016
|
-
* @
|
|
5017
|
-
* @param {number}
|
|
5018
|
-
* @
|
|
5120
|
+
* A slicer as used by {@link util.pool}.
|
|
5121
|
+
* @typedef PoolSlicer
|
|
5122
|
+
* @type {function}
|
|
5123
|
+
* @param {number} start Start offset
|
|
5124
|
+
* @param {number} end End offset
|
|
5125
|
+
* @returns {Uint8Array} Buffer slice
|
|
5126
|
+
* @this {Uint8Array}
|
|
5019
5127
|
*/
|
|
5020
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5021
|
-
var len = end - start;
|
|
5022
|
-
if (len < 1)
|
|
5023
|
-
return "";
|
|
5024
|
-
var parts = null,
|
|
5025
|
-
chunk = [],
|
|
5026
|
-
i = 0, // char offset
|
|
5027
|
-
t; // temporary
|
|
5028
|
-
while (start < end) {
|
|
5029
|
-
t = buffer[start++];
|
|
5030
|
-
if (t < 128)
|
|
5031
|
-
chunk[i++] = t;
|
|
5032
|
-
else if (t > 191 && t < 224)
|
|
5033
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5034
|
-
else if (t > 239 && t < 365) {
|
|
5035
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5036
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5037
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5038
|
-
} else
|
|
5039
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5040
|
-
if (i > 8191) {
|
|
5041
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5042
|
-
i = 0;
|
|
5043
|
-
}
|
|
5044
|
-
}
|
|
5045
|
-
if (parts) {
|
|
5046
|
-
if (i)
|
|
5047
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5048
|
-
return parts.join("");
|
|
5049
|
-
}
|
|
5050
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5051
|
-
};
|
|
5052
5128
|
|
|
5053
5129
|
/**
|
|
5054
|
-
*
|
|
5055
|
-
* @
|
|
5056
|
-
* @
|
|
5057
|
-
* @param {
|
|
5058
|
-
* @
|
|
5130
|
+
* A general purpose buffer pool.
|
|
5131
|
+
* @memberof util
|
|
5132
|
+
* @function
|
|
5133
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5134
|
+
* @param {PoolSlicer} slice Slicer
|
|
5135
|
+
* @param {number} [size=8192] Slab size
|
|
5136
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5059
5137
|
*/
|
|
5060
|
-
|
|
5061
|
-
var
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
if (
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5072
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5073
|
-
++i;
|
|
5074
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5075
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5076
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5077
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5078
|
-
} else {
|
|
5079
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5080
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5081
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5138
|
+
function pool(alloc, slice, size) {
|
|
5139
|
+
var SIZE = size || 8192;
|
|
5140
|
+
var MAX = SIZE >>> 1;
|
|
5141
|
+
var slab = null;
|
|
5142
|
+
var offset = SIZE;
|
|
5143
|
+
return function pool_alloc(size) {
|
|
5144
|
+
if (size < 1 || size > MAX)
|
|
5145
|
+
return alloc(size);
|
|
5146
|
+
if (offset + size > SIZE) {
|
|
5147
|
+
slab = alloc(SIZE);
|
|
5148
|
+
offset = 0;
|
|
5082
5149
|
}
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
/**
|
|
5091
|
-
* An allocator as used by {@link util.pool}.
|
|
5092
|
-
* @typedef PoolAllocator
|
|
5093
|
-
* @type {function}
|
|
5094
|
-
* @param {number} size Buffer size
|
|
5095
|
-
* @returns {Uint8Array} Buffer
|
|
5096
|
-
*/
|
|
5097
|
-
|
|
5098
|
-
/**
|
|
5099
|
-
* A slicer as used by {@link util.pool}.
|
|
5100
|
-
* @typedef PoolSlicer
|
|
5101
|
-
* @type {function}
|
|
5102
|
-
* @param {number} start Start offset
|
|
5103
|
-
* @param {number} end End offset
|
|
5104
|
-
* @returns {Uint8Array} Buffer slice
|
|
5105
|
-
* @this {Uint8Array}
|
|
5106
|
-
*/
|
|
5107
|
-
|
|
5108
|
-
/**
|
|
5109
|
-
* A general purpose buffer pool.
|
|
5110
|
-
* @memberof util
|
|
5111
|
-
* @function
|
|
5112
|
-
* @param {PoolAllocator} alloc Allocator
|
|
5113
|
-
* @param {PoolSlicer} slice Slicer
|
|
5114
|
-
* @param {number} [size=8192] Slab size
|
|
5115
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5116
|
-
*/
|
|
5117
|
-
function pool(alloc, slice, size) {
|
|
5118
|
-
var SIZE = size || 8192;
|
|
5119
|
-
var MAX = SIZE >>> 1;
|
|
5120
|
-
var slab = null;
|
|
5121
|
-
var offset = SIZE;
|
|
5122
|
-
return function pool_alloc(size) {
|
|
5123
|
-
if (size < 1 || size > MAX)
|
|
5124
|
-
return alloc(size);
|
|
5125
|
-
if (offset + size > SIZE) {
|
|
5126
|
-
slab = alloc(SIZE);
|
|
5127
|
-
offset = 0;
|
|
5128
|
-
}
|
|
5129
|
-
var buf = slice.call(slab, offset, offset += size);
|
|
5130
|
-
if (offset & 7) // align to 32 bit
|
|
5131
|
-
offset = (offset | 7) + 1;
|
|
5132
|
-
return buf;
|
|
5133
|
-
};
|
|
5150
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5151
|
+
if (offset & 7) // align to 32 bit
|
|
5152
|
+
offset = (offset | 7) + 1;
|
|
5153
|
+
return buf;
|
|
5154
|
+
};
|
|
5155
|
+
}
|
|
5156
|
+
return pool_1;
|
|
5134
5157
|
}
|
|
5135
5158
|
|
|
5136
5159
|
var longbits;
|
|
@@ -5362,13 +5385,13 @@ function requireMinimal () {
|
|
|
5362
5385
|
util.float = float;
|
|
5363
5386
|
|
|
5364
5387
|
// requires modules optionally and hides the call from bundlers
|
|
5365
|
-
util.inquire =
|
|
5388
|
+
util.inquire = requireInquire();
|
|
5366
5389
|
|
|
5367
5390
|
// converts to / from utf8 encoded strings
|
|
5368
|
-
util.utf8 =
|
|
5391
|
+
util.utf8 = requireUtf8();
|
|
5369
5392
|
|
|
5370
5393
|
// provides a node-like buffer pool in the browser
|
|
5371
|
-
util.pool =
|
|
5394
|
+
util.pool = requirePool();
|
|
5372
5395
|
|
|
5373
5396
|
// utility to work with the low and high bits of a 64 bit value
|
|
5374
5397
|
util.LongBits = requireLongbits();
|