aggregator add setResolutionMode

This commit is contained in:
mgild 2022-11-13 17:27:58 -05:00
parent 57ed254a64
commit 8f26d0e872
1 changed files with 21 additions and 0 deletions

View File

@ -1121,6 +1121,27 @@ export class AggregatorAccount {
.rpc();
}
async setResolutionMode(params: {
authority: Keypair;
mode: number;
}): Promise<TransactionSignature> {
const slidingWindow = anchor.utils.publicKey.findProgramAddressSync(
[Buffer.from("SlidingResultAccountData"), this.publicKey.toBytes()],
this.program.programId
)[0];
return this.program.methods
.aggregatorSetResolutionMode({ mode: params.mode })
.accounts({
aggregator: this.publicKey,
authority: params.authority.publicKey,
slidingWindow,
payer: programWallet(this.program).publicKey,
systemProgram: SystemProgram.programId,
})
.signers([params.authority])
.rpc();
}
async setQueue(
params: AggregatorSetQueueParams
): Promise<TransactionSignature> {