# StackingClient | Stacks.js 1.4.1 Library Reference
Documentation for Stacks.js 1.4.1 Library Reference

### Hierarchy

- StackingClient

## Index

### Constructors

- constructor

### Properties

- address
- network

### Methods

- canStack
- delegateStackStx
- delegateStx
- getAccountBalance
- getAccountStatus
- getCoreInfo
- getCycleDuration
- getDelegateOptions
- getDelegateStackOptions
- getPoxInfo
- getRevokeDelegateStxOptions
- getSecondsUntilNextCycle
- getStackAggregationCommitOptions
- getStackOptions
- getStatus
- getTargetBlockTime
- hasMinimumStx
- isStackingEnabledNextCycle
- modifyLockTxFee
- parseContractId
- revokeDelegateStx
- stack
- stackAggregationCommit

## Constructors

### constructor

- new StackingClient(address: string, network: StacksNetwork ): StackingClient

- - Defined in packages/stacking/src/index.ts:158

  #### Parameters

  - ##### address: string

  - ##### network: StacksNetwork

  #### Returns StackingClient

## Properties

### address

address: string

### network

network: StacksNetwork

## Methods

### canStack

- canStack(__namedParameters: CanLockStxOptions ): Promise< StackingEligibility >

- - Defined in packages/stacking/src/index.ts:281

  Check if account can lock stx

  #### Parameters

  - ##### __namedParameters: CanLockStxOptions

  #### Returns Promise< StackingEligibility >

  that resolves to a StackingEligibility object if the operation succeeds

### delegateStackStx

- delegateStackStx(__namedParameters: DelegateStackStxOptions ): Promise< TxBroadcastResult >

- - Defined in packages/stacking/src/index.ts:398

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

  #### Parameters

  - ##### __namedParameters: DelegateStackStxOptions

  #### Returns Promise< TxBroadcastResult >

  that resolves to a broadcasted txid if the operation succeeds

### delegateStx

- delegateStx(__namedParameters: DelegateStxOptions ): Promise< TxBroadcastResult >

- - Defined in packages/stacking/src/index.ts:365

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

  #### Parameters

  - ##### __namedParameters: DelegateStxOptions

  #### Returns Promise< TxBroadcastResult >

  that resolves to a broadcasted txid if the operation succeeds

### getAccountBalance

- getAccountBalance(): Promise<BN>

- - Defined in packages/stacking/src/index.ts:207

  Get account balance

  #### Returns Promise<BN>

  that resolves to a BigNum if the operation succeeds

### getAccountStatus

- getAccountStatus(): Promise<any>

- - Defined in packages/stacking/src/index.ts:197

  #### Returns Promise<any>

### getCoreInfo

- getCoreInfo(): Promise< CoreInfo >

- - Defined in packages/stacking/src/index.ts:166

  Get stacks node info

  #### Returns Promise< CoreInfo >

  that resolves to a CoreInfo response if the operation succeeds

### getCycleDuration

- getCycleDuration(): Promise<number>

- - Defined in packages/stacking/src/index.ts:222

  Get reward cycle duration in seconds

  #### Returns Promise<number>

  that resolves to a number if the operation succeeds

### getDelegateOptions

- getDelegateOptions(__namedParameters: { amountMicroStx: BN; contract: string; delegateTo: string; poxAddress?: string; untilBurnBlockHeight?: number }): ContractCallOptions

- - Defined in packages/stacking/src/index.ts:516

  #### Parameters

  - ##### __namedParameters: { amountMicroStx: BN; contract: string; delegateTo: string; poxAddress?: string; untilBurnBlockHeight?: number }

    - ##### amountMicroStx: BN

    - ##### contract: string

    - ##### delegateTo: string

    - ##### Optional poxAddress?: string

    - ##### Optional untilBurnBlockHeight?: number

  #### Returns ContractCallOptions

### getDelegateStackOptions

- getDelegateStackOptions(__namedParameters: { amountMicroStx: BN; burnBlockHeight: number; contract: string; cycles: number; nonce?: BN; poxAddress: string; stacker: string }): ContractCallOptions

- - Defined in packages/stacking/src/index.ts:562

  #### Parameters

  - ##### __namedParameters: { amountMicroStx: BN; burnBlockHeight: number; contract: string; cycles: number; nonce?: BN; poxAddress: string; stacker: string }

    - ##### amountMicroStx: BN

    - ##### burnBlockHeight: number

    - ##### contract: string

    - ##### cycles: number

    - ##### Optional nonce?: BN

    - ##### poxAddress: string

    - ##### stacker: string

  #### Returns ContractCallOptions

### getPoxInfo

- getPoxInfo(): Promise< PoxInfo >

- - Defined in packages/stacking/src/index.ts:176

  Get stacks node pox info

  #### Returns Promise< PoxInfo >

  that resolves to a PoxInfo response if the operation succeeds

### getRevokeDelegateStxOptions

- getRevokeDelegateStxOptions(contract: string): ContractCallOptions

- - Defined in packages/stacking/src/index.ts:643

  #### Parameters

  - ##### contract: string

  #### Returns ContractCallOptions

### getSecondsUntilNextCycle

- getSecondsUntilNextCycle(): Promise<number>

- - Defined in packages/stacking/src/index.ts:238

  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

- - Defined in packages/stacking/src/index.ts:612

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

- - Defined in packages/stacking/src/index.ts:476

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

- getStatus(): Promise< StackerInfo >

- - Defined in packages/stacking/src/index.ts:663

  Check stacking status

  #### Returns Promise< StackerInfo >

  that resolves to a StackerInfo object if the operation succeeds

### getTargetBlockTime

- getTargetBlockTime(): Promise<number>

- - Defined in packages/stacking/src/index.ts:186

  Get stacks node target block time

  #### Returns Promise<number>

  that resolves to a number if the operation succeeds

### hasMinimumStx

- hasMinimumStx(): Promise<boolean>

- - Defined in packages/stacking/src/index.ts:268

  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>

- - Defined in packages/stacking/src/index.ts:259

  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

- - Defined in packages/stacking/src/index.ts:715

  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): string[]

- - Defined in packages/stacking/src/index.ts:728

  Parses a contract identifier and ensures it is formatted correctly

  #### Parameters

  - ##### contract: string

  #### Returns string[]

  a contract address and name

### revokeDelegateStx

- revokeDelegateStx(privateKey: string): Promise< TxBroadcastResult >

- - Defined in packages/stacking/src/index.ts:462

  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: LockStxOptions ): Promise< TxBroadcastResult >

- - Defined in packages/stacking/src/index.ts:333

  Generate and broadcast a stacking transaction to lock STX

  #### Parameters

  - ##### __namedParameters: LockStxOptions

  #### Returns Promise< TxBroadcastResult >

  that resolves to a broadcasted txid if the operation succeeds

### stackAggregationCommit

- stackAggregationCommit(__namedParameters: StackAggregationCommitOptions ): Promise< TxBroadcastResult >

- - Defined in packages/stacking/src/index.ts:434

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

  #### Parameters

  - ##### __namedParameters: StackAggregationCommitOptions

  #### Returns Promise< TxBroadcastResult >

  that resolves to a broadcasted txid if the operation succeeds

Generated using TypeDoc