diff --git a/src/api/tokens.ts b/src/api/tokens.ts index 4d2672b..75e9860 100644 --- a/src/api/tokens.ts +++ b/src/api/tokens.ts @@ -1,8 +1,9 @@ import axios, { AxiosResponse } from 'axios'; import { BigNumber } from 'ethers'; import { - Network, ReefSigner, reefTokenWithAmount, Token, + ReefSigner, reefTokenWithAmount, Token, } from '../state'; +import type {Network} from "@reef-chain/util-lib/dist/network"; interface AccountTokensRes { tokens: AccountTokensResBalance[]; diff --git a/src/hooks/useAddLiquidity.tsx b/src/hooks/useAddLiquidity.tsx index 118f4f5..8f1856f 100644 --- a/src/hooks/useAddLiquidity.tsx +++ b/src/hooks/useAddLiquidity.tsx @@ -8,12 +8,12 @@ import { ERC20 } from '../assets/abi/ERC20'; import { getReefswapRouter } from '../rpc'; import { AddressToNumber, - Network, NotifyFun, ReefSigner, resolveSettings, Token, TokenWithAmount, } from '../state'; +import type {DexProtocolv2 as Network} from "@reef-chain/util-lib/dist/network"; import { AddLiquidityActions, SetNewPoolSupplyAction, diff --git a/src/hooks/useInitReefState.ts b/src/hooks/useInitReefState.ts index 8d42d10..d458b71 100644 --- a/src/hooks/useInitReefState.ts +++ b/src/hooks/useInitReefState.ts @@ -7,7 +7,7 @@ import type { Signer as InjectedSigner } from '@polkadot/api/types'; import { map } from 'rxjs'; import { hooks, rpc, appState } from '..'; import { ReefSigner } from '../state'; -import { Network } from '../state/network'; +import type {Network} from "@reef-chain/util-lib/dist/network"; import { useAsyncEffect } from './useAsyncEffect'; import { useInjectExtension } from './useInjectExtension'; import { useObservableState } from './useObservableState'; diff --git a/src/hooks/useLoadSignerTokens.ts b/src/hooks/useLoadSignerTokens.ts index e142672..57fa8e2 100644 --- a/src/hooks/useLoadSignerTokens.ts +++ b/src/hooks/useLoadSignerTokens.ts @@ -7,8 +7,9 @@ import { isDataSet, } from '../utils/dataWithProgress'; import { - Network, ReefSigner, reefTokenWithAmount, Token, + ReefSigner, reefTokenWithAmount, Token, } from '../state'; +import type {Network} from "@reef-chain/util-lib/dist/network"; import { loadSignerTokens } from '../api/tokens'; export const useLoadSignerTokens = ( diff --git a/src/hooks/useRemoveLiquidity.tsx b/src/hooks/useRemoveLiquidity.tsx index ee95942..e7a335f 100644 --- a/src/hooks/useRemoveLiquidity.tsx +++ b/src/hooks/useRemoveLiquidity.tsx @@ -9,8 +9,9 @@ import { ReefswapPair } from '../assets/abi/ReefswapPair'; import { getReefswapRouter } from '../rpc'; import { AddressToNumber, - Network, NotifyFun, Pool, ReefSigner, REMOVE_DEFAULT_SLIPPAGE_TOLERANCE, resolveSettings, Token, + NotifyFun, Pool, ReefSigner, REMOVE_DEFAULT_SLIPPAGE_TOLERANCE, resolveSettings, Token, } from '../state'; +import type {DexProtocolv2 as Network} from "@reef-chain/util-lib/dist/network"; import { RemoveLiquidityActions, RemoveLiquidityState, setCompleteStatusAction, setLoadingAction, setPercentageAction, setPoolAction, setStatusAction, setToken1Action, setToken2Action, } from '../store'; diff --git a/src/hooks/useSwapState.ts b/src/hooks/useSwapState.ts index 808bd03..88683cc 100644 --- a/src/hooks/useSwapState.ts +++ b/src/hooks/useSwapState.ts @@ -8,13 +8,13 @@ import { getReefswapRouter } from '../rpc'; import { AddressToNumber, ensureTokenAmount, - Network, NotifyFun, Pool, ReefSigner, resolveSettings, Token, TokenWithAmount, } from '../state'; +import type {DexProtocolv2 as Network} from "@reef-chain/util-lib/dist/network"; import { SwapAction } from '../store'; import { clearTokenAmountsAction, setCompleteStatusAction, setLoadingAction, setPoolAction, setStatusAction, setToken1Action, setToken2Action, setTokenPricesAction, diff --git a/src/state/index.ts b/src/state/index.ts index 6ab425c..2793145 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -3,4 +3,3 @@ export * from './token'; export * from './nft'; export * from './pool'; export * from './types'; -export * from './network'; diff --git a/src/state/network.ts b/src/state/network.ts deleted file mode 100644 index ca3f1fc..0000000 --- a/src/state/network.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { network } from '@reef-chain/util-lib'; -import {Bond, Network as UtilLibNetwork} from "@reef-chain/util-lib/dist/network" - -const networks = Object.keys(network.AVAILABLE_NETWORKS); -export type AvailableNetworks = typeof networks[number]; - -export interface Network extends UtilLibNetwork{ - factoryAddress:string; - routerAddress:string; - graphqlDexsUrl:string; - bonds:Bond[]; -} diff --git a/src/utils/transactionUtil.ts b/src/utils/transactionUtil.ts index 816538d..9bf57ce 100644 --- a/src/utils/transactionUtil.ts +++ b/src/utils/transactionUtil.ts @@ -4,7 +4,7 @@ import { Provider } from "@reef-chain/evm-provider"; import { BigNumber } from "ethers"; import { network as nw } from "@reef-chain/util-lib"; import { ReefSigner } from "../state"; -import { Network } from "../state/network"; +import type {Network} from "@reef-chain/util-lib/dist/network"; export type TxStatusHandler = (status: TxStatusUpdate) => void;