Skip to content

Commit

Permalink
sdk: pause/unpause helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhly committed Feb 5, 2022
1 parent f9e151f commit 7d89da4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/wrappers/mine/rewarder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,30 @@ export class RewarderWrapper {
}),
]);
}

/**
* Pause the rewarder
*/
pause(
authority: PublicKey = this.sdk.provider.wallet.publicKey
): TransactionEnvelope {
return new TransactionEnvelope(this.sdk.provider, [
this.program.instruction.pause({
accounts: { pauseAuthority: authority, rewarder: this.rewarderKey },
}),
]);
}

/**
* Unpause the rewarder
*/
unpause(
authority: PublicKey = this.sdk.provider.wallet.publicKey
): TransactionEnvelope {
return new TransactionEnvelope(this.sdk.provider, [
this.program.instruction.unpause({
accounts: { pauseAuthority: authority, rewarder: this.rewarderKey },
}),
]);
}
}

0 comments on commit 7d89da4

Please sign in to comment.