acc creation fix

This commit is contained in:
Finn 2024-02-22 17:04:13 +00:00
parent 23f99b2d4d
commit ddf3434a33
2 changed files with 3 additions and 6 deletions

View File

@ -160,7 +160,7 @@ function StakeForm({ token: selectedToken }: StakeFormProps) {
const client = mangoStore.getState().client
const group = mangoStore.getState().group
const actions = mangoStore.getState().actions
// const mangoAccounts = mangoStore.getState().mangoAccounts
const mangoAccountsLength = (mangoStore.getState().mangoAccounts).length
const mangoAccount = mangoStore.getState().mangoAccount.current
if (!group || !stakeBank || !publicKey) return
@ -168,9 +168,6 @@ function StakeForm({ token: selectedToken }: StakeFormProps) {
set((state) => {
state.submittingBoost = true
})
const tokenNum = STAKEABLE_TOKENS_DATA.find(
(t) => t.name.toLowerCase() === stakeBank.name.toLowerCase(),
)?.id
try {
// const newAccountNum = getNextAccountNumber(mangoAccounts)
notify({
@ -184,7 +181,7 @@ function StakeForm({ token: selectedToken }: StakeFormProps) {
amountToBorrow,
stakeBank.mint,
parseFloat(inputAmount),
tokenNum || 0,
mangoAccountsLength + 1 || 0,
)
notify({
title: 'Transaction confirmed',

View File

@ -200,7 +200,7 @@ export const stakeAndCreate = async (
const createMangoAccountIx = await client.program.methods
.accountCreate(
accountNumber ?? 0,
2,
4,
0, // serum
0, // perp
0, // perp OO