ts client: Fix serum3DeregisterMarket

The indexReservation arg wasn't passed.
This commit is contained in:
Christian Kamm 2022-09-20 11:41:15 +02:00
parent 6399e6cb6c
commit 8c91541d12
1 changed files with 8 additions and 0 deletions

View File

@ -945,11 +945,19 @@ export class MangoClient {
externalMarketPk.toBase58(), externalMarketPk.toBase58(),
)!; )!;
const marketIndexBuf = Buffer.alloc(2);
marketIndexBuf.writeUInt16LE(serum3Market.marketIndex);
const [indexReservation] = await PublicKey.findProgramAddress(
[Buffer.from('Serum3Index'), group.publicKey.toBuffer(), marketIndexBuf],
this.program.programId,
);
return await this.program.methods return await this.program.methods
.serum3DeregisterMarket() .serum3DeregisterMarket()
.accounts({ .accounts({
group: group.publicKey, group: group.publicKey,
serumMarket: serum3Market.publicKey, serumMarket: serum3Market.publicKey,
indexReservation,
solDestination: (this.program.provider as AnchorProvider).wallet solDestination: (this.program.provider as AnchorProvider).wallet
.publicKey, .publicKey,
}) })