getMinimumBalanceForRentExemption
Calculates the minimum lamports required to make an account rent exempt for a given data size, without performing an RPC call.
Values are sourced from the on-chain rent parameters in the Solana runtime: https://github.com/anza-xyz/solana-sdk/blob/c07f692e41d757057c8700211a9300cdcd6d33b1/rent/src/lib.rs#L93-L97
Note that this logic may change, or be incorrect depending on the cluster you are connected to.
You can always use the RPC method getMinimumBalanceForRentExemption to get the current value.
Parameters
| Parameter | Type | Description |
|---|---|---|
space | bigint | The number of bytes of account data. |