add settle borrows instruction to borrowAndWithdraw

This commit is contained in:
Tyler Shipe 2021-04-20 16:24:17 -04:00
parent 767facf575
commit c1882c49f1
1 changed files with 10 additions and 0 deletions

View File

@ -410,6 +410,16 @@ export async function borrowAndWithdraw(
)
transaction.add(withdrawInstruction)
const settleBorrowInstruction = makeSettleBorrowInstruction(
programId,
mangoGroup.publicKey,
marginAccount.publicKey,
wallet.publicKey,
tokenIndex,
nativeWithdrawQuantity
)
transaction.add(settleBorrowInstruction)
const signers = []
const functionName = 'Borrow And Withdraw'
const sendingMessage = `Sending ${functionName} instruction...`