Interface: StakeProgram
Stake program interface
Methods
all()
ts
all(): Promise<Stake[]>;Fetch all stake accounts
Returns
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
| Parameter | Type |
|---|---|
owner? | Address |
Returns
get()
ts
get(addr): Promise<Stake>;Fetch a stake account by address
Parameters
| Parameter | Type |
|---|---|
addr | Address |
Returns
getAddress()
ts
getAddress(owner?): Promise<Address>;Derive the stake account PDA address for a given owner (defaults to wallet address)
Parameters
| Parameter | Type |
|---|---|
owner? | Address |
Returns
Promise<Address>
getByOwner()
ts
getByOwner(owner?): Promise<Stake>;Fetch a stake account by owner address (defaults to wallet address)
Parameters
| Parameter | Type |
|---|---|
owner? | Address |
Returns
multiple()
ts
multiple(addresses): Promise<Stake[]>;Fetch multiple stake accounts by address
Parameters
| Parameter | Type |
|---|---|
addresses | Address[] |
Returns
Properties
| Property | Type | Description |
|---|---|---|
stake | CreateStake | Create a stake instruction for creating/initializing a stake account |
topup | CreateTopup | Create 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. |