@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.js
CHANGED
|
@@ -4372,8 +4372,8 @@ const FallBackUrls = [
|
|
|
4372
4372
|
rpc: ['https://stagenet-rpc.ninerealms.com'],
|
|
4373
4373
|
},
|
|
4374
4374
|
[lib.Network.Mainnet]: {
|
|
4375
|
-
node: ['https://thornode-v1.ninerealms.com'
|
|
4376
|
-
rpc: ['https://rpc-v1.ninerealms.com'
|
|
4375
|
+
node: ['https://thornode-v1.ninerealms.com'],
|
|
4376
|
+
rpc: ['https://rpc-v1.ninerealms.com'],
|
|
4377
4377
|
},
|
|
4378
4378
|
},
|
|
4379
4379
|
];
|
|
@@ -4987,178 +4987,201 @@ function readUintBE(buf, pos) {
|
|
|
4987
4987
|
| buf[pos + 3]) >>> 0;
|
|
4988
4988
|
}
|
|
4989
4989
|
|
|
4990
|
-
var inquire_1
|
|
4990
|
+
var inquire_1;
|
|
4991
|
+
var hasRequiredInquire;
|
|
4992
|
+
|
|
4993
|
+
function requireInquire () {
|
|
4994
|
+
if (hasRequiredInquire) return inquire_1;
|
|
4995
|
+
hasRequiredInquire = 1;
|
|
4996
|
+
inquire_1 = inquire;
|
|
4991
4997
|
|
|
4992
|
-
/**
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
function inquire(moduleName) {
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
4998
|
+
/**
|
|
4999
|
+
* Requires a module only if available.
|
|
5000
|
+
* @memberof util
|
|
5001
|
+
* @param {string} moduleName Module to require
|
|
5002
|
+
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
5003
|
+
*/
|
|
5004
|
+
function inquire(moduleName) {
|
|
5005
|
+
try {
|
|
5006
|
+
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
|
5007
|
+
if (mod && (mod.length || Object.keys(mod).length))
|
|
5008
|
+
return mod;
|
|
5009
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
5010
|
+
return null;
|
|
5011
|
+
}
|
|
5012
|
+
return inquire_1;
|
|
5005
5013
|
}
|
|
5006
5014
|
|
|
5007
5015
|
var utf8$2 = {};
|
|
5008
5016
|
|
|
5009
|
-
|
|
5017
|
+
var hasRequiredUtf8;
|
|
5018
|
+
|
|
5019
|
+
function requireUtf8 () {
|
|
5020
|
+
if (hasRequiredUtf8) return utf8$2;
|
|
5021
|
+
hasRequiredUtf8 = 1;
|
|
5022
|
+
(function (exports) {
|
|
5010
5023
|
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5024
|
+
/**
|
|
5025
|
+
* A minimal UTF8 implementation for number arrays.
|
|
5026
|
+
* @memberof util
|
|
5027
|
+
* @namespace
|
|
5028
|
+
*/
|
|
5029
|
+
var utf8 = exports;
|
|
5030
|
+
|
|
5031
|
+
/**
|
|
5032
|
+
* Calculates the UTF8 byte length of a string.
|
|
5033
|
+
* @param {string} string String
|
|
5034
|
+
* @returns {number} Byte length
|
|
5035
|
+
*/
|
|
5036
|
+
utf8.length = function utf8_length(string) {
|
|
5037
|
+
var len = 0,
|
|
5038
|
+
c = 0;
|
|
5039
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5040
|
+
c = string.charCodeAt(i);
|
|
5041
|
+
if (c < 128)
|
|
5042
|
+
len += 1;
|
|
5043
|
+
else if (c < 2048)
|
|
5044
|
+
len += 2;
|
|
5045
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5046
|
+
++i;
|
|
5047
|
+
len += 4;
|
|
5048
|
+
} else
|
|
5049
|
+
len += 3;
|
|
5050
|
+
}
|
|
5051
|
+
return len;
|
|
5052
|
+
};
|
|
5053
|
+
|
|
5054
|
+
/**
|
|
5055
|
+
* Reads UTF8 bytes as a string.
|
|
5056
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5057
|
+
* @param {number} start Source start
|
|
5058
|
+
* @param {number} end Source end
|
|
5059
|
+
* @returns {string} String read
|
|
5060
|
+
*/
|
|
5061
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5062
|
+
var len = end - start;
|
|
5063
|
+
if (len < 1)
|
|
5064
|
+
return "";
|
|
5065
|
+
var parts = null,
|
|
5066
|
+
chunk = [],
|
|
5067
|
+
i = 0, // char offset
|
|
5068
|
+
t; // temporary
|
|
5069
|
+
while (start < end) {
|
|
5070
|
+
t = buffer[start++];
|
|
5071
|
+
if (t < 128)
|
|
5072
|
+
chunk[i++] = t;
|
|
5073
|
+
else if (t > 191 && t < 224)
|
|
5074
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5075
|
+
else if (t > 239 && t < 365) {
|
|
5076
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5077
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5078
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5079
|
+
} else
|
|
5080
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5081
|
+
if (i > 8191) {
|
|
5082
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5083
|
+
i = 0;
|
|
5084
|
+
}
|
|
5085
|
+
}
|
|
5086
|
+
if (parts) {
|
|
5087
|
+
if (i)
|
|
5088
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5089
|
+
return parts.join("");
|
|
5090
|
+
}
|
|
5091
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5092
|
+
};
|
|
5093
|
+
|
|
5094
|
+
/**
|
|
5095
|
+
* Writes a string as UTF8 bytes.
|
|
5096
|
+
* @param {string} string Source string
|
|
5097
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5098
|
+
* @param {number} offset Destination offset
|
|
5099
|
+
* @returns {number} Bytes written
|
|
5100
|
+
*/
|
|
5101
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5102
|
+
var start = offset,
|
|
5103
|
+
c1, // character 1
|
|
5104
|
+
c2; // character 2
|
|
5105
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5106
|
+
c1 = string.charCodeAt(i);
|
|
5107
|
+
if (c1 < 128) {
|
|
5108
|
+
buffer[offset++] = c1;
|
|
5109
|
+
} else if (c1 < 2048) {
|
|
5110
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5111
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5112
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5113
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5114
|
+
++i;
|
|
5115
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5116
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5117
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5118
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5119
|
+
} else {
|
|
5120
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5121
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5122
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
return offset - start;
|
|
5126
|
+
};
|
|
5127
|
+
} (utf8$2));
|
|
5128
|
+
return utf8$2;
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
var pool_1;
|
|
5132
|
+
var hasRequiredPool;
|
|
5133
|
+
|
|
5134
|
+
function requirePool () {
|
|
5135
|
+
if (hasRequiredPool) return pool_1;
|
|
5136
|
+
hasRequiredPool = 1;
|
|
5137
|
+
pool_1 = pool;
|
|
5017
5138
|
|
|
5018
5139
|
/**
|
|
5019
|
-
*
|
|
5020
|
-
* @
|
|
5021
|
-
* @
|
|
5140
|
+
* An allocator as used by {@link util.pool}.
|
|
5141
|
+
* @typedef PoolAllocator
|
|
5142
|
+
* @type {function}
|
|
5143
|
+
* @param {number} size Buffer size
|
|
5144
|
+
* @returns {Uint8Array} Buffer
|
|
5022
5145
|
*/
|
|
5023
|
-
utf8.length = function utf8_length(string) {
|
|
5024
|
-
var len = 0,
|
|
5025
|
-
c = 0;
|
|
5026
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5027
|
-
c = string.charCodeAt(i);
|
|
5028
|
-
if (c < 128)
|
|
5029
|
-
len += 1;
|
|
5030
|
-
else if (c < 2048)
|
|
5031
|
-
len += 2;
|
|
5032
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5033
|
-
++i;
|
|
5034
|
-
len += 4;
|
|
5035
|
-
} else
|
|
5036
|
-
len += 3;
|
|
5037
|
-
}
|
|
5038
|
-
return len;
|
|
5039
|
-
};
|
|
5040
5146
|
|
|
5041
5147
|
/**
|
|
5042
|
-
*
|
|
5043
|
-
* @
|
|
5044
|
-
* @
|
|
5045
|
-
* @param {number}
|
|
5046
|
-
* @
|
|
5148
|
+
* A slicer as used by {@link util.pool}.
|
|
5149
|
+
* @typedef PoolSlicer
|
|
5150
|
+
* @type {function}
|
|
5151
|
+
* @param {number} start Start offset
|
|
5152
|
+
* @param {number} end End offset
|
|
5153
|
+
* @returns {Uint8Array} Buffer slice
|
|
5154
|
+
* @this {Uint8Array}
|
|
5047
5155
|
*/
|
|
5048
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5049
|
-
var len = end - start;
|
|
5050
|
-
if (len < 1)
|
|
5051
|
-
return "";
|
|
5052
|
-
var parts = null,
|
|
5053
|
-
chunk = [],
|
|
5054
|
-
i = 0, // char offset
|
|
5055
|
-
t; // temporary
|
|
5056
|
-
while (start < end) {
|
|
5057
|
-
t = buffer[start++];
|
|
5058
|
-
if (t < 128)
|
|
5059
|
-
chunk[i++] = t;
|
|
5060
|
-
else if (t > 191 && t < 224)
|
|
5061
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5062
|
-
else if (t > 239 && t < 365) {
|
|
5063
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5064
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5065
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5066
|
-
} else
|
|
5067
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5068
|
-
if (i > 8191) {
|
|
5069
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5070
|
-
i = 0;
|
|
5071
|
-
}
|
|
5072
|
-
}
|
|
5073
|
-
if (parts) {
|
|
5074
|
-
if (i)
|
|
5075
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5076
|
-
return parts.join("");
|
|
5077
|
-
}
|
|
5078
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5079
|
-
};
|
|
5080
5156
|
|
|
5081
5157
|
/**
|
|
5082
|
-
*
|
|
5083
|
-
* @
|
|
5084
|
-
* @
|
|
5085
|
-
* @param {
|
|
5086
|
-
* @
|
|
5158
|
+
* A general purpose buffer pool.
|
|
5159
|
+
* @memberof util
|
|
5160
|
+
* @function
|
|
5161
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5162
|
+
* @param {PoolSlicer} slice Slicer
|
|
5163
|
+
* @param {number} [size=8192] Slab size
|
|
5164
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5087
5165
|
*/
|
|
5088
|
-
|
|
5089
|
-
var
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
if (
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5100
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5101
|
-
++i;
|
|
5102
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5103
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5104
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5105
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5106
|
-
} else {
|
|
5107
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5108
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5109
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5166
|
+
function pool(alloc, slice, size) {
|
|
5167
|
+
var SIZE = size || 8192;
|
|
5168
|
+
var MAX = SIZE >>> 1;
|
|
5169
|
+
var slab = null;
|
|
5170
|
+
var offset = SIZE;
|
|
5171
|
+
return function pool_alloc(size) {
|
|
5172
|
+
if (size < 1 || size > MAX)
|
|
5173
|
+
return alloc(size);
|
|
5174
|
+
if (offset + size > SIZE) {
|
|
5175
|
+
slab = alloc(SIZE);
|
|
5176
|
+
offset = 0;
|
|
5110
5177
|
}
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
/**
|
|
5119
|
-
* An allocator as used by {@link util.pool}.
|
|
5120
|
-
* @typedef PoolAllocator
|
|
5121
|
-
* @type {function}
|
|
5122
|
-
* @param {number} size Buffer size
|
|
5123
|
-
* @returns {Uint8Array} Buffer
|
|
5124
|
-
*/
|
|
5125
|
-
|
|
5126
|
-
/**
|
|
5127
|
-
* A slicer as used by {@link util.pool}.
|
|
5128
|
-
* @typedef PoolSlicer
|
|
5129
|
-
* @type {function}
|
|
5130
|
-
* @param {number} start Start offset
|
|
5131
|
-
* @param {number} end End offset
|
|
5132
|
-
* @returns {Uint8Array} Buffer slice
|
|
5133
|
-
* @this {Uint8Array}
|
|
5134
|
-
*/
|
|
5135
|
-
|
|
5136
|
-
/**
|
|
5137
|
-
* A general purpose buffer pool.
|
|
5138
|
-
* @memberof util
|
|
5139
|
-
* @function
|
|
5140
|
-
* @param {PoolAllocator} alloc Allocator
|
|
5141
|
-
* @param {PoolSlicer} slice Slicer
|
|
5142
|
-
* @param {number} [size=8192] Slab size
|
|
5143
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5144
|
-
*/
|
|
5145
|
-
function pool(alloc, slice, size) {
|
|
5146
|
-
var SIZE = size || 8192;
|
|
5147
|
-
var MAX = SIZE >>> 1;
|
|
5148
|
-
var slab = null;
|
|
5149
|
-
var offset = SIZE;
|
|
5150
|
-
return function pool_alloc(size) {
|
|
5151
|
-
if (size < 1 || size > MAX)
|
|
5152
|
-
return alloc(size);
|
|
5153
|
-
if (offset + size > SIZE) {
|
|
5154
|
-
slab = alloc(SIZE);
|
|
5155
|
-
offset = 0;
|
|
5156
|
-
}
|
|
5157
|
-
var buf = slice.call(slab, offset, offset += size);
|
|
5158
|
-
if (offset & 7) // align to 32 bit
|
|
5159
|
-
offset = (offset | 7) + 1;
|
|
5160
|
-
return buf;
|
|
5161
|
-
};
|
|
5178
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5179
|
+
if (offset & 7) // align to 32 bit
|
|
5180
|
+
offset = (offset | 7) + 1;
|
|
5181
|
+
return buf;
|
|
5182
|
+
};
|
|
5183
|
+
}
|
|
5184
|
+
return pool_1;
|
|
5162
5185
|
}
|
|
5163
5186
|
|
|
5164
5187
|
var longbits;
|
|
@@ -5390,13 +5413,13 @@ function requireMinimal () {
|
|
|
5390
5413
|
util.float = float;
|
|
5391
5414
|
|
|
5392
5415
|
// requires modules optionally and hides the call from bundlers
|
|
5393
|
-
util.inquire =
|
|
5416
|
+
util.inquire = requireInquire();
|
|
5394
5417
|
|
|
5395
5418
|
// converts to / from utf8 encoded strings
|
|
5396
|
-
util.utf8 =
|
|
5419
|
+
util.utf8 = requireUtf8();
|
|
5397
5420
|
|
|
5398
5421
|
// provides a node-like buffer pool in the browser
|
|
5399
|
-
util.pool =
|
|
5422
|
+
util.pool = requirePool();
|
|
5400
5423
|
|
|
5401
5424
|
// utility to work with the low and high bits of a 64 bit value
|
|
5402
5425
|
util.LongBits = requireLongbits();
|