Hierarchy

  • StackingClient

Constructors

Properties

address: string
client: Required<ClientOpts>
network: StacksNetwork

Accessors

  • get baseUrl(): string
  • Returns string

  • get fetch(): FetchFn
  • Returns FetchFn

Methods - Other

  • readonly can-stack-stx

    Check if account can lock stx

    Parameters

    Returns Promise<StackingEligibility>

    that resolves to a StackingEligibility object if the operation succeeds

  • delegate-stack-stx

    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

  • delegate-stx

    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

  • Get account balance

    Returns Promise<bigint>

  • Get account balance of locked tokens

    Returns Promise<bigint>

  • Get extended account balances

    Returns Promise<ExtendedAccountBalances>

  • Get account status

    Returns Promise<any>

  • Returns Promise<V2CoreInfoResponse>

    Deprecated

    Kept for backwards compatibility, may be removed in the future

  • Get reward cycle duration in seconds

    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;
          poxAddress: string;
          stacker: string;
      }
      • contract: string
      • extendCount: number
      • poxAddress: string
      • stacker: string

    Returns ContractCallOptions

  • Parameters

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

    Returns ContractCallOptions

  • Parameters

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

    Returns ContractCallOptions

  • Check delegation status

    Returns Promise<DelegationInfo>

    that resolves to a DelegationInfo object if the operation succeeds

  • Returns Promise<V2PoxInfoResponse>

    Deprecated

    Kept for backwards compatibility, may be removed in the future

  • 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.

    Parameters

    • Optional poxInfo: V2PoxInfoResponse

    Returns Promise<PoxOperationInfo>

  • Get burnchain rewards holders for the set address

    Parameters

    • Optional options: PaginationOptions

    Returns Promise<BaseErrorResponse | BurnchainRewardSlotHolderListResponse>

  • Get PoX address from reward set by index (if it exists)

    Parameters

    Returns Promise<undefined | RewardSetInfo>

  • Get burnchain rewards for the set address

    Parameters

    • Optional options: PaginationOptions

    Returns Promise<BaseErrorResponse | BurnchainRewardListResponse>

  • Get the total burnchain rewards total for the set address

    Returns Promise<BurnchainRewardsTotal | BaseErrorResponse>

  • Get number of seconds until next reward cycle

    Returns Promise<number>

  • Get number of seconds until the end of the stacking deadline. This is the estimated time stackers have to submit their stacking transactions to be included in the upcoming reward cycle.

    Returns Promise<number>

    number of seconds ⚠️ Attention: The returned number of seconds can be negative if the deadline has passed and the prepare phase has started.

  • Parameters

    • __namedParameters: {
          authId?: IntegerType;
          contract: string;
          maxAmount?: IntegerType;
          poxAddress: string;
          rewardCycle: number;
          signerKey?: string;
          signerSignature?: string;
      }
      • Optional authId?: IntegerType
      • contract: string
      • Optional maxAmount?: IntegerType
      • poxAddress: string
      • rewardCycle: number
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          authId?: IntegerType;
          contract: string;
          maxAmount?: IntegerType;
          poxAddress: string;
          rewardCycle: number;
          signerKey?: string;
          signerSignature?: string;
      }
      • Optional authId?: IntegerType
      • contract: string
      • Optional maxAmount?: IntegerType
      • poxAddress: string
      • rewardCycle: number
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          authId?: IntegerType;
          contract: string;
          maxAmount?: IntegerType;
          poxAddress: string;
          rewardCycle: number;
          rewardCycleIndex: number;
          signerKey?: string;
          signerSignature?: string;
      }
      • Optional authId?: IntegerType
      • contract: string
      • Optional maxAmount?: IntegerType
      • poxAddress: string
      • rewardCycle: number
      • rewardCycleIndex: number
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          authId?: IntegerType;
          contract: string;
          extendCycles: number;
          maxAmount?: IntegerType;
          poxAddress: string;
          signerKey?: string;
          signerSignature?: string;
      }
      • Optional authId?: IntegerType
      • contract: string
      • extendCycles: number
      • Optional maxAmount?: IntegerType
      • poxAddress: string
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          authId?: IntegerType;
          contract: string;
          increaseBy: IntegerType;
          maxAmount?: IntegerType;
          signerKey?: string;
          signerSignature?: string;
      }
      • Optional authId?: IntegerType
      • contract: string
      • increaseBy: IntegerType
      • Optional maxAmount?: IntegerType
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    • __namedParameters: {
          amountMicroStx: IntegerType;
          authId?: IntegerType;
          burnBlockHeight: number;
          contract: string;
          cycles: number;
          maxAmount?: IntegerType;
          poxAddress: string;
          signerKey?: string;
          signerSignature?: string;
      }
      • amountMicroStx: IntegerType
      • Optional authId?: IntegerType
      • burnBlockHeight: number
      • contract: string
      • cycles: number
      • Optional maxAmount?: IntegerType
      • poxAddress: string
      • Optional signerKey?: string
      • Optional signerSignature?: string

    Returns ContractCallOptions

  • Parameters

    Returns Promise<string>

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

  • Check stacking status

    Returns Promise<StackerInfo>

    that resolves to a StackerInfo object if the operation succeeds

  • Returns Promise<number>

    Deprecated

    Kept for backwards compatibility, may be removed in the future

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

    Returns Promise<boolean>

    that resolves to a bool if the operation succeeds

  • 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

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

    Parameters

    • txOptions: BaseTxOptions

      the private key, fee, and nonce to be used for the revoke call

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • Generates a signer-sig string for the current PoX contract.

    Parameters

    • __namedParameters: {
          authId: IntegerType;
          maxAmount: IntegerType;
          period: number;
          poxAddress: string;
          rewardCycle: number;
          signerPrivateKey: PrivateKey;
          topic: "stack-stx" | "agg-commit" | "agg-increase" | "stack-extend" | "stack-increase";
      }
      • authId: IntegerType
      • maxAmount: IntegerType
      • period: number
      • poxAddress: string
      • rewardCycle: number
      • signerPrivateKey: PrivateKey
      • topic: "stack-stx" | "agg-commit" | "agg-increase" | "stack-extend" | "stack-increase"

    Returns string

  • stack-stx

    Generate and broadcast a stacking transaction to lock STX

    Parameters

    • options: LockStxOptions & BaseTxOptions

      a required lock STX options object

    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

  • Call the verify-signer-key-sig read-only function on the PoX contract.

    Parameters

    • __namedParameters: {
          amount: IntegerType;
          authId: IntegerType;
          maxAmount: IntegerType;
          period: number;
          poxAddress: string;
          rewardCycle: number;
          signerKey: string;
          signerSignature?: string;
          topic: string;
      }
      • amount: IntegerType
      • authId: IntegerType
      • maxAmount: IntegerType
      • period: number
      • poxAddress: string
      • rewardCycle: number
      • signerKey: string
      • Optional signerSignature?: string
      • topic: string

    Returns Promise<boolean>

    (async) a boolean indicating if the signature is valid

Methods - PoX-2

  • delegate-stack-extend

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

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

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

    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

    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.

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

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

    Parameters

    Returns Promise<TxBroadcastResult>

    that resolves to a broadcasted txid if the operation succeeds

  • stack-extend

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

    Parameters

    Returns Promise<TxBroadcastResult>

    a broadcasted txid if the operation succeeds

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

    Parameters

    Returns Promise<TxBroadcastResult>

    a broadcasted txid if the operation succeeds

Generated using TypeDoc