mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-09 18:45:38 +00:00
980366694c
* create ensureOkResponse and check against RPC responses * Merge with develop branch * added single unit test * main nodes added * getBalance method * remove console.log * minor conflict fix - readd polyfill to integration test * added two more method tests * seperate rpcnode from extended classes * fixes etherscan * added all tests * revert files with only formatting changes * remove console.logs - still need to update snapshot before tests will pass * updated snapshot due to RpcNode fixes for Infura and Etherscan nodes * added RpcNodeTest config so we don't rely on constants in code * undo formatting changes * Multiple fixes to error handling tokens. * Fixed TSC errors * Minor styling edit - change async func to promise * changed shape of tokenBalances * change balance type back to stricter TokenValue type * remove package.json change and include test for error state. * minor change removing unneeded line of code * added longer timeout for api * update snapshot
18 lines
424 B
JavaScript
18 lines
424 B
JavaScript
'use strict';
|
|
|
|
var realFetch = require('node-fetch');
|
|
module.exports = function(url, options) {
|
|
if (/^\/\//.test(url)) {
|
|
url = 'https:' + url;
|
|
}
|
|
return realFetch.call(this, url, options);
|
|
};
|
|
|
|
if (!global.fetch) {
|
|
global.fetch = module.exports;
|
|
global.Response = realFetch.Response;
|
|
global.Headers = realFetch.Headers;
|
|
global.Request = realFetch.Request;
|
|
}
|
|
window.BASE_API = 'http://localhost:4000/api/v1';
|