@xchainjs/xchain-thorchain 0.28.13 → 0.28.14
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 +232 -263
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +232 -263
- package/lib/index.js.map +1 -1
- package/lib/types/client-types.d.ts +2 -4
- package/package.json +3 -3
package/lib/index.esm.js
CHANGED
|
@@ -4564,89 +4564,81 @@ function requireBase64 () {
|
|
|
4564
4564
|
return base64$1;
|
|
4565
4565
|
}
|
|
4566
4566
|
|
|
4567
|
-
var eventemitter;
|
|
4568
|
-
var hasRequiredEventemitter;
|
|
4569
|
-
|
|
4570
|
-
function requireEventemitter () {
|
|
4571
|
-
if (hasRequiredEventemitter) return eventemitter;
|
|
4572
|
-
hasRequiredEventemitter = 1;
|
|
4573
|
-
eventemitter = EventEmitter;
|
|
4567
|
+
var eventemitter = EventEmitter;
|
|
4574
4568
|
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
/**
|
|
4584
|
-
* Registered listeners.
|
|
4585
|
-
* @type {Object.<string,*>}
|
|
4586
|
-
* @private
|
|
4587
|
-
*/
|
|
4588
|
-
this._listeners = {};
|
|
4589
|
-
}
|
|
4569
|
+
/**
|
|
4570
|
+
* Constructs a new event emitter instance.
|
|
4571
|
+
* @classdesc A minimal event emitter.
|
|
4572
|
+
* @memberof util
|
|
4573
|
+
* @constructor
|
|
4574
|
+
*/
|
|
4575
|
+
function EventEmitter() {
|
|
4590
4576
|
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4599
|
-
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4600
|
-
fn : fn,
|
|
4601
|
-
ctx : ctx || this
|
|
4602
|
-
});
|
|
4603
|
-
return this;
|
|
4604
|
-
};
|
|
4577
|
+
/**
|
|
4578
|
+
* Registered listeners.
|
|
4579
|
+
* @type {Object.<string,*>}
|
|
4580
|
+
* @private
|
|
4581
|
+
*/
|
|
4582
|
+
this._listeners = {};
|
|
4583
|
+
}
|
|
4605
4584
|
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
for (var i = 0; i < listeners.length;)
|
|
4621
|
-
if (listeners[i].fn === fn)
|
|
4622
|
-
listeners.splice(i, 1);
|
|
4623
|
-
else
|
|
4624
|
-
++i;
|
|
4625
|
-
}
|
|
4626
|
-
}
|
|
4627
|
-
return this;
|
|
4628
|
-
};
|
|
4585
|
+
/**
|
|
4586
|
+
* Registers an event listener.
|
|
4587
|
+
* @param {string} evt Event name
|
|
4588
|
+
* @param {function} fn Listener
|
|
4589
|
+
* @param {*} [ctx] Listener context
|
|
4590
|
+
* @returns {util.EventEmitter} `this`
|
|
4591
|
+
*/
|
|
4592
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4593
|
+
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4594
|
+
fn : fn,
|
|
4595
|
+
ctx : ctx || this
|
|
4596
|
+
});
|
|
4597
|
+
return this;
|
|
4598
|
+
};
|
|
4629
4599
|
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
}
|
|
4600
|
+
/**
|
|
4601
|
+
* Removes an event listener or any matching listeners if arguments are omitted.
|
|
4602
|
+
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
|
4603
|
+
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
|
4604
|
+
* @returns {util.EventEmitter} `this`
|
|
4605
|
+
*/
|
|
4606
|
+
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4607
|
+
if (evt === undefined)
|
|
4608
|
+
this._listeners = {};
|
|
4609
|
+
else {
|
|
4610
|
+
if (fn === undefined)
|
|
4611
|
+
this._listeners[evt] = [];
|
|
4612
|
+
else {
|
|
4613
|
+
var listeners = this._listeners[evt];
|
|
4614
|
+
for (var i = 0; i < listeners.length;)
|
|
4615
|
+
if (listeners[i].fn === fn)
|
|
4616
|
+
listeners.splice(i, 1);
|
|
4617
|
+
else
|
|
4618
|
+
++i;
|
|
4619
|
+
}
|
|
4620
|
+
}
|
|
4621
|
+
return this;
|
|
4622
|
+
};
|
|
4623
|
+
|
|
4624
|
+
/**
|
|
4625
|
+
* Emits an event by calling its listeners with the specified arguments.
|
|
4626
|
+
* @param {string} evt Event name
|
|
4627
|
+
* @param {...*} args Arguments
|
|
4628
|
+
* @returns {util.EventEmitter} `this`
|
|
4629
|
+
*/
|
|
4630
|
+
EventEmitter.prototype.emit = function emit(evt) {
|
|
4631
|
+
var listeners = this._listeners[evt];
|
|
4632
|
+
if (listeners) {
|
|
4633
|
+
var args = [],
|
|
4634
|
+
i = 1;
|
|
4635
|
+
for (; i < arguments.length;)
|
|
4636
|
+
args.push(arguments[i++]);
|
|
4637
|
+
for (i = 0; i < listeners.length;)
|
|
4638
|
+
listeners[i].fn.apply(listeners[i++].ctx, args);
|
|
4639
|
+
}
|
|
4640
|
+
return this;
|
|
4641
|
+
};
|
|
4650
4642
|
|
|
4651
4643
|
var float;
|
|
4652
4644
|
var hasRequiredFloat;
|
|
@@ -4991,201 +4983,178 @@ function requireFloat () {
|
|
|
4991
4983
|
return float;
|
|
4992
4984
|
}
|
|
4993
4985
|
|
|
4994
|
-
var inquire_1;
|
|
4995
|
-
var hasRequiredInquire;
|
|
4996
|
-
|
|
4997
|
-
function requireInquire () {
|
|
4998
|
-
if (hasRequiredInquire) return inquire_1;
|
|
4999
|
-
hasRequiredInquire = 1;
|
|
5000
|
-
inquire_1 = inquire;
|
|
4986
|
+
var inquire_1 = inquire;
|
|
5001
4987
|
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
}
|
|
5016
|
-
return inquire_1;
|
|
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;
|
|
5017
5001
|
}
|
|
5018
5002
|
|
|
5019
5003
|
var utf8$2 = {};
|
|
5020
5004
|
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
function requireUtf8 () {
|
|
5024
|
-
if (hasRequiredUtf8) return utf8$2;
|
|
5025
|
-
hasRequiredUtf8 = 1;
|
|
5026
|
-
(function (exports) {
|
|
5027
|
-
|
|
5028
|
-
/**
|
|
5029
|
-
* A minimal UTF8 implementation for number arrays.
|
|
5030
|
-
* @memberof util
|
|
5031
|
-
* @namespace
|
|
5032
|
-
*/
|
|
5033
|
-
var utf8 = exports;
|
|
5034
|
-
|
|
5035
|
-
/**
|
|
5036
|
-
* Calculates the UTF8 byte length of a string.
|
|
5037
|
-
* @param {string} string String
|
|
5038
|
-
* @returns {number} Byte length
|
|
5039
|
-
*/
|
|
5040
|
-
utf8.length = function utf8_length(string) {
|
|
5041
|
-
var len = 0,
|
|
5042
|
-
c = 0;
|
|
5043
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5044
|
-
c = string.charCodeAt(i);
|
|
5045
|
-
if (c < 128)
|
|
5046
|
-
len += 1;
|
|
5047
|
-
else if (c < 2048)
|
|
5048
|
-
len += 2;
|
|
5049
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5050
|
-
++i;
|
|
5051
|
-
len += 4;
|
|
5052
|
-
} else
|
|
5053
|
-
len += 3;
|
|
5054
|
-
}
|
|
5055
|
-
return len;
|
|
5056
|
-
};
|
|
5057
|
-
|
|
5058
|
-
/**
|
|
5059
|
-
* Reads UTF8 bytes as a string.
|
|
5060
|
-
* @param {Uint8Array} buffer Source buffer
|
|
5061
|
-
* @param {number} start Source start
|
|
5062
|
-
* @param {number} end Source end
|
|
5063
|
-
* @returns {string} String read
|
|
5064
|
-
*/
|
|
5065
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5066
|
-
var len = end - start;
|
|
5067
|
-
if (len < 1)
|
|
5068
|
-
return "";
|
|
5069
|
-
var parts = null,
|
|
5070
|
-
chunk = [],
|
|
5071
|
-
i = 0, // char offset
|
|
5072
|
-
t; // temporary
|
|
5073
|
-
while (start < end) {
|
|
5074
|
-
t = buffer[start++];
|
|
5075
|
-
if (t < 128)
|
|
5076
|
-
chunk[i++] = t;
|
|
5077
|
-
else if (t > 191 && t < 224)
|
|
5078
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5079
|
-
else if (t > 239 && t < 365) {
|
|
5080
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5081
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5082
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5083
|
-
} else
|
|
5084
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5085
|
-
if (i > 8191) {
|
|
5086
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5087
|
-
i = 0;
|
|
5088
|
-
}
|
|
5089
|
-
}
|
|
5090
|
-
if (parts) {
|
|
5091
|
-
if (i)
|
|
5092
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5093
|
-
return parts.join("");
|
|
5094
|
-
}
|
|
5095
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5096
|
-
};
|
|
5005
|
+
(function (exports) {
|
|
5097
5006
|
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
*/
|
|
5105
|
-
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5106
|
-
var start = offset,
|
|
5107
|
-
c1, // character 1
|
|
5108
|
-
c2; // character 2
|
|
5109
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5110
|
-
c1 = string.charCodeAt(i);
|
|
5111
|
-
if (c1 < 128) {
|
|
5112
|
-
buffer[offset++] = c1;
|
|
5113
|
-
} else if (c1 < 2048) {
|
|
5114
|
-
buffer[offset++] = c1 >> 6 | 192;
|
|
5115
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5116
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5117
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5118
|
-
++i;
|
|
5119
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5120
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5121
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5122
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5123
|
-
} else {
|
|
5124
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5125
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5126
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5127
|
-
}
|
|
5128
|
-
}
|
|
5129
|
-
return offset - start;
|
|
5130
|
-
};
|
|
5131
|
-
} (utf8$2));
|
|
5132
|
-
return utf8$2;
|
|
5133
|
-
}
|
|
5134
|
-
|
|
5135
|
-
var pool_1;
|
|
5136
|
-
var hasRequiredPool;
|
|
5137
|
-
|
|
5138
|
-
function requirePool () {
|
|
5139
|
-
if (hasRequiredPool) return pool_1;
|
|
5140
|
-
hasRequiredPool = 1;
|
|
5141
|
-
pool_1 = pool;
|
|
5007
|
+
/**
|
|
5008
|
+
* A minimal UTF8 implementation for number arrays.
|
|
5009
|
+
* @memberof util
|
|
5010
|
+
* @namespace
|
|
5011
|
+
*/
|
|
5012
|
+
var utf8 = exports;
|
|
5142
5013
|
|
|
5143
5014
|
/**
|
|
5144
|
-
*
|
|
5145
|
-
* @
|
|
5146
|
-
* @
|
|
5147
|
-
* @param {number} size Buffer size
|
|
5148
|
-
* @returns {Uint8Array} Buffer
|
|
5015
|
+
* Calculates the UTF8 byte length of a string.
|
|
5016
|
+
* @param {string} string String
|
|
5017
|
+
* @returns {number} Byte length
|
|
5149
5018
|
*/
|
|
5019
|
+
utf8.length = function utf8_length(string) {
|
|
5020
|
+
var len = 0,
|
|
5021
|
+
c = 0;
|
|
5022
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5023
|
+
c = string.charCodeAt(i);
|
|
5024
|
+
if (c < 128)
|
|
5025
|
+
len += 1;
|
|
5026
|
+
else if (c < 2048)
|
|
5027
|
+
len += 2;
|
|
5028
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5029
|
+
++i;
|
|
5030
|
+
len += 4;
|
|
5031
|
+
} else
|
|
5032
|
+
len += 3;
|
|
5033
|
+
}
|
|
5034
|
+
return len;
|
|
5035
|
+
};
|
|
5150
5036
|
|
|
5151
5037
|
/**
|
|
5152
|
-
*
|
|
5153
|
-
* @
|
|
5154
|
-
* @
|
|
5155
|
-
* @param {number}
|
|
5156
|
-
* @
|
|
5157
|
-
* @returns {Uint8Array} Buffer slice
|
|
5158
|
-
* @this {Uint8Array}
|
|
5038
|
+
* Reads UTF8 bytes as a string.
|
|
5039
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5040
|
+
* @param {number} start Source start
|
|
5041
|
+
* @param {number} end Source end
|
|
5042
|
+
* @returns {string} String read
|
|
5159
5043
|
*/
|
|
5044
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5045
|
+
var len = end - start;
|
|
5046
|
+
if (len < 1)
|
|
5047
|
+
return "";
|
|
5048
|
+
var parts = null,
|
|
5049
|
+
chunk = [],
|
|
5050
|
+
i = 0, // char offset
|
|
5051
|
+
t; // temporary
|
|
5052
|
+
while (start < end) {
|
|
5053
|
+
t = buffer[start++];
|
|
5054
|
+
if (t < 128)
|
|
5055
|
+
chunk[i++] = t;
|
|
5056
|
+
else if (t > 191 && t < 224)
|
|
5057
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5058
|
+
else if (t > 239 && t < 365) {
|
|
5059
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5060
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5061
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5062
|
+
} else
|
|
5063
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5064
|
+
if (i > 8191) {
|
|
5065
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5066
|
+
i = 0;
|
|
5067
|
+
}
|
|
5068
|
+
}
|
|
5069
|
+
if (parts) {
|
|
5070
|
+
if (i)
|
|
5071
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5072
|
+
return parts.join("");
|
|
5073
|
+
}
|
|
5074
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5075
|
+
};
|
|
5160
5076
|
|
|
5161
5077
|
/**
|
|
5162
|
-
*
|
|
5163
|
-
* @
|
|
5164
|
-
* @
|
|
5165
|
-
* @param {
|
|
5166
|
-
* @
|
|
5167
|
-
* @param {number} [size=8192] Slab size
|
|
5168
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5078
|
+
* Writes a string as UTF8 bytes.
|
|
5079
|
+
* @param {string} string Source string
|
|
5080
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5081
|
+
* @param {number} offset Destination offset
|
|
5082
|
+
* @returns {number} Bytes written
|
|
5169
5083
|
*/
|
|
5170
|
-
function
|
|
5171
|
-
var
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
var
|
|
5175
|
-
|
|
5176
|
-
if (
|
|
5177
|
-
|
|
5178
|
-
if (
|
|
5179
|
-
|
|
5180
|
-
offset =
|
|
5084
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5085
|
+
var start = offset,
|
|
5086
|
+
c1, // character 1
|
|
5087
|
+
c2; // character 2
|
|
5088
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5089
|
+
c1 = string.charCodeAt(i);
|
|
5090
|
+
if (c1 < 128) {
|
|
5091
|
+
buffer[offset++] = c1;
|
|
5092
|
+
} else if (c1 < 2048) {
|
|
5093
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5094
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5095
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5096
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5097
|
+
++i;
|
|
5098
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5099
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5100
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5101
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5102
|
+
} else {
|
|
5103
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5104
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5105
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5181
5106
|
}
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5107
|
+
}
|
|
5108
|
+
return offset - start;
|
|
5109
|
+
};
|
|
5110
|
+
} (utf8$2));
|
|
5111
|
+
|
|
5112
|
+
var pool_1 = pool;
|
|
5113
|
+
|
|
5114
|
+
/**
|
|
5115
|
+
* An allocator as used by {@link util.pool}.
|
|
5116
|
+
* @typedef PoolAllocator
|
|
5117
|
+
* @type {function}
|
|
5118
|
+
* @param {number} size Buffer size
|
|
5119
|
+
* @returns {Uint8Array} Buffer
|
|
5120
|
+
*/
|
|
5121
|
+
|
|
5122
|
+
/**
|
|
5123
|
+
* A slicer as used by {@link util.pool}.
|
|
5124
|
+
* @typedef PoolSlicer
|
|
5125
|
+
* @type {function}
|
|
5126
|
+
* @param {number} start Start offset
|
|
5127
|
+
* @param {number} end End offset
|
|
5128
|
+
* @returns {Uint8Array} Buffer slice
|
|
5129
|
+
* @this {Uint8Array}
|
|
5130
|
+
*/
|
|
5131
|
+
|
|
5132
|
+
/**
|
|
5133
|
+
* A general purpose buffer pool.
|
|
5134
|
+
* @memberof util
|
|
5135
|
+
* @function
|
|
5136
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5137
|
+
* @param {PoolSlicer} slice Slicer
|
|
5138
|
+
* @param {number} [size=8192] Slab size
|
|
5139
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5140
|
+
*/
|
|
5141
|
+
function pool(alloc, slice, size) {
|
|
5142
|
+
var SIZE = size || 8192;
|
|
5143
|
+
var MAX = SIZE >>> 1;
|
|
5144
|
+
var slab = null;
|
|
5145
|
+
var offset = SIZE;
|
|
5146
|
+
return function pool_alloc(size) {
|
|
5147
|
+
if (size < 1 || size > MAX)
|
|
5148
|
+
return alloc(size);
|
|
5149
|
+
if (offset + size > SIZE) {
|
|
5150
|
+
slab = alloc(SIZE);
|
|
5151
|
+
offset = 0;
|
|
5152
|
+
}
|
|
5153
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5154
|
+
if (offset & 7) // align to 32 bit
|
|
5155
|
+
offset = (offset | 7) + 1;
|
|
5156
|
+
return buf;
|
|
5157
|
+
};
|
|
5189
5158
|
}
|
|
5190
5159
|
|
|
5191
5160
|
var longbits;
|
|
@@ -5411,19 +5380,19 @@ function requireMinimal () {
|
|
|
5411
5380
|
util.base64 = requireBase64();
|
|
5412
5381
|
|
|
5413
5382
|
// base class of rpc.Service
|
|
5414
|
-
util.EventEmitter =
|
|
5383
|
+
util.EventEmitter = eventemitter;
|
|
5415
5384
|
|
|
5416
5385
|
// float handling accross browsers
|
|
5417
5386
|
util.float = requireFloat();
|
|
5418
5387
|
|
|
5419
5388
|
// requires modules optionally and hides the call from bundlers
|
|
5420
|
-
util.inquire =
|
|
5389
|
+
util.inquire = inquire_1;
|
|
5421
5390
|
|
|
5422
5391
|
// converts to / from utf8 encoded strings
|
|
5423
|
-
util.utf8 =
|
|
5392
|
+
util.utf8 = utf8$2;
|
|
5424
5393
|
|
|
5425
5394
|
// provides a node-like buffer pool in the browser
|
|
5426
|
-
util.pool =
|
|
5395
|
+
util.pool = pool_1;
|
|
5427
5396
|
|
|
5428
5397
|
// utility to work with the low and high bits of a 64 bit value
|
|
5429
5398
|
util.LongBits = requireLongbits();
|
|
@@ -10810,7 +10779,7 @@ class Client extends BaseXChainClient {
|
|
|
10810
10779
|
getFees() {
|
|
10811
10780
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10812
10781
|
try {
|
|
10813
|
-
const { data: {
|
|
10782
|
+
const { data: { native_tx_fee_rune: fee }, } = yield axios.get(`${this.getClientUrl().node}/thorchain/network`);
|
|
10814
10783
|
// validate data
|
|
10815
10784
|
if (!fee || isNaN(fee) || fee < 0)
|
|
10816
10785
|
throw Error(`Invalid fee: ${fee.toString()}`);
|