Refactor RPC/GetMinimumBalanceForRentExemption

This commit is contained in:
Slavomir 2021-07-01 17:49:20 +02:00
parent 4c9703315b
commit 2b6bbe35d4
1 changed files with 8 additions and 1 deletions

View File

@ -202,8 +202,15 @@ func (c *Client) GetProgramAccounts(ctx context.Context, publicKey solana.Public
}
// GetMinimumBalanceForRentExemption returns minimum balance required to make account rent exempt.
func (c *Client) GetMinimumBalanceForRentExemption(ctx context.Context, dataSize int) (lamport int, err error) {
func (c *Client) GetMinimumBalanceForRentExemption(
ctx context.Context,
dataSize int,
commitment CommitmentType,
) (lamport int, err error) {
params := []interface{}{dataSize}
if commitment != "" {
params = append(params, M{"commitment": commitment})
}
err = c.rpcClient.CallFor(&lamport, "getMinimumBalanceForRentExemption", params...)
return
}