fix: asset-swapper EthGasStation proxy url (#2614)
This commit is contained in:
parent
a5a68acfec
commit
d36acc7ec7
@ -1,4 +1,17 @@
|
||||
[
|
||||
{
|
||||
"version": "4.6.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Use internal Eth Gas Station proxy",
|
||||
"pr": 2614
|
||||
},
|
||||
{
|
||||
"note": "Renamed RFQT request parameters",
|
||||
"pr": 2582
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.5.0",
|
||||
"changes": [
|
||||
|
@ -11,10 +11,9 @@ import {
|
||||
SwapQuoteRequestOpts,
|
||||
SwapQuoterOpts,
|
||||
} from './types';
|
||||
|
||||
import { DEFAULT_GET_MARKET_ORDERS_OPTS } from './utils/market_operation_utils/constants';
|
||||
|
||||
const ETH_GAS_STATION_API_BASE_URL = 'https://ethgasstation.info';
|
||||
const ETH_GAS_STATION_API_URL = 'https://ethgasstation.api.0x.org/api/ethgasAPI.json';
|
||||
const NULL_BYTES = '0x';
|
||||
const NULL_ERC20_ASSET_DATA = '0xf47261b00000000000000000000000000000000000000000000000000000000000000000';
|
||||
const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||
@ -72,7 +71,7 @@ const DEFAULT_RFQT_REQUEST_OPTS: Partial<RfqtRequestOpts> = {
|
||||
};
|
||||
|
||||
export const constants = {
|
||||
ETH_GAS_STATION_API_BASE_URL,
|
||||
ETH_GAS_STATION_API_URL,
|
||||
PROTOCOL_FEE_MULTIPLIER,
|
||||
NULL_BYTES,
|
||||
ZERO_AMOUNT: new BigNumber(0),
|
||||
|
@ -35,7 +35,7 @@ export class ProtocolFeeUtils {
|
||||
// tslint:disable-next-line: prefer-function-over-method
|
||||
private async _getGasPriceFromGasStationOrThrowAsync(): Promise<BigNumber> {
|
||||
try {
|
||||
const res = await fetch(`${constants.ETH_GAS_STATION_API_BASE_URL}/json/ethgasAPI.json`);
|
||||
const res = await fetch(constants.ETH_GAS_STATION_API_URL);
|
||||
const gasInfo = await res.json();
|
||||
// Eth Gas Station result is gwei * 10
|
||||
// tslint:disable-next-line:custom-no-magic-numbers
|
||||
|
Loading…
x
Reference in New Issue
Block a user