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

delegateStackStx

  • delegateStackStx(__namedParameters: { amountMicroStx: BN; burnBlockHeight: number; cycles: number; nonce: undefined | BN; poxAddress: string; privateKey: string; stacker: string }): Promise<TxBroadcastResult>
  • As a delegator, generate and broadcast transactions to stack for multiple delegatees. This will lock up tokens owned by the delegatees.

    Parameters

    • __namedParameters: { amountMicroStx: BN; burnBlockHeight: number; cycles: number; nonce: undefined | BN; poxAddress: string; privateKey: string; stacker: string }
      • amountMicroStx: BN
      • burnBlockHeight: number
      • cycles: number
      • nonce: undefined | BN
      • poxAddress: string
      • privateKey: string
      • stacker: string

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

delegateStx

  • delegateStx(__namedParameters: { amountMicroStx: BN; delegateTo: string; poxAddress: undefined | string; privateKey: string; untilBurnBlockHeight: undefined | number }): Promise<TxBroadcastResult>
  • As a delegatee, generate and broadcast a transaction to create a delegation relationship

    Parameters

    • __namedParameters: { amountMicroStx: BN; delegateTo: string; poxAddress: undefined | string; privateKey: string; untilBurnBlockHeight: undefined | number }
      • amountMicroStx: BN
      • delegateTo: string
      • poxAddress: undefined | string
      • privateKey: string
      • untilBurnBlockHeight: undefined | number

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

getAccountBalance

  • getAccountBalance(): Promise<BN>

getAccountStatus

  • getAccountStatus(): Promise<any>

getCoreInfo

getCycleDuration

  • getCycleDuration(): Promise<number>

getDelegateOptions

  • getDelegateOptions(__namedParameters: { amountMicroStx: BN; contract: string; delegateTo: string; poxAddress: undefined | string; untilBurnBlockHeight: undefined | number }): ContractCallOptions
  • Parameters

    • __namedParameters: { amountMicroStx: BN; contract: string; delegateTo: string; poxAddress: undefined | string; untilBurnBlockHeight: undefined | number }
      • amountMicroStx: BN
      • contract: string
      • delegateTo: string
      • poxAddress: undefined | string
      • untilBurnBlockHeight: undefined | number

    Returns ContractCallOptions

getDelegateStackOptions

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

    • __namedParameters: { amountMicroStx: BN; burnBlockHeight: number; contract: string; cycles: number; nonce: undefined | BN; poxAddress: string; stacker: string }
      • amountMicroStx: BN
      • burnBlockHeight: number
      • contract: string
      • cycles: number
      • nonce: undefined | BN
      • poxAddress: string
      • stacker: string

    Returns ContractCallOptions

getPoxInfo

getRevokeDelegateStxOptions

  • getRevokeDelegateStxOptions(contract: string): ContractCallOptions

getSecondsUntilNextCycle

  • getSecondsUntilNextCycle(): Promise<number>

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

parseContractId

  • parseContractId(contract: string): Array<string>
  • Parses a contract identifier and ensures it is formatted correctly

    Parameters

    • contract: string

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

  • stack(__namedParameters: { amountMicroStx: BN; burnBlockHeight: number; cycles: number; poxAddress: string; privateKey: string }): Promise<TxBroadcastResult>
  • 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<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

stackAggregationCommit

  • stackAggregationCommit(__namedParameters: { poxAddress: string; privateKey: string; rewardCycle: number }): Promise<TxBroadcastResult>
  • As a delegator, generate and broadcast a transaction to commit partially committed delegatee tokens

    Parameters

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

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

Generated using TypeDoc