small updates to token withdraw script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
88451debed
commit
f4c6a086c1
|
@ -38,16 +38,6 @@ async function forceWithdrawTokens(): Promise<void> {
|
|||
|
||||
const group = await client.getGroup(new PublicKey(GROUP_PK));
|
||||
const forceWithdrawBank = group.getFirstBankByTokenIndex(TOKEN_INDEX);
|
||||
if (forceWithdrawBank.reduceOnly != 2) {
|
||||
throw new Error(
|
||||
`Unexpected reduce only state ${forceWithdrawBank.reduceOnly}`,
|
||||
);
|
||||
}
|
||||
if (!forceWithdrawBank.forceWithdraw) {
|
||||
throw new Error(
|
||||
`Unexpected force withdraw state ${forceWithdrawBank.forceWithdraw}`,
|
||||
);
|
||||
}
|
||||
|
||||
// Get all mango accounts with deposits for given token
|
||||
const mangoAccountsWithDeposits = (
|
||||
|
|
|
@ -725,7 +725,11 @@ export class MangoClient {
|
|||
vault: bank.vault,
|
||||
oracle: bank.oracle,
|
||||
ownerAtaTokenAccount,
|
||||
alternateOwnerTokenAccount,
|
||||
alternateOwnerTokenAccount: alternateOwnerTokenAccount.equals(
|
||||
PublicKey.default,
|
||||
)
|
||||
? ownerAtaTokenAccount
|
||||
: alternateOwnerTokenAccount,
|
||||
})
|
||||
.instruction();
|
||||
return await this.sendAndConfirmTransactionForGroup(group, [
|
||||
|
|
Loading…
Reference in New Issue