@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.
package/dist/sdk.esm.js CHANGED
@@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js';
2
2
  import { BigNumber as BigNumber$1, utils, Contract, ethers } from 'ethers';
3
3
  import { Logger } from 'ethers/lib/utils';
4
4
  import { Signer } from '@ethersproject/abstract-signer';
5
- import fetch from 'node-fetch';
5
+ import fetch, { Headers, Request, Response } from 'node-fetch';
6
6
  import AuErc20ABI from '@aurigami/contracts/artifacts/contracts/AuErc20.sol/AuErc20.json';
7
7
  import AuETHABI from '@aurigami/contracts/artifacts/contracts/AuETH.sol/AuETH.json';
8
8
  import ComptrollerABI from '@aurigami/contracts/artifacts/contracts/Comptroller.sol/Comptroller.json';
@@ -1033,27 +1033,36 @@ function _getQuery() {
1033
1033
  params = {};
1034
1034
  }
1035
1035
 
1036
+ if (!globalThis.fetch) {
1037
+ Object.assign(globalThis, {
1038
+ fetch: fetch,
1039
+ Headers: Headers,
1040
+ Request: Request,
1041
+ Response: Response
1042
+ });
1043
+ }
1044
+
1036
1045
  params = _extends({}, params, {
1037
1046
  'module': module,
1038
1047
  'action': action
1039
1048
  });
1040
- _context.next = 4;
1041
- return fetch(AURORA_API_BASE_URL + '?' + new URLSearchParams(params), {
1049
+ _context.next = 5;
1050
+ return globalThis.fetch(AURORA_API_BASE_URL + '?' + new URLSearchParams(params), {
1042
1051
  headers: {
1043
1052
  'Content-Type': 'application/json'
1044
1053
  },
1045
1054
  method: 'GET'
1046
1055
  });
1047
1056
 
1048
- case 4:
1057
+ case 5:
1049
1058
  resp = _context.sent;
1050
- _context.next = 7;
1059
+ _context.next = 8;
1051
1060
  return resp.json();
1052
1061
 
1053
- case 7:
1062
+ case 8:
1054
1063
  return _context.abrupt("return", _context.sent.result);
1055
1064
 
1056
- case 8:
1065
+ case 9:
1057
1066
  case "end":
1058
1067
  return _context.stop();
1059
1068
  }