getMinimumBalanceForRentExemption

function getMinimumBalanceForRentExemption(space): Lamports;

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

ParameterTypeDescription
spacebigintThe number of bytes of account data.

Returns

Lamports

On this page