Skip to main content

Class: Stake

Defined in: bee-js/src/modules/stake.ts:16

Staking operations.

Accessed as bee.stake.

Constructors​

Constructor​

new Stake(context): Stake

Defined in: bee-js/src/modules/stake.ts:17

Parameters​

context​

BeeContext

Returns​

Stake

Methods​

deposit()​

deposit(amount, options?, requestOptions?): Promise<TransactionId>

Defined in: bee-js/src/modules/stake.ts:55

Stakes the given amount of BZZ. Must be at least getMinimumDeposit, otherwise Bee rejects it with 400.

Be aware that staked BZZ tokens can not be withdrawn.

Parameters​

amount​

Amount of BZZ tokens to be staked. If not providing a BZZ instance, the amount is denoted in PLUR.

string | bigint | NumberString | BZZ

options?​

TransactionOptions

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<TransactionId>


get()​

get(requestOptions?): Promise<BZZ>

Defined in: bee-js/src/modules/stake.ts:24

Gets the amount of staked BZZ.

Parameters​

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<BZZ>


getMinimumDeposit()​

getMinimumDeposit(requestOptions?): Promise<BZZ | null>

Defined in: bee-js/src/modules/stake.ts:31

Gets the minimum next deposit, or null when Bee cannot determine it (e.g. the price oracle is unavailable).

Parameters​

requestOptions?​

BeeRequestOptions

Returns​

Promise<BZZ | null>


getRedistributionState()​

getRedistributionState(requestOptions?): Promise<RedistributionState>

Defined in: bee-js/src/modules/stake.ts:95

Gets current status of node in redistribution game.

Parameters​

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<RedistributionState>


getWithdrawable()​

getWithdrawable(requestOptions?): Promise<BZZ>

Defined in: bee-js/src/modules/stake.ts:42

Gets the amount of withdrawable staked BZZ.

Parameters​

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<BZZ>


migrate()​

migrate(requestOptions?): Promise<TransactionId>

Defined in: bee-js/src/modules/stake.ts:86

Withdraws all staked BZZ to the node wallet.

Only available when the staking contract is paused and is in the process of being migrated to a new contract!

Parameters​

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<TransactionId>


setRedistributionEnabled()​

setRedistributionEnabled(enabled, requestOptions?): Promise<boolean>

Defined in: bee-js/src/modules/stake.ts:100

Enables or disables participation in new redistribution rounds; resets to enabled when the node restarts.

Parameters​

enabled​

boolean

requestOptions?​

BeeRequestOptions

Returns​

Promise<boolean>


withdrawSurplus()​

withdrawSurplus(requestOptions?): Promise<TransactionId>

Defined in: bee-js/src/modules/stake.ts:75

Withdraws all surplus staked BZZ to the node wallet.

Parameters​

requestOptions?​

BeeRequestOptions

Options for making requests, such as timeouts, custom HTTP agents, headers, etc.

Returns​

Promise<TransactionId>

💬 Get Help