This API server is the layer that allows 3rd party apps and services interfacing with the coordinator to explore, monitor and use the Hermez rollup.
This Hermez node API is the layer that allows 3rd party apps and services to interface with the node to use the layer two features of the Hermez rollup.
Example of these apps are:
* Wallet:send L2 transactions, check balance, ...
* Explorer:List transactions, slots, batches, ...
*Exchange integrations
Note that some of the interactions with the rollup must be done using the Ethereum network directly.
Another way to integrate with the rollup is to [deploy a node](github.com/hermeznetwork/hermez-node/) and connect directly to its PostgreSQL database.
### Pagination
@ -25,22 +28,35 @@ info:
Since all the items are ordered chronologicaly, there are no safety problems when fetching items in ascending order, except for reorgs (more on this later).
Onthe other hand, when iterating in descending order, new items will be added at the beginning. This doesn't cause any safety problem, but to get those new items, it's necessary to start queryng without the `fromItem` set to `pagination.lastItem`.
To handle reorgs, the `itemId` can be used since it will change. This is important since other identifiers may be the same but with different content. As an example, if the batch 424 get's reorged, it will be deleted, but eventualy, a new batch 424 will appear with potentialy different content.
To handle reorgs, the `itemId` can be used since it will change. This is important since other identifiers may be the same but with different content. As an example, if batch 424 gets reorged, it will be deleted, but eventually, a new batch 424 will appear with potentially different content. However these two batches number 424, will have different `itemId`.
### Signatures
The POST endpoint requires to be signed using BabyJubJub or Ethereum keys. TODO:add references to libraries / examples / ...
There are two endpoints that require signatures:
* POST /account-creation-authorization:signed using an Ethereum key.
* POST /transactions-pool:signed using BJJ key.
More details on how to sign will be provided soon.
### Contact
If you have any doubt or suggestion, please contact us at:
summary:Get to know if the coordinator has the ability to create accounts associated to an Ethereum address.
description:>-
Trueif the coordinator has the required authorization to perform an account creation with the given Ethereum address on behalf of the Ethereum address holder.
Returns the authorization to perform an account creation with the given Ethereum address on behalf of the Ethereum address holder.
operationId:getAccountCreationAuthorization
parameters:
- name:hezEthereumAddress
@ -157,7 +173,7 @@ paths:
- name:tokenIds
in:query
required:false
description:Only get accounts of specific tokens.
description:Only get accounts of specific tokens. This is represented by a comma separated list of token identifiers.
schema:
type:string
description:Comma separated list of token identifiers.
@ -471,9 +487,9 @@ paths:
- Transaction
summary:Get details and status of transactions that have been forged.
description:>-
Get historical transactions. This endpoint will return all the different types of transactions except for:
- Transactions that are still in the transaction pool of any coordinator. These transactions can be fetched using `GET /transactions-pool/{id}`.
- L1 transactions sent by users that have not been forged yet. These transactions can be fetched using `GET /transactions-history/{id}`.
Get historical transactions. This endpoint will return all the different types of **forged** transactions, this means that:
*Transactions that are still in the transaction pool of any coordinator are not included. These transactions can be fetched using `GET /transactions-pool/{id}`.
*L1 transactions sent by users that have not been forged yet are not included. These transactions can be fetched using `GET /transactions-history/{id}`.
operationId:getHistoryTxs
parameters:
- name:tokenId
@ -567,7 +583,7 @@ paths:
- Transaction
summary:Get details and status of a historical transaction.
description:>-
Get transaction from the history by its id. This endpoint will return all the different types of transactions except those that are still in the pool of any coordinator.
Get transaction by its id. This endpoint will return all the different types of transactions except those that are still in the pool of any coordinator.
operationId:getHistoryTx
parameters:
- name:id
@ -890,8 +906,9 @@ paths:
get:
tags:
- Hermez status
summary:Get a list of bids made for a specific slot auction.
description:Get a list of bids made for a specific slot auction. Is necessary to add a filter (`slotNum` or `bidderAddr`).
summary:Get a list of bids.
description:>-
Get a list of bids. It's necessary to provide at least one of the following filters:`slotNum`, `bidderAddr`.
operationId:getSlotBids
parameters:
- name:slotNum
@ -1304,6 +1321,19 @@ components:
description:References the `nonce` of the requested transaction.