verze-app / solana-php-sdk

Simple PHP SDK for Solana JSON RPC endpoints
MIT License
88 stars 45 forks source link

Header support added to the call method of SolanaRpcClient #24

Closed faridmovsumov closed 2 years ago

faridmovsumov commented 2 years ago

Some RPC services (https://runnode.com/) require an API key to be sent as header information. Header support will make it possible to send an API key.

image

Usage example:

image

faridmovsumov commented 2 years ago

Hi @mattstauffer did you have a chance to take a look into this?

mattstauffer commented 2 years ago

@faridmovsumov Thanks for your patience. I know this was built to mirror this:

https://docs.solana.com/developing/clients/jsonrpc-api

Does the way you implemented this mirror how they handle headers?

faridmovsumov commented 2 years ago

Thanks, @mattstauffer for checking it will basically allow adding any kind of headers. In this case, I only tested with runnode headers and it was giving correct results.

mattstauffer commented 2 years ago

@faridmovsumov Sure, but here is my question, which I should've communicated more clearly:

When this class was first built, it was intending to work as closely to how the JavaScript and Python SDKs work.

Could you look at the JS and Python SDKs and make sure this is similar to how they handle sending headers?

Thanks!