0

I am building a stake pool for my spl-token on Solana. On my website I can get staked amount of an address by Anchor to call rpc API via connected program.

Is there any way to get staked amount of a wallet address from my server?

agentp
  • 335
  • 4
  • 17
  • You'll need to add some more context here, since "staked amount" appears to be a property of your Anchor program. Most likely, you need to keep user information about how much they have staked, or you need to issue a separate stake pool token to users who have staked. – Jon C Feb 22 '22 at 21:58

1 Answers1

0

the following API call should work:

H = {"Content-Type": "application/json"}
B = f''' {{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getVoteAccounts"
}}'''
r = requests.post(RPC_URL, headers=H, data=B).json()['result']
print(r)
Maksimjeet Chowdhary
  • 1,153
  • 1
  • 5
  • 11