diff --git a/src/routes/Evodex/BackLayer/Liquidity/LiquidityBackLayer.js b/src/routes/Evodex/BackLayer/Liquidity/LiquidityBackLayer.js index 5193015..48ec583 100644 --- a/src/routes/Evodex/BackLayer/Liquidity/LiquidityBackLayer.js +++ b/src/routes/Evodex/BackLayer/Liquidity/LiquidityBackLayer.js @@ -315,12 +315,11 @@ const LiquidityBackLayer = ({ const getCurrentSupply = useCallback(async () => { const currentSupply = await evolutiondex.getCurrentSupply( - ual, youGive.selectValue ) setCurrentSupplyValue(currentSupply) - }, [ual, youGive.selectValue]) + }, [youGive.selectValue]) useEffect(() => { getCurrentSupply() diff --git a/src/utils/eosapi.js b/src/utils/eosapi.js new file mode 100644 index 0000000..87836d3 --- /dev/null +++ b/src/utils/eosapi.js @@ -0,0 +1,9 @@ +import EosApi from 'eosjs-api' + +const eosApi = EosApi({ + httpEndpoint: `${process.env.REACT_APP_EOS_API_PROTOCOL}://${process.env.REACT_APP_EOS_API_HOST}:${process.env.REACT_APP_EOS_API_PORT}`, + verbose: false, + fetchConfiguration: {} +}) + +export default eosApi diff --git a/src/utils/evolutiondex.js b/src/utils/evolutiondex.js index 063cb3d..98d247b 100644 --- a/src/utils/evolutiondex.js +++ b/src/utils/evolutiondex.js @@ -1,11 +1,11 @@ import * as eosCommon from 'eos-common' +import { JsonRpc } from 'eosjs' import { evodexConfig } from '../config' import { getScatterError } from './getScatterError' import axiosUtil from './axios.util' - -import { JsonRpc } from 'eosjs' +import eosApi from './eosapi' const { asset, number_to_asset: numberToAsset } = eosCommon const defaultState = { pairs: [], tokens: [] } @@ -620,14 +620,12 @@ const voteFee = async (amount, pair, ual) => { } } -const getCurrentSupply = async (ual, pool) => { - if (!ual.activeUser || !pool) { +const getCurrentSupply = async (pool) => { + if (!pool) { return } - const rpc = getRpc(ual) - - const { rows } = await rpc.get_table_rows({ + const { rows } = await eosApi.getTableRows({ json: true, code: 'evolutiondex', scope: pool,