fix
This commit is contained in:
parent
c459c09451
commit
448cdf7c09
|
@ -55,6 +55,7 @@ import {
|
||||||
createAssociatedTokenAccountIdempotentInstruction,
|
createAssociatedTokenAccountIdempotentInstruction,
|
||||||
getAssociatedTokenAddress,
|
getAssociatedTokenAddress,
|
||||||
toNative,
|
toNative,
|
||||||
|
U64_MAX_BN,
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import { sendTransaction } from './utils/rpc';
|
import { sendTransaction } from './utils/rpc';
|
||||||
|
|
||||||
|
@ -837,18 +838,15 @@ export class MangoClient {
|
||||||
const instructions: TransactionInstruction[] = [];
|
const instructions: TransactionInstruction[] = [];
|
||||||
for (const token of mangoAccount.tokensActive()) {
|
for (const token of mangoAccount.tokensActive()) {
|
||||||
const bank = group.getFirstBankByTokenIndex(token.tokenIndex);
|
const bank = group.getFirstBankByTokenIndex(token.tokenIndex);
|
||||||
const nativeAmount = token.balance(bank).data;
|
|
||||||
if (!nativeAmount.isZero()) {
|
|
||||||
const withdrawIx = await this.tokenWithdrawNativeIx(
|
const withdrawIx = await this.tokenWithdrawNativeIx(
|
||||||
group,
|
group,
|
||||||
mangoAccount,
|
mangoAccount,
|
||||||
bank.mint,
|
bank.mint,
|
||||||
nativeAmount,
|
U64_MAX_BN,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
instructions.push(...withdrawIx);
|
instructions.push(...withdrawIx);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (const serum3Account of mangoAccount.serum3Active()) {
|
for (const serum3Account of mangoAccount.serum3Active()) {
|
||||||
const serum3Market = group.serum3MarketsMapByMarketIndex.get(
|
const serum3Market = group.serum3MarketsMapByMarketIndex.get(
|
||||||
|
|
Loading…
Reference in New Issue