Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StackingClient

Hierarchy

  • StackingClient

Index

Constructors

constructor

  • new StackingClient(address: string, network: StacksNetwork): StackingClient

Properties

address

address: string

network

network: StacksNetwork

Methods

canStack

  • canStack(__namedParameters: { cycles: number; poxAddress: string }): Promise<StackingEligibility>
  • Check if account can lock stx

    Parameters

    • __namedParameters: { cycles: number; poxAddress: string }
      • cycles: number
      • poxAddress: string

    Returns Promise<StackingEligibility>

    that resolves to a StackingEligibility object if the operation succeeds

getAccountBalance

  • getAccountBalance(): Promise<BN>

getAccountStatus

  • getAccountStatus(): Promise<any>

getCoreInfo

getCycleDuration

  • getCycleDuration(): Promise<number>

getPoxInfo

getSecondsUntilNextCycle

  • getSecondsUntilNextCycle(): Promise<number>

getStackOptions

  • getStackOptions(__namedParameters: { amountMicroStx: BN; burnBlockHeight: number; contract: string; cycles: number; poxAddress: string }): ContractCallOptions
  • Parameters

    • __namedParameters: { amountMicroStx: BN; burnBlockHeight: number; contract: string; cycles: number; poxAddress: string }
      • amountMicroStx: BN
      • burnBlockHeight: number
      • contract: string
      • cycles: number
      • poxAddress: string

    Returns ContractCallOptions

getStatus

getTargetBlockTime

  • getTargetBlockTime(): Promise<number>

hasMinimumStx

  • hasMinimumStx(): Promise<boolean>
  • Check if account has minimum require amount of Stacks for stacking

    Returns Promise<boolean>

    that resolves to a bool if the operation succeeds

isStackingEnabledNextCycle

  • isStackingEnabledNextCycle(): Promise<boolean>
  • Check if stacking is enabled for next reward cycle

    Returns Promise<boolean>

    that resolves to a bool if the operation succeeds

modifyLockTxFee

  • modifyLockTxFee(__namedParameters: { amountMicroStx: BN; tx: StacksTransaction }): StacksTransaction
  • Adjust microstacks amount for locking after taking into account transaction fees

    Parameters

    • __namedParameters: { amountMicroStx: BN; tx: StacksTransaction }
      • amountMicroStx: BN
      • tx: StacksTransaction

    Returns StacksTransaction

    that resolves to a transaction object if the operation succeeds

stack

  • stack(__namedParameters: { amountMicroStx: BN; burnBlockHeight: number; cycles: number; poxAddress: string; privateKey: string }): Promise<string>
  • Generate and broadcast a stacking transaction to lock STX

    Parameters

    • __namedParameters: { amountMicroStx: BN; burnBlockHeight: number; cycles: number; poxAddress: string; privateKey: string }
      • amountMicroStx: BN
      • burnBlockHeight: number
      • cycles: number
      • poxAddress: string
      • privateKey: string

    Returns Promise<string>

    that resolves to a broadcasted txid if the operation succeeds

Generated using TypeDoc