@aurigami/sdk 1.4.2 → 1.4.4

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.
@@ -8,7 +8,8 @@ var BigNumber = _interopDefault(require('bignumber.js'));
8
8
  var ethers = require('ethers');
9
9
  var utils = require('ethers/lib/utils');
10
10
  var abstractSigner = require('@ethersproject/abstract-signer');
11
- var fetch = _interopDefault(require('node-fetch'));
11
+ var fetch = require('node-fetch');
12
+ var fetch__default = _interopDefault(fetch);
12
13
  var AuErc20ABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json'));
13
14
  var AuETHABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json'));
14
15
  var ComptrollerABI = _interopDefault(require('@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json'));
@@ -1036,27 +1037,36 @@ function _getQuery() {
1036
1037
  params = {};
1037
1038
  }
1038
1039
 
1040
+ if (!globalThis.fetch) {
1041
+ Object.assign(globalThis, {
1042
+ fetch: fetch__default,
1043
+ Headers: fetch.Headers,
1044
+ Request: fetch.Request,
1045
+ Response: fetch.Response
1046
+ });
1047
+ }
1048
+
1039
1049
  params = _extends({}, params, {
1040
1050
  'module': module,
1041
1051
  'action': action
1042
1052
  });
1043
- _context.next = 4;
1044
- return fetch(AURORA_API_BASE_URL + '?' + new URLSearchParams(params), {
1053
+ _context.next = 5;
1054
+ return globalThis.fetch(AURORA_API_BASE_URL + '?' + new URLSearchParams(params), {
1045
1055
  headers: {
1046
1056
  'Content-Type': 'application/json'
1047
1057
  },
1048
1058
  method: 'GET'
1049
1059
  });
1050
1060
 
1051
- case 4:
1061
+ case 5:
1052
1062
  resp = _context.sent;
1053
- _context.next = 7;
1063
+ _context.next = 8;
1054
1064
  return resp.json();
1055
1065
 
1056
- case 7:
1066
+ case 8:
1057
1067
  return _context.abrupt("return", _context.sent.result);
1058
1068
 
1059
- case 8:
1069
+ case 9:
1060
1070
  case "end":
1061
1071
  return _context.stop();
1062
1072
  }