API unification - more widespread JSON-RPC API
Currently Devnet has endpoints such as /mint, /dump, /load, etc. which aren't JSON-RPC based. Similar to how Devnet supports starknet_<METHOD_NAME> JSON-RPC methods, there could be devnet_<METHOD_NAME> methods such as devnet_mint> which would follow JSON-RPC semantics.
For the transition phase, let's keep both REST and JSON-RPC API. E.g. minting should, for now, be possible via both
POST /mint
{ "amount": ..., "address": ... }
and
POST /rpc
{ "method": "devnet_mint", "amount": ..., "address": ... }
And in the future we can just keep the RPC support.
@FabijanC kindly assign this issue to me, i will like to work on it.
@mubarak23 Thanks for commenting, please wait until it is decided whose responsibility this should be.
@mubarak23 You've been assigned. Please note that the issue description has been updated.
@FabijanC thank you.
i will take a bit of time to study the code and start working on the issue.
don't mind if you can point me to where is the best to start.
You can run Devnet in debug mode, send it a simple RPC request, and see which parts of the code it goes through. You could then see how to expand JsonRpcHandler to support all the Devnet-specific requests. Ideally, you would not use the StarknetRequest enumeration for these requests. Ideally, the RPC and REST endpoints would point to the same internal logic (e.g. only one minting logic implementation, but different endpoints using it).