Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • StackingClient

Index

Constructors

constructor

Properties

address

address: string

network

network: StacksNetwork

Methods

canStack

  • Check if account can lock stx

    Parameters

    Returns Promise<StackingEligibility>

    that resolves to a StackingEligibility object if the operation succeeds

delegateStackStx

  • 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

delegateStx

  • 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

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

    Returns Promise<bigint>

    promise resolves to a bigint if the operation succeeds

getAccountStatus

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

getCoreInfo

  • Get stacks node info

    Returns Promise<CoreInfo>

    that resolves to a CoreInfo response if the operation succeeds

getCycleDuration

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

    Returns Promise<number>

    that resolves to a number if the operation succeeds

getDelegateOptions

  • 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

  • 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

getPoxInfo

  • Get stacks node pox info

    Returns Promise<PoxInfo>

    that resolves to a PoxInfo response if the operation succeeds

getRevokeDelegateStxOptions

  • Parameters

    • contract: string

    Returns ContractCallOptions

getRewardHoldersForBtcAddress

  • Get burnchain rewards holders for the set address

    Parameters

    Returns Promise<RewardsError | BurnchainRewardSlotHolderListResponse>

    that resolves to RewardHoldersResponse or RewardsError

getRewardsForBtcAddress

  • Get burnchain rewards for the set address

    Parameters

    Returns Promise<RewardsError | BurnchainRewardListResponse>

    that resolves to RewardsResponse or RewardsError

getRewardsTotalForBtcAddress

  • 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

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

    Returns Promise<number>

    that resolves to a number if the operation succeeds

getStackAggregationCommitOptions

  • 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

  • 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

getStatus

  • Check stacking status

    Returns Promise<StackerInfo>

    that resolves to a StackerInfo object if the operation succeeds

getTargetBlockTime

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

    Returns Promise<number>

    that resolves to a number if the operation succeeds

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

parseContractId

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

    Parameters

    • contract: string

    Returns string[]

    a contract address and name

revokeDelegateStx

  • 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

stack

  • Generate and broadcast a stacking transaction to lock STX

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

stackAggregationCommit

  • 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