Added limit to ForceCancelOrders
This commit is contained in:
parent
767734b224
commit
0c3859fb24
|
@ -792,9 +792,10 @@ export class MangoClient {
|
|||
liqeeMarginAccount: MarginAccount,
|
||||
liqor: Account,
|
||||
spotMarket: Market,
|
||||
|
||||
limit: number
|
||||
): Promise<TransactionSignature> {
|
||||
|
||||
const limitBn = new BN(limit)
|
||||
const marketIndex = mangoGroup.getMarketIndex(spotMarket)
|
||||
const dexSigner = await PublicKey.createProgramAddress(
|
||||
[
|
||||
|
@ -822,6 +823,7 @@ export class MangoClient {
|
|||
mangoGroup.dexProgramId,
|
||||
liqeeMarginAccount.openOrders,
|
||||
mangoGroup.oracles,
|
||||
limitBn
|
||||
)
|
||||
|
||||
const transaction = new Transaction()
|
||||
|
|
|
@ -152,7 +152,8 @@ export function makeForceCancelOrdersInstruction(
|
|||
dexSigner: PublicKey,
|
||||
dexProgramId: PublicKey,
|
||||
openOrders: PublicKey[],
|
||||
oracles: PublicKey[]
|
||||
oracles: PublicKey[],
|
||||
limit: BN
|
||||
): TransactionInstruction {
|
||||
|
||||
const keys = [
|
||||
|
@ -176,7 +177,7 @@ export function makeForceCancelOrdersInstruction(
|
|||
...oracles.map( (pubkey) => ( { isSigner: false, isWritable: false, pubkey })),
|
||||
]
|
||||
|
||||
const data = encodeMangoInstruction({ForceCancelOrders: {}})
|
||||
const data = encodeMangoInstruction({ForceCancelOrders: { limit }})
|
||||
return new TransactionInstruction( { keys, data, programId })
|
||||
}
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ MangoInstructionLayout.addVariant(14,
|
|||
),
|
||||
'PlaceAndSettle'
|
||||
)
|
||||
MangoInstructionLayout.addVariant(15, struct([]), 'ForceCancelOrders')
|
||||
MangoInstructionLayout.addVariant(15, struct([u8('limit')]), 'ForceCancelOrders')
|
||||
MangoInstructionLayout.addVariant(16, struct([u64('maxDeposit')]), 'PartialLiquidate')
|
||||
|
||||
// @ts-ignore
|
||||
|
|
Loading…
Reference in New Issue