Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MinerWrapper

Index

Constructors

constructor

  • new MinerWrapper(quarry: QuarryWrapper, authority: PublicKey, minerKey: PublicKey, tokenVaultKey: PublicKey, stakedTokenATA: PublicKey): MinerWrapper

Properties

Readonly authority

authority: PublicKey

Readonly minerKey

minerKey: PublicKey

Readonly quarry

Readonly stakedTokenATA

stakedTokenATA: PublicKey

Readonly tokenVaultKey

tokenVaultKey: PublicKey

Accessors

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

sdk

userClaimAccounts

  • get userClaimAccounts(): ContextAccounts<[{ isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "miner" }, { isMut: true; isSigner: false; name: "quarry" }, { isMut: true; isSigner: false; name: "unusedMinerVault" }, { isMut: true; isSigner: false; name: "unusedTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "rewarder" }] & IdlAccountItem[]>
  • Generates stake accounts for the user.

    Returns ContextAccounts<[{ isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "miner" }, { isMut: true; isSigner: false; name: "quarry" }, { isMut: true; isSigner: false; name: "unusedMinerVault" }, { isMut: true; isSigner: false; name: "unusedTokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "rewarder" }] & IdlAccountItem[]>

userStakeAccounts

  • get userStakeAccounts(): ContextAccounts<[{ isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "miner" }, { isMut: true; isSigner: false; name: "quarry" }, { isMut: true; isSigner: false; name: "minerVault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "rewarder" }]>
  • Generates stake accounts for the user.

    Returns ContextAccounts<[{ isMut: false; isSigner: true; name: "authority" }, { isMut: true; isSigner: false; name: "miner" }, { isMut: true; isSigner: false; name: "quarry" }, { isMut: true; isSigner: false; name: "minerVault" }, { isMut: true; isSigner: false; name: "tokenAccount" }, { isMut: false; isSigner: false; name: "tokenProgram" }, { isMut: false; isSigner: false; name: "rewarder" }]>

Methods

claim

  • claim(): Promise<TransactionEnvelope>

createATAIfNotExists

  • createATAIfNotExists(): Promise<null | TransactionEnvelope>

fetchData

  • fetchData(): Promise<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>>>>
  • Fetches the data associated with the miner.

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

initialize

stake

  • stake(amount: TokenAmount): TransactionEnvelope

withdraw

  • withdraw(amount: TokenAmount): TransactionEnvelope
  • Withdraws the current wallet's tokens from the pool.

    Parameters

    • amount: TokenAmount

    Returns TransactionEnvelope

Generated using TypeDoc