Skip to content

Interface: StakeProgram ​

Stake program interface

Methods ​

all() ​

ts
all(): Promise<Stake[]>;

Fetch all stake accounts

Returns ​

Promise<Stake[]>


find() ​

ts
find(owner?): Promise<Stake | undefined>;

Fetch a stake account by owner address (defaults to wallet address); undefined when the owner has none

Parameters ​

ParameterType
owner?Address

Returns ​

Promise<Stake | undefined>


get() ​

ts
get(addr): Promise<Stake>;

Fetch a stake account by address

Parameters ​

ParameterType
addrAddress

Returns ​

Promise<Stake>


getAddress() ​

ts
getAddress(owner?): Promise<Address>;

Derive the stake account PDA address for a given owner (defaults to wallet address)

Parameters ​

ParameterType
owner?Address

Returns ​

Promise<Address>


getByOwner() ​

ts
getByOwner(owner?): Promise<Stake>;

Fetch a stake account by owner address (defaults to wallet address)

Parameters ​

ParameterType
owner?Address

Returns ​

Promise<Stake>


multiple() ​

ts
multiple(addresses): Promise<Stake[]>;

Fetch multiple stake accounts by address

Parameters ​

ParameterType
addressesAddress[]

Returns ​

Promise<Stake[]>

Properties ​

PropertyTypeDescription
stakeCreateStakeCreate a stake instruction for creating/initializing a stake account
topupCreateTopupCreate the instructions that top up the wallet's existing stake account by amount (NOS base units) and keep its staking rewards in step. In order: rewards enter (only when the wallet has no rewards account yet), pools claimFee for pool (default: programs.rewardsPoolAddress), stake topup, rewards sync. Send them together in one transaction.