@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.js
CHANGED
|
@@ -4592,89 +4592,81 @@ function requireBase64 () {
|
|
|
4592
4592
|
return base64$1;
|
|
4593
4593
|
}
|
|
4594
4594
|
|
|
4595
|
-
var eventemitter;
|
|
4596
|
-
var hasRequiredEventemitter;
|
|
4597
|
-
|
|
4598
|
-
function requireEventemitter () {
|
|
4599
|
-
if (hasRequiredEventemitter) return eventemitter;
|
|
4600
|
-
hasRequiredEventemitter = 1;
|
|
4601
|
-
eventemitter = EventEmitter;
|
|
4595
|
+
var eventemitter = EventEmitter;
|
|
4602
4596
|
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
/**
|
|
4612
|
-
* Registered listeners.
|
|
4613
|
-
* @type {Object.<string,*>}
|
|
4614
|
-
* @private
|
|
4615
|
-
*/
|
|
4616
|
-
this._listeners = {};
|
|
4617
|
-
}
|
|
4597
|
+
/**
|
|
4598
|
+
* Constructs a new event emitter instance.
|
|
4599
|
+
* @classdesc A minimal event emitter.
|
|
4600
|
+
* @memberof util
|
|
4601
|
+
* @constructor
|
|
4602
|
+
*/
|
|
4603
|
+
function EventEmitter() {
|
|
4618
4604
|
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4627
|
-
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4628
|
-
fn : fn,
|
|
4629
|
-
ctx : ctx || this
|
|
4630
|
-
});
|
|
4631
|
-
return this;
|
|
4632
|
-
};
|
|
4605
|
+
/**
|
|
4606
|
+
* Registered listeners.
|
|
4607
|
+
* @type {Object.<string,*>}
|
|
4608
|
+
* @private
|
|
4609
|
+
*/
|
|
4610
|
+
this._listeners = {};
|
|
4611
|
+
}
|
|
4633
4612
|
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
for (var i = 0; i < listeners.length;)
|
|
4649
|
-
if (listeners[i].fn === fn)
|
|
4650
|
-
listeners.splice(i, 1);
|
|
4651
|
-
else
|
|
4652
|
-
++i;
|
|
4653
|
-
}
|
|
4654
|
-
}
|
|
4655
|
-
return this;
|
|
4656
|
-
};
|
|
4613
|
+
/**
|
|
4614
|
+
* Registers an event listener.
|
|
4615
|
+
* @param {string} evt Event name
|
|
4616
|
+
* @param {function} fn Listener
|
|
4617
|
+
* @param {*} [ctx] Listener context
|
|
4618
|
+
* @returns {util.EventEmitter} `this`
|
|
4619
|
+
*/
|
|
4620
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
|
4621
|
+
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
4622
|
+
fn : fn,
|
|
4623
|
+
ctx : ctx || this
|
|
4624
|
+
});
|
|
4625
|
+
return this;
|
|
4626
|
+
};
|
|
4657
4627
|
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
}
|
|
4628
|
+
/**
|
|
4629
|
+
* Removes an event listener or any matching listeners if arguments are omitted.
|
|
4630
|
+
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
|
4631
|
+
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
|
4632
|
+
* @returns {util.EventEmitter} `this`
|
|
4633
|
+
*/
|
|
4634
|
+
EventEmitter.prototype.off = function off(evt, fn) {
|
|
4635
|
+
if (evt === undefined)
|
|
4636
|
+
this._listeners = {};
|
|
4637
|
+
else {
|
|
4638
|
+
if (fn === undefined)
|
|
4639
|
+
this._listeners[evt] = [];
|
|
4640
|
+
else {
|
|
4641
|
+
var listeners = this._listeners[evt];
|
|
4642
|
+
for (var i = 0; i < listeners.length;)
|
|
4643
|
+
if (listeners[i].fn === fn)
|
|
4644
|
+
listeners.splice(i, 1);
|
|
4645
|
+
else
|
|
4646
|
+
++i;
|
|
4647
|
+
}
|
|
4648
|
+
}
|
|
4649
|
+
return this;
|
|
4650
|
+
};
|
|
4651
|
+
|
|
4652
|
+
/**
|
|
4653
|
+
* Emits an event by calling its listeners with the specified arguments.
|
|
4654
|
+
* @param {string} evt Event name
|
|
4655
|
+
* @param {...*} args Arguments
|
|
4656
|
+
* @returns {util.EventEmitter} `this`
|
|
4657
|
+
*/
|
|
4658
|
+
EventEmitter.prototype.emit = function emit(evt) {
|
|
4659
|
+
var listeners = this._listeners[evt];
|
|
4660
|
+
if (listeners) {
|
|
4661
|
+
var args = [],
|
|
4662
|
+
i = 1;
|
|
4663
|
+
for (; i < arguments.length;)
|
|
4664
|
+
args.push(arguments[i++]);
|
|
4665
|
+
for (i = 0; i < listeners.length;)
|
|
4666
|
+
listeners[i].fn.apply(listeners[i++].ctx, args);
|
|
4667
|
+
}
|
|
4668
|
+
return this;
|
|
4669
|
+
};
|
|
4678
4670
|
|
|
4679
4671
|
var float;
|
|
4680
4672
|
var hasRequiredFloat;
|
|
@@ -5019,201 +5011,178 @@ function requireFloat () {
|
|
|
5019
5011
|
return float;
|
|
5020
5012
|
}
|
|
5021
5013
|
|
|
5022
|
-
var inquire_1;
|
|
5023
|
-
var hasRequiredInquire;
|
|
5024
|
-
|
|
5025
|
-
function requireInquire () {
|
|
5026
|
-
if (hasRequiredInquire) return inquire_1;
|
|
5027
|
-
hasRequiredInquire = 1;
|
|
5028
|
-
inquire_1 = inquire;
|
|
5014
|
+
var inquire_1 = inquire;
|
|
5029
5015
|
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
}
|
|
5044
|
-
return inquire_1;
|
|
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;
|
|
5045
5029
|
}
|
|
5046
5030
|
|
|
5047
5031
|
var utf8$2 = {};
|
|
5048
5032
|
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
function requireUtf8 () {
|
|
5052
|
-
if (hasRequiredUtf8) return utf8$2;
|
|
5053
|
-
hasRequiredUtf8 = 1;
|
|
5054
|
-
(function (exports) {
|
|
5055
|
-
|
|
5056
|
-
/**
|
|
5057
|
-
* A minimal UTF8 implementation for number arrays.
|
|
5058
|
-
* @memberof util
|
|
5059
|
-
* @namespace
|
|
5060
|
-
*/
|
|
5061
|
-
var utf8 = exports;
|
|
5062
|
-
|
|
5063
|
-
/**
|
|
5064
|
-
* Calculates the UTF8 byte length of a string.
|
|
5065
|
-
* @param {string} string String
|
|
5066
|
-
* @returns {number} Byte length
|
|
5067
|
-
*/
|
|
5068
|
-
utf8.length = function utf8_length(string) {
|
|
5069
|
-
var len = 0,
|
|
5070
|
-
c = 0;
|
|
5071
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5072
|
-
c = string.charCodeAt(i);
|
|
5073
|
-
if (c < 128)
|
|
5074
|
-
len += 1;
|
|
5075
|
-
else if (c < 2048)
|
|
5076
|
-
len += 2;
|
|
5077
|
-
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5078
|
-
++i;
|
|
5079
|
-
len += 4;
|
|
5080
|
-
} else
|
|
5081
|
-
len += 3;
|
|
5082
|
-
}
|
|
5083
|
-
return len;
|
|
5084
|
-
};
|
|
5085
|
-
|
|
5086
|
-
/**
|
|
5087
|
-
* Reads UTF8 bytes as a string.
|
|
5088
|
-
* @param {Uint8Array} buffer Source buffer
|
|
5089
|
-
* @param {number} start Source start
|
|
5090
|
-
* @param {number} end Source end
|
|
5091
|
-
* @returns {string} String read
|
|
5092
|
-
*/
|
|
5093
|
-
utf8.read = function utf8_read(buffer, start, end) {
|
|
5094
|
-
var len = end - start;
|
|
5095
|
-
if (len < 1)
|
|
5096
|
-
return "";
|
|
5097
|
-
var parts = null,
|
|
5098
|
-
chunk = [],
|
|
5099
|
-
i = 0, // char offset
|
|
5100
|
-
t; // temporary
|
|
5101
|
-
while (start < end) {
|
|
5102
|
-
t = buffer[start++];
|
|
5103
|
-
if (t < 128)
|
|
5104
|
-
chunk[i++] = t;
|
|
5105
|
-
else if (t > 191 && t < 224)
|
|
5106
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5107
|
-
else if (t > 239 && t < 365) {
|
|
5108
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5109
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
5110
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5111
|
-
} else
|
|
5112
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5113
|
-
if (i > 8191) {
|
|
5114
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5115
|
-
i = 0;
|
|
5116
|
-
}
|
|
5117
|
-
}
|
|
5118
|
-
if (parts) {
|
|
5119
|
-
if (i)
|
|
5120
|
-
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5121
|
-
return parts.join("");
|
|
5122
|
-
}
|
|
5123
|
-
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5124
|
-
};
|
|
5033
|
+
(function (exports) {
|
|
5125
5034
|
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
*/
|
|
5133
|
-
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5134
|
-
var start = offset,
|
|
5135
|
-
c1, // character 1
|
|
5136
|
-
c2; // character 2
|
|
5137
|
-
for (var i = 0; i < string.length; ++i) {
|
|
5138
|
-
c1 = string.charCodeAt(i);
|
|
5139
|
-
if (c1 < 128) {
|
|
5140
|
-
buffer[offset++] = c1;
|
|
5141
|
-
} else if (c1 < 2048) {
|
|
5142
|
-
buffer[offset++] = c1 >> 6 | 192;
|
|
5143
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5144
|
-
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5145
|
-
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5146
|
-
++i;
|
|
5147
|
-
buffer[offset++] = c1 >> 18 | 240;
|
|
5148
|
-
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5149
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5150
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5151
|
-
} else {
|
|
5152
|
-
buffer[offset++] = c1 >> 12 | 224;
|
|
5153
|
-
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5154
|
-
buffer[offset++] = c1 & 63 | 128;
|
|
5155
|
-
}
|
|
5156
|
-
}
|
|
5157
|
-
return offset - start;
|
|
5158
|
-
};
|
|
5159
|
-
} (utf8$2));
|
|
5160
|
-
return utf8$2;
|
|
5161
|
-
}
|
|
5162
|
-
|
|
5163
|
-
var pool_1;
|
|
5164
|
-
var hasRequiredPool;
|
|
5165
|
-
|
|
5166
|
-
function requirePool () {
|
|
5167
|
-
if (hasRequiredPool) return pool_1;
|
|
5168
|
-
hasRequiredPool = 1;
|
|
5169
|
-
pool_1 = pool;
|
|
5035
|
+
/**
|
|
5036
|
+
* A minimal UTF8 implementation for number arrays.
|
|
5037
|
+
* @memberof util
|
|
5038
|
+
* @namespace
|
|
5039
|
+
*/
|
|
5040
|
+
var utf8 = exports;
|
|
5170
5041
|
|
|
5171
5042
|
/**
|
|
5172
|
-
*
|
|
5173
|
-
* @
|
|
5174
|
-
* @
|
|
5175
|
-
* @param {number} size Buffer size
|
|
5176
|
-
* @returns {Uint8Array} Buffer
|
|
5043
|
+
* Calculates the UTF8 byte length of a string.
|
|
5044
|
+
* @param {string} string String
|
|
5045
|
+
* @returns {number} Byte length
|
|
5177
5046
|
*/
|
|
5047
|
+
utf8.length = function utf8_length(string) {
|
|
5048
|
+
var len = 0,
|
|
5049
|
+
c = 0;
|
|
5050
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5051
|
+
c = string.charCodeAt(i);
|
|
5052
|
+
if (c < 128)
|
|
5053
|
+
len += 1;
|
|
5054
|
+
else if (c < 2048)
|
|
5055
|
+
len += 2;
|
|
5056
|
+
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
|
5057
|
+
++i;
|
|
5058
|
+
len += 4;
|
|
5059
|
+
} else
|
|
5060
|
+
len += 3;
|
|
5061
|
+
}
|
|
5062
|
+
return len;
|
|
5063
|
+
};
|
|
5178
5064
|
|
|
5179
5065
|
/**
|
|
5180
|
-
*
|
|
5181
|
-
* @
|
|
5182
|
-
* @
|
|
5183
|
-
* @param {number}
|
|
5184
|
-
* @
|
|
5185
|
-
* @returns {Uint8Array} Buffer slice
|
|
5186
|
-
* @this {Uint8Array}
|
|
5066
|
+
* Reads UTF8 bytes as a string.
|
|
5067
|
+
* @param {Uint8Array} buffer Source buffer
|
|
5068
|
+
* @param {number} start Source start
|
|
5069
|
+
* @param {number} end Source end
|
|
5070
|
+
* @returns {string} String read
|
|
5187
5071
|
*/
|
|
5072
|
+
utf8.read = function utf8_read(buffer, start, end) {
|
|
5073
|
+
var len = end - start;
|
|
5074
|
+
if (len < 1)
|
|
5075
|
+
return "";
|
|
5076
|
+
var parts = null,
|
|
5077
|
+
chunk = [],
|
|
5078
|
+
i = 0, // char offset
|
|
5079
|
+
t; // temporary
|
|
5080
|
+
while (start < end) {
|
|
5081
|
+
t = buffer[start++];
|
|
5082
|
+
if (t < 128)
|
|
5083
|
+
chunk[i++] = t;
|
|
5084
|
+
else if (t > 191 && t < 224)
|
|
5085
|
+
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
5086
|
+
else if (t > 239 && t < 365) {
|
|
5087
|
+
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
5088
|
+
chunk[i++] = 0xD800 + (t >> 10);
|
|
5089
|
+
chunk[i++] = 0xDC00 + (t & 1023);
|
|
5090
|
+
} else
|
|
5091
|
+
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
5092
|
+
if (i > 8191) {
|
|
5093
|
+
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
5094
|
+
i = 0;
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
if (parts) {
|
|
5098
|
+
if (i)
|
|
5099
|
+
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
|
5100
|
+
return parts.join("");
|
|
5101
|
+
}
|
|
5102
|
+
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
|
5103
|
+
};
|
|
5188
5104
|
|
|
5189
5105
|
/**
|
|
5190
|
-
*
|
|
5191
|
-
* @
|
|
5192
|
-
* @
|
|
5193
|
-
* @param {
|
|
5194
|
-
* @
|
|
5195
|
-
* @param {number} [size=8192] Slab size
|
|
5196
|
-
* @returns {PoolAllocator} Pooled allocator
|
|
5106
|
+
* Writes a string as UTF8 bytes.
|
|
5107
|
+
* @param {string} string Source string
|
|
5108
|
+
* @param {Uint8Array} buffer Destination buffer
|
|
5109
|
+
* @param {number} offset Destination offset
|
|
5110
|
+
* @returns {number} Bytes written
|
|
5197
5111
|
*/
|
|
5198
|
-
function
|
|
5199
|
-
var
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
var
|
|
5203
|
-
|
|
5204
|
-
if (
|
|
5205
|
-
|
|
5206
|
-
if (
|
|
5207
|
-
|
|
5208
|
-
offset =
|
|
5112
|
+
utf8.write = function utf8_write(string, buffer, offset) {
|
|
5113
|
+
var start = offset,
|
|
5114
|
+
c1, // character 1
|
|
5115
|
+
c2; // character 2
|
|
5116
|
+
for (var i = 0; i < string.length; ++i) {
|
|
5117
|
+
c1 = string.charCodeAt(i);
|
|
5118
|
+
if (c1 < 128) {
|
|
5119
|
+
buffer[offset++] = c1;
|
|
5120
|
+
} else if (c1 < 2048) {
|
|
5121
|
+
buffer[offset++] = c1 >> 6 | 192;
|
|
5122
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5123
|
+
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
|
5124
|
+
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
|
5125
|
+
++i;
|
|
5126
|
+
buffer[offset++] = c1 >> 18 | 240;
|
|
5127
|
+
buffer[offset++] = c1 >> 12 & 63 | 128;
|
|
5128
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5129
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5130
|
+
} else {
|
|
5131
|
+
buffer[offset++] = c1 >> 12 | 224;
|
|
5132
|
+
buffer[offset++] = c1 >> 6 & 63 | 128;
|
|
5133
|
+
buffer[offset++] = c1 & 63 | 128;
|
|
5209
5134
|
}
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5135
|
+
}
|
|
5136
|
+
return offset - start;
|
|
5137
|
+
};
|
|
5138
|
+
} (utf8$2));
|
|
5139
|
+
|
|
5140
|
+
var pool_1 = pool;
|
|
5141
|
+
|
|
5142
|
+
/**
|
|
5143
|
+
* An allocator as used by {@link util.pool}.
|
|
5144
|
+
* @typedef PoolAllocator
|
|
5145
|
+
* @type {function}
|
|
5146
|
+
* @param {number} size Buffer size
|
|
5147
|
+
* @returns {Uint8Array} Buffer
|
|
5148
|
+
*/
|
|
5149
|
+
|
|
5150
|
+
/**
|
|
5151
|
+
* A slicer as used by {@link util.pool}.
|
|
5152
|
+
* @typedef PoolSlicer
|
|
5153
|
+
* @type {function}
|
|
5154
|
+
* @param {number} start Start offset
|
|
5155
|
+
* @param {number} end End offset
|
|
5156
|
+
* @returns {Uint8Array} Buffer slice
|
|
5157
|
+
* @this {Uint8Array}
|
|
5158
|
+
*/
|
|
5159
|
+
|
|
5160
|
+
/**
|
|
5161
|
+
* A general purpose buffer pool.
|
|
5162
|
+
* @memberof util
|
|
5163
|
+
* @function
|
|
5164
|
+
* @param {PoolAllocator} alloc Allocator
|
|
5165
|
+
* @param {PoolSlicer} slice Slicer
|
|
5166
|
+
* @param {number} [size=8192] Slab size
|
|
5167
|
+
* @returns {PoolAllocator} Pooled allocator
|
|
5168
|
+
*/
|
|
5169
|
+
function pool(alloc, slice, size) {
|
|
5170
|
+
var SIZE = size || 8192;
|
|
5171
|
+
var MAX = SIZE >>> 1;
|
|
5172
|
+
var slab = null;
|
|
5173
|
+
var offset = SIZE;
|
|
5174
|
+
return function pool_alloc(size) {
|
|
5175
|
+
if (size < 1 || size > MAX)
|
|
5176
|
+
return alloc(size);
|
|
5177
|
+
if (offset + size > SIZE) {
|
|
5178
|
+
slab = alloc(SIZE);
|
|
5179
|
+
offset = 0;
|
|
5180
|
+
}
|
|
5181
|
+
var buf = slice.call(slab, offset, offset += size);
|
|
5182
|
+
if (offset & 7) // align to 32 bit
|
|
5183
|
+
offset = (offset | 7) + 1;
|
|
5184
|
+
return buf;
|
|
5185
|
+
};
|
|
5217
5186
|
}
|
|
5218
5187
|
|
|
5219
5188
|
var longbits;
|
|
@@ -5439,19 +5408,19 @@ function requireMinimal () {
|
|
|
5439
5408
|
util.base64 = requireBase64();
|
|
5440
5409
|
|
|
5441
5410
|
// base class of rpc.Service
|
|
5442
|
-
util.EventEmitter =
|
|
5411
|
+
util.EventEmitter = eventemitter;
|
|
5443
5412
|
|
|
5444
5413
|
// float handling accross browsers
|
|
5445
5414
|
util.float = requireFloat();
|
|
5446
5415
|
|
|
5447
5416
|
// requires modules optionally and hides the call from bundlers
|
|
5448
|
-
util.inquire =
|
|
5417
|
+
util.inquire = inquire_1;
|
|
5449
5418
|
|
|
5450
5419
|
// converts to / from utf8 encoded strings
|
|
5451
|
-
util.utf8 =
|
|
5420
|
+
util.utf8 = utf8$2;
|
|
5452
5421
|
|
|
5453
5422
|
// provides a node-like buffer pool in the browser
|
|
5454
|
-
util.pool =
|
|
5423
|
+
util.pool = pool_1;
|
|
5455
5424
|
|
|
5456
5425
|
// utility to work with the low and high bits of a 64 bit value
|
|
5457
5426
|
util.LongBits = requireLongbits();
|
|
@@ -10838,7 +10807,7 @@ class Client extends xchainClient.BaseXChainClient {
|
|
|
10838
10807
|
getFees() {
|
|
10839
10808
|
return __awaiter(this, void 0, void 0, function* () {
|
|
10840
10809
|
try {
|
|
10841
|
-
const { data: {
|
|
10810
|
+
const { data: { native_tx_fee_rune: fee }, } = yield axios__default["default"].get(`${this.getClientUrl().node}/thorchain/network`);
|
|
10842
10811
|
// validate data
|
|
10843
10812
|
if (!fee || isNaN(fee) || fee < 0)
|
|
10844
10813
|
throw Error(`Invalid fee: ${fee.toString()}`);
|