Class: Stake
Defined in: bee-js/src/modules/stake.ts:15
Staking operations.
Accessed as bee.stake.
Constructors
Constructor
new Stake(
context):Stake
Defined in: bee-js/src/modules/stake.ts:16
Parameters
context
BeeContext
Returns
Stake
Methods
deposit()
deposit(
amount,options?,requestOptions?):Promise<TransactionId>
Defined in: bee-js/src/modules/stake.ts:45
Stakes the given amount of BZZ. Initial deposit must be at least 10 BZZ.
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 | BZZ | NumberString
options?
requestOptions?
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:23
Gets the amount of staked BZZ.
Parameters
requestOptions?
Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
Returns
Promise<BZZ>
getRedistributionState()
getRedistributionState(
requestOptions?):Promise<RedistributionState>
Defined in: bee-js/src/modules/stake.ts:85
Gets current status of node in redistribution game.
Parameters
requestOptions?
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:32
Gets the amount of withdrawable staked BZZ.
Parameters
requestOptions?
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:76
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?
Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
Returns
Promise<TransactionId>
withdrawSurplus()
withdrawSurplus(
requestOptions?):Promise<TransactionId>
Defined in: bee-js/src/modules/stake.ts:65
Withdraws all surplus staked BZZ to the node wallet.
Parameters
requestOptions?
Options for making requests, such as timeouts, custom HTTP agents, headers, etc.
Returns
Promise<TransactionId>