Fetch and decode a Solana stake account.
HTTP transport.
Stake account public key.
RPC options.
Decoded stake account, or null if not found.
null
const stake = await fetchStakeAccount(transport, stakeAccountPubkey);if (stake?.decoded.type === 'delegated') { console.log(`Delegated to: ${stake.decoded.stake!.voterPubkey}`); console.log(`Stake amount: ${stake.decoded.stake!.stake} lamports`);} Copy
const stake = await fetchStakeAccount(transport, stakeAccountPubkey);if (stake?.decoded.type === 'delegated') { console.log(`Delegated to: ${stake.decoded.stake!.voterPubkey}`); console.log(`Stake amount: ${stake.decoded.stake!.stake} lamports`);}
1.1.0
Fetch and decode a Solana stake account.