small fixes

This commit is contained in:
Maximilian Schneider 2021-06-18 18:57:13 -04:00
parent ccad1015f3
commit e256ed4754
5 changed files with 9 additions and 9 deletions

View File

@ -153,8 +153,8 @@ export default function MarginBalances() {
</tr>
</thead>
<tbody>
{selectedMangoGroupConfig.tokens.map(({ symbol, mint_key }) => {
const tokenIndex = selectedMangoGroup.getTokenIndex(mint_key)
{selectedMangoGroupConfig.tokens.map(({ symbol, mintKey }) => {
const tokenIndex = selectedMangoGroup.getTokenIndex(mintKey)
return (
<tr key={symbol} className={`text-th-fgd-1`}>
<td className={`flex items-center py-2`}>

View File

@ -32,7 +32,7 @@ const MarketSelect = () => {
}
`}
onClick={() => handleChange(s.baseSymbol, 'perp')}
key={s.key.toBase58()}
key={s.publicKey.toBase58()}
>
{s.name}
</div>
@ -48,7 +48,7 @@ const MarketSelect = () => {
}
`}
onClick={() => handleChange(s.baseSymbol, 'spot')}
key={s.key.toBase58()}
key={s.publicKey.toBase58()}
>
{s.name}
</div>

View File

@ -30,7 +30,7 @@ const NewAccount: FunctionComponent<NewAccountProps> = ({
onAccountCreation,
}) => {
const groupConfig = useMangoGroupConfig()
// const tokenMints = useMemo(() => groupConfig.tokens.map(t => t.mint_key.toBase58()), [groupConfig]);
// const tokenMints = useMemo(() => groupConfig.tokens.map(t => t.mintKey.toBase58()), [groupConfig]);
const [inputAmount, setInputAmount] = useState(0)
const [submitting, setSubmitting] = useState(false)
const [invalidAmountMessage, setInvalidAmountMessage] = useState('')

View File

@ -38,7 +38,7 @@ const useHydrateStore = () => {
if (marketConfig.kind === 'spot') {
Market.load(
connection,
marketConfig.key,
marketConfig.publicKey,
{},
groupConfig.serumProgramId
)
@ -62,7 +62,7 @@ const useHydrateStore = () => {
})
})
} else {
mangoClient.getPerpMarket(marketConfig.key).then(async (market) => {
mangoClient.getPerpMarket(marketConfig.publicKey).then(async (market) => {
const bidInfo = await connection.getAccountInfo(market.bids)
const askInfo = await connection.getAccountInfo(market.asks)

View File

@ -242,10 +242,10 @@ export async function decodeAndLoadMarkets(
console.log('decoded accs===', decodedAcc)
const baseToken = groupConfig.tokens.find((token) =>
token.mint_key.equals(decodedAcc.baseMint)
token.mintKey.equals(decodedAcc.baseMint)
)
const quoteToken = groupConfig.tokens.find((token) =>
token.mint_key.equals(decodedAcc.quoteMint)
token.mintKey.equals(decodedAcc.quoteMint)
)
const baseMintDecimals = baseToken.decimals