diff --git a/batcher-ui/Dockerfile.ghostnet b/batcher-ui/Dockerfile.ghostnet index 4da8875f..043cc7cd 100644 --- a/batcher-ui/Dockerfile.ghostnet +++ b/batcher-ui/Dockerfile.ghostnet @@ -9,7 +9,7 @@ COPY ./package.json ./ RUN npm install COPY ./tsconfig.json ./jsconfig.json ./ -COPY ./pages ./pages +#COPY ./pages ./pages COPY ./src ./src COPY ./styles ./styles COPY ./public ./public diff --git a/batcher-ui/src/components/market-maker/Vault.tsx b/batcher-ui/src/components/market-maker/Vault.tsx index f75993a4..90c17551 100644 --- a/batcher-ui/src/components/market-maker/Vault.tsx +++ b/batcher-ui/src/components/market-maker/Vault.tsx @@ -3,14 +3,12 @@ import { useDispatch } from 'react-redux'; import { getMarketHoldings, fetchUserBalances } from '@/actions'; import { selectCurrentVaultName } from '@/reducers'; import { ValidTokenAmount } from '@/types/contracts/token-manager'; -import PrimaryButton from '@/components/common/PrimaryButton'; import * as Form from '@radix-ui/react-form'; import { scaleAmountUp } from '@/utils/utils'; import { tzip12 } from '@taquito/tzip12'; import { tzip16 } from '@taquito/tzip16'; import { compose, OpKind } from '@taquito/taquito'; import { useSelector } from 'react-redux'; -import { NumericFormat } from 'react-number-format'; import { userBalancesSelector, userAddressSelector, @@ -27,13 +25,13 @@ const Vault = () => { const marketHoldings = useSelector(selectHoldings); const [amountInput, setAmount] = useState('0'); const tokenName = useSelector(selectCurrentVaultName); - const scaleTokenAmount = (ta: ValidTokenAmount): ValidTokenAmount => { - const scaledAmount = ta.amount / 10 ** ta?.token.decimals; - return { - ...ta, - amount: scaledAmount, - }; - }; + // const scaleTokenAmount = (ta: ValidTokenAmount): ValidTokenAmount => { + // const scaledAmount = ta.amount / 10 ** (ta?.token.decimals || 0); + // return { + // ...ta, + // amount: scaledAmount, + // }; + // }; useEffect(() => { dispatch(getMarketHoldings(tokenName || '', userAddress)); }, [dispatch, userAddress, tokenName]); diff --git a/batcher-ui/src/reducers/exchange.ts b/batcher-ui/src/reducers/exchange.ts index 1bbba17d..37642e68 100644 --- a/batcher-ui/src/reducers/exchange.ts +++ b/batcher-ui/src/reducers/exchange.ts @@ -5,7 +5,6 @@ import { getCurrentBatchNumber, getOraclePrice, getPairsInfos, - newError, } from '../../src/actions'; import { BatcherStatus, diff --git a/batcher-ui/src/reducers/marketholdings.ts b/batcher-ui/src/reducers/marketholdings.ts index 51af640a..41941639 100644 --- a/batcher-ui/src/reducers/marketholdings.ts +++ b/batcher-ui/src/reducers/marketholdings.ts @@ -4,6 +4,7 @@ import { fetchMarketHoldingsCmd } from '@/commands/marketholdings'; import { MarketHoldingsState } from '@/types'; export const initialMHState: MarketHoldingsState = { + vault_address:'', shares: 0, nativeToken: { token: { diff --git a/batcher-ui/src/utils/token-manager.ts b/batcher-ui/src/utils/token-manager.ts index ed1e2496..7d4c17f7 100644 --- a/batcher-ui/src/utils/token-manager.ts +++ b/batcher-ui/src/utils/token-manager.ts @@ -103,17 +103,37 @@ export const parseToken = (tokenObject: any): ValidToken => { }; } catch (e: any) { console.error('Unable to parse valid token', e); + return { + name: '', + address: '', + token_id: '0', + decimals: '0', + standard: '', + }; } }; export const parseTokenAmount = (tokenAmountObject: any): ValidTokenAmount => { try { - const scaledAmount = scaleAmountDown(parseInt(tokenAmountObject.amount),tokenAmountObject.token.decimals); + const scaledAmount = scaleAmountDown( + parseInt(tokenAmountObject.amount), + tokenAmountObject.token.decimals + ); return { token: parseToken(tokenAmountObject.token), amount: scaledAmount, }; } catch (e: any) { console.error('Unable to parse valid token amount', e); + return { + amount: 0, + token: { + name: '', + address: '', + token_id: '0', + decimals: '0', + standard: '', + }, + }; } }; diff --git a/batcher-ui/tsconfig.json b/batcher-ui/tsconfig.json index 0ed5f538..e915b3d3 100644 --- a/batcher-ui/tsconfig.json +++ b/batcher-ui/tsconfig.json @@ -19,7 +19,7 @@ "allowJs": false, "skipLibCheck": true, "experimentalDecorators": true, - "strict": true, + "strict": false, "noEmit": true, "incremental": true, "esModuleInterop": true,