How to get account stakes? (WIP)

  • getStake

This function is used to get stake information of a specific account.

import { L1XProvider, GetStakeArg } from "@l1x/l1x-wallet-sdk";

let l1xProvider = new L1XProvider({
  clusterType: "mainnet",
  endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});

let params: GetStakeArg = {
  pool_address: "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
  account_address: "f060c5232a76cd8cfb931c1e199cfd5dc2e4ee07",
};

l1xProvider.core
  .getStake(params)
  .then((response) => console.log(response)) // log response
  .catch((err) => console.error(err)); // log error

Parameters:

The address of the account for which the stake information needs to be retrieved

{
    "pool_address": "346fb07c43e88b58c058e8d6c4bf2f5080a01999",
    "account_address": "f060c5232a76cd8cfb931c1e199cfd5dc2e4ee07"
}

Returns:

A promise that resolves with the stake information.

Last updated