This method checks an incoming transaction, builds the zkSNARK Merkle tree proof, and sends the transaction to the Pool contract. The transaction doesn’t process immediately because contract interaction is completed in a serial manner. Incoming transactions are put into the job queue. The method returns jobId on success
Request Body
Name
Type
Description
{"jobId": "1"}
{ error:"Error while parsing the input JSON", description:"tx_type is incorrect"}
{ error:"An internal error has occured. Please try again later", description:"optional error description"}
Get the job status
GEThttp://relayer/job/:id
Returns incoming transaction processing state. jobId is returned by /transaction method
Query Parameters
Name
Type
Description
{"state": "failed","txHash": null}
"Job 2 not found"
{ error:"An internal error has occured. Please try again later", description:"optional error description"}}
Query transactions
GEThttp://relayer/transactions/:limit/:offset
Returns memo blocks and out commits for transactions at the specified offset. This method is used by clients to synchronize account state.
Query Parameters
[ (Buffer|null)]
{ error:"Incorrect parameters", description:"limit is too high"}
{ error:"An internal error has occured. Please try again later", description:"optional error description"}
Get Merkle tree proofs at the specified position
GEThttp://relayer/merkle/proof?[index]
{ root,// Merkle tree root for this proofs deltaIndex,// this index should be used for building tx proof proofs // Merkle tree proofs}
"Incorrect index"
{ error:"An internal error has occured. Please try again later", description:"optional error description"}
{ error:"An internal error has occured. Please try again later", description:"optional error description"}
Calculate transaction proof
POSThttp://relayer/proof_tx
Builds zkSNARK proof for the transaction based on public and secret transaction input calculated by a client.
WARNING: This is a debug method used to decrease client overhead. DO NOT use in production, as the client should pass public and secret transactional data. This significantly decreases overall security!
Request Body
{ proof // Transaction proof}
{ error:"Error while parsing the input JSON", description:"cannot find pub field"}
{ error:"An internal error has occured. Please try again later", description:"optional error description"}
Get the next index in the Merkle tree
GEThttp://relayer/delta_index
0
{ error:"An internal error has occured. Please try again later", description:"optional error description"}