Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • QuarryWrapper

Index

Constructors

constructor

  • new QuarryWrapper(sdk: QuarrySDK, token: Token, 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>>>, quarryData: 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>>>, key: PublicKey): QuarryWrapper
  • Parameters

    • sdk: QuarrySDK
    • token: Token
    • 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>>>
    • quarryData: 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>>>
    • key: PublicKey

    Returns QuarryWrapper

Properties

Readonly key

key: PublicKey

Readonly quarryData

quarryData: 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>>>

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 sdk

Readonly token

token: Token

Accessors

payroll

program

  • get 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>>>>
  • The program.

    Returns 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>>>>

provider

  • get provider(): Provider

Methods

computeAnnualRewardsRate

  • computeAnnualRewardsRate(): u64
  • Get the computed rewards rate of the quarry.

    This is used for tests, so you probably don't want this. You want quarryData.annualRewardsRate.

    Returns u64

    annualRewardsRate

createMiner

  • createMiner(__namedParameters?: { authority?: PublicKey }): Promise<PendingMiner>

createMinerWrapper

  • createMinerWrapper(authority: PublicKey, minerKey: PublicKey, tokenVaultKey: PublicKey, stakedTokenATA: PublicKey): MinerWrapper

getMiner

  • getMiner(authority: PublicKey): Promise<null | 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>>>>
  • Get the miner data associated with the authority account

    Parameters

    • authority: PublicKey

    Returns Promise<null | 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>>>>

getMinerActions

  • getMinerActions(authority?: PublicKey): Promise<MinerWrapper>

getMinerAddress

  • getMinerAddress(authority: PublicKey): Promise<PublicKey>
  • Get the public key of the miner assocaited with the authority account

    Parameters

    • authority: PublicKey

      who owns the miner

    Returns Promise<PublicKey>

    miner public key

setFamine

  • setFamine(famineTs: u64): TransactionEnvelope

setRewardsShare

  • setRewardsShare(share: u64): TransactionEnvelope

Static load

Generated using TypeDoc