Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StackingClient

Hierarchy

  • StackingClient

Index

Constructors

Properties

address: string
network: StacksNetwork

Methods

  • Check if account can lock stx

    Parameters

    Returns Promise<StackingEligibility>

    that resolves to a StackingEligibility object if the operation succeeds

  • As a delegator, generate and broadcast transactions to stack for multiple delegatees. This will lock up tokens owned by the delegatees.

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • As a delegatee, generate and broadcast a transaction to create a delegation relationship

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • getAccountBalance(): Promise<bigint>
  • Get account balance

    Returns Promise<bigint>

    promise resolves to a bigint if the operation succeeds

  • getAccountStatus(): Promise<any>
  • Returns Promise<any>

  • Get stacks node info

    Returns Promise<CoreInfo>

    that resolves to a CoreInfo response if the operation succeeds

  • getCycleDuration(): Promise<number>
  • Get reward cycle duration in seconds

    Returns Promise<number>

    that resolves to a number if the operation succeeds

  • getDelegateOptions(__namedParameters: { amountMicroStx: IntegerType; contract: string; delegateTo: string; poxAddress?: string; untilBurnBlockHeight?: number }): ContractCallOptions
  • Parameters

    • __namedParameters: { amountMicroStx: IntegerType; contract: string; delegateTo: string; poxAddress?: string; untilBurnBlockHeight?: number }
      • amountMicroStx: IntegerType
      • contract: string
      • delegateTo: string
      • Optional poxAddress?: string
      • Optional untilBurnBlockHeight?: number

    Returns ContractCallOptions

  • getDelegateStackOptions(__namedParameters: { amountMicroStx: IntegerType; burnBlockHeight: number; contract: string; cycles: number; nonce?: IntegerType; poxAddress: string; stacker: string }): ContractCallOptions
  • Parameters

    • __namedParameters: { amountMicroStx: IntegerType; burnBlockHeight: number; contract: string; cycles: number; nonce?: IntegerType; poxAddress: string; stacker: string }
      • amountMicroStx: IntegerType
      • burnBlockHeight: number
      • contract: string
      • cycles: number
      • Optional nonce?: IntegerType
      • poxAddress: string
      • stacker: string

    Returns ContractCallOptions

  • Get stacks node pox info

    Returns Promise<PoxInfo>

    that resolves to a PoxInfo response if the operation succeeds

  • Parameters

    • contract: string

    Returns ContractCallOptions

  • Get burnchain rewards holders for the set address

    Parameters

    Returns Promise<RewardsError | BurnchainRewardSlotHolderListResponse>

    that resolves to RewardHoldersResponse or RewardsError

  • Get burnchain rewards for the set address

    Parameters

    Returns Promise<RewardsError | BurnchainRewardListResponse>

    that resolves to RewardsResponse or RewardsError

  • getRewardsTotalForBtcAddress(): Promise<RewardsError | BurnchainRewardsTotal>
  • Get the total burnchain rewards total for the set address

    Returns Promise<RewardsError | BurnchainRewardsTotal>

    that resolves to TotalRewardsResponse or RewardsError

  • getSecondsUntilNextCycle(): Promise<number>
  • Get number of seconds until next reward cycle

    Returns Promise<number>

    that resolves to a number if the operation succeeds

  • getStackAggregationCommitOptions(__namedParameters: { contract: string; poxAddress: string; rewardCycle: number }): ContractCallOptions
  • Parameters

    • __namedParameters: { contract: string; poxAddress: string; rewardCycle: number }
      • contract: string
      • poxAddress: string
      • rewardCycle: number

    Returns ContractCallOptions

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

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

    Returns ContractCallOptions

  • Check stacking status

    Returns Promise<StackerInfo>

    that resolves to a StackerInfo object if the operation succeeds

  • getTargetBlockTime(): Promise<number>
  • Get stacks node target block time

    Returns Promise<number>

    that resolves to a number if the operation succeeds

  • 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(): Promise<boolean>
  • Check if stacking is enabled for next reward cycle

    Returns Promise<boolean>

    that resolves to a bool if the operation succeeds

  • parseContractId(contract: string): string[]
  • Parses a contract identifier and ensures it is formatted correctly

    Parameters

    • contract: string

    Returns string[]

    a contract address and name

  • As a delegatee, generate and broadcast a transaction to terminate the delegation relationship

    Parameters

    • privateKey: string

      the private key to be used for the revoke call

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • Generate and broadcast a stacking transaction to lock STX

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • As a delegator, generate and broadcast a transaction to commit partially committed delegatee tokens

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

Generated using TypeDoc