solathon
solathon copied to clipboard
Add commitment to RPC request
Right now, most of the Client
class method accept commitment parameter, however it isn't actually being used when the request is being sent.
This part is where the commitment needs to be added: https://github.com/SuperteamDAO/solathon/blob/master/solathon/core/http.py
Solana JSON RPC commitment reference: https://docs.solana.com/api/http#example
The logic is simple. If the user enters parameters array, with an object, having "commitment" key, then we have to add it to our request. The commitment is validated using this helper function: https://github.com/SuperteamDAO/solathon/blob/master/solathon/utils.py#L27
Also, some important RPC methods like send_transaction
don't have commitment parameter accepted yet either, so that needs to be added too.