Skip to content

Commit ee39f43

Browse files
Update JSON-RPC.md
Add docs for `get_transactionByTxHash`.
1 parent 22c7228 commit ee39f43

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

JSON-RPC.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,18 @@ JSON-RPC APIs are APIs provided by running a JeChain RPC server. They can be use
190190
* Status: 400
191191
* Body: `{ success: false, payload: null, error: { message: "Invalid transaction index." } }`
192192

193+
* `/get_transactionByTxHash`:
194+
* Use case: Get transaction through its hash.
195+
* Request body: `{ params: { hash: <tx_hash_hex_string> } }`
196+
* Reply body: `{ success: true, payload: { transaction: <transaction_object> } }`
197+
* Error body:
198+
* Invalid request (not enough params):
199+
* Status: 400
200+
* Body: `{ success: false, payload: null, error: { message: "Invalid request." } }`
201+
* Failed to get transaction with the given hash:
202+
* Status: 400
203+
* Body: `{ success: false, payload: null, error: { message: "Failed to get transaction with the given hash." } }`
204+
193205
### Other errors
194206

195207
* Invalid option (non-existent API):

0 commit comments

Comments
 (0)