Getting Info Solana
The get
namespace contains method used for getting info. The unique methods to the get
namespace is:
getDelegations(address)
: Get all user delegations.
Getting Info Code Example
ts
// Import SDK
import { Solana } from "@everstake/wallet-sdk-solana";
// Select network: "mainnet-beta" | "devnet"
const network = "mainnet-beta";
// Create SDK instance
const solanaClient = new Solana(network);
// User wallet address.
const address = "CnpYVG5ukLQsfusLqMGFRm5kJwcNhVdA3NS94example";
// Get all user delegations.
const getDelegationsResult = await solanaClient.getDelegations(address);
console.log(getDelegationsResult); // see response example below
Response Example
ts
getDelegationsResult = {
result: [
{
account: null,
data: {
parsed: {
info: {
meta: {
authorized: {
staker: "CnpYVG5ukLQsfusLqMGFRm5kJwcNhVdA3NS94example",
withdrawer: "CnpYVG5ukLQsfusLqMGFRm5kJwcNhVdA3NS94example",
},
lockup: {
custodian: "11111111111111111111111111111111",
epoch: 0,
unixTimestamp: 0,
},
rentExemptReserve: "2282880",
},
stake: {
creditsObserved: 140045079,
delegation: {
activationEpoch: "399",
deactivationEpoch: "400",
stake: "2300000",
voter: "9QU2QSxhb24FUX3Tu2FpczXjpK3VYrvRudywSZaM29mF",
warmupCooldownRate: 0.25,
},
},
},
type: "delegated",
},
program: "stake",
space: 200,
},
executable: false,
lamports: 4582880,
owner: "Stake11111111111111111111111111111111111111",
rentEpoch: 0,
pubkey: "CTZ4dbobNAec3fikKLFaXscPNqUzLmdLTzhNxrz4RTBh",
},
],
};