@xchainjs/xchain-dash 2.2.0 → 2.2.2

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.
Files changed (3) hide show
  1. package/lib/index.esm.js +124 -102
  2. package/lib/index.js +123 -101
  3. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -1023,7 +1023,7 @@ var utils$1 = {
1023
1023
  isIterable,
1024
1024
  };
1025
1025
 
1026
- class AxiosError extends Error {
1026
+ let AxiosError$1 = class AxiosError extends Error {
1027
1027
  static from(error, code, config, request, response, customProps) {
1028
1028
  const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1029
1029
  axiosError.cause = error;
@@ -1075,21 +1075,21 @@ class AxiosError extends Error {
1075
1075
  status: this.status,
1076
1076
  };
1077
1077
  }
1078
- }
1078
+ };
1079
1079
 
1080
1080
  // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1081
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1082
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1083
- AxiosError.ECONNABORTED = 'ECONNABORTED';
1084
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1085
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1086
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1087
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1088
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1089
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1090
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1091
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1092
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1081
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1082
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1083
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1084
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1085
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1086
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1087
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1088
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1089
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1090
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1091
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1092
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1093
1093
 
1094
1094
  // eslint-disable-next-line strict
1095
1095
  var httpAdapter = null;
@@ -1172,7 +1172,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
1172
1172
  *
1173
1173
  * @returns
1174
1174
  */
1175
- function toFormData(obj, formData, options) {
1175
+ function toFormData$1(obj, formData, options) {
1176
1176
  if (!utils$1.isObject(obj)) {
1177
1177
  throw new TypeError('target must be an object');
1178
1178
  }
@@ -1214,7 +1214,7 @@ function toFormData(obj, formData, options) {
1214
1214
  }
1215
1215
 
1216
1216
  if (!useBlob && utils$1.isBlob(value)) {
1217
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1217
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1218
1218
  }
1219
1219
 
1220
1220
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -1343,7 +1343,7 @@ function encode$1(str) {
1343
1343
  function AxiosURLSearchParams(params, options) {
1344
1344
  this._pairs = [];
1345
1345
 
1346
- params && toFormData(params, this, options);
1346
+ params && toFormData$1(params, this, options);
1347
1347
  }
1348
1348
 
1349
1349
  const prototype = AxiosURLSearchParams.prototype;
@@ -1571,7 +1571,7 @@ var platform = {
1571
1571
  };
1572
1572
 
1573
1573
  function toURLEncodedForm(data, options) {
1574
- return toFormData(data, new platform.classes.URLSearchParams(), {
1574
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
1575
1575
  visitor: function(value, key, path, helpers) {
1576
1576
  if (platform.isNode && utils$1.isBuffer(value)) {
1577
1577
  this.append(key, value.toString('base64'));
@@ -1696,7 +1696,7 @@ function stringifySafely(rawValue, parser, encoder) {
1696
1696
  }
1697
1697
  }
1698
1698
 
1699
- return (0, JSON.stringify)(rawValue);
1699
+ return (encoder || JSON.stringify)(rawValue);
1700
1700
  }
1701
1701
 
1702
1702
  const defaults = {
@@ -1747,7 +1747,7 @@ const defaults = {
1747
1747
  if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1748
1748
  const _FormData = this.env && this.env.FormData;
1749
1749
 
1750
- return toFormData(
1750
+ return toFormData$1(
1751
1751
  isFileList ? {'files[]': data} : data,
1752
1752
  _FormData && new _FormData(),
1753
1753
  this.formSerializer
@@ -1781,7 +1781,7 @@ const defaults = {
1781
1781
  } catch (e) {
1782
1782
  if (strictJSONParsing) {
1783
1783
  if (e.name === 'SyntaxError') {
1784
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1784
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1785
1785
  }
1786
1786
  throw e;
1787
1787
  }
@@ -1944,7 +1944,7 @@ function buildAccessors(obj, header) {
1944
1944
  });
1945
1945
  }
1946
1946
 
1947
- class AxiosHeaders {
1947
+ let AxiosHeaders$1 = class AxiosHeaders {
1948
1948
  constructor(headers) {
1949
1949
  headers && this.set(headers);
1950
1950
  }
@@ -2167,12 +2167,12 @@ class AxiosHeaders {
2167
2167
 
2168
2168
  return this;
2169
2169
  }
2170
- }
2170
+ };
2171
2171
 
2172
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2172
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2173
2173
 
2174
2174
  // reserved names hotfix
2175
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2175
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
2176
2176
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2177
2177
  return {
2178
2178
  get: () => value,
@@ -2182,7 +2182,7 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2182
2182
  }
2183
2183
  });
2184
2184
 
2185
- utils$1.freezeMethods(AxiosHeaders);
2185
+ utils$1.freezeMethods(AxiosHeaders$1);
2186
2186
 
2187
2187
  /**
2188
2188
  * Transform the data for a request or a response
@@ -2195,7 +2195,7 @@ utils$1.freezeMethods(AxiosHeaders);
2195
2195
  function transformData(fns, response) {
2196
2196
  const config = this || defaults;
2197
2197
  const context = response || config;
2198
- const headers = AxiosHeaders.from(context.headers);
2198
+ const headers = AxiosHeaders$1.from(context.headers);
2199
2199
  let data = context.data;
2200
2200
 
2201
2201
  utils$1.forEach(fns, function transform(fn) {
@@ -2207,11 +2207,11 @@ function transformData(fns, response) {
2207
2207
  return data;
2208
2208
  }
2209
2209
 
2210
- function isCancel(value) {
2210
+ function isCancel$1(value) {
2211
2211
  return !!(value && value.__CANCEL__);
2212
2212
  }
2213
2213
 
2214
- class CanceledError extends AxiosError {
2214
+ let CanceledError$1 = class CanceledError extends AxiosError$1 {
2215
2215
  /**
2216
2216
  * A `CanceledError` is an object that is thrown when an operation is canceled.
2217
2217
  *
@@ -2222,11 +2222,11 @@ class CanceledError extends AxiosError {
2222
2222
  * @returns {CanceledError} The created error.
2223
2223
  */
2224
2224
  constructor(message, config, request) {
2225
- super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
2225
+ super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
2226
2226
  this.name = 'CanceledError';
2227
2227
  this.__CANCEL__ = true;
2228
2228
  }
2229
- }
2229
+ };
2230
2230
 
2231
2231
  /**
2232
2232
  * Resolve or reject a Promise based on response status.
@@ -2242,9 +2242,9 @@ function settle(resolve, reject, response) {
2242
2242
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2243
2243
  resolve(response);
2244
2244
  } else {
2245
- reject(new AxiosError(
2245
+ reject(new AxiosError$1(
2246
2246
  'Request failed with status code ' + response.status,
2247
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2247
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2248
2248
  response.config,
2249
2249
  response.request,
2250
2250
  response
@@ -2507,7 +2507,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2507
2507
  }
2508
2508
 
2509
2509
  const headersToObject = (thing) =>
2510
- thing instanceof AxiosHeaders ? { ...thing } : thing;
2510
+ thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
2511
2511
 
2512
2512
  /**
2513
2513
  * Config-specific merge-function which creates a new config-object
@@ -2518,7 +2518,7 @@ const headersToObject = (thing) =>
2518
2518
  *
2519
2519
  * @returns {Object} New object resulting from merging config2 to config1
2520
2520
  */
2521
- function mergeConfig(config1, config2) {
2521
+ function mergeConfig$1(config1, config2) {
2522
2522
  // eslint-disable-next-line no-param-reassign
2523
2523
  config2 = config2 || {};
2524
2524
  const config = {};
@@ -2622,11 +2622,11 @@ function mergeConfig(config1, config2) {
2622
2622
  }
2623
2623
 
2624
2624
  var resolveConfig = (config) => {
2625
- const newConfig = mergeConfig({}, config);
2625
+ const newConfig = mergeConfig$1({}, config);
2626
2626
 
2627
2627
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
2628
2628
 
2629
- newConfig.headers = headers = AxiosHeaders.from(headers);
2629
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
2630
2630
 
2631
2631
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2632
2632
 
@@ -2679,7 +2679,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2679
2679
  return new Promise(function dispatchXhrRequest(resolve, reject) {
2680
2680
  const _config = resolveConfig(config);
2681
2681
  let requestData = _config.data;
2682
- const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
2682
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
2683
2683
  let {responseType, onUploadProgress, onDownloadProgress} = _config;
2684
2684
  let onCanceled;
2685
2685
  let uploadThrottled, downloadThrottled;
@@ -2706,7 +2706,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2706
2706
  return;
2707
2707
  }
2708
2708
  // Prepare the response
2709
- const responseHeaders = AxiosHeaders.from(
2709
+ const responseHeaders = AxiosHeaders$1.from(
2710
2710
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2711
2711
  );
2712
2712
  const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
@@ -2761,7 +2761,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2761
2761
  return;
2762
2762
  }
2763
2763
 
2764
- reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2764
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2765
2765
 
2766
2766
  // Clean up request
2767
2767
  request = null;
@@ -2773,7 +2773,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2773
2773
  // (message may be empty; when present, surface it)
2774
2774
  // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
2775
2775
  const msg = event && event.message ? event.message : 'Network Error';
2776
- const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
2776
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
2777
2777
  // attach the underlying event for consumers who want details
2778
2778
  err.event = event || null;
2779
2779
  reject(err);
@@ -2787,9 +2787,9 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2787
2787
  if (_config.timeoutErrorMessage) {
2788
2788
  timeoutErrorMessage = _config.timeoutErrorMessage;
2789
2789
  }
2790
- reject(new AxiosError(
2790
+ reject(new AxiosError$1(
2791
2791
  timeoutErrorMessage,
2792
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
2792
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2793
2793
  config,
2794
2794
  request));
2795
2795
 
@@ -2839,7 +2839,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2839
2839
  if (!request) {
2840
2840
  return;
2841
2841
  }
2842
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
2842
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2843
2843
  request.abort();
2844
2844
  request = null;
2845
2845
  };
@@ -2853,7 +2853,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2853
2853
  const protocol = parseProtocol(_config.url);
2854
2854
 
2855
2855
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
2856
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
2856
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
2857
2857
  return;
2858
2858
  }
2859
2859
 
@@ -2876,13 +2876,13 @@ const composeSignals = (signals, timeout) => {
2876
2876
  aborted = true;
2877
2877
  unsubscribe();
2878
2878
  const err = reason instanceof Error ? reason : this.reason;
2879
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
2879
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
2880
2880
  }
2881
2881
  };
2882
2882
 
2883
2883
  let timer = timeout && setTimeout(() => {
2884
2884
  timer = null;
2885
- onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
2885
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
2886
2886
  }, timeout);
2887
2887
 
2888
2888
  const unsubscribe = () => {
@@ -3066,7 +3066,7 @@ const factory = (env) => {
3066
3066
  return method.call(res);
3067
3067
  }
3068
3068
 
3069
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
3069
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
3070
3070
  });
3071
3071
  });
3072
3072
  })());
@@ -3220,7 +3220,7 @@ const factory = (env) => {
3220
3220
  return await new Promise((resolve, reject) => {
3221
3221
  settle(resolve, reject, {
3222
3222
  data: responseData,
3223
- headers: AxiosHeaders.from(response.headers),
3223
+ headers: AxiosHeaders$1.from(response.headers),
3224
3224
  status: response.status,
3225
3225
  statusText: response.statusText,
3226
3226
  config,
@@ -3232,14 +3232,14 @@ const factory = (env) => {
3232
3232
 
3233
3233
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3234
3234
  throw Object.assign(
3235
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
3235
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
3236
3236
  {
3237
3237
  cause: err.cause || err
3238
3238
  }
3239
3239
  )
3240
3240
  }
3241
3241
 
3242
- throw AxiosError.from(err, err && err.code, config, request, err && err.response);
3242
+ throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
3243
3243
  }
3244
3244
  }
3245
3245
  };
@@ -3325,7 +3325,7 @@ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter ===
3325
3325
  * @throws {AxiosError} If no suitable adapter is available
3326
3326
  * @returns {Function} The resolved adapter function
3327
3327
  */
3328
- function getAdapter(adapters, config) {
3328
+ function getAdapter$1(adapters, config) {
3329
3329
  adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3330
3330
 
3331
3331
  const { length } = adapters;
@@ -3344,7 +3344,7 @@ function getAdapter(adapters, config) {
3344
3344
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3345
3345
 
3346
3346
  if (adapter === undefined) {
3347
- throw new AxiosError(`Unknown adapter '${id}'`);
3347
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
3348
3348
  }
3349
3349
  }
3350
3350
 
@@ -3365,7 +3365,7 @@ function getAdapter(adapters, config) {
3365
3365
  (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3366
3366
  'as no adapter specified';
3367
3367
 
3368
- throw new AxiosError(
3368
+ throw new AxiosError$1(
3369
3369
  `There is no suitable adapter to dispatch the request ` + s,
3370
3370
  'ERR_NOT_SUPPORT'
3371
3371
  );
@@ -3382,7 +3382,7 @@ var adapters = {
3382
3382
  * Resolve an adapter from a list of adapter names or functions.
3383
3383
  * @type {Function}
3384
3384
  */
3385
- getAdapter,
3385
+ getAdapter: getAdapter$1,
3386
3386
 
3387
3387
  /**
3388
3388
  * Exposes all known adapters
@@ -3404,7 +3404,7 @@ function throwIfCancellationRequested(config) {
3404
3404
  }
3405
3405
 
3406
3406
  if (config.signal && config.signal.aborted) {
3407
- throw new CanceledError(null, config);
3407
+ throw new CanceledError$1(null, config);
3408
3408
  }
3409
3409
  }
3410
3410
 
@@ -3418,7 +3418,7 @@ function throwIfCancellationRequested(config) {
3418
3418
  function dispatchRequest(config) {
3419
3419
  throwIfCancellationRequested(config);
3420
3420
 
3421
- config.headers = AxiosHeaders.from(config.headers);
3421
+ config.headers = AxiosHeaders$1.from(config.headers);
3422
3422
 
3423
3423
  // Transform request data
3424
3424
  config.data = transformData.call(
@@ -3442,11 +3442,11 @@ function dispatchRequest(config) {
3442
3442
  response
3443
3443
  );
3444
3444
 
3445
- response.headers = AxiosHeaders.from(response.headers);
3445
+ response.headers = AxiosHeaders$1.from(response.headers);
3446
3446
 
3447
3447
  return response;
3448
3448
  }, function onAdapterRejection(reason) {
3449
- if (!isCancel(reason)) {
3449
+ if (!isCancel$1(reason)) {
3450
3450
  throwIfCancellationRequested(config);
3451
3451
 
3452
3452
  // Transform response data
@@ -3456,7 +3456,7 @@ function dispatchRequest(config) {
3456
3456
  config.transformResponse,
3457
3457
  reason.response
3458
3458
  );
3459
- reason.response.headers = AxiosHeaders.from(reason.response.headers);
3459
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3460
3460
  }
3461
3461
  }
3462
3462
 
@@ -3464,7 +3464,7 @@ function dispatchRequest(config) {
3464
3464
  });
3465
3465
  }
3466
3466
 
3467
- const VERSION = "1.13.5";
3467
+ const VERSION$1 = "1.13.5";
3468
3468
 
3469
3469
  const validators$1 = {};
3470
3470
 
@@ -3488,15 +3488,15 @@ const deprecatedWarnings = {};
3488
3488
  */
3489
3489
  validators$1.transitional = function transitional(validator, version, message) {
3490
3490
  function formatMessage(opt, desc) {
3491
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3491
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3492
3492
  }
3493
3493
 
3494
3494
  // eslint-disable-next-line func-names
3495
3495
  return (value, opt, opts) => {
3496
3496
  if (validator === false) {
3497
- throw new AxiosError(
3497
+ throw new AxiosError$1(
3498
3498
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3499
- AxiosError.ERR_DEPRECATED
3499
+ AxiosError$1.ERR_DEPRECATED
3500
3500
  );
3501
3501
  }
3502
3502
 
@@ -3535,7 +3535,7 @@ validators$1.spelling = function spelling(correctSpelling) {
3535
3535
 
3536
3536
  function assertOptions(options, schema, allowUnknown) {
3537
3537
  if (typeof options !== 'object') {
3538
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
3538
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3539
3539
  }
3540
3540
  const keys = Object.keys(options);
3541
3541
  let i = keys.length;
@@ -3546,12 +3546,12 @@ function assertOptions(options, schema, allowUnknown) {
3546
3546
  const value = options[opt];
3547
3547
  const result = value === undefined || validator(value, opt, options);
3548
3548
  if (result !== true) {
3549
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
3549
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3550
3550
  }
3551
3551
  continue;
3552
3552
  }
3553
3553
  if (allowUnknown !== true) {
3554
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
3554
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3555
3555
  }
3556
3556
  }
3557
3557
  }
@@ -3570,7 +3570,7 @@ const validators = validator.validators;
3570
3570
  *
3571
3571
  * @return {Axios} A new instance of Axios
3572
3572
  */
3573
- class Axios {
3573
+ let Axios$1 = class Axios {
3574
3574
  constructor(instanceConfig) {
3575
3575
  this.defaults = instanceConfig || {};
3576
3576
  this.interceptors = {
@@ -3624,7 +3624,7 @@ class Axios {
3624
3624
  config = configOrUrl || {};
3625
3625
  }
3626
3626
 
3627
- config = mergeConfig(this.defaults, config);
3627
+ config = mergeConfig$1(this.defaults, config);
3628
3628
 
3629
3629
  const {transitional, paramsSerializer, headers} = config;
3630
3630
 
@@ -3678,7 +3678,7 @@ class Axios {
3678
3678
  }
3679
3679
  );
3680
3680
 
3681
- config.headers = AxiosHeaders.concat(contextHeaders, headers);
3681
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3682
3682
 
3683
3683
  // filter out skipped interceptors
3684
3684
  const requestInterceptorChain = [];
@@ -3756,17 +3756,17 @@ class Axios {
3756
3756
  }
3757
3757
 
3758
3758
  getUri(config) {
3759
- config = mergeConfig(this.defaults, config);
3759
+ config = mergeConfig$1(this.defaults, config);
3760
3760
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3761
3761
  return buildURL(fullPath, config.params, config.paramsSerializer);
3762
3762
  }
3763
- }
3763
+ };
3764
3764
 
3765
3765
  // Provide aliases for supported request methods
3766
3766
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3767
3767
  /*eslint func-names:0*/
3768
- Axios.prototype[method] = function(url, config) {
3769
- return this.request(mergeConfig(config || {}, {
3768
+ Axios$1.prototype[method] = function(url, config) {
3769
+ return this.request(mergeConfig$1(config || {}, {
3770
3770
  method,
3771
3771
  url,
3772
3772
  data: (config || {}).data
@@ -3779,7 +3779,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3779
3779
 
3780
3780
  function generateHTTPMethod(isForm) {
3781
3781
  return function httpMethod(url, data, config) {
3782
- return this.request(mergeConfig(config || {}, {
3782
+ return this.request(mergeConfig$1(config || {}, {
3783
3783
  method,
3784
3784
  headers: isForm ? {
3785
3785
  'Content-Type': 'multipart/form-data'
@@ -3790,9 +3790,9 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3790
3790
  };
3791
3791
  }
3792
3792
 
3793
- Axios.prototype[method] = generateHTTPMethod();
3793
+ Axios$1.prototype[method] = generateHTTPMethod();
3794
3794
 
3795
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
3795
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
3796
3796
  });
3797
3797
 
3798
3798
  /**
@@ -3802,7 +3802,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3802
3802
  *
3803
3803
  * @returns {CancelToken}
3804
3804
  */
3805
- class CancelToken {
3805
+ let CancelToken$1 = class CancelToken {
3806
3806
  constructor(executor) {
3807
3807
  if (typeof executor !== 'function') {
3808
3808
  throw new TypeError('executor must be a function.');
@@ -3850,7 +3850,7 @@ class CancelToken {
3850
3850
  return;
3851
3851
  }
3852
3852
 
3853
- token.reason = new CanceledError(message, config, request);
3853
+ token.reason = new CanceledError$1(message, config, request);
3854
3854
  resolvePromise(token.reason);
3855
3855
  });
3856
3856
  }
@@ -3923,7 +3923,7 @@ class CancelToken {
3923
3923
  cancel
3924
3924
  };
3925
3925
  }
3926
- }
3926
+ };
3927
3927
 
3928
3928
  /**
3929
3929
  * Syntactic sugar for invoking a function and expanding an array for arguments.
@@ -3946,7 +3946,7 @@ class CancelToken {
3946
3946
  *
3947
3947
  * @returns {Function}
3948
3948
  */
3949
- function spread(callback) {
3949
+ function spread$1(callback) {
3950
3950
  return function wrap(arr) {
3951
3951
  return callback.apply(null, arr);
3952
3952
  };
@@ -3959,11 +3959,11 @@ function spread(callback) {
3959
3959
  *
3960
3960
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
3961
3961
  */
3962
- function isAxiosError(payload) {
3962
+ function isAxiosError$1(payload) {
3963
3963
  return utils$1.isObject(payload) && (payload.isAxiosError === true);
3964
3964
  }
3965
3965
 
3966
- const HttpStatusCode = {
3966
+ const HttpStatusCode$1 = {
3967
3967
  Continue: 100,
3968
3968
  SwitchingProtocols: 101,
3969
3969
  Processing: 102,
@@ -4035,8 +4035,8 @@ const HttpStatusCode = {
4035
4035
  InvalidSslCertificate: 526,
4036
4036
  };
4037
4037
 
4038
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
4039
- HttpStatusCode[value] = key;
4038
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
4039
+ HttpStatusCode$1[value] = key;
4040
4040
  });
4041
4041
 
4042
4042
  /**
@@ -4047,18 +4047,18 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
4047
4047
  * @returns {Axios} A new instance of Axios
4048
4048
  */
4049
4049
  function createInstance(defaultConfig) {
4050
- const context = new Axios(defaultConfig);
4051
- const instance = bind(Axios.prototype.request, context);
4050
+ const context = new Axios$1(defaultConfig);
4051
+ const instance = bind(Axios$1.prototype.request, context);
4052
4052
 
4053
4053
  // Copy axios.prototype to instance
4054
- utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
4054
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
4055
4055
 
4056
4056
  // Copy context to instance
4057
4057
  utils$1.extend(instance, context, null, {allOwnKeys: true});
4058
4058
 
4059
4059
  // Factory for creating new instances
4060
4060
  instance.create = function create(instanceConfig) {
4061
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
4061
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
4062
4062
  };
4063
4063
 
4064
4064
  return instance;
@@ -4068,17 +4068,17 @@ function createInstance(defaultConfig) {
4068
4068
  const axios = createInstance(defaults);
4069
4069
 
4070
4070
  // Expose Axios class to allow class inheritance
4071
- axios.Axios = Axios;
4071
+ axios.Axios = Axios$1;
4072
4072
 
4073
4073
  // Expose Cancel & CancelToken
4074
- axios.CanceledError = CanceledError;
4075
- axios.CancelToken = CancelToken;
4076
- axios.isCancel = isCancel;
4077
- axios.VERSION = VERSION;
4078
- axios.toFormData = toFormData;
4074
+ axios.CanceledError = CanceledError$1;
4075
+ axios.CancelToken = CancelToken$1;
4076
+ axios.isCancel = isCancel$1;
4077
+ axios.VERSION = VERSION$1;
4078
+ axios.toFormData = toFormData$1;
4079
4079
 
4080
4080
  // Expose AxiosError class
4081
- axios.AxiosError = AxiosError;
4081
+ axios.AxiosError = AxiosError$1;
4082
4082
 
4083
4083
  // alias for CanceledError for backward compatibility
4084
4084
  axios.Cancel = axios.CanceledError;
@@ -4088,24 +4088,46 @@ axios.all = function all(promises) {
4088
4088
  return Promise.all(promises);
4089
4089
  };
4090
4090
 
4091
- axios.spread = spread;
4091
+ axios.spread = spread$1;
4092
4092
 
4093
4093
  // Expose isAxiosError
4094
- axios.isAxiosError = isAxiosError;
4094
+ axios.isAxiosError = isAxiosError$1;
4095
4095
 
4096
4096
  // Expose mergeConfig
4097
- axios.mergeConfig = mergeConfig;
4097
+ axios.mergeConfig = mergeConfig$1;
4098
4098
 
4099
- axios.AxiosHeaders = AxiosHeaders;
4099
+ axios.AxiosHeaders = AxiosHeaders$1;
4100
4100
 
4101
4101
  axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4102
4102
 
4103
4103
  axios.getAdapter = adapters.getAdapter;
4104
4104
 
4105
- axios.HttpStatusCode = HttpStatusCode;
4105
+ axios.HttpStatusCode = HttpStatusCode$1;
4106
4106
 
4107
4107
  axios.default = axios;
4108
4108
 
4109
+ // This module is intended to unwrap Axios default export as named.
4110
+ // Keep top-level export same with static properties
4111
+ // so that it can keep same with es module or cjs
4112
+ const {
4113
+ Axios,
4114
+ AxiosError,
4115
+ CanceledError,
4116
+ isCancel,
4117
+ CancelToken,
4118
+ VERSION,
4119
+ all,
4120
+ Cancel,
4121
+ isAxiosError,
4122
+ spread,
4123
+ toFormData,
4124
+ AxiosHeaders,
4125
+ HttpStatusCode,
4126
+ formToJSON,
4127
+ getAdapter,
4128
+ mergeConfig
4129
+ } = axios;
4130
+
4109
4131
  /**
4110
4132
  * Function to generate the URL for the given network.
4111
4133
  *