Hierarchy

  • StackingClient

Constructors

  • Parameters

    • address: string
    • network: StacksNetwork

    Returns StackingClient

Properties

address: string
network: StacksNetwork

PoX-2 Methods

  • As a delegator, generate and broadcast transactions to extend stack for multiple delegatees.

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

  • As a delegator, generate and broadcast transactions to stack increase for multiple delegatees.

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

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

    Commit partially stacked STX and allocate a new PoX reward address slot. This allows a stacker/delegate to lock fewer STX than the minimal threshold in multiple transactions, so long as: 1. The pox-addr is the same. 2. This "commit" transaction is called before the PoX anchor block. This ensures that each entry in the reward set returned to the stacks-node is greater than the threshold, but does not require it be all locked up within a single transaction

    stack-aggregation-commit-indexed returns (ok uint) on success, where the given uint is the reward address's index in the list of reward addresses allocated in this reward cycle. This index can then be passed to stack-aggregation-increase to later increment the STX this PoX address represents, in amounts less than the stacking minimum.

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

  • As a delegator, generate and broadcast a transaction to increase partial commitment committed delegatee tokens

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

  • Generate and broadcast a stacking transaction to extend locked STX (pox-2.stack-extend)

    Returns

    a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

  • Generate and broadcast a stacking transaction to increase locked STX (pox-2.stack-increase)

    Returns

    a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

Other Methods

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

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

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

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

  • Get account balance

    Returns

    promise resolves to a bigint if the operation succeeds

    Returns Promise<bigint>

  • Get account balance of locked tokens

    Returns

    promise resolves to a bigint if the operation succeeds

    Returns Promise<bigint>

  • Get extended account balances

    Returns

    promise resolves to a bigint if the operation succeeds

    Returns Promise<AccountExtendedBalances>

  • Returns Promise<any>

  • Get stacks node info

    Returns

    that resolves to a CoreInfo response if the operation succeeds

    Returns Promise<CoreInfo>

  • Get reward cycle duration in seconds

    Returns

    that resolves to a number if the operation succeeds

    Returns Promise<number>

  • 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

  • Parameters

    • __namedParameters: {
          contract: string;
          extendCount: number;
          nonce?: IntegerType;
          poxAddress: string;
          stacker: string;
      }
      • contract: string
      • extendCount: number
      • Optional nonce?: IntegerType
      • poxAddress: string
      • stacker: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          contract: string;
          increaseBy: IntegerType;
          nonce?: IntegerType;
          poxAddress: string;
          stacker: string;
      }
      • contract: string
      • increaseBy: IntegerType
      • Optional nonce?: IntegerType
      • poxAddress: string
      • stacker: string

    Returns 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

  • Check delegation status

    Returns

    that resolves to a DelegationInfo object if the operation succeeds

    Returns Promise<DelegationInfo>

  • Get stacks node pox info

    Returns

    that resolves to a PoxInfo response if the operation succeeds

    Returns Promise<PoxInfo>

  • Get information on current PoX operation

    Periods:

    • Period 1: This is before the 2.1 fork.
    • Period 2: This is after the 2.1 fork, but before cycle (N+1).
    • Period 3: This is after cycle (N+1) has begun. Original PoX contract state will no longer have any impact on reward sets, account lock status, etc.

    Returns

    that resolves to PoX operation info

    Parameters

    Returns Promise<PoxOperationInfo>

  • Parameters

    • contract: string

    Returns ContractCallOptions

  • Get burnchain rewards holders for the set address

    Returns

    that resolves to RewardHoldersResponse or RewardsError

    Parameters

    Returns Promise<RewardsError | BurnchainRewardSlotHolderListResponse>

  • Get PoX address from reward set by index

    Returns

    that resolves to RewardSetInfo if the entry exists

    Parameters

    Returns Promise<undefined | RewardSetInfo>

  • Get burnchain rewards for the set address

    Returns

    that resolves to RewardsResponse or RewardsError

    Parameters

    Returns Promise<RewardsError | BurnchainRewardListResponse>

  • Get the total burnchain rewards total for the set address

    Returns

    that resolves to TotalRewardsResponse or RewardsError

    Returns Promise<RewardsError | BurnchainRewardsTotal>

  • Get number of seconds until next reward cycle

    Returns

    that resolves to a number if the operation succeeds

    Returns Promise<number>

  • Parameters

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

    Returns ContractCallOptions

  • Parameters

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

    Returns ContractCallOptions

  • Parameters

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

    Returns ContractCallOptions

  • Parameters

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

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          contract: string;
          increaseBy: IntegerType;
      }
      • contract: string
      • increaseBy: IntegerType

    Returns 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

  • Returns

    that resolves to the contract id (address and name) to use for stacking

    Parameters

    Returns Promise<string>

  • Check stacking status

    Returns

    that resolves to a StackerInfo object if the operation succeeds

    Returns Promise<StackerInfo>

  • Get stacks node target block time

    Returns

    that resolves to a number if the operation succeeds

    Returns Promise<number>

  • Check if account has minimum require amount of Stacks for stacking

    Returns

    that resolves to a bool if the operation succeeds

    Returns Promise<boolean>

  • Check if stacking is enabled for next reward cycle

    Returns

    that resolves to a bool if the operation succeeds

    Returns Promise<boolean>

  • Adjust microstacks amount for locking after taking into account transaction fees

    Returns

    that resolves to a transaction object if the operation succeeds

    Parameters

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

    Returns StacksTransaction

  • Parses a contract identifier and ensures it is formatted correctly

    Returns

    a contract address and name

    Parameters

    • contract: string

    Returns string[]

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

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    • privateKey: string

      the private key to be used for the revoke call

    Returns Promise<TxBroadcastResult>

  • Generate and broadcast a stacking transaction to lock STX

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

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

    Returns

    that resolves to a broadcasted txid if the operation succeeds

    Parameters

    Returns Promise<TxBroadcastResult>

Generated using TypeDoc