2

Is there an endpoint in the JSON RPC API which can give me back the rent balance for a given address? https://docs.solana.com/api/http#getaccountinfo enter image description here

1 Answer 1

4

Here's the endpoint to get the minimum rent-exempt balance: https://docs.solana.com/api/http#getminimumbalanceforrentexemption.

You will need to provide the account size as the parameter (in bytes). The result will be in lamports, so multiply the result by 10**9 to get the rent exemption in SOL. Since system accounts don't have any data, the account in your SS has 0 bytes of data which requires the minimum rent of 890880 lamports.

Another important point to note is that the minimum rent exemption is not the actual rent balance that the account holds. It's the minimum balance the account must have; otherwise, the validators can drop the account from their memory. The actual balance is returned by the API you mentioned (getAccountInfo), where the lamports field in the response is the actual account balance. In short, the account must have more lamports as the balance than the minimum rent exemption.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.