@xchainjs/xchain-dash 1.0.11 → 2.0.0

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 CHANGED
@@ -5,6 +5,7 @@ import * as dashcore from '@dashevo/dashcore-lib';
5
5
  import { Client as Client$1 } from '@xchainjs/xchain-utxo';
6
6
  import * as Dash from 'bitcoinjs-lib';
7
7
  import * as coininfo from 'coininfo';
8
+ import accumulative from 'coinselect/accumulative';
8
9
  import { getSeed } from '@xchainjs/xchain-crypto';
9
10
  import AppBtc from '@ledgerhq/hw-app-btc';
10
11
 
@@ -802,7 +803,7 @@ const asap = typeof queueMicrotask !== 'undefined' ?
802
803
 
803
804
  // *********************
804
805
 
805
- var utils$2 = {
806
+ var utils$1 = {
806
807
  isArray,
807
808
  isArrayBuffer,
808
809
  isBuffer,
@@ -891,7 +892,7 @@ function AxiosError(message, code, config, request, response) {
891
892
  }
892
893
  }
893
894
 
894
- utils$2.inherits(AxiosError, Error, {
895
+ utils$1.inherits(AxiosError, Error, {
895
896
  toJSON: function toJSON() {
896
897
  return {
897
898
  // Standard
@@ -906,7 +907,7 @@ utils$2.inherits(AxiosError, Error, {
906
907
  columnNumber: this.columnNumber,
907
908
  stack: this.stack,
908
909
  // Axios
909
- config: utils$2.toJSONObject(this.config),
910
+ config: utils$1.toJSONObject(this.config),
910
911
  code: this.code,
911
912
  status: this.status
912
913
  };
@@ -941,7 +942,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
941
942
  AxiosError.from = (error, code, config, request, response, customProps) => {
942
943
  const axiosError = Object.create(prototype$1);
943
944
 
944
- utils$2.toFlatObject(error, axiosError, function filter(obj) {
945
+ utils$1.toFlatObject(error, axiosError, function filter(obj) {
945
946
  return obj !== Error.prototype;
946
947
  }, prop => {
947
948
  return prop !== 'isAxiosError';
@@ -969,7 +970,7 @@ var httpAdapter = null;
969
970
  * @returns {boolean}
970
971
  */
971
972
  function isVisitable(thing) {
972
- return utils$2.isPlainObject(thing) || utils$2.isArray(thing);
973
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
973
974
  }
974
975
 
975
976
  /**
@@ -980,7 +981,7 @@ function isVisitable(thing) {
980
981
  * @returns {string} the key without the brackets.
981
982
  */
982
983
  function removeBrackets(key) {
983
- return utils$2.endsWith(key, '[]') ? key.slice(0, -2) : key;
984
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
984
985
  }
985
986
 
986
987
  /**
@@ -1009,10 +1010,10 @@ function renderKey(path, key, dots) {
1009
1010
  * @returns {boolean}
1010
1011
  */
1011
1012
  function isFlatArray(arr) {
1012
- return utils$2.isArray(arr) && !arr.some(isVisitable);
1013
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
1013
1014
  }
1014
1015
 
1015
- const predicates = utils$2.toFlatObject(utils$2, {}, null, function filter(prop) {
1016
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1016
1017
  return /^is[A-Z]/.test(prop);
1017
1018
  });
1018
1019
 
@@ -1040,7 +1041,7 @@ const predicates = utils$2.toFlatObject(utils$2, {}, null, function filter(prop)
1040
1041
  * @returns
1041
1042
  */
1042
1043
  function toFormData(obj, formData, options) {
1043
- if (!utils$2.isObject(obj)) {
1044
+ if (!utils$1.isObject(obj)) {
1044
1045
  throw new TypeError('target must be an object');
1045
1046
  }
1046
1047
 
@@ -1048,13 +1049,13 @@ function toFormData(obj, formData, options) {
1048
1049
  formData = formData || new (FormData)();
1049
1050
 
1050
1051
  // eslint-disable-next-line no-param-reassign
1051
- options = utils$2.toFlatObject(options, {
1052
+ options = utils$1.toFlatObject(options, {
1052
1053
  metaTokens: true,
1053
1054
  dots: false,
1054
1055
  indexes: false
1055
1056
  }, false, function defined(option, source) {
1056
1057
  // eslint-disable-next-line no-eq-null,eqeqeq
1057
- return !utils$2.isUndefined(source[option]);
1058
+ return !utils$1.isUndefined(source[option]);
1058
1059
  });
1059
1060
 
1060
1061
  const metaTokens = options.metaTokens;
@@ -1063,24 +1064,24 @@ function toFormData(obj, formData, options) {
1063
1064
  const dots = options.dots;
1064
1065
  const indexes = options.indexes;
1065
1066
  const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
1066
- const useBlob = _Blob && utils$2.isSpecCompliantForm(formData);
1067
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1067
1068
 
1068
- if (!utils$2.isFunction(visitor)) {
1069
+ if (!utils$1.isFunction(visitor)) {
1069
1070
  throw new TypeError('visitor must be a function');
1070
1071
  }
1071
1072
 
1072
1073
  function convertValue(value) {
1073
1074
  if (value === null) return '';
1074
1075
 
1075
- if (utils$2.isDate(value)) {
1076
+ if (utils$1.isDate(value)) {
1076
1077
  return value.toISOString();
1077
1078
  }
1078
1079
 
1079
- if (!useBlob && utils$2.isBlob(value)) {
1080
+ if (!useBlob && utils$1.isBlob(value)) {
1080
1081
  throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1081
1082
  }
1082
1083
 
1083
- if (utils$2.isArrayBuffer(value) || utils$2.isTypedArray(value)) {
1084
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1084
1085
  return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1085
1086
  }
1086
1087
 
@@ -1101,20 +1102,20 @@ function toFormData(obj, formData, options) {
1101
1102
  let arr = value;
1102
1103
 
1103
1104
  if (value && !path && typeof value === 'object') {
1104
- if (utils$2.endsWith(key, '{}')) {
1105
+ if (utils$1.endsWith(key, '{}')) {
1105
1106
  // eslint-disable-next-line no-param-reassign
1106
1107
  key = metaTokens ? key : key.slice(0, -2);
1107
1108
  // eslint-disable-next-line no-param-reassign
1108
1109
  value = JSON.stringify(value);
1109
1110
  } else if (
1110
- (utils$2.isArray(value) && isFlatArray(value)) ||
1111
- ((utils$2.isFileList(value) || utils$2.endsWith(key, '[]')) && (arr = utils$2.toArray(value))
1111
+ (utils$1.isArray(value) && isFlatArray(value)) ||
1112
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
1112
1113
  )) {
1113
1114
  // eslint-disable-next-line no-param-reassign
1114
1115
  key = removeBrackets(key);
1115
1116
 
1116
1117
  arr.forEach(function each(el, index) {
1117
- !(utils$2.isUndefined(el) || el === null) && formData.append(
1118
+ !(utils$1.isUndefined(el) || el === null) && formData.append(
1118
1119
  // eslint-disable-next-line no-nested-ternary
1119
1120
  indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
1120
1121
  convertValue(el)
@@ -1142,7 +1143,7 @@ function toFormData(obj, formData, options) {
1142
1143
  });
1143
1144
 
1144
1145
  function build(value, path) {
1145
- if (utils$2.isUndefined(value)) return;
1146
+ if (utils$1.isUndefined(value)) return;
1146
1147
 
1147
1148
  if (stack.indexOf(value) !== -1) {
1148
1149
  throw Error('Circular reference detected in ' + path.join('.'));
@@ -1150,9 +1151,9 @@ function toFormData(obj, formData, options) {
1150
1151
 
1151
1152
  stack.push(value);
1152
1153
 
1153
- utils$2.forEach(value, function each(el, key) {
1154
- const result = !(utils$2.isUndefined(el) || el === null) && visitor.call(
1155
- formData, el, utils$2.isString(key) ? key.trim() : key, path, exposedHelpers
1154
+ utils$1.forEach(value, function each(el, key) {
1155
+ const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
1156
+ formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
1156
1157
  );
1157
1158
 
1158
1159
  if (result === true) {
@@ -1163,7 +1164,7 @@ function toFormData(obj, formData, options) {
1163
1164
  stack.pop();
1164
1165
  }
1165
1166
 
1166
- if (!utils$2.isObject(obj)) {
1167
+ if (!utils$1.isObject(obj)) {
1167
1168
  throw new TypeError('data must be an object');
1168
1169
  }
1169
1170
 
@@ -1260,7 +1261,7 @@ function buildURL(url, params, options) {
1260
1261
 
1261
1262
  const _encode = options && options.encode || encode;
1262
1263
 
1263
- if (utils$2.isFunction(options)) {
1264
+ if (utils$1.isFunction(options)) {
1264
1265
  options = {
1265
1266
  serialize: options
1266
1267
  };
@@ -1273,7 +1274,7 @@ function buildURL(url, params, options) {
1273
1274
  if (serializeFn) {
1274
1275
  serializedParams = serializeFn(params, options);
1275
1276
  } else {
1276
- serializedParams = utils$2.isURLSearchParams(params) ?
1277
+ serializedParams = utils$1.isURLSearchParams(params) ?
1277
1278
  params.toString() :
1278
1279
  new AxiosURLSearchParams(params, options).toString(_encode);
1279
1280
  }
@@ -1348,7 +1349,7 @@ class InterceptorManager {
1348
1349
  * @returns {void}
1349
1350
  */
1350
1351
  forEach(fn) {
1351
- utils$2.forEach(this.handlers, function forEachHandler(h) {
1352
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
1352
1353
  if (h !== null) {
1353
1354
  fn(h);
1354
1355
  }
@@ -1422,7 +1423,7 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1422
1423
 
1423
1424
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1424
1425
 
1425
- var utils$1 = /*#__PURE__*/Object.freeze({
1426
+ var utils = /*#__PURE__*/Object.freeze({
1426
1427
  __proto__: null,
1427
1428
  hasBrowserEnv: hasBrowserEnv,
1428
1429
  hasStandardBrowserEnv: hasStandardBrowserEnv,
@@ -1432,14 +1433,14 @@ var utils$1 = /*#__PURE__*/Object.freeze({
1432
1433
  });
1433
1434
 
1434
1435
  var platform = {
1435
- ...utils$1,
1436
+ ...utils,
1436
1437
  ...platform$1
1437
1438
  };
1438
1439
 
1439
1440
  function toURLEncodedForm(data, options) {
1440
1441
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
1441
1442
  visitor: function(value, key, path, helpers) {
1442
- if (platform.isNode && utils$2.isBuffer(value)) {
1443
+ if (platform.isNode && utils$1.isBuffer(value)) {
1443
1444
  this.append(key, value.toString('base64'));
1444
1445
  return false;
1445
1446
  }
@@ -1461,7 +1462,7 @@ function parsePropPath(name) {
1461
1462
  // foo.x.y.z
1462
1463
  // foo-x-y-z
1463
1464
  // foo x y z
1464
- return utils$2.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1465
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
1465
1466
  return match[0] === '[]' ? '' : match[1] || match[0];
1466
1467
  });
1467
1468
  }
@@ -1501,10 +1502,10 @@ function formDataToJSON(formData) {
1501
1502
 
1502
1503
  const isNumericKey = Number.isFinite(+name);
1503
1504
  const isLast = index >= path.length;
1504
- name = !name && utils$2.isArray(target) ? target.length : name;
1505
+ name = !name && utils$1.isArray(target) ? target.length : name;
1505
1506
 
1506
1507
  if (isLast) {
1507
- if (utils$2.hasOwnProp(target, name)) {
1508
+ if (utils$1.hasOwnProp(target, name)) {
1508
1509
  target[name] = [target[name], value];
1509
1510
  } else {
1510
1511
  target[name] = value;
@@ -1513,23 +1514,23 @@ function formDataToJSON(formData) {
1513
1514
  return !isNumericKey;
1514
1515
  }
1515
1516
 
1516
- if (!target[name] || !utils$2.isObject(target[name])) {
1517
+ if (!target[name] || !utils$1.isObject(target[name])) {
1517
1518
  target[name] = [];
1518
1519
  }
1519
1520
 
1520
1521
  const result = buildPath(path, value, target[name], index);
1521
1522
 
1522
- if (result && utils$2.isArray(target[name])) {
1523
+ if (result && utils$1.isArray(target[name])) {
1523
1524
  target[name] = arrayToObject(target[name]);
1524
1525
  }
1525
1526
 
1526
1527
  return !isNumericKey;
1527
1528
  }
1528
1529
 
1529
- if (utils$2.isFormData(formData) && utils$2.isFunction(formData.entries)) {
1530
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
1530
1531
  const obj = {};
1531
1532
 
1532
- utils$2.forEachEntry(formData, (name, value) => {
1533
+ utils$1.forEachEntry(formData, (name, value) => {
1533
1534
  buildPath(parsePropPath(name), value, obj, 0);
1534
1535
  });
1535
1536
 
@@ -1550,10 +1551,10 @@ function formDataToJSON(formData) {
1550
1551
  * @returns {string} A stringified version of the rawValue.
1551
1552
  */
1552
1553
  function stringifySafely(rawValue, parser, encoder) {
1553
- if (utils$2.isString(rawValue)) {
1554
+ if (utils$1.isString(rawValue)) {
1554
1555
  try {
1555
1556
  (parser || JSON.parse)(rawValue);
1556
- return utils$2.trim(rawValue);
1557
+ return utils$1.trim(rawValue);
1557
1558
  } catch (e) {
1558
1559
  if (e.name !== 'SyntaxError') {
1559
1560
  throw e;
@@ -1573,31 +1574,31 @@ const defaults = {
1573
1574
  transformRequest: [function transformRequest(data, headers) {
1574
1575
  const contentType = headers.getContentType() || '';
1575
1576
  const hasJSONContentType = contentType.indexOf('application/json') > -1;
1576
- const isObjectPayload = utils$2.isObject(data);
1577
+ const isObjectPayload = utils$1.isObject(data);
1577
1578
 
1578
- if (isObjectPayload && utils$2.isHTMLForm(data)) {
1579
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
1579
1580
  data = new FormData(data);
1580
1581
  }
1581
1582
 
1582
- const isFormData = utils$2.isFormData(data);
1583
+ const isFormData = utils$1.isFormData(data);
1583
1584
 
1584
1585
  if (isFormData) {
1585
1586
  return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
1586
1587
  }
1587
1588
 
1588
- if (utils$2.isArrayBuffer(data) ||
1589
- utils$2.isBuffer(data) ||
1590
- utils$2.isStream(data) ||
1591
- utils$2.isFile(data) ||
1592
- utils$2.isBlob(data) ||
1593
- utils$2.isReadableStream(data)
1589
+ if (utils$1.isArrayBuffer(data) ||
1590
+ utils$1.isBuffer(data) ||
1591
+ utils$1.isStream(data) ||
1592
+ utils$1.isFile(data) ||
1593
+ utils$1.isBlob(data) ||
1594
+ utils$1.isReadableStream(data)
1594
1595
  ) {
1595
1596
  return data;
1596
1597
  }
1597
- if (utils$2.isArrayBufferView(data)) {
1598
+ if (utils$1.isArrayBufferView(data)) {
1598
1599
  return data.buffer;
1599
1600
  }
1600
- if (utils$2.isURLSearchParams(data)) {
1601
+ if (utils$1.isURLSearchParams(data)) {
1601
1602
  headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
1602
1603
  return data.toString();
1603
1604
  }
@@ -1609,7 +1610,7 @@ const defaults = {
1609
1610
  return toURLEncodedForm(data, this.formSerializer).toString();
1610
1611
  }
1611
1612
 
1612
- if ((isFileList = utils$2.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1613
+ if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1613
1614
  const _FormData = this.env && this.env.FormData;
1614
1615
 
1615
1616
  return toFormData(
@@ -1633,11 +1634,11 @@ const defaults = {
1633
1634
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1634
1635
  const JSONRequested = this.responseType === 'json';
1635
1636
 
1636
- if (utils$2.isResponse(data) || utils$2.isReadableStream(data)) {
1637
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
1637
1638
  return data;
1638
1639
  }
1639
1640
 
1640
- if (data && utils$2.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1641
+ if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
1641
1642
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
1642
1643
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
1643
1644
 
@@ -1685,13 +1686,13 @@ const defaults = {
1685
1686
  }
1686
1687
  };
1687
1688
 
1688
- utils$2.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1689
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
1689
1690
  defaults.headers[method] = {};
1690
1691
  });
1691
1692
 
1692
1693
  // RawAxiosHeaders whose duplicates are ignored by node
1693
1694
  // c.f. https://nodejs.org/api/http.html#http_message_headers
1694
- const ignoreDuplicateOf = utils$2.toObjectSet([
1695
+ const ignoreDuplicateOf = utils$1.toObjectSet([
1695
1696
  'age', 'authorization', 'content-length', 'content-type', 'etag',
1696
1697
  'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
1697
1698
  'last-modified', 'location', 'max-forwards', 'proxy-authorization',
@@ -1752,7 +1753,7 @@ function normalizeValue(value) {
1752
1753
  return value;
1753
1754
  }
1754
1755
 
1755
- return utils$2.isArray(value) ? value.map(normalizeValue) : String(value);
1756
+ return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
1756
1757
  }
1757
1758
 
1758
1759
  function parseTokens(str) {
@@ -1770,7 +1771,7 @@ function parseTokens(str) {
1770
1771
  const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1771
1772
 
1772
1773
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1773
- if (utils$2.isFunction(filter)) {
1774
+ if (utils$1.isFunction(filter)) {
1774
1775
  return filter.call(this, value, header);
1775
1776
  }
1776
1777
 
@@ -1778,13 +1779,13 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1778
1779
  value = header;
1779
1780
  }
1780
1781
 
1781
- if (!utils$2.isString(value)) return;
1782
+ if (!utils$1.isString(value)) return;
1782
1783
 
1783
- if (utils$2.isString(filter)) {
1784
+ if (utils$1.isString(filter)) {
1784
1785
  return value.indexOf(filter) !== -1;
1785
1786
  }
1786
1787
 
1787
- if (utils$2.isRegExp(filter)) {
1788
+ if (utils$1.isRegExp(filter)) {
1788
1789
  return filter.test(value);
1789
1790
  }
1790
1791
  }
@@ -1797,7 +1798,7 @@ function formatHeader(header) {
1797
1798
  }
1798
1799
 
1799
1800
  function buildAccessors(obj, header) {
1800
- const accessorName = utils$2.toCamelCase(' ' + header);
1801
+ const accessorName = utils$1.toCamelCase(' ' + header);
1801
1802
 
1802
1803
  ['get', 'set', 'has'].forEach(methodName => {
1803
1804
  Object.defineProperty(obj, methodName + accessorName, {
@@ -1824,7 +1825,7 @@ class AxiosHeaders {
1824
1825
  throw new Error('header name must be a non-empty string');
1825
1826
  }
1826
1827
 
1827
- const key = utils$2.findKey(self, lHeader);
1828
+ const key = utils$1.findKey(self, lHeader);
1828
1829
 
1829
1830
  if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
1830
1831
  self[key || _header] = normalizeValue(_value);
@@ -1832,13 +1833,13 @@ class AxiosHeaders {
1832
1833
  }
1833
1834
 
1834
1835
  const setHeaders = (headers, _rewrite) =>
1835
- utils$2.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1836
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1836
1837
 
1837
- if (utils$2.isPlainObject(header) || header instanceof this.constructor) {
1838
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1838
1839
  setHeaders(header, valueOrRewrite);
1839
- } else if(utils$2.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1840
+ } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1840
1841
  setHeaders(parseHeaders(header), valueOrRewrite);
1841
- } else if (utils$2.isHeaders(header)) {
1842
+ } else if (utils$1.isHeaders(header)) {
1842
1843
  for (const [key, value] of header.entries()) {
1843
1844
  setHeader(value, key, rewrite);
1844
1845
  }
@@ -1853,7 +1854,7 @@ class AxiosHeaders {
1853
1854
  header = normalizeHeader(header);
1854
1855
 
1855
1856
  if (header) {
1856
- const key = utils$2.findKey(this, header);
1857
+ const key = utils$1.findKey(this, header);
1857
1858
 
1858
1859
  if (key) {
1859
1860
  const value = this[key];
@@ -1866,11 +1867,11 @@ class AxiosHeaders {
1866
1867
  return parseTokens(value);
1867
1868
  }
1868
1869
 
1869
- if (utils$2.isFunction(parser)) {
1870
+ if (utils$1.isFunction(parser)) {
1870
1871
  return parser.call(this, value, key);
1871
1872
  }
1872
1873
 
1873
- if (utils$2.isRegExp(parser)) {
1874
+ if (utils$1.isRegExp(parser)) {
1874
1875
  return parser.exec(value);
1875
1876
  }
1876
1877
 
@@ -1883,7 +1884,7 @@ class AxiosHeaders {
1883
1884
  header = normalizeHeader(header);
1884
1885
 
1885
1886
  if (header) {
1886
- const key = utils$2.findKey(this, header);
1887
+ const key = utils$1.findKey(this, header);
1887
1888
 
1888
1889
  return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1889
1890
  }
@@ -1899,7 +1900,7 @@ class AxiosHeaders {
1899
1900
  _header = normalizeHeader(_header);
1900
1901
 
1901
1902
  if (_header) {
1902
- const key = utils$2.findKey(self, _header);
1903
+ const key = utils$1.findKey(self, _header);
1903
1904
 
1904
1905
  if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1905
1906
  delete self[key];
@@ -1909,7 +1910,7 @@ class AxiosHeaders {
1909
1910
  }
1910
1911
  }
1911
1912
 
1912
- if (utils$2.isArray(header)) {
1913
+ if (utils$1.isArray(header)) {
1913
1914
  header.forEach(deleteHeader);
1914
1915
  } else {
1915
1916
  deleteHeader(header);
@@ -1938,8 +1939,8 @@ class AxiosHeaders {
1938
1939
  const self = this;
1939
1940
  const headers = {};
1940
1941
 
1941
- utils$2.forEach(this, (value, header) => {
1942
- const key = utils$2.findKey(headers, header);
1942
+ utils$1.forEach(this, (value, header) => {
1943
+ const key = utils$1.findKey(headers, header);
1943
1944
 
1944
1945
  if (key) {
1945
1946
  self[key] = normalizeValue(value);
@@ -1968,8 +1969,8 @@ class AxiosHeaders {
1968
1969
  toJSON(asStrings) {
1969
1970
  const obj = Object.create(null);
1970
1971
 
1971
- utils$2.forEach(this, (value, header) => {
1972
- value != null && value !== false && (obj[header] = asStrings && utils$2.isArray(value) ? value.join(', ') : value);
1972
+ utils$1.forEach(this, (value, header) => {
1973
+ value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1973
1974
  });
1974
1975
 
1975
1976
  return obj;
@@ -2016,7 +2017,7 @@ class AxiosHeaders {
2016
2017
  }
2017
2018
  }
2018
2019
 
2019
- utils$2.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2020
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
2020
2021
 
2021
2022
  return this;
2022
2023
  }
@@ -2025,7 +2026,7 @@ class AxiosHeaders {
2025
2026
  AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2026
2027
 
2027
2028
  // reserved names hotfix
2028
- utils$2.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2029
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2029
2030
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2030
2031
  return {
2031
2032
  get: () => value,
@@ -2035,7 +2036,7 @@ utils$2.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2035
2036
  }
2036
2037
  });
2037
2038
 
2038
- utils$2.freezeMethods(AxiosHeaders);
2039
+ utils$1.freezeMethods(AxiosHeaders);
2039
2040
 
2040
2041
  /**
2041
2042
  * Transform the data for a request or a response
@@ -2051,7 +2052,7 @@ function transformData(fns, response) {
2051
2052
  const headers = AxiosHeaders.from(context.headers);
2052
2053
  let data = context.data;
2053
2054
 
2054
- utils$2.forEach(fns, function transform(fn) {
2055
+ utils$1.forEach(fns, function transform(fn) {
2055
2056
  data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2056
2057
  });
2057
2058
 
@@ -2079,7 +2080,7 @@ function CanceledError(message, config, request) {
2079
2080
  this.name = 'CanceledError';
2080
2081
  }
2081
2082
 
2082
- utils$2.inherits(CanceledError, AxiosError, {
2083
+ utils$1.inherits(CanceledError, AxiosError, {
2083
2084
  __CANCEL__: true
2084
2085
  });
2085
2086
 
@@ -2246,7 +2247,7 @@ const progressEventDecorator = (total, throttled) => {
2246
2247
  }), throttled[1]];
2247
2248
  };
2248
2249
 
2249
- const asyncDecorator = (fn) => (...args) => utils$2.asap(() => fn(...args));
2250
+ const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
2250
2251
 
2251
2252
  var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
2252
2253
  url = new URL(url, platform.origin);
@@ -2268,11 +2269,11 @@ var cookies = platform.hasStandardBrowserEnv ?
2268
2269
  write(name, value, expires, path, domain, secure) {
2269
2270
  const cookie = [name + '=' + encodeURIComponent(value)];
2270
2271
 
2271
- utils$2.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2272
+ utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
2272
2273
 
2273
- utils$2.isString(path) && cookie.push('path=' + path);
2274
+ utils$1.isString(path) && cookie.push('path=' + path);
2274
2275
 
2275
- utils$2.isString(domain) && cookie.push('domain=' + domain);
2276
+ utils$1.isString(domain) && cookie.push('domain=' + domain);
2276
2277
 
2277
2278
  secure === true && cookie.push('secure');
2278
2279
 
@@ -2363,11 +2364,11 @@ function mergeConfig(config1, config2) {
2363
2364
  const config = {};
2364
2365
 
2365
2366
  function getMergedValue(target, source, prop, caseless) {
2366
- if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source)) {
2367
- return utils$2.merge.call({caseless}, target, source);
2368
- } else if (utils$2.isPlainObject(source)) {
2369
- return utils$2.merge({}, source);
2370
- } else if (utils$2.isArray(source)) {
2367
+ if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2368
+ return utils$1.merge.call({caseless}, target, source);
2369
+ } else if (utils$1.isPlainObject(source)) {
2370
+ return utils$1.merge({}, source);
2371
+ } else if (utils$1.isArray(source)) {
2371
2372
  return source.slice();
2372
2373
  }
2373
2374
  return source;
@@ -2375,25 +2376,25 @@ function mergeConfig(config1, config2) {
2375
2376
 
2376
2377
  // eslint-disable-next-line consistent-return
2377
2378
  function mergeDeepProperties(a, b, prop , caseless) {
2378
- if (!utils$2.isUndefined(b)) {
2379
+ if (!utils$1.isUndefined(b)) {
2379
2380
  return getMergedValue(a, b, prop , caseless);
2380
- } else if (!utils$2.isUndefined(a)) {
2381
+ } else if (!utils$1.isUndefined(a)) {
2381
2382
  return getMergedValue(undefined, a, prop , caseless);
2382
2383
  }
2383
2384
  }
2384
2385
 
2385
2386
  // eslint-disable-next-line consistent-return
2386
2387
  function valueFromConfig2(a, b) {
2387
- if (!utils$2.isUndefined(b)) {
2388
+ if (!utils$1.isUndefined(b)) {
2388
2389
  return getMergedValue(undefined, b);
2389
2390
  }
2390
2391
  }
2391
2392
 
2392
2393
  // eslint-disable-next-line consistent-return
2393
2394
  function defaultToConfig2(a, b) {
2394
- if (!utils$2.isUndefined(b)) {
2395
+ if (!utils$1.isUndefined(b)) {
2395
2396
  return getMergedValue(undefined, b);
2396
- } else if (!utils$2.isUndefined(a)) {
2397
+ } else if (!utils$1.isUndefined(a)) {
2397
2398
  return getMergedValue(undefined, a);
2398
2399
  }
2399
2400
  }
@@ -2439,10 +2440,10 @@ function mergeConfig(config1, config2) {
2439
2440
  headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
2440
2441
  };
2441
2442
 
2442
- utils$2.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2443
+ utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2443
2444
  const merge = mergeMap[prop] || mergeDeepProperties;
2444
2445
  const configValue = merge(config1[prop], config2[prop], prop);
2445
- (utils$2.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2446
+ (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2446
2447
  });
2447
2448
 
2448
2449
  return config;
@@ -2466,7 +2467,7 @@ var resolveConfig = (config) => {
2466
2467
 
2467
2468
  let contentType;
2468
2469
 
2469
- if (utils$2.isFormData(data)) {
2470
+ if (utils$1.isFormData(data)) {
2470
2471
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2471
2472
  headers.setContentType(undefined); // Let the browser set it
2472
2473
  } else if ((contentType = headers.getContentType()) !== false) {
@@ -2481,7 +2482,7 @@ var resolveConfig = (config) => {
2481
2482
  // Specifically not if we're in a web worker, or react-native.
2482
2483
 
2483
2484
  if (platform.hasStandardBrowserEnv) {
2484
- withXSRFToken && utils$2.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2485
+ withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
2485
2486
 
2486
2487
  if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
2487
2488
  // Add xsrf header
@@ -2622,13 +2623,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2622
2623
 
2623
2624
  // Add headers to the request
2624
2625
  if ('setRequestHeader' in request) {
2625
- utils$2.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2626
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
2626
2627
  request.setRequestHeader(key, val);
2627
2628
  });
2628
2629
  }
2629
2630
 
2630
2631
  // Add withCredentials to request if needed
2631
- if (!utils$2.isUndefined(_config.withCredentials)) {
2632
+ if (!utils$1.isUndefined(_config.withCredentials)) {
2632
2633
  request.withCredentials = !!_config.withCredentials;
2633
2634
  }
2634
2635
 
@@ -2720,7 +2721,7 @@ const composeSignals = (signals, timeout) => {
2720
2721
 
2721
2722
  const {signal} = controller;
2722
2723
 
2723
- signal.unsubscribe = () => utils$2.asap(unsubscribe);
2724
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
2724
2725
 
2725
2726
  return signal;
2726
2727
  }
@@ -2848,7 +2849,7 @@ const supportsRequestStream = isReadableStreamSupported && test(() => {
2848
2849
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
2849
2850
 
2850
2851
  const supportsResponseStream = isReadableStreamSupported &&
2851
- test(() => utils$2.isReadableStream(new Response('').body));
2852
+ test(() => utils$1.isReadableStream(new Response('').body));
2852
2853
 
2853
2854
 
2854
2855
  const resolvers = {
@@ -2857,7 +2858,7 @@ const resolvers = {
2857
2858
 
2858
2859
  isFetchSupported && (((res) => {
2859
2860
  ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
2860
- !resolvers[type] && (resolvers[type] = utils$2.isFunction(res[type]) ? (res) => res[type]() :
2861
+ !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
2861
2862
  (_, config) => {
2862
2863
  throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
2863
2864
  });
@@ -2869,11 +2870,11 @@ const getBodyLength = async (body) => {
2869
2870
  return 0;
2870
2871
  }
2871
2872
 
2872
- if(utils$2.isBlob(body)) {
2873
+ if(utils$1.isBlob(body)) {
2873
2874
  return body.size;
2874
2875
  }
2875
2876
 
2876
- if(utils$2.isSpecCompliantForm(body)) {
2877
+ if(utils$1.isSpecCompliantForm(body)) {
2877
2878
  const _request = new Request(platform.origin, {
2878
2879
  method: 'POST',
2879
2880
  body,
@@ -2881,21 +2882,21 @@ const getBodyLength = async (body) => {
2881
2882
  return (await _request.arrayBuffer()).byteLength;
2882
2883
  }
2883
2884
 
2884
- if(utils$2.isArrayBufferView(body) || utils$2.isArrayBuffer(body)) {
2885
+ if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
2885
2886
  return body.byteLength;
2886
2887
  }
2887
2888
 
2888
- if(utils$2.isURLSearchParams(body)) {
2889
+ if(utils$1.isURLSearchParams(body)) {
2889
2890
  body = body + '';
2890
2891
  }
2891
2892
 
2892
- if(utils$2.isString(body)) {
2893
+ if(utils$1.isString(body)) {
2893
2894
  return (await encodeText(body)).byteLength;
2894
2895
  }
2895
2896
  };
2896
2897
 
2897
2898
  const resolveBodyLength = async (headers, body) => {
2898
- const length = utils$2.toFiniteNumber(headers.getContentLength());
2899
+ const length = utils$1.toFiniteNumber(headers.getContentLength());
2899
2900
 
2900
2901
  return length == null ? getBodyLength(body) : length;
2901
2902
  };
@@ -2941,7 +2942,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
2941
2942
 
2942
2943
  let contentTypeHeader;
2943
2944
 
2944
- if (utils$2.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
2945
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
2945
2946
  headers.setContentType(contentTypeHeader);
2946
2947
  }
2947
2948
 
@@ -2955,7 +2956,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
2955
2956
  }
2956
2957
  }
2957
2958
 
2958
- if (!utils$2.isString(withCredentials)) {
2959
+ if (!utils$1.isString(withCredentials)) {
2959
2960
  withCredentials = withCredentials ? 'include' : 'omit';
2960
2961
  }
2961
2962
 
@@ -2983,7 +2984,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
2983
2984
  options[prop] = response[prop];
2984
2985
  });
2985
2986
 
2986
- const responseContentLength = utils$2.toFiniteNumber(response.headers.get('content-length'));
2987
+ const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
2987
2988
 
2988
2989
  const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
2989
2990
  responseContentLength,
@@ -3001,7 +3002,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
3001
3002
 
3002
3003
  responseType = responseType || 'text';
3003
3004
 
3004
- let responseData = await resolvers[utils$2.findKey(resolvers, responseType) || 'text'](response, config);
3005
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
3005
3006
 
3006
3007
  !isStreamResponse && unsubscribe && unsubscribe();
3007
3008
 
@@ -3037,7 +3038,7 @@ const knownAdapters = {
3037
3038
  fetch: fetchAdapter
3038
3039
  };
3039
3040
 
3040
- utils$2.forEach(knownAdapters, (fn, value) => {
3041
+ utils$1.forEach(knownAdapters, (fn, value) => {
3041
3042
  if (fn) {
3042
3043
  try {
3043
3044
  Object.defineProperty(fn, 'name', {value});
@@ -3050,11 +3051,11 @@ utils$2.forEach(knownAdapters, (fn, value) => {
3050
3051
 
3051
3052
  const renderReason = (reason) => `- ${reason}`;
3052
3053
 
3053
- const isResolvedHandle = (adapter) => utils$2.isFunction(adapter) || adapter === null || adapter === false;
3054
+ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
3054
3055
 
3055
3056
  var adapters = {
3056
3057
  getAdapter: (adapters) => {
3057
- adapters = utils$2.isArray(adapters) ? adapters : [adapters];
3058
+ adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3058
3059
 
3059
3060
  const {length} = adapters;
3060
3061
  let nameOrAdapter;
@@ -3351,7 +3352,7 @@ class Axios {
3351
3352
  }
3352
3353
 
3353
3354
  if (paramsSerializer != null) {
3354
- if (utils$2.isFunction(paramsSerializer)) {
3355
+ if (utils$1.isFunction(paramsSerializer)) {
3355
3356
  config.paramsSerializer = {
3356
3357
  serialize: paramsSerializer
3357
3358
  };
@@ -3379,12 +3380,12 @@ class Axios {
3379
3380
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
3380
3381
 
3381
3382
  // Flatten headers
3382
- let contextHeaders = headers && utils$2.merge(
3383
+ let contextHeaders = headers && utils$1.merge(
3383
3384
  headers.common,
3384
3385
  headers[config.method]
3385
3386
  );
3386
3387
 
3387
- headers && utils$2.forEach(
3388
+ headers && utils$1.forEach(
3388
3389
  ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
3389
3390
  (method) => {
3390
3391
  delete headers[method];
@@ -3471,7 +3472,7 @@ class Axios {
3471
3472
  }
3472
3473
 
3473
3474
  // Provide aliases for supported request methods
3474
- utils$2.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3475
+ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3475
3476
  /*eslint func-names:0*/
3476
3477
  Axios.prototype[method] = function(url, config) {
3477
3478
  return this.request(mergeConfig(config || {}, {
@@ -3482,7 +3483,7 @@ utils$2.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
3482
3483
  };
3483
3484
  });
3484
3485
 
3485
- utils$2.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3486
+ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
3486
3487
  /*eslint func-names:0*/
3487
3488
 
3488
3489
  function generateHTTPMethod(isForm) {
@@ -3668,7 +3669,7 @@ function spread(callback) {
3668
3669
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3669
3670
  */
3670
3671
  function isAxiosError(payload) {
3671
- return utils$2.isObject(payload) && (payload.isAxiosError === true);
3672
+ return utils$1.isObject(payload) && (payload.isAxiosError === true);
3672
3673
  }
3673
3674
 
3674
3675
  const HttpStatusCode = {
@@ -3753,10 +3754,10 @@ function createInstance(defaultConfig) {
3753
3754
  const instance = bind(Axios.prototype.request, context);
3754
3755
 
3755
3756
  // Copy axios.prototype to instance
3756
- utils$2.extend(instance, Axios.prototype, context, {allOwnKeys: true});
3757
+ utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
3757
3758
 
3758
3759
  // Copy context to instance
3759
- utils$2.extend(instance, context, null, {allOwnKeys: true});
3760
+ utils$1.extend(instance, context, null, {allOwnKeys: true});
3760
3761
 
3761
3762
  // Factory for creating new instances
3762
3763
  instance.create = function create(instanceConfig) {
@@ -3800,7 +3801,7 @@ axios.mergeConfig = mergeConfig;
3800
3801
 
3801
3802
  axios.AxiosHeaders = AxiosHeaders;
3802
3803
 
3803
- axios.formToJSON = thing => formDataToJSON(utils$2.isHTMLForm(thing) ? new FormData(thing) : thing);
3804
+ axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
3804
3805
 
3805
3806
  axios.getAdapter = adapters.getAdapter;
3806
3807
 
@@ -3871,143 +3872,6 @@ const getRawTx = (p) => __awaiter(void 0, void 0, void 0, function* () {
3871
3872
  return (yield axios.get(`${urlForNetwork(p.network)}/rawtx/${p.txid}`)).data.rawtx;
3872
3873
  });
3873
3874
 
3874
- function getDefaultExportFromCjs (x) {
3875
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3876
- }
3877
-
3878
- var utils;
3879
- var hasRequiredUtils;
3880
-
3881
- function requireUtils () {
3882
- if (hasRequiredUtils) return utils;
3883
- hasRequiredUtils = 1;
3884
- // baseline estimates, used to improve performance
3885
- var TX_EMPTY_SIZE = 4 + 1 + 1 + 4;
3886
- var TX_INPUT_BASE = 32 + 4 + 1 + 4;
3887
- var TX_INPUT_PUBKEYHASH = 107;
3888
- var TX_OUTPUT_BASE = 8 + 1;
3889
- var TX_OUTPUT_PUBKEYHASH = 25;
3890
-
3891
- function inputBytes (input) {
3892
- return TX_INPUT_BASE + (input.script ? input.script.length : TX_INPUT_PUBKEYHASH)
3893
- }
3894
-
3895
- function outputBytes (output) {
3896
- return TX_OUTPUT_BASE + (output.script ? output.script.length : TX_OUTPUT_PUBKEYHASH)
3897
- }
3898
-
3899
- function dustThreshold (output, feeRate) {
3900
- /* ... classify the output for input estimate */
3901
- return inputBytes({}) * feeRate
3902
- }
3903
-
3904
- function transactionBytes (inputs, outputs) {
3905
- return TX_EMPTY_SIZE +
3906
- inputs.reduce(function (a, x) { return a + inputBytes(x) }, 0) +
3907
- outputs.reduce(function (a, x) { return a + outputBytes(x) }, 0)
3908
- }
3909
-
3910
- function uintOrNaN (v) {
3911
- if (typeof v !== 'number') return NaN
3912
- if (!isFinite(v)) return NaN
3913
- if (Math.floor(v) !== v) return NaN
3914
- if (v < 0) return NaN
3915
- return v
3916
- }
3917
-
3918
- function sumForgiving (range) {
3919
- return range.reduce(function (a, x) { return a + (isFinite(x.value) ? x.value : 0) }, 0)
3920
- }
3921
-
3922
- function sumOrNaN (range) {
3923
- return range.reduce(function (a, x) { return a + uintOrNaN(x.value) }, 0)
3924
- }
3925
-
3926
- var BLANK_OUTPUT = outputBytes({});
3927
-
3928
- function finalize (inputs, outputs, feeRate) {
3929
- var bytesAccum = transactionBytes(inputs, outputs);
3930
- var feeAfterExtraOutput = feeRate * (bytesAccum + BLANK_OUTPUT);
3931
- var remainderAfterExtraOutput = sumOrNaN(inputs) - (sumOrNaN(outputs) + feeAfterExtraOutput);
3932
-
3933
- // is it worth a change output?
3934
- if (remainderAfterExtraOutput > dustThreshold({}, feeRate)) {
3935
- outputs = outputs.concat({ value: remainderAfterExtraOutput });
3936
- }
3937
-
3938
- var fee = sumOrNaN(inputs) - sumOrNaN(outputs);
3939
- if (!isFinite(fee)) return { fee: feeRate * bytesAccum }
3940
-
3941
- return {
3942
- inputs: inputs,
3943
- outputs: outputs,
3944
- fee: fee
3945
- }
3946
- }
3947
-
3948
- utils = {
3949
- dustThreshold: dustThreshold,
3950
- finalize: finalize,
3951
- inputBytes: inputBytes,
3952
- outputBytes: outputBytes,
3953
- sumOrNaN: sumOrNaN,
3954
- sumForgiving: sumForgiving,
3955
- transactionBytes: transactionBytes,
3956
- uintOrNaN: uintOrNaN
3957
- };
3958
- return utils;
3959
- }
3960
-
3961
- var accumulative$1;
3962
- var hasRequiredAccumulative;
3963
-
3964
- function requireAccumulative () {
3965
- if (hasRequiredAccumulative) return accumulative$1;
3966
- hasRequiredAccumulative = 1;
3967
- var utils = requireUtils();
3968
-
3969
- // add inputs until we reach or surpass the target value (or deplete)
3970
- // worst-case: O(n)
3971
- accumulative$1 = function accumulative (utxos, outputs, feeRate) {
3972
- if (!isFinite(utils.uintOrNaN(feeRate))) return {}
3973
- var bytesAccum = utils.transactionBytes([], outputs);
3974
-
3975
- var inAccum = 0;
3976
- var inputs = [];
3977
- var outAccum = utils.sumOrNaN(outputs);
3978
-
3979
- for (var i = 0; i < utxos.length; ++i) {
3980
- var utxo = utxos[i];
3981
- var utxoBytes = utils.inputBytes(utxo);
3982
- var utxoFee = feeRate * utxoBytes;
3983
- var utxoValue = utils.uintOrNaN(utxo.value);
3984
-
3985
- // skip detrimental input
3986
- if (utxoFee > utxo.value) {
3987
- if (i === utxos.length - 1) return { fee: feeRate * (bytesAccum + utxoBytes) }
3988
- continue
3989
- }
3990
-
3991
- bytesAccum += utxoBytes;
3992
- inAccum += utxoValue;
3993
- inputs.push(utxo);
3994
-
3995
- var fee = feeRate * bytesAccum;
3996
-
3997
- // go again?
3998
- if (inAccum < outAccum + fee) continue
3999
-
4000
- return utils.finalize(inputs, outputs, feeRate)
4001
- }
4002
-
4003
- return { fee: feeRate * bytesAccum }
4004
- };
4005
- return accumulative$1;
4006
- }
4007
-
4008
- var accumulativeExports = requireAccumulative();
4009
- var accumulative = /*@__PURE__*/getDefaultExportFromCjs(accumulativeExports);
4010
-
4011
3875
  /**
4012
3876
  * Object containing the sizes (in bytes) of various components in a Dash transaction.
4013
3877
  */
@@ -4604,4 +4468,3 @@ class ClientLedger extends Client {
4604
4468
  }
4605
4469
 
4606
4470
  export { AssetDASH, BitgoProviders, BlockcypherDataProviders, ClientKeystore as Client, ClientKeystore, ClientLedger, DASHChain, DASH_DECIMAL, DASH_SYMBOL, DEFAULT_FEE_RATE, LOWER_FEE_BOUND, MIN_TX_FEE, UPPER_FEE_BOUND, buildTx, defaultDashParams, explorerProviders, getPrefix, validateAddress };
4607
- //# sourceMappingURL=index.esm.js.map