Skip to content

Commit

Permalink
Add documentations for new APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenphuminh authored Jul 11, 2022
1 parent 45003f2 commit 73435ef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions JSON-RPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ JSON-RPC APIs are APIs provided by running a JeChain RPC server. They can be use
* Use case: Get hash and nonce from the latest block.
* Reply body: `{ success: true, payload: { hash: <hash>, nonce: <nonce> } }`

* `/mining`:
* Use case: Check on whether client is mining or not.
* Reply body: `{ success: true, payload: { mining: true | false } }`

### POST

* `/get_blockByHash`:
Expand Down Expand Up @@ -89,6 +93,15 @@ JSON-RPC APIs are APIs provided by running a JeChain RPC server. They can be use
* Status: 400
* Body: `{ success: false, payload: null, error: { message: "Invalid request." } }`

* `/get_storage`:
* Use case: Get the storage object from address.
* Request body: `{ params: { address: <address> } }`
* Reply body: `{ success: true, payload: { storage: <storage_object> } }`
* Error body:
* Invalid request (not enough params):
* Status: 400
* Body: `{ success: false, payload: null, error: { message: "Invalid request." } }`

* `/sendTransaction`:
* Use case: Send transaction.
* Request body: `{ params: { transaction: <transaction_object> } }`
Expand Down

0 comments on commit 73435ef

Please sign in to comment.