Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RewarderWrapper

Index

Constructors

constructor

  • new RewarderWrapper(mineWrapper: MineWrapper, rewarderKey: PublicKey, rewarderData: AnchorTypeDef<({ name: "Rewarder"; type: { fields: [{ name: "base"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "authority"; type: "publicKey" }, { name: "pendingAuthority"; type: "publicKey" }, { name: "numQuarries"; type: "u16" }, { name: "annualRewardsRate"; type: "u64" }, { name: "totalRewardsShares"; type: "u64" }]; kind: "struct" } } & { name: "Rewarder" }) & never & never, AnchorDefined<QuarryMineIDL, Record<string, never>>>): RewarderWrapper
  • Parameters

    • mineWrapper: MineWrapper
    • rewarderKey: PublicKey
    • rewarderData: AnchorTypeDef<({ name: "Rewarder"; type: { fields: [{ name: "base"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "authority"; type: "publicKey" }, { name: "pendingAuthority"; type: "publicKey" }, { name: "numQuarries"; type: "u16" }, { name: "annualRewardsRate"; type: "u64" }, { name: "totalRewardsShares"; type: "u64" }]; kind: "struct" } } & { name: "Rewarder" }) & never & never, AnchorDefined<QuarryMineIDL, Record<string, never>>>

    Returns RewarderWrapper

Properties

Readonly mineWrapper

mineWrapper: MineWrapper

Readonly program

program: AnchorProgram<QuarryMineIDL, { miner: AnchorTypeDef<never & never & ({ name: "Miner"; type: { fields: [{ name: "quarryKey"; type: "publicKey" }, { name: "authority"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "tokenVaultKey"; type: "publicKey" }, { name: "rewardsEarned"; type: "u64" }, { name: "rewardsPerTokenPaid"; type: "u128" }, { name: "balance"; type: "u64" }, { name: "index"; type: "u64" }]; kind: "struct" } } & { name: "Miner" }), AnchorDefined<QuarryMineIDL, Record<string, never>>>; quarry: AnchorTypeDef<never & ({ name: "Quarry"; type: { fields: [{ name: "rewarderKey"; type: "publicKey" }, { name: "tokenMintKey"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "index"; type: "u16" }, { name: "tokenMintDecimals"; type: "u8" }, { name: "famineTs"; type: "i64" }, { name: "lastUpdateTs"; type: "i64" }]; kind: "struct" } } & { name: "Quarry" }) & never, AnchorDefined<QuarryMineIDL, Record<string, never>>>; rewarder: AnchorTypeDef<({ name: "Rewarder"; type: { fields: [{ name: "base"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "authority"; type: "publicKey" }, { name: "pendingAuthority"; type: "publicKey" }, { name: "numQuarries"; type: "u16" }, { name: "annualRewardsRate"; type: "u64" }, { name: "totalRewardsShares"; type: "u64" }]; kind: "struct" } } & { name: "Rewarder" }) & never & never, AnchorDefined<QuarryMineIDL, Record<string, never>>> }, AnchorDefined<QuarryMineIDL, Record<string, never>>, MakeInstructions<[{ accounts: [{ isMut: false; isSigner: true; name: "base" }, { isMut: true; isSigner: false; name: "rewarder" }, { isMut: false; isSigner: false; name: "authority" }, { isMut: true; isSigner: true; name: "payer" }, { isMut: false; isSigner: false; name: "systemProgram" }, { isMut: false; isSigner: false; name: "unusedClock" }]; args: [{ name: "bump"; type: "u8" }]; name: "newRewarder" }, { accounts: [{ accounts: [{ isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "rewarder" }]; name: "auth" }, { isMut: false; isSigner: false; name: "pauseAuthority" }]; args: []; name: "setPauseAuthority" }, { accounts: [{ isMut: false; isSigner: true; name: "pauseAuthority" }, { isMut: true; isSigner: false; name: "rewarder" }]; args: []; name: "pause" }], AnchorDefined<QuarryMineIDL, Record<string, never>>>, MakeInstructions<unknown, AnchorDefined<QuarryMineIDL, Record<string, never>>>>

Readonly rewarderData

rewarderData: AnchorTypeDef<({ name: "Rewarder"; type: { fields: [{ name: "base"; type: "publicKey" }, { name: "bump"; type: "u8" }, { name: "authority"; type: "publicKey" }, { name: "pendingAuthority"; type: "publicKey" }, { name: "numQuarries"; type: "u16" }, { name: "annualRewardsRate"; type: "u64" }, { name: "totalRewardsShares"; type: "u64" }]; kind: "struct" } } & { name: "Rewarder" }) & never & never, AnchorDefined<QuarryMineIDL, Record<string, never>>>

Readonly rewarderKey

rewarderKey: PublicKey

Readonly sdk

Methods

createQuarry

  • createQuarry(param0: { authority?: PublicKey; token: Token }): Promise<PendingQuarry>
  • Creates a new quarry. Only the rewarder can call this.

    Parameters

    • param0: { authority?: PublicKey; token: Token }
      • Optional authority?: PublicKey
      • token: Token

    Returns Promise<PendingQuarry>

getQuarry

getQuarryKey

  • getQuarryKey(token: Token): Promise<PublicKey>

getQuarryKeyForMint

  • getQuarryKeyForMint(mint: PublicKey): Promise<PublicKey>

setAndSyncAnnualRewards

  • setAndSyncAnnualRewards(newAnnualRate: u64, mints: PublicKey[]): Promise<TransactionEnvelope>
  • Updates to annual rewards rate on the quarry, and update rewards on quarries assocated with each mint provided.

    Parameters

    • newAnnualRate: u64
    • mints: PublicKey[]

    Returns Promise<TransactionEnvelope>

setAnnualRewards

  • setAnnualRewards(param0: { authority?: PublicKey; newAnnualRate: u64 }): TransactionEnvelope
  • Updates annual rewards rate on the Rewarder. One must sync after this.

    Parameters

    • param0: { authority?: PublicKey; newAnnualRate: u64 }
      • Optional authority?: PublicKey
      • newAnnualRate: u64

    Returns TransactionEnvelope

setFamine

  • setFamine(__namedParameters: { authority?: PublicKey; newFamineTs: u64; quarry: PublicKey }): TransactionEnvelope
  • Sets timestamp on when rewards will cease

    Parameters

    • __namedParameters: { authority?: PublicKey; newFamineTs: u64; quarry: PublicKey }
      • Optional authority?: PublicKey
      • newFamineTs: u64
      • quarry: PublicKey

    Returns TransactionEnvelope

syncQuarryRewards

  • syncQuarryRewards(mints: PublicKey[]): Promise<TransactionEnvelope>

transferAuthority

  • transferAuthority(param0: { authority?: PublicKey; nextAuthority: PublicKey }): TransactionEnvelope
  • Transfers the authority to a different account.

    Parameters

    • param0: { authority?: PublicKey; nextAuthority: PublicKey }
      • Optional authority?: PublicKey
      • nextAuthority: PublicKey

    Returns TransactionEnvelope

Generated using TypeDoc