|
|
@ -2,7 +2,10 @@ import log from 'loglevel'; |
|
|
|
import BigNumber from 'bignumber.js'; |
|
|
|
import BigNumber from 'bignumber.js'; |
|
|
|
import abi from 'human-standard-token-abi'; |
|
|
|
import abi from 'human-standard-token-abi'; |
|
|
|
import { isValidAddress } from 'ethereumjs-util'; |
|
|
|
import { isValidAddress } from 'ethereumjs-util'; |
|
|
|
import { ETH_SWAPS_TOKEN_OBJECT } from '../../helpers/constants/swaps'; |
|
|
|
import { |
|
|
|
|
|
|
|
ETH_SWAPS_TOKEN_OBJECT, |
|
|
|
|
|
|
|
METASWAP_API_HOST, |
|
|
|
|
|
|
|
} from '../../helpers/constants/swaps'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
calcTokenValue, |
|
|
|
calcTokenValue, |
|
|
|
calcTokenAmount, |
|
|
|
calcTokenAmount, |
|
|
@ -27,8 +30,6 @@ const TOKEN_TRANSFER_LOG_TOPIC_HASH = |
|
|
|
|
|
|
|
|
|
|
|
const CACHE_REFRESH_ONE_HOUR = 3600000; |
|
|
|
const CACHE_REFRESH_ONE_HOUR = 3600000; |
|
|
|
|
|
|
|
|
|
|
|
const METASWAP_API_HOST = 'https://api.metaswap.codefi.network'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getBaseApi = function (type) { |
|
|
|
const getBaseApi = function (type) { |
|
|
|
switch (type) { |
|
|
|
switch (type) { |
|
|
|
case 'trade': |
|
|
|
case 'trade': |
|
|
|