Skip to content

Commit

Permalink
add connection->getMinimumBalanceForRentExcemption()
Browse files Browse the repository at this point in the history
  • Loading branch information
chongkan committed May 9, 2024
1 parent 2373725 commit d95c43c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,8 @@ public function getProgramAccounts(string $programIdBs58, $dataSlice, $filters)

}

public function getMinimumBalanceForRentExemption(array $params = [1024]){
return $this->client->call('getMinimumBalanceForRentExemption', $params );
}

}
9 changes: 9 additions & 0 deletions tests/Feature/ConnectionFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ public function testGetBalance()
$this->assertIsFloat($result);
}

#[Test]
public function test_getMinimumBalanceForRentExemption(){
$client = new SolanaRpcClient($this->endpoint);
$connection = new Connection($client);
$result = $connection->getMinimumBalanceForRentExemption([2000]);
$this->assertIsInt($result);

}



}

0 comments on commit d95c43c

Please sign in to comment.