diff --git a/components/DepositForm.tsx b/components/DepositForm.tsx index 6edcad5..31cfec9 100644 --- a/components/DepositForm.tsx +++ b/components/DepositForm.tsx @@ -136,9 +136,7 @@ function DespositForm({ token: selectedToken }: StakeFormProps) { setInputAmount('') await sleep(500) if (!mangoAccount) { - await actions.fetchMangoAccounts( - (client.program.provider as AnchorProvider).wallet.publicKey, - ) + await actions.fetchMangoAccounts(publicKey) } await actions.reloadMangoAccount(slot) await actions.fetchWalletTokens(publicKey) diff --git a/components/StakeForm.tsx b/components/StakeForm.tsx index 26c8e82..95fa7e8 100644 --- a/components/StakeForm.tsx +++ b/components/StakeForm.tsx @@ -33,7 +33,6 @@ import useMangoGroup from 'hooks/useMangoGroup' import FormatNumericValue from './shared/FormatNumericValue' import { getNextAccountNumber, stakeAndCreate } from 'utils/transactions' // import { MangoAccount } from '@blockworks-foundation/mango-v4' -import { AnchorProvider } from '@project-serum/anchor' import useBankRates from 'hooks/useBankRates' import { Disclosure } from '@headlessui/react' import SheenLoader from './shared/SheenLoader' @@ -202,11 +201,13 @@ function StakeForm({ token: selectedToken }: StakeFormProps) { if (!ipAllowed || !stakeBank || !publicKey) { return } - const client = mangoStore.getState().client const jlpGroup = mangoStore.getState().group.jlpGroup const lstGroup = mangoStore.getState().group.lstGroup const isJlpGroup = stakeBank.name === 'JLP' || stakeBank.name === 'USDC' const group = isJlpGroup ? jlpGroup : lstGroup + const client = isJlpGroup + ? mangoStore.getState().client.jlp + : mangoStore.getState().client.lst const actions = mangoStore.getState().actions const mangoAccount = mangoStore.getState().mangoAccount.current const mangoAccounts = mangoStore.getState().mangoAccounts @@ -243,9 +244,7 @@ function StakeForm({ token: selectedToken }: StakeFormProps) { setInputAmount('') await sleep(500) if (!mangoAccount) { - await actions.fetchMangoAccounts( - (client.program.provider as AnchorProvider).wallet.publicKey, - ) + await actions.fetchMangoAccounts(publicKey) } await actions.reloadMangoAccount(slot) await actions.fetchWalletTokens(publicKey) diff --git a/components/UnstakeForm.tsx b/components/UnstakeForm.tsx index 1590910..d8ad312 100644 --- a/components/UnstakeForm.tsx +++ b/components/UnstakeForm.tsx @@ -196,9 +196,7 @@ function UnstakeForm({ token: selectedToken }: UnstakeFormProps) { txid: tx, }) await sleep(100) - await actions.fetchMangoAccounts( - (client.program.provider as AnchorProvider).wallet.publicKey, - ) + await actions.fetchMangoAccounts(publicKey) await actions.reloadMangoAccount() await actions.fetchWalletTokens(publicKey) mangoAccount = mangoStore.getState().mangoAccount.current @@ -223,9 +221,7 @@ function UnstakeForm({ token: selectedToken }: UnstakeFormProps) { setSubmitting(false) setInputAmount('') await sleep(100) - await actions.fetchMangoAccounts( - (client.program.provider as AnchorProvider).wallet.publicKey, - ) + await actions.fetchMangoAccounts(publicKey) await actions.reloadMangoAccount() await actions.fetchWalletTokens(publicKey) } catch (e) { diff --git a/store/mangoStore.ts b/store/mangoStore.ts index cfc52a2..d9e6429 100644 --- a/store/mangoStore.ts +++ b/store/mangoStore.ts @@ -825,7 +825,7 @@ const mangoStore = create()( if (!group || !client) return const altResponse = await connection.getAddressLookupTable( - new PublicKey('AgCBUZ6UMWqPyLftTxeAqpQxtrfiCyL2HgRfmmM6QTfCj'), + new PublicKey('AgCBUZ6UMWqPLftTxeAqpQxtrfiCyL2HgRfmmM6QTfCj'), ) const altKeys = altResponse.value?.state.addresses