You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3038 lines
107 KiB

3 years ago
3 years ago
3 years ago
  1. openapi: 3.0.0
  2. info:
  3. description: |
  4. 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.
  5. Example of these apps are:
  6. * Wallet: send L2 transactions, check balance, ...
  7. * Explorer: List transactions, slots, batches, ...
  8. * Exchange integrations
  9. Note that some of the interactions with the rollup must be done using the Ethereum network directly.
  10. Another way to integrate with the rollup is to [deploy a node](github.com/hermeznetwork/hermez-node/) and connect directly to its PostgreSQL database.
  11. ### Pagination
  12. #### Usage
  13. All the endpoints that return a list of undefined size use pagination. Unless the opposite is explicitly said.
  14. In order to use pagination, three query parameters are used:
  15. * `fromItem`: indicates the first item to be returned. In general, this parameter shouldn't be provided in the first call to the endpoint, and use the `itemId` of the last returned item (+/-) 1, if the order is (ascending/descending).
  16. * `order`: all paginated items are ordered chronologically. However, the specific fields to guarantee this order depend on each endpoint. For this purpose, `itemId` is used (itemId follows ascending chronological order except for unforged L1 user transactions). If the parameter is not provided, ascending order will be used by default.
  17. * `limit`: maximum amount of items to include in each response. Default is 20, maximum is 2049.
  18. Responses for those endpoints will always include a `pendingItems` property. This property includes the amount of items that are not fetched yet. This can be used to:
  19. * Calculate the amount of items that match the filters: `totalItems = length(alreadyFetchedItems) + pendingItems`
  20. * Know when all items have been fetched: `if pendingItems == 0 {/* all items have been fetched */}`
  21. #### Reorgs and Safety
  22. Since all the items are ordered chronologically, there are no safety problems when fetching items in ascending order, except for reorgs (more on this later).
  23. On the 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 querying without the `fromItem` set to `pagination.lastItem`.
  24. 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`.
  25. ### Signatures
  26. There are two endpoints that require signatures:
  27. * POST /account-creation-authorization: signed using an Ethereum key.
  28. * POST /transactions-pool: signed using BJJ key.
  29. More details on how to sign will be provided soon.
  30. ### Contact
  31. If you have any doubt or suggestion, please contact us at:
  32. * [GitHub](https://github.com/hermeznetwork/hermez-node/)
  33. * [Telegram](https://t.me/hermez_network)
  34. * [Discord](https://bit.ly/3nohULM)
  35. * Email: hello@hermez.network
  36. * [Twitter](https://twitter.com/hermez_network)
  37. # TODO: add further documentation on how to sign auths and txs
  38. version: "0.0.1"
  39. title: Hermez Network API
  40. # TODO: update with support email
  41. # termsOfService: 'http://swagger.io/terms/'
  42. license:
  43. name: license AGPLv3
  44. url: 'https://www.gnu.org/licenses/agpl-3.0.html'
  45. externalDocs:
  46. description: Find out more about Hermez network.
  47. url: 'https://hermez.io'
  48. servers:
  49. - description: Hosted mock up
  50. url: https://apimock.hermez.network
  51. - description: Localhost mock Up
  52. url: http://localhost:4010
  53. tags:
  54. - name: Coordinator
  55. description: Endpoints used by the nodes running in coordinator mode. They are used to interact with the network.
  56. - name: Explorer
  57. description: Endpoints used by the nodes running in explorer mode. They are used to get information of the netwrok.
  58. paths:
  59. '/account-creation-authorization':
  60. post:
  61. tags:
  62. - Coordinator
  63. summary: Send an authorization that will allow the coordinator to register accounts associated to an Ethereum address on behalf of the user.
  64. description: >-
  65. Send an authorization to create rollup accounts associated with an Ethereum address. Each account creation (an account can only hold a specific token) is effective once the coordinator forges the corresponding L1CoordinatorTx (which is always of type *account creation*).
  66. operationId: postRegister
  67. requestBody:
  68. description: Account creation authorization.
  69. required: true
  70. content:
  71. application/json:
  72. schema:
  73. $ref: '#/components/schemas/AccountCreationAuthorizationPost'
  74. responses:
  75. '200':
  76. description: Successful operation.
  77. '400':
  78. description: Bad request.
  79. content:
  80. application/json:
  81. schema:
  82. $ref: '#/components/schemas/Error400'
  83. '500':
  84. description: Internal server error.
  85. content:
  86. application/json:
  87. schema:
  88. $ref: '#/components/schemas/Error500'
  89. '/account-creation-authorization/{hezEthereumAddress}':
  90. get:
  91. tags:
  92. - Coordinator
  93. summary: Find out if the coordinator has the ability to create accounts associated with an Ethereum address.
  94. description: >-
  95. Returns the authorization to perform an account creation with the given Ethereum address on behalf of the Ethereum address holder.
  96. operationId: getAccountCreationAuthorization
  97. parameters:
  98. - name: hezEthereumAddress
  99. in: path
  100. description: Ethereum address.
  101. required: true
  102. schema:
  103. $ref: '#/components/schemas/HezEthereumAddress'
  104. responses:
  105. '200':
  106. description: Successful operation.
  107. content:
  108. application/json:
  109. schema:
  110. $ref: '#/components/schemas/AccountCreationAuthorization'
  111. '400':
  112. description: Bad request.
  113. content:
  114. application/json:
  115. schema:
  116. $ref: '#/components/schemas/Error400'
  117. '404':
  118. description: Not found.
  119. content:
  120. application/json:
  121. schema:
  122. $ref: '#/components/schemas/Error404'
  123. '500':
  124. description: Internal server error.
  125. content:
  126. application/json:
  127. schema:
  128. $ref: '#/components/schemas/Error500'
  129. '/accounts':
  130. get:
  131. tags:
  132. - Explorer
  133. summary: Get accounts balances and other associated information.
  134. description: Get account balances and other associated information.
  135. operationId: getAccounts
  136. parameters:
  137. - name: hezEthereumAddress
  138. in: query
  139. description: Only get accounts associated to an Ethereum address. Incompatible with the query `BJJ`.
  140. required: false
  141. schema:
  142. $ref: '#/components/schemas/HezEthereumAddress'
  143. - name: BJJ
  144. in: query
  145. description: Only get accounts associated to a BabyJubJub compressed public key. Incompatible with the query `hezEthereumAddress`.
  146. required: false
  147. schema:
  148. $ref: '#/components/schemas/BJJ'
  149. - name: tokenIds
  150. in: query
  151. required: false
  152. description: Only get accounts of specific tokens. This is represented by a comma separated list of token identifiers.
  153. schema:
  154. type: string
  155. description: Comma separated list of token identifiers.
  156. example: "3,87,91"
  157. - name: fromItem
  158. in: query
  159. required: false
  160. description: Indicates the desired first item (using the itemId property) to be included in the response.
  161. schema:
  162. type: number
  163. - name: order
  164. in: query
  165. required: false
  166. description: Order of the returned items. Accounts will be ordered by increasing account index.
  167. schema:
  168. type: string
  169. default: ASC
  170. enum:
  171. - ASC
  172. - DESC
  173. - name: limit
  174. in: query
  175. required: false
  176. description: Maximum number of items to be returned.
  177. schema:
  178. type: integer
  179. minimum: 1
  180. maximum: 2049
  181. responses:
  182. '200':
  183. description: Successful operation.
  184. content:
  185. application/json:
  186. schema:
  187. $ref: '#/components/schemas/Accounts'
  188. '400':
  189. description: Bad request.
  190. content:
  191. application/json:
  192. schema:
  193. $ref: '#/components/schemas/Error400'
  194. '500':
  195. description: Internal server error.
  196. content:
  197. application/json:
  198. schema:
  199. $ref: '#/components/schemas/Error500'
  200. '/accounts/{accountIndex}':
  201. get:
  202. tags:
  203. - Explorer
  204. summary: Get an account by its index.
  205. description: Get an account by its index.
  206. operationId: getAccount
  207. parameters:
  208. - name: accountIndex
  209. in: path
  210. description: Identifier of an account.
  211. required: true
  212. schema:
  213. $ref: '#/components/schemas/AccountIndex'
  214. responses:
  215. '200':
  216. description: Successful operation.
  217. content:
  218. application/json:
  219. schema:
  220. $ref: '#/components/schemas/Account'
  221. '400':
  222. description: Bad request.
  223. content:
  224. application/json:
  225. schema:
  226. $ref: '#/components/schemas/Error400'
  227. '404':
  228. description: Not found.
  229. content:
  230. application/json:
  231. schema:
  232. $ref: '#/components/schemas/Error404'
  233. '500':
  234. description: Internal server error.
  235. content:
  236. application/json:
  237. schema:
  238. $ref: '#/components/schemas/Error500'
  239. '/exits':
  240. get:
  241. tags:
  242. - Explorer
  243. summary: Get exit information. This information is required to perform a withdraw.
  244. description: Get exit information. This information is required to perform a withdraw.
  245. operationId: getExits
  246. parameters:
  247. - name: tokenId
  248. in: query
  249. required: false
  250. description: Only get exits of specific token
  251. schema:
  252. $ref: '#/components/schemas/TokenId'
  253. - name: hezEthereumAddress
  254. in: query
  255. description: Get exits associated to an Ethereum address. Incompatible with query `BJJ` and `accountIndex`.
  256. required: false
  257. schema:
  258. $ref: '#/components/schemas/HezEthereumAddress'
  259. - name: BJJ
  260. in: query
  261. description: Get exits associated to a BabyJubJub compressed public key. Incompatible with query `hezEthereumAddress` and `accountIndex`.
  262. required: false
  263. schema:
  264. $ref: '#/components/schemas/BJJ'
  265. - name: accountIndex
  266. in: query
  267. description: Get exits associated to a specific account. Incompatible with queries `tokenId`, `hezEthereumAddress` and `BJJ`.
  268. required: false
  269. schema:
  270. $ref: '#/components/schemas/AccountIndex'
  271. - name: batchNum
  272. in: query
  273. description: Get exits from the exit tree of a specific batch.
  274. required: false
  275. schema:
  276. $ref: '#/components/schemas/BatchNum'
  277. - name: onlyPendingWithdraws
  278. in: query
  279. description: Get exits with pending withdrawals.
  280. required: false
  281. schema:
  282. type: boolean
  283. - name: fromItem
  284. in: query
  285. required: false
  286. description: Indicates the desired first item (using the itemId property) to be included in the response.
  287. schema:
  288. type: number
  289. - name: order
  290. in: query
  291. required: false
  292. description: Order of the returned items. Exits will be ordered by increasing (batchNum, accountIndex).
  293. schema:
  294. type: string
  295. default: ASC
  296. enum:
  297. - ASC
  298. - DESC
  299. - name: limit
  300. in: query
  301. required: false
  302. description: Maximum number of items to be returned.
  303. schema:
  304. type: integer
  305. minimum: 1
  306. maximum: 2049
  307. responses:
  308. '200':
  309. description: Successful operation.
  310. content:
  311. application/json:
  312. schema:
  313. $ref: '#/components/schemas/Exits'
  314. '400':
  315. description: Bad request.
  316. content:
  317. application/json:
  318. schema:
  319. $ref: '#/components/schemas/Error400'
  320. '500':
  321. description: Internal server error.
  322. content:
  323. application/json:
  324. schema:
  325. $ref: '#/components/schemas/Error500'
  326. '/exits/{batchNum}/{accountIndex}':
  327. get:
  328. tags:
  329. - Explorer
  330. summary: Get specific exit information.
  331. description: Get exit information form a specific exit tree and account. This information is required to perform a withdraw. Exits are identified with accounIndex and batchNum since every batch that has exits has a different exit tree.
  332. operationId: getExit
  333. parameters:
  334. - name: batchNum
  335. in: path
  336. description: Batch of the exit tree.
  337. required: true
  338. schema:
  339. $ref: '#/components/schemas/BatchNum'
  340. - name: accountIndex
  341. in: path
  342. description: Account identifier.
  343. required: true
  344. schema:
  345. $ref: '#/components/schemas/AccountIndex'
  346. responses:
  347. '200':
  348. description: Successful operation.
  349. content:
  350. application/json:
  351. schema:
  352. $ref: '#/components/schemas/Exit'
  353. '400':
  354. description: Bad request.
  355. content:
  356. application/json:
  357. schema:
  358. $ref: '#/components/schemas/Error400'
  359. '404':
  360. description: Not found.
  361. content:
  362. application/json:
  363. schema:
  364. $ref: '#/components/schemas/Error404'
  365. '500':
  366. description: Internal server error.
  367. content:
  368. application/json:
  369. schema:
  370. $ref: '#/components/schemas/Error500'
  371. '/transactions-pool':
  372. post:
  373. tags:
  374. - Coordinator
  375. summary: Add an L2 transaction to the coordinator's pool.
  376. description: >-
  377. Send L2 transaction. The transaction will be stored in the transaction pool of the coordinator and eventually forged.
  378. operationId: postTx
  379. requestBody:
  380. description: Signed transaction.
  381. required: true
  382. content:
  383. application/json:
  384. schema:
  385. $ref: '#/components/schemas/PostPoolL2Transaction'
  386. responses:
  387. '200':
  388. description: Successful operation.
  389. content:
  390. application/json:
  391. schema:
  392. $ref: '#/components/schemas/TransactionId'
  393. '400':
  394. description: Bad request.
  395. content:
  396. application/json:
  397. schema:
  398. $ref: '#/components/schemas/Error400'
  399. '500':
  400. description: Internal server error.
  401. content:
  402. application/json:
  403. schema:
  404. $ref: '#/components/schemas/Error500'
  405. '/transactions-pool/{id}':
  406. get:
  407. tags:
  408. - Coordinator
  409. summary: Get details and status of a transaction that is in the pool.
  410. description: >-
  411. Get transaction from the pool by its ID. This endpoint is specially useful for tracking the status of a transaction that may not be forged yet.
  412. Only transactions from the pool will be returned.
  413. Note that the transaction pool is different for each coordinator and therefore only a coordinator that has received a specific transaction
  414. will be able to provide information about that transaction.
  415. operationId: getPoolTx
  416. parameters:
  417. - name: id
  418. in: path
  419. description: Transaction identifier.
  420. required: true
  421. schema:
  422. $ref: '#/components/schemas/TransactionId'
  423. responses:
  424. '200':
  425. description: Successful operation.
  426. content:
  427. application/json:
  428. schema:
  429. $ref: '#/components/schemas/PoolL2Transaction'
  430. '400':
  431. description: Bad request.
  432. content:
  433. application/json:
  434. schema:
  435. $ref: '#/components/schemas/Error400'
  436. '404':
  437. description: Not found.
  438. content:
  439. application/json:
  440. schema:
  441. $ref: '#/components/schemas/Error404'
  442. '500':
  443. description: Internal server error.
  444. content:
  445. application/json:
  446. schema:
  447. $ref: '#/components/schemas/Error500'
  448. '/transactions-history':
  449. get:
  450. tags:
  451. - Explorer
  452. summary: Get details and status of transactions that have been forged.
  453. description: >-
  454. Get historical transactions. This endpoint will return all the different types of **forged** transactions, this means that:
  455. * Transactions that are still in the transaction pool of any coordinator are not included. These transactions can be fetched using `GET /transactions-pool/{id}`.
  456. * L1 transactions sent by users that have not been forged yet are not included. These transactions can be fetched using `GET /transactions-history/{id}`.
  457. operationId: getHistoryTxs
  458. parameters:
  459. - name: tokenId
  460. in: query
  461. required: false
  462. description: Only get transactions of specific token
  463. schema:
  464. $ref: '#/components/schemas/TokenId'
  465. - name: hezEthereumAddress
  466. in: query
  467. required: false
  468. description: Only get transactions sent from or to an account associated with an Ethereum address Incompatible with the queries `BJJ` and `accountIndex`.
  469. schema:
  470. $ref: '#/components/schemas/HezEthereumAddress'
  471. - name: BJJ
  472. in: query
  473. description: Only get transactions associated with a BabyJubJub compressed public key. Incompatible with the queries `hezEthereumAddress` and `accountIndex`.
  474. required: false
  475. schema:
  476. $ref: '#/components/schemas/BJJ'
  477. - name: accountIndex
  478. in: query
  479. required: false
  480. description: Only get transactions sent from or to a specific account. Incompatible with the queries `tokenId`, `hezEthereumAddress` and `BJJ`.
  481. schema:
  482. $ref: '#/components/schemas/AccountIndex'
  483. - name: batchNum
  484. in: query
  485. required: false
  486. description: Only get transactions forged in a specific batch.
  487. schema:
  488. $ref: '#/components/schemas/BatchNum'
  489. - name: type
  490. in: query
  491. required: false
  492. description: Only get transactions of a specific type.
  493. schema:
  494. $ref: '#/components/schemas/TransactionType'
  495. - name: fromItem
  496. in: query
  497. required: false
  498. description: Indicates the desired first item (using the itemId property) to be included in the response.
  499. schema:
  500. type: number
  501. - name: order
  502. in: query
  503. required: false
  504. description: Order of the returned items. History transactions will be ordered by (batchNum, position).
  505. schema:
  506. type: string
  507. default: ASC
  508. enum:
  509. - ASC
  510. - DESC
  511. - name: limit
  512. in: query
  513. required: false
  514. description: Maximum number of items to be returned.
  515. schema:
  516. type: integer
  517. minimum: 1
  518. maximum: 2049
  519. responses:
  520. '200':
  521. description: Successful operation.
  522. content:
  523. application/json:
  524. schema:
  525. $ref: '#/components/schemas/HistoryTransactions'
  526. '400':
  527. description: Bad request.
  528. content:
  529. application/json:
  530. schema:
  531. $ref: '#/components/schemas/Error400'
  532. '500':
  533. description: Internal server error.
  534. content:
  535. application/json:
  536. schema:
  537. $ref: '#/components/schemas/Error500'
  538. '/transactions-history/{id}':
  539. get:
  540. tags:
  541. - Explorer
  542. summary: Get details and status of a historical transaction.
  543. description: >-
  544. 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.
  545. operationId: getHistoryTx
  546. parameters:
  547. - name: id
  548. in: path
  549. description: Transaction identifier.
  550. required: true
  551. schema:
  552. $ref: '#/components/schemas/TransactionId'
  553. responses:
  554. '200':
  555. description: Successful operation.
  556. content:
  557. application/json:
  558. schema:
  559. $ref: '#/components/schemas/HistoryTransaction'
  560. '400':
  561. description: Bad request.
  562. content:
  563. application/json:
  564. schema:
  565. $ref: '#/components/schemas/Error400'
  566. '404':
  567. description: Not found.
  568. content:
  569. application/json:
  570. schema:
  571. $ref: '#/components/schemas/Error404'
  572. '500':
  573. description: Internal server error.
  574. content:
  575. application/json:
  576. schema:
  577. $ref: '#/components/schemas/Error500'
  578. '/batches':
  579. get:
  580. tags:
  581. - Explorer
  582. summary: Get information about forged batches.
  583. description: >-
  584. Get information about forged batches.
  585. operationId: getBatches
  586. parameters:
  587. - name: minBatchNum
  588. in: query
  589. required: false
  590. description: Include only `batchNum > minBatchNum` batches.
  591. schema:
  592. $ref: '#/components/schemas/BatchNum'
  593. - name: maxBatchNum
  594. in: query
  595. required: false
  596. description: Include only `batchNum < maxBatchNum` batches.
  597. schema:
  598. type: number
  599. - name: slotNum
  600. in: query
  601. required: false
  602. description: Include only batches that were forged within the specified slot.
  603. schema:
  604. $ref: '#/components/schemas/SlotNum'
  605. - name: forgerAddr
  606. in: query
  607. required: false
  608. description: Include only batches forged by `forgerAddr`
  609. schema:
  610. $ref: '#/components/schemas/EthereumAddress'
  611. - name: fromItem
  612. in: query
  613. required: false
  614. description: Indicates the desired first item (using the itemId property) to be included in the response.
  615. schema:
  616. type: number
  617. - name: order
  618. in: query
  619. required: false
  620. description: Order of the returned items. Batches will be ordered by increasing `batchNum`.
  621. schema:
  622. type: string
  623. default: ASC
  624. enum:
  625. - ASC
  626. - DESC
  627. - name: limit
  628. in: query
  629. required: false
  630. description: Maximum number of items to be returned.
  631. schema:
  632. type: integer
  633. minimum: 1
  634. maximum: 2049
  635. responses:
  636. '200':
  637. description: Successful operation.
  638. content:
  639. application/json:
  640. schema:
  641. $ref: '#/components/schemas/Batches'
  642. '400':
  643. description: Bad request.
  644. content:
  645. application/json:
  646. schema:
  647. $ref: '#/components/schemas/Error400'
  648. '500':
  649. description: Internal server error.
  650. content:
  651. application/json:
  652. schema:
  653. $ref: '#/components/schemas/Error500'
  654. '/batches/{batchNum}':
  655. get:
  656. tags:
  657. - Explorer
  658. summary: Get a specific batch.
  659. description: >-
  660. Get a specific batch.
  661. operationId: getBatch
  662. parameters:
  663. - name: batchNum
  664. in: path
  665. description: Batch identifier.
  666. required: true
  667. schema:
  668. $ref: '#/components/schemas/BatchNum'
  669. responses:
  670. '200':
  671. description: Successful operation
  672. content:
  673. application/json:
  674. schema:
  675. $ref: '#/components/schemas/Batch'
  676. '400':
  677. description: Bad request.
  678. content:
  679. application/json:
  680. schema:
  681. $ref: '#/components/schemas/Error400'
  682. '404':
  683. description: Not found.
  684. content:
  685. application/json:
  686. schema:
  687. $ref: '#/components/schemas/Error404'
  688. '500':
  689. description: Internal server error.
  690. content:
  691. application/json:
  692. schema:
  693. $ref: '#/components/schemas/Error500'
  694. '/full-batches/{batchNum}':
  695. get:
  696. tags:
  697. - Explorer
  698. summary: Get a full batch.
  699. description: >-
  700. Get a specific batch, including the associated transactions. The object returned in this method can be a bit heavy.
  701. If you're devloping a front end, you may consider using a combinaton of `GET /batches/{batchnum}` and `GET /history-transactions?batchNum={batchNum}`.
  702. operationId: getFullBatch
  703. parameters:
  704. - name: batchNum
  705. in: path
  706. description: Batch identifier
  707. required: true
  708. schema:
  709. $ref: '#/components/schemas/BatchNum'
  710. responses:
  711. '200':
  712. description: successful operation
  713. content:
  714. application/json:
  715. schema:
  716. $ref: '#/components/schemas/FullBatch'
  717. '400':
  718. description: Bad request.
  719. content:
  720. application/json:
  721. schema:
  722. $ref: '#/components/schemas/Error400'
  723. '404':
  724. description: Not found.
  725. content:
  726. application/json:
  727. schema:
  728. $ref: '#/components/schemas/Error404'
  729. '500':
  730. description: Internal server error.
  731. content:
  732. application/json:
  733. schema:
  734. $ref: '#/components/schemas/Error500'
  735. '/slots':
  736. get:
  737. tags:
  738. - Explorer
  739. summary: Get information about slots.
  740. description: >-
  741. Get information about slots.
  742. operationId: getSlots
  743. parameters:
  744. - name: minSlotNum
  745. in: query
  746. required: false
  747. description: Only include slots with `slotNum >= minSlotNum`. By default, `minSlotNum = 0`.
  748. schema:
  749. $ref: '#/components/schemas/SlotNum'
  750. - name: maxSlotNum
  751. in: query
  752. required: false
  753. description: Only include slots with `slotNum <= maxSlotNum`.
  754. schema:
  755. $ref: '#/components/schemas/SlotNum'
  756. - name: wonByEthereumAddress
  757. in: query
  758. required: false
  759. description: Only include slots won by a coordinator whose `bidderAddr == wonByEthereumAddress`.
  760. schema:
  761. $ref: '#/components/schemas/EthereumAddress'
  762. - name: finishedAuction
  763. in: query
  764. required: false
  765. description: If set to true, only include slots whose auction has finished.
  766. schema:
  767. type: boolean
  768. - name: fromItem
  769. in: query
  770. required: false
  771. description: Indicates the desired first item (using the itemId property) to be included in the response.
  772. schema:
  773. type: number
  774. - name: order
  775. in: query
  776. required: false
  777. description: Order of the returned items. Slots will be ordered by increasing `slotNum`.
  778. schema:
  779. type: string
  780. default: ASC
  781. enum:
  782. - ASC
  783. - DESC
  784. - name: limit
  785. in: query
  786. required: false
  787. description: Maximum number of items to be returned.
  788. schema:
  789. type: integer
  790. minimum: 1
  791. maximum: 2049
  792. responses:
  793. '200':
  794. description: Successful operation.
  795. content:
  796. application/json:
  797. schema:
  798. $ref: '#/components/schemas/Slots'
  799. '400':
  800. description: Bad request.
  801. content:
  802. application/json:
  803. schema:
  804. $ref: '#/components/schemas/Error400'
  805. '500':
  806. description: Internal server error.
  807. content:
  808. application/json:
  809. schema:
  810. $ref: '#/components/schemas/Error500'
  811. '/slots/{slotNum}':
  812. get:
  813. tags:
  814. - Explorer
  815. summary: Get information about a specific slot.
  816. description: >-
  817. Get information about a specific slot.
  818. operationId: getSlot
  819. parameters:
  820. - name: slotNum
  821. in: path
  822. required: true
  823. description: Identifier of the slot.
  824. schema:
  825. $ref: '#/components/schemas/SlotNum'
  826. responses:
  827. '200':
  828. description: Successful operation.
  829. content:
  830. application/json:
  831. schema:
  832. $ref: '#/components/schemas/Slot'
  833. '400':
  834. description: Bad request.
  835. content:
  836. application/json:
  837. schema:
  838. $ref: '#/components/schemas/Error400'
  839. '404':
  840. description: Not found.
  841. content:
  842. application/json:
  843. schema:
  844. $ref: '#/components/schemas/Error404'
  845. '500':
  846. description: Internal server error.
  847. content:
  848. application/json:
  849. schema:
  850. $ref: '#/components/schemas/Error500'
  851. '/bids':
  852. get:
  853. tags:
  854. - Explorer
  855. summary: Get a list of bids.
  856. description: >-
  857. Get a list of bids. It's necessary to provide at least one of the following filters: `slotNum`, `bidderAddr`.
  858. operationId: getSlotBids
  859. parameters:
  860. - name: slotNum
  861. in: query
  862. description: Slot identifier. Specify the auction where the returned bids were made.
  863. required: false
  864. schema:
  865. $ref: '#/components/schemas/SlotNum'
  866. - name: bidderAddr
  867. in: query
  868. description: Get only bids made by a coordinator identified by its bidder address. In this case, the bids will be returned in the order that the coordinator made them.
  869. required: false
  870. schema:
  871. $ref: '#/components/schemas/EthereumAddress'
  872. - name: fromItem
  873. in: query
  874. required: false
  875. description: Indicates the desired first item (using the itemId property) to be included in the response.
  876. schema:
  877. type: number
  878. - name: order
  879. in: query
  880. required: false
  881. description: Order of the returned items. Bids will be ordered by increasing (slotNum, bidValue)`.
  882. schema:
  883. type: string
  884. default: ASC
  885. enum:
  886. - ASC
  887. - DESC
  888. - name: limit
  889. in: query
  890. required: false
  891. description: Maximum number of items to be returned.
  892. schema:
  893. type: integer
  894. minimum: 1
  895. maximum: 2049
  896. responses:
  897. '200':
  898. description: Successful operation
  899. content:
  900. application/json:
  901. schema:
  902. $ref: '#/components/schemas/Bids'
  903. '400':
  904. description: Bad request.
  905. content:
  906. application/json:
  907. schema:
  908. $ref: '#/components/schemas/Error400'
  909. '500':
  910. description: Internal server error.
  911. content:
  912. application/json:
  913. schema:
  914. $ref: '#/components/schemas/Error500'
  915. '/state':
  916. get:
  917. tags:
  918. - Explorer
  919. summary: Return information that represents the current state of the network.
  920. description: Return information that represents the current state of the network. It also includes metrics and statistics.
  921. operationId: getState
  922. responses:
  923. '200':
  924. description: Successful operation.
  925. content:
  926. application/json:
  927. schema:
  928. $ref: '#/components/schemas/State'
  929. '400':
  930. description: Bad request.
  931. content:
  932. application/json:
  933. schema:
  934. $ref: '#/components/schemas/Error400'
  935. '500':
  936. description: Internal server error.
  937. content:
  938. application/json:
  939. schema:
  940. $ref: '#/components/schemas/Error500'
  941. '/config':
  942. get:
  943. tags:
  944. - Explorer
  945. summary: Return constant configuration of the network.
  946. description: Return constant configuration of the network.
  947. operationId: getConfig
  948. responses:
  949. '200':
  950. description: Successful operation.
  951. content:
  952. application/json:
  953. schema:
  954. $ref: '#/components/schemas/Config'
  955. '500':
  956. description: Internal server error.
  957. content:
  958. application/json:
  959. schema:
  960. $ref: '#/components/schemas/Error500'
  961. '/tokens':
  962. get:
  963. tags:
  964. - Explorer
  965. summary: Get information of the supported tokens in the Hermez Network.
  966. description: Get information of the supported tokens in the Hermez Network.
  967. operationId: getTokens
  968. parameters:
  969. - name: ids
  970. in: query
  971. required: false
  972. description: Include only specific tokens by their Hermez identifiers.
  973. schema:
  974. type: string
  975. description: Comma separated list of token identifiers
  976. example: "2,44,689"
  977. - name: symbols
  978. in: query
  979. required: false
  980. description: Include only specific tokens by their symbols.
  981. schema:
  982. type: string
  983. description: Comma separated list of token symbols.
  984. example: "DAI,NEC,UMA"
  985. - name: name
  986. in: query
  987. required: false
  988. description: Include token(s) by their names (or a substring of the name).
  989. schema:
  990. type: string
  991. - name: fromItem
  992. in: query
  993. required: false
  994. description: Indicates the desired first item (using the itemId property) to be included in the response.
  995. schema:
  996. type: number
  997. - name: order
  998. in: query
  999. required: false
  1000. description: Order of the returned items. Tokens will be ordered by increasing tokenID.
  1001. schema:
  1002. type: string
  1003. default: ASC
  1004. enum:
  1005. - ASC
  1006. - DESC
  1007. - name: limit
  1008. in: query
  1009. required: false
  1010. description: Maximum number of items to be returned.
  1011. schema:
  1012. type: integer
  1013. minimum: 1
  1014. maximum: 2049
  1015. responses:
  1016. '200':
  1017. description: Successful operation.
  1018. content:
  1019. application/json:
  1020. schema:
  1021. $ref: '#/components/schemas/Tokens'
  1022. '400':
  1023. description: Bad request.
  1024. content:
  1025. application/json:
  1026. schema:
  1027. $ref: '#/components/schemas/Error400'
  1028. '500':
  1029. description: Internal server error.
  1030. content:
  1031. application/json:
  1032. schema:
  1033. $ref: '#/components/schemas/Error500'
  1034. '/tokens/{id}':
  1035. get:
  1036. tags:
  1037. - Explorer
  1038. summary: Get information of a token supported by Hermez Network.
  1039. description: Get information of a token supported by Hermez Network.
  1040. operationId: getToken
  1041. parameters:
  1042. - name: id
  1043. in: path
  1044. description: Token identifier
  1045. required: true
  1046. schema:
  1047. $ref: '#/components/schemas/TokenId'
  1048. responses:
  1049. '200':
  1050. description: Successful operation.
  1051. content:
  1052. application/json:
  1053. schema:
  1054. $ref: '#/components/schemas/Token'
  1055. '400':
  1056. description: Bad request.
  1057. content:
  1058. application/json:
  1059. schema:
  1060. $ref: '#/components/schemas/Error400'
  1061. '404':
  1062. description: Not found.
  1063. content:
  1064. application/json:
  1065. schema:
  1066. $ref: '#/components/schemas/Error404'
  1067. '500':
  1068. description: Internal server error.
  1069. content:
  1070. application/json:
  1071. schema:
  1072. $ref: '#/components/schemas/Error500'
  1073. '/coordinators':
  1074. get:
  1075. tags:
  1076. - Explorer
  1077. summary: Get information about coordinators.
  1078. description: Get information about coordinators.
  1079. operationId: getCoordinators
  1080. parameters:
  1081. - name: forgerAddr
  1082. in: query
  1083. required: false
  1084. description: Get coordinators by it's forger address.
  1085. schema:
  1086. $ref: '#/components/schemas/EthereumAddress'
  1087. - name: bidderAddr
  1088. in: query
  1089. required: false
  1090. description: Get coordinators by it's bidder address.
  1091. schema:
  1092. $ref: '#/components/schemas/EthereumAddress'
  1093. - name: fromItem
  1094. in: query
  1095. required: false
  1096. description: Indicates the desired first item (using the itemId property) to be included in the response.
  1097. schema:
  1098. type: number
  1099. - name: order
  1100. in: query
  1101. required: false
  1102. description: Order of the returned items. Coordinators will be ordered by increasing (ethereumBlock, forgerAddr).
  1103. schema:
  1104. type: string
  1105. default: ASC
  1106. enum:
  1107. - ASC
  1108. - DESC
  1109. - name: limit
  1110. in: query
  1111. required: false
  1112. description: Maximum number of items to be returned.
  1113. schema:
  1114. type: integer
  1115. minimum: 1
  1116. maximum: 2049
  1117. responses:
  1118. '200':
  1119. description: Successful operation.
  1120. content:
  1121. application/json:
  1122. schema:
  1123. $ref: '#/components/schemas/Coordinators'
  1124. '400':
  1125. description: Bad request.
  1126. content:
  1127. application/json:
  1128. schema:
  1129. $ref: '#/components/schemas/Error400'
  1130. '500':
  1131. description: Internal server error.
  1132. content:
  1133. application/json:
  1134. schema:
  1135. $ref: '#/components/schemas/Error500'
  1136. components:
  1137. schemas:
  1138. ItemId:
  1139. type: integer
  1140. description: Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
  1141. PostPoolL2Transaction:
  1142. type: object
  1143. description: L2 transaction to be posted.
  1144. properties:
  1145. id:
  1146. $ref: '#/components/schemas/TransactionId'
  1147. type:
  1148. $ref: '#/components/schemas/TransactionTypeL2'
  1149. tokenId:
  1150. $ref: '#/components/schemas/TokenId'
  1151. fromAccountIndex:
  1152. $ref: '#/components/schemas/AccountIndex'
  1153. toAccountIndex:
  1154. type: string
  1155. description: >-
  1156. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1157. The identifier is built using: `hez:` + `token symbol:` + `index`. If this is provided, toHezEthereumAddress and toBjj
  1158. must be null. To perform an exit the value hez:EXIT:1 must be used.
  1159. example: null
  1160. nullable: true
  1161. toHezEthereumAddress:
  1162. type: string
  1163. description: "Address of an Etherum account linked to the Hermez Network. If this is provided, toAccountIndex and toBjj must be null."
  1164. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1165. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1166. nullable: true
  1167. toBjj:
  1168. type: string
  1169. description: >-
  1170. BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes.
  1171. If this is provided, toAccountIndex must be null and toHezEthereumAddress must be hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.
  1172. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1173. example: null
  1174. nullable: true
  1175. amount:
  1176. allOf:
  1177. - $ref: '#/components/schemas/BigInt'
  1178. - description: Amount of tokens to be sent.
  1179. example: "6300000000000000000"
  1180. fee:
  1181. $ref: '#/components/schemas/FeeSelector'
  1182. nonce:
  1183. $ref: '#/components/schemas/Nonce'
  1184. signature:
  1185. allOf:
  1186. - $ref: '#/components/schemas/BJJSignature'
  1187. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1188. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1189. requestFromAccountIndex:
  1190. type: string
  1191. description: References the `fromAccountIndex` of the requested transaction.
  1192. example: null
  1193. nullable: true
  1194. requestToAccountIndex:
  1195. type: string
  1196. description: References the `toAccountIndex` of the requested transaction.
  1197. example: null
  1198. nullable: true
  1199. requestToHezEthereumAddress:
  1200. type: string
  1201. description: References the `toHezEthereumAddress` of the requested transaction.
  1202. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1203. example: null
  1204. nullable: true
  1205. requestToBjj:
  1206. type: string
  1207. description: References the `toBjj` of the requested transaction.
  1208. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1209. example: null
  1210. nullable: true
  1211. requestTokenId:
  1212. type: integer
  1213. description: References the `tokenId` of the requested transaction.
  1214. example: null
  1215. nullable: true
  1216. requestAmount:
  1217. type: string
  1218. description: References the `amount` of the requested transaction.
  1219. example: null
  1220. nullable: true
  1221. requestFee:
  1222. type: integer
  1223. description: References the `fee` of the requested transaction.
  1224. example: null
  1225. nullable: true
  1226. requestNonce:
  1227. type: integer
  1228. description: References the `nonce` of the requested transaction.
  1229. example: null
  1230. nullable: true
  1231. example:
  1232. id: '0x020000000001000000000006'
  1233. type: Transfer
  1234. tokenId: 6
  1235. fromAccountIndex: hez:DAI:256
  1236. toAccountIndex: hez:DAI:257
  1237. toHezEthereumAddress:
  1238. toBjj:
  1239. amount: '100000000000000'
  1240. fee: 0
  1241. nonce: 6
  1242. signature: 1a79dd5e661d58266901a0de8afb046b466c4c1af937100f627a421771f2911fa3fde8ea2e272b4802a8b1f1229689292acd6f7e8ab4cadc4ab37b6b9e13a101
  1243. additionalProperties: false
  1244. required:
  1245. - id
  1246. - type
  1247. - tokenId
  1248. - fromAccountIndex
  1249. - amount
  1250. - fee
  1251. - nonce
  1252. - signature
  1253. PoolL2Transaction:
  1254. type: object
  1255. properties:
  1256. id:
  1257. $ref: '#/components/schemas/TransactionId'
  1258. type:
  1259. $ref: '#/components/schemas/TransactionTypeL2'
  1260. fromAccountIndex:
  1261. $ref: '#/components/schemas/AccountIndex'
  1262. fromHezEthereumAddress:
  1263. type: string
  1264. description: "Address of an Etherum account linked to the Hermez Network."
  1265. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1266. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1267. nullable: true
  1268. fromBJJ:
  1269. type: string
  1270. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1271. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1272. example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
  1273. nullable: true
  1274. toAccountIndex:
  1275. type: string
  1276. description: >-
  1277. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1278. The identifier is built using: `hez:` + `token symbol:` + `index`
  1279. example: "hez:DAI:309"
  1280. nullable: true
  1281. toHezEthereumAddress:
  1282. type: string
  1283. description: "Address of an Etherum account linked to the Hermez Network."
  1284. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1285. example: null
  1286. nullable: true
  1287. toBjj:
  1288. type: string
  1289. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1290. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1291. example: null
  1292. nullable: true
  1293. amount:
  1294. allOf:
  1295. - $ref: '#/components/schemas/BigInt'
  1296. - description: Amount of tokens to be sent.
  1297. example: "6303020000000000000"
  1298. fee:
  1299. $ref: '#/components/schemas/FeeSelector'
  1300. nonce:
  1301. $ref: '#/components/schemas/Nonce'
  1302. state:
  1303. $ref: '#/components/schemas/PoolL2TransactionState'
  1304. signature:
  1305. allOf:
  1306. - $ref: '#/components/schemas/BJJSignature'
  1307. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1308. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1309. timestamp:
  1310. type: string
  1311. description: Moment in which the transaction was added to the pool.
  1312. format: date-time
  1313. batchNum:
  1314. type: integer
  1315. description: Identifier of a batch. Every new forged batch increases by one the batchNum, starting at 0.
  1316. minimum: 0
  1317. maximum: 4294967295
  1318. nullable: true
  1319. example: null
  1320. requestFromAccountIndex:
  1321. type: string
  1322. description: >-
  1323. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1324. The identifier is built using: `hez:` + `token symbol:` + `index`
  1325. nullable: true
  1326. example: null
  1327. requestToAccountIndex:
  1328. type: string
  1329. description: >-
  1330. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1331. The identifier is built using: `hez:` + `token symbol:` + `index`
  1332. nullable: true
  1333. example: null
  1334. requestToHezEthereumAddress:
  1335. type: string
  1336. description: "Address of an Etherum account linked to the Hermez Network."
  1337. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1338. nullable: true
  1339. example: null
  1340. requestToBJJ:
  1341. type: string
  1342. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1343. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1344. nullable: true
  1345. example: null
  1346. requestTokenId:
  1347. type: integer
  1348. description: References the `tokenId` of the requested transaction.
  1349. example: null
  1350. nullable: true
  1351. requestAmount:
  1352. type: string
  1353. description: BigInt is an integer encoded as a string for numbers that are very large.
  1354. nullable: true
  1355. example: null
  1356. requestFee:
  1357. type: integer
  1358. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1359. minimum: 0
  1360. maximum: 256
  1361. nullable: true
  1362. example: null
  1363. requestNonce:
  1364. type: integer
  1365. description: Number that can only be used once per account. Increments by one with each transaction.
  1366. minimum: 0
  1367. maximum: 1.84467440737096e+19
  1368. nullable: true
  1369. example: null
  1370. token:
  1371. $ref: '#/components/schemas/Token'
  1372. example:
  1373. amount: '100000000000000'
  1374. batchNum:
  1375. fee: 0
  1376. fromAccountIndex: hez:SCC:256
  1377. fromBJJ: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1378. fromHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1379. id: '0x020000000001000000000006'
  1380. nonce: 6
  1381. requestAmount:
  1382. requestFee: 0
  1383. requestFromAccountIndex:
  1384. requestNonce: 0
  1385. requestToAccountIndex:
  1386. requestToBJJ:
  1387. requestToHezEthereumAddress:
  1388. requestTokenId:
  1389. signature: 5ee9c7b5baa243ba282d18596a55cc357b01513eaed75165365f802102cce4a7a1dd35e3ab31cf9039e2b8a9f570d935115be9379a3dd47813dfc014031ab201
  1390. state: pend
  1391. timestamp: '2020-11-17T13:58:54.422232Z'
  1392. toAccountIndex: hez:SCC:257
  1393. toBjj: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1394. toHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1395. token:
  1396. USD: 23.74
  1397. decimals: 7
  1398. ethereumAddress: '0x0000000000000000000000000000000000000006'
  1399. ethereumBlockNum: 2
  1400. fiatUpdate:
  1401. id: 6
  1402. itemId: 7
  1403. name: Some Cool Coin
  1404. symbol: 'SCC'
  1405. type: Transfer
  1406. required:
  1407. - id
  1408. - type
  1409. - fromAccountIndex
  1410. - fromHezEthereumAddress
  1411. - fromBJJ
  1412. - toAccountIndex
  1413. - toHezEthereumAddress
  1414. - toBjj
  1415. - amount
  1416. - fee
  1417. - nonce
  1418. - state
  1419. - signature
  1420. - timestamp
  1421. - batchNum
  1422. - requestFromAccountIndex
  1423. - requestToAccountIndex
  1424. - requestToHezEthereumAddress
  1425. - requestToBJJ
  1426. - requestTokenId
  1427. - requestAmount
  1428. - requestFee
  1429. - requestNonce
  1430. - token
  1431. TransactionId:
  1432. type: string
  1433. description: Identifier for transactions. Used for any kind of transaction (both L1 and L2). More info on how the identifiers are built [here](https://idocs.hermez.io/#/spec/architecture/db/README?id=txid)
  1434. example: "0x00000000000001e240004700"
  1435. EthereumAddress:
  1436. type: string
  1437. description: "Address of an Etherum account."
  1438. pattern: "^0x[a-fA-F0-9]{40}$"
  1439. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1440. HezEthereumAddress:
  1441. type: string
  1442. description: "Address of an Etherum account linked to the Hermez Network."
  1443. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1444. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1445. BJJ:
  1446. type: string
  1447. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1448. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1449. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1450. AccountIndex:
  1451. type: string
  1452. description: >-
  1453. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1454. The identifier is built using: `hez:` + `token symbol:` + `index`
  1455. example: "hez:DAI:4444"
  1456. TransactionType:
  1457. type: string
  1458. description: Type of transaction.
  1459. enum:
  1460. - Exit
  1461. - Transfer
  1462. - Deposit
  1463. - CreateAccountDeposit
  1464. - CreateAccountDepositTransfer
  1465. - DepositTransfer
  1466. - ForceTransfer
  1467. - ForceExit
  1468. - TransferToEthAddr
  1469. - TransferToBJJ
  1470. TransactionTypeL2:
  1471. type: string
  1472. description: Type of transaction.
  1473. enum:
  1474. - Exit
  1475. - Transfer
  1476. - TransferToEthAddr
  1477. - TransferToBJJ
  1478. TokenId:
  1479. type: integer
  1480. description: Identifier of a token registered in the network.
  1481. minimum: 0
  1482. maximum: 4294967295
  1483. example: 98765
  1484. BigInt:
  1485. type: string
  1486. description: BigInt is an integer encoded as a string for numbers that are very large.
  1487. example: "8708856933496328593"
  1488. pattern: "^\\d+$"
  1489. FeeSelector:
  1490. type: integer
  1491. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1492. minimum: 0
  1493. maximum: 256
  1494. example: 36
  1495. Nonce:
  1496. type: integer
  1497. description: Number that can only be used once per account, increments by one at each transaction.
  1498. minimum: 0
  1499. maximum: 1.84467440737096e+19
  1500. example: 121
  1501. PoolL2TransactionState:
  1502. type: string
  1503. description: >
  1504. State of a L2 transaction from the coordinator pool.
  1505. * pend: Pending
  1506. * fing: Forging
  1507. * fged: Forged
  1508. * invl: Invalid
  1509. enum:
  1510. - pend
  1511. - fing
  1512. - fged
  1513. - invl
  1514. ETHSignature:
  1515. type: string
  1516. description: Ethereum signature.
  1517. pattern: "^0x[a-fA-F0-9]{130}$"
  1518. example: "0xf9161cd688394772d93aa3e7b3f8f9553ca4f94f65b7cece93ed4a239d5c0b4677dca6d1d459e3a5c271a34de735d4664a43e5a8960a9a6e027d12c562dd448e1c"
  1519. BJJSignature:
  1520. type: string
  1521. description: BabyJubJub compressed signature.
  1522. pattern: "^[a-fA-F0-9]{128}$"
  1523. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1524. BatchNum:
  1525. type: integer
  1526. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1527. minimum: 0
  1528. maximum: 4294967295
  1529. example: 5432
  1530. AccountCreationAuthorizationPost:
  1531. type: object
  1532. properties:
  1533. hezEthereumAddress:
  1534. $ref: '#/components/schemas/HezEthereumAddress'
  1535. bjj:
  1536. $ref: '#/components/schemas/BJJ'
  1537. signature:
  1538. $ref: '#/components/schemas/ETHSignature'
  1539. example:
  1540. hezEthereumAddress: hez:0xb5270eB4ae11c6fAAff6F5fa0A5202B8d963634C
  1541. bjj: hez:hg2Ydsb8O66H-steBR3cnHl944ua7E-PkTJ_SbPBBg5r
  1542. signature: '0xb7cf237c4a2ff3d4df57752e7b9deb236fa384f03a79d39acf17ec5f8d12a3cf00b017c2466611310cb2bacac68460e96778278646842c6d2bcb79979271c28501'
  1543. required:
  1544. - hezEthereumAddress
  1545. - bjj
  1546. - signature
  1547. AccountCreationAuthorization:
  1548. type: object
  1549. properties:
  1550. timestamp:
  1551. type: string
  1552. format: date-time
  1553. hezEthereumAddress:
  1554. $ref: '#/components/schemas/HezEthereumAddress'
  1555. bjj:
  1556. $ref: '#/components/schemas/BJJ'
  1557. signature:
  1558. $ref: '#/components/schemas/ETHSignature'
  1559. example:
  1560. hezEthereumAddress: hez:0x74a549b410d01d9eC56346aE52b8550515B283b2
  1561. bjj: hez:dEZ-Tj7d5h0TAqbnRTTYURYDEo5KZzB87_2WknUU8gCN
  1562. signature: '0x8db6db2ad6cbe21297fb8ee01c59b01b52d4df7ea92a0f0dee0be0075a8f224a06b367407c8f402cfe0490c142a1c92da3fc29b51162ae160d35e1577d3071bb01'
  1563. timestamp: '2020-11-17T13:25:36.784295Z'
  1564. additionalProperties: false
  1565. required:
  1566. - timestamp
  1567. - hezEthereumAddress
  1568. - bjj
  1569. - signature
  1570. HistoryTransaction:
  1571. type: object
  1572. description: Transaction of the Hermez Network
  1573. properties:
  1574. L1orL2:
  1575. type: string
  1576. enum:
  1577. - L1
  1578. - L2
  1579. id:
  1580. $ref: '#/components/schemas/TransactionId'
  1581. itemId:
  1582. $ref: '#/components/schemas/ItemId'
  1583. type:
  1584. $ref: '#/components/schemas/TransactionType'
  1585. position:
  1586. $ref: '#/components/schemas/TransactionPosition'
  1587. fromAccountIndex:
  1588. type: string
  1589. description: >-
  1590. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1591. The identifier is built using: `hez:` + `token symbol:` + `index`
  1592. example: "hez:DAI:4444"
  1593. nullable: true
  1594. fromHezEthereumAddress:
  1595. type: string
  1596. description: "Address of an Etherum account linked to the Hermez Network."
  1597. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1598. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1599. nullable: true
  1600. fromBJJ:
  1601. type: string
  1602. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1603. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1604. example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
  1605. nullable: true
  1606. toAccountIndex:
  1607. allOf:
  1608. - $ref: '#/components/schemas/AccountIndex'
  1609. - example: "hez:DAI:672"
  1610. toHezEthereumAddress:
  1611. type: string
  1612. description: "Address of an Etherum account linked to the Hermez Network."
  1613. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1614. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1615. nullable: true
  1616. toBJJ:
  1617. type: string
  1618. description: "BabyJubJub compressed public key, encoded as base64 URL (RFC 4648), which result in 33 bytes. The padding byte is replaced by a sum of the encoded bytes."
  1619. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1620. example: "hez:f1J78_6uqTyjX6jrVCqN4RFeRBnWQAGl477ZFtOnH6Sm"
  1621. nullable: true
  1622. amount:
  1623. allOf:
  1624. - $ref: '#/components/schemas/BigInt'
  1625. - description: Amount of tokens to be sent.
  1626. - example: "4903020000000000000"
  1627. batchNum:
  1628. type: integer
  1629. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1630. minimum: 0
  1631. maximum: 4294967295
  1632. example: 5432
  1633. nullable: true
  1634. historicUSD:
  1635. type: number
  1636. description: Value in USD at the moment the transaction was forged.
  1637. example: 49.7
  1638. nullable: true
  1639. timestamp:
  1640. type: string
  1641. format: date-time
  1642. description: In the case of L1 indicates the moment where the transaction was added in the smart contract. For L2 indicates when the transaction was forged.
  1643. token:
  1644. $ref: '#/components/schemas/Token'
  1645. L1Info:
  1646. type: object
  1647. description: Additional information that only applies to L1 transactions.
  1648. nullable: true
  1649. properties:
  1650. toForgeL1TransactionsNum:
  1651. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1652. userOrigin:
  1653. type: boolean
  1654. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1655. depositAmount:
  1656. allOf:
  1657. - $ref: '#/components/schemas/BigInt'
  1658. - description: Tokens transfered from L1 to L2.
  1659. - example: "4900000000000000000"
  1660. amountSuccess:
  1661. type: boolean
  1662. description: >-
  1663. Indicates if the amount specified by the user has been sent propperly. If false, the amount that actualy has been sent is 0.
  1664. If the transaction hasn't been forged yet (`batchNum == null`), this value will be false, as it's unknown if it has succeed or not.
  1665. An example were this value could be false: a user send a `DepositTransfer` transaction, but when the tx is forged there are not
  1666. enougth founds in the account. In this case the transfer part of the transaction won't be effective making the amount have a real value of 0.
  1667. example: true
  1668. depositAmountSuccess:
  1669. type: boolean
  1670. description: >-
  1671. Indicates if the deposit amount specified by the user has been sent propperly. If false, the deposit amount that actualy has been sent is 0.
  1672. If the transaction hasn't been forged yet (`batchNum == null`), this value will be false, as it's unknown if it has succeed or not.
  1673. An example were this value could be false: a user send a `Deposit` transaction, but when the tx is forged the token id is not registered on the network.
  1674. In this case transaction won't be effective making the deposit amount have a real value of 0.
  1675. example: true
  1676. historicDepositAmountUSD:
  1677. type: number
  1678. description: Deposit amount in USD, at the moment the transaction was made.
  1679. example: 3.897
  1680. nullable: true
  1681. ethereumBlockNum:
  1682. allOf:
  1683. - $ref: '#/components/schemas/EthBlockNum'
  1684. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1685. - example: 258723049
  1686. required:
  1687. - toForgeL1TransactionsNum
  1688. - userOrigin
  1689. - depositAmount
  1690. - amountSuccess
  1691. - depositAmountSuccess
  1692. - historicDepositAmountUSD
  1693. - ethereumBlockNum
  1694. additionalProperties: false
  1695. L2Info:
  1696. type: object
  1697. description: Additional information that only applies to L2 transactions.
  1698. nullable: true
  1699. properties:
  1700. fee:
  1701. $ref: '#/components/schemas/FeeSelector'
  1702. historicFeeUSD:
  1703. type: number
  1704. description: Fee in USD, at the moment the transaction was forged.
  1705. example: 263.89
  1706. nullable: true
  1707. nonce:
  1708. $ref: '#/components/schemas/Nonce'
  1709. example: null
  1710. required:
  1711. - fee
  1712. - historicFeeUSD
  1713. - nonce
  1714. additionalProperties: false
  1715. example:
  1716. L1Info:
  1717. ethereumBlockNum: 1
  1718. historicDepositAmountUSD: 232.47
  1719. depositAmount: '261'
  1720. toForgeL1TransactionsNum: 10
  1721. userOrigin: true
  1722. L1orL2: L1
  1723. L2Info:
  1724. amount: '261'
  1725. batchNum: 1
  1726. fromAccountIndex: hez:ETH:276
  1727. fromBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1728. fromHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1729. historicUSD: 3784.19
  1730. id: '0x00000000000000000a000400'
  1731. itemId: 2
  1732. position: 4
  1733. timestamp: '2020-11-17T14:08:12.197554Z'
  1734. toAccountIndex: hez:ETH:276
  1735. toBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1736. toHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1737. token:
  1738. USD: 234.56
  1739. decimals: 18
  1740. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1741. ethereumBlockNum: 0
  1742. fiatUpdate:
  1743. id: 0
  1744. itemId: 1
  1745. name: Ether
  1746. symbol: ETH
  1747. type: CreateAccountDeposit
  1748. required:
  1749. - L1orL2
  1750. - id
  1751. - itemId
  1752. - type
  1753. - position
  1754. - fromAccountIndex
  1755. - fromHezEthereumAddress
  1756. - fromBJJ
  1757. - toAccountIndex
  1758. - toHezEthereumAddress
  1759. - toBJJ
  1760. - amount
  1761. - batchNum
  1762. - historicUSD
  1763. - timestamp
  1764. - token
  1765. - L1Info
  1766. - L2Info
  1767. additionalProperties: false
  1768. HistoryTransactions:
  1769. type: object
  1770. properties:
  1771. transactions:
  1772. type: array
  1773. description: List of history transactions.
  1774. items:
  1775. $ref: '#/components/schemas/HistoryTransaction'
  1776. pendingItems:
  1777. $ref: '#/components/schemas/PendingItems'
  1778. example:
  1779. transactions:
  1780. - L1Info:
  1781. ethereumBlockNum: 3
  1782. historicDepositAmountUSD:
  1783. depositAmount: '0'
  1784. toForgeL1TransactionsNum: 7
  1785. userOrigin: true
  1786. L1orL2: L1
  1787. L2Info:
  1788. amount: '88888800000000000'
  1789. batchNum: 9
  1790. fromAccountIndex: hez:ETH:262
  1791. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1792. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1793. historicUSD: 44.4444
  1794. id: '0x000000000000000007000300'
  1795. itemId: 28
  1796. position: 3
  1797. timestamp: '2020-11-26T09:18:40.004749Z'
  1798. toAccountIndex: hez:EXIT:1
  1799. toBJJ:
  1800. toHezEthereumAddress:
  1801. token:
  1802. USD: 500
  1803. decimals: 18
  1804. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1805. ethereumBlockNum: 0
  1806. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1807. id: 0
  1808. itemId: 1
  1809. name: Ether
  1810. symbol: ETH
  1811. type: ForceExit
  1812. - L1Info:
  1813. L1orL2: L2
  1814. L2Info:
  1815. fee: 123
  1816. historicFeeUSD: 2.15037380962404
  1817. nonce: 1
  1818. amount: '55555500000000000'
  1819. batchNum: 8
  1820. fromAccountIndex: hez:TKN1:264
  1821. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1822. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1823. historicUSD: 23.4999765
  1824. id: '0x020000000001080000000001'
  1825. itemId: 19
  1826. position: 2
  1827. timestamp: '2020-11-26T09:18:40.004749Z'
  1828. toAccountIndex: hez:TKN1:260
  1829. toBJJ: hez:81h61cx0FKR1RXcLbHW8cZMPY8SR6yKU3ei4pmcLjpaQ
  1830. toHezEthereumAddress: hez:0x6813Eb9362372EEF6200f3b1dbC3f819671cBA69
  1831. token:
  1832. USD: 423
  1833. decimals: 18
  1834. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1835. ethereumBlockNum: 2
  1836. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1837. id: 1
  1838. itemId: 2
  1839. name: Test Token 1
  1840. symbol: TKN1
  1841. type: Transfer
  1842. - L1Info:
  1843. L1orL2: L2
  1844. L2Info:
  1845. fee: 44
  1846. historicFeeUSD: 0.1973587359744
  1847. nonce: 2
  1848. amount: '66666600000000000'
  1849. batchNum: 8
  1850. fromAccountIndex: hez:ETH:259
  1851. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1852. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1853. historicUSD: 33.3333
  1854. id: '0x020000000001030000000002'
  1855. itemId: 20
  1856. position: 3
  1857. timestamp: '2020-11-26T09:18:40.004749Z'
  1858. toAccountIndex: hez:EXIT:1
  1859. toBJJ:
  1860. toHezEthereumAddress:
  1861. token:
  1862. USD: 500
  1863. decimals: 18
  1864. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1865. ethereumBlockNum: 0
  1866. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1867. id: 0
  1868. itemId: 1
  1869. name: Ether
  1870. symbol: ETH
  1871. type: Exit
  1872. - L1Info:
  1873. ethereumBlockNum: 3
  1874. historicDepositAmountUSD: 14099.9999859
  1875. depositAmount: '33333333300000000000'
  1876. toForgeL1TransactionsNum: 2
  1877. userOrigin: true
  1878. L1orL2: L1
  1879. L2Info:
  1880. amount: '0'
  1881. batchNum: 4
  1882. fromAccountIndex: hez:TKN1:0
  1883. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1884. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1885. historicUSD:
  1886. id: '0x000000000000000002000000'
  1887. itemId: 9
  1888. position: 0
  1889. timestamp: '2020-11-26T09:18:40.004749Z'
  1890. toAccountIndex: hez:TKN1:0
  1891. toBJJ:
  1892. toHezEthereumAddress:
  1893. token:
  1894. USD: 423
  1895. decimals: 18
  1896. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1897. ethereumBlockNum: 2
  1898. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1899. id: 1
  1900. itemId: 2
  1901. name: Test Token 1
  1902. symbol: TKN1
  1903. type: CreateAccountDeposit
  1904. - L1Info:
  1905. L1orL2: L2
  1906. L2Info:
  1907. fee: 2
  1908. historicFeeUSD: 3.87833366166246e-17
  1909. nonce: 1
  1910. amount: '11111100000000000'
  1911. batchNum: 7
  1912. fromAccountIndex: hez:TKN1:261
  1913. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1914. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1915. historicUSD: 4.6999953
  1916. id: '0x020000000001050000000001'
  1917. itemId: 15
  1918. position: 2
  1919. timestamp: '2020-11-26T09:18:40.004749Z'
  1920. toAccountIndex: hez:TKN1:264
  1921. toBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1922. toHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1923. token:
  1924. USD: 423
  1925. decimals: 18
  1926. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1927. ethereumBlockNum: 2
  1928. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1929. id: 1
  1930. itemId: 2
  1931. name: Test Token 1
  1932. symbol: TKN1
  1933. type: Transfer
  1934. pendingItems: 23
  1935. required:
  1936. - transactions
  1937. - pendingItems
  1938. additionalProperties: false
  1939. EthBlockNum:
  1940. type: integer
  1941. description: Ethereum block number
  1942. minimum: 0
  1943. maximum: 1.84467440737096e+19
  1944. example: 762375478
  1945. ToForgeL1TransactionsNum:
  1946. type: integer
  1947. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  1948. minimum: 0
  1949. maximum: 4294967295
  1950. example: 784
  1951. nullable: true
  1952. TransactionPosition:
  1953. type: integer
  1954. description: Position that a transaction occupies in a batch.
  1955. minimum: 0
  1956. example: 5
  1957. URL:
  1958. type: string
  1959. description: HTTP URL
  1960. example: "https://apimock.hermez.network"
  1961. TokenSymbol:
  1962. type: string
  1963. description: Abreviation of the token name.
  1964. example: "DAI"
  1965. TokenName:
  1966. type: string
  1967. description: Token name.
  1968. example: "Dai"
  1969. CollectedFees:
  1970. type: object
  1971. description: Collected fees by the forger of the batch, represented by a map of tokenId => amount. A maximum of 64 different tokens can be used.
  1972. additionalProperties:
  1973. type: string
  1974. example:
  1975. 1234: "425632785672345647"
  1976. 4321: "86538967235465432654352"
  1977. Batch:
  1978. type: object
  1979. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1980. properties:
  1981. itemId:
  1982. $ref: '#/components/schemas/ItemId'
  1983. batchNum:
  1984. $ref: '#/components/schemas/BatchNum'
  1985. ethereumBlockNum:
  1986. $ref: '#/components/schemas/EthBlockNum'
  1987. ethereumBlockHash:
  1988. type: string
  1989. description: hash of the Ethereum block in which the batch was forged
  1990. example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
  1991. timestamp:
  1992. type: string
  1993. format: date-time
  1994. description: Time in which the batch was forged.
  1995. forgerAddr:
  1996. $ref: '#/components/schemas/EthereumAddress'
  1997. collectedFees:
  1998. $ref: '#/components/schemas/CollectedFees'
  1999. historicTotalCollectedFeesUSD:
  2000. type: number
  2001. description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
  2002. example: 23.3
  2003. stateRoot:
  2004. allOf:
  2005. - $ref: '#/components/schemas/Hash'
  2006. - description: Root of the accounts Merkle Tree.
  2007. - example: "2734657026572a8708d883"
  2008. numAccounts:
  2009. type: integer
  2010. description: Number of registered accounts in this batch.
  2011. exitRoot:
  2012. allOf:
  2013. - $ref: '#/components/schemas/Hash'
  2014. - description: Root of the exit Merkle Tree associated to this batch.
  2015. - example: "2734657026572a8708d883"
  2016. forgeL1TransactionsNum:
  2017. type: integer
  2018. description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  2019. example: 5
  2020. nullable: true
  2021. slotNum:
  2022. $ref: '#/components/schemas/SlotNum'
  2023. forgedTransactions:
  2024. type: integer
  2025. description: Amount of forged transactions in this batch.
  2026. example: 318
  2027. additionalProperties: false
  2028. required:
  2029. - itemId
  2030. - batchNum
  2031. - ethereumBlockNum
  2032. - ethereumBlockHash
  2033. - timestamp
  2034. - forgerAddr
  2035. - collectedFees
  2036. - historicTotalCollectedFeesUSD
  2037. - stateRoot
  2038. - numAccounts
  2039. - exitRoot
  2040. - forgeL1TransactionsNum
  2041. - slotNum
  2042. - forgedTransactions
  2043. FullBatch:
  2044. type: object
  2045. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  2046. properties:
  2047. batch:
  2048. $ref: '#/components/schemas/Batch'
  2049. transactions:
  2050. type: array
  2051. description: List of forged transactions in the batch
  2052. items:
  2053. $ref: '#/components/schemas/HistoryTransaction'
  2054. nullable: true
  2055. additionalProperties: false
  2056. required:
  2057. - batch
  2058. - transactions
  2059. Hash:
  2060. type: string
  2061. description: hashed data
  2062. example: "2734657026572a8708d883"
  2063. SlotNum:
  2064. type: integer
  2065. description: Identifier of a slot.
  2066. minimum: 0
  2067. maximum: 4294967295
  2068. example: 784
  2069. Batches:
  2070. type: object
  2071. properties:
  2072. batches:
  2073. type: array
  2074. description: List of batches.
  2075. items:
  2076. $ref: '#/components/schemas/Batch'
  2077. pendingItems:
  2078. $ref: '#/components/schemas/PendingItems'
  2079. additionalProperties: false
  2080. required:
  2081. - batches
  2082. - pendingItems
  2083. Coordinator:
  2084. type: object
  2085. properties:
  2086. itemId:
  2087. $ref: '#/components/schemas/ItemId'
  2088. forgerAddr:
  2089. $ref: '#/components/schemas/EthereumAddress'
  2090. bidderAddr:
  2091. $ref: '#/components/schemas/EthereumAddress'
  2092. URL:
  2093. $ref: '#/components/schemas/URL'
  2094. ethereumBlock:
  2095. allOf:
  2096. - $ref: '#/components/schemas/EthBlockNum'
  2097. - description: Ethereum block in which the coordinator registered into the network.
  2098. - example: 5735943738
  2099. additionalProperties: false
  2100. required:
  2101. - itemId
  2102. - forgerAddr
  2103. - bidderAddr
  2104. - URL
  2105. - ethereumBlock
  2106. Coordinators:
  2107. type: object
  2108. properties:
  2109. coordinators:
  2110. type: array
  2111. description: List of coordinators.
  2112. items:
  2113. $ref: '#/components/schemas/Coordinator'
  2114. pendingItems:
  2115. $ref: '#/components/schemas/PendingItems'
  2116. additionalProperties: false
  2117. required:
  2118. - coordinators
  2119. - pendingItems
  2120. Bid:
  2121. type: object
  2122. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  2123. properties:
  2124. itemId:
  2125. $ref: '#/components/schemas/ItemId'
  2126. bidderAddr:
  2127. $ref: '#/components/schemas/EthereumAddress'
  2128. forgerAddr:
  2129. $ref: '#/components/schemas/EthereumAddress'
  2130. slotNum:
  2131. $ref: '#/components/schemas/SlotNum'
  2132. URL:
  2133. $ref: '#/components/schemas/URL'
  2134. bidValue:
  2135. $ref: '#/components/schemas/BigInt'
  2136. ethereumBlockNum:
  2137. $ref: '#/components/schemas/EthBlockNum'
  2138. timestamp:
  2139. type: string
  2140. format: date-time
  2141. additionalProperties: false
  2142. required:
  2143. - bidderAddr
  2144. - forgerAddr
  2145. - slotNum
  2146. - URL
  2147. - bidValue
  2148. - ethereumBlockNum
  2149. - timestamp
  2150. Bids:
  2151. type: object
  2152. properties:
  2153. bids:
  2154. type: array
  2155. description: List of bids.
  2156. items:
  2157. $ref: '#/components/schemas/Bid'
  2158. pendingItems:
  2159. $ref: '#/components/schemas/PendingItems'
  2160. additionalProperties: false
  2161. required:
  2162. - bids
  2163. - pendingItems
  2164. RecommendedFee:
  2165. type: object
  2166. description: Fee that the coordinator recommends per transaction in USD.
  2167. properties:
  2168. existingAccount:
  2169. type: number
  2170. description: Recommended fee if the destination account of the transaction already exists.
  2171. minimum: 0
  2172. example: 0.1
  2173. createAccount:
  2174. type: number
  2175. description: Recommended fee if the destination account of the transaction doesn't exist, but the coordinator has an authorization to create a valid account associated to an Ethereum address and a BJJ public key controlled by the receiver.
  2176. minimum: 0
  2177. example: 1.3
  2178. createAccountInternal:
  2179. type: number
  2180. description: Recommended fee if the destination account of the transaction doesn't exist, but the coordinator has the ability to create a valid account associated to a BJJ public key controlled by the receiver. Note that these kind of accounts are not associated with an Ethereum address and therefore can only operate in L2.
  2181. minimum: 0
  2182. example: 0.5
  2183. required:
  2184. - existingAccount
  2185. - createAccount
  2186. - createAccountInternal
  2187. additionalProperties: false
  2188. Token:
  2189. type: object
  2190. description: Hermez Network compatible and registered token.
  2191. properties:
  2192. id:
  2193. $ref: '#/components/schemas/TokenId'
  2194. ethereumAddress:
  2195. allOf:
  2196. - $ref: '#/components/schemas/EthereumAddress'
  2197. - description: Ethereum address in which the token is deployed.
  2198. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  2199. itemId:
  2200. $ref: '#/components/schemas/ItemId'
  2201. name:
  2202. type: string
  2203. description: full name of the token
  2204. example: Maker Dai
  2205. symbol:
  2206. allOf:
  2207. - $ref: '#/components/schemas/TokenSymbol'
  2208. - example: DAI
  2209. decimals:
  2210. type: integer
  2211. description: Number of decimals of the token.
  2212. example: 18
  2213. ethereumBlockNum:
  2214. allOf:
  2215. - $ref: '#/components/schemas/EthBlockNum'
  2216. - description: Ethereum block number in which the token was added to the Hermez Network.
  2217. - example: 539847538
  2218. USD:
  2219. type: number
  2220. description: Value of the token in USD.
  2221. example: 1.01
  2222. nullable: true
  2223. fiatUpdate:
  2224. type: string
  2225. format: date-time
  2226. description: Timestamp of the moment the `USD` value was updated.
  2227. nullable: true
  2228. required:
  2229. - id
  2230. - ethereumAddress
  2231. - itemId
  2232. - name
  2233. - symbol
  2234. - decimals
  2235. - ethereumBlockNum
  2236. - USD
  2237. - fiatUpdate
  2238. additionalProperties: false
  2239. Tokens:
  2240. type: object
  2241. properties:
  2242. tokens:
  2243. type: array
  2244. description: List of tokens.
  2245. items:
  2246. $ref: '#/components/schemas/Token'
  2247. pendingItems:
  2248. $ref: '#/components/schemas/PendingItems'
  2249. Exit:
  2250. type: object
  2251. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  2252. properties:
  2253. batchNum:
  2254. allOf:
  2255. - $ref: '#/components/schemas/BatchNum'
  2256. - description: Batch in which the exit was forged.
  2257. - example: 7394
  2258. accountIndex:
  2259. $ref: '#/components/schemas/AccountIndex'
  2260. bjj:
  2261. $ref: '#/components/schemas/BJJ'
  2262. hezEthereumAddress:
  2263. $ref: '#/components/schemas/HezEthereumAddress'
  2264. itemId:
  2265. $ref: '#/components/schemas/ItemId'
  2266. merkleProof:
  2267. type: object
  2268. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  2269. properties:
  2270. root:
  2271. $ref: '#/components/schemas/BigInt'
  2272. siblings:
  2273. type: array
  2274. items:
  2275. $ref: '#/components/schemas/BigInt'
  2276. oldKey:
  2277. $ref: '#/components/schemas/BigInt'
  2278. oldValue:
  2279. $ref: '#/components/schemas/BigInt'
  2280. isOld0:
  2281. type: boolean
  2282. key:
  2283. $ref: '#/components/schemas/BigInt'
  2284. value:
  2285. $ref: '#/components/schemas/BigInt'
  2286. fnc:
  2287. type: integer
  2288. maximum: 3
  2289. minimum: 0
  2290. required:
  2291. - root
  2292. - siblings
  2293. - oldKey
  2294. - oldValue
  2295. - isOld0
  2296. - key
  2297. - value
  2298. - fnc
  2299. additionalProperties: false
  2300. balance:
  2301. $ref: '#/components/schemas/BigInt'
  2302. instantWithdraw:
  2303. type: integer
  2304. description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  2305. minimum: 0
  2306. maximum: 1.84467440737096e+19
  2307. example: 74747363
  2308. nullable: true
  2309. delayedWithdrawRequest:
  2310. type: integer
  2311. description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  2312. minimum: 0
  2313. maximum: 1.84467440737096e+19
  2314. example: null
  2315. nullable: true
  2316. delayedWithdraw:
  2317. type: integer
  2318. description: Block in which the exit balance was delayed withdrawn after a delay withdraw request. Null indicates that a delay withdraw hasn't been performed.
  2319. minimum: 0
  2320. maximum: 1.84467440737096e+19
  2321. example: null
  2322. nullable: true
  2323. token:
  2324. $ref: '#/components/schemas/Token'
  2325. required:
  2326. - batchNum
  2327. - accountIndex
  2328. - bjj
  2329. - hezEthereumAddress
  2330. - itemId
  2331. - merkleProof
  2332. - balance
  2333. - instantWithdraw
  2334. - delayedWithdrawRequest
  2335. - delayedWithdraw
  2336. - token
  2337. additionalProperties: false
  2338. Exits:
  2339. type: object
  2340. properties:
  2341. exits:
  2342. type: array
  2343. description: List of exits.
  2344. items:
  2345. $ref: '#/components/schemas/Exit'
  2346. pendingItems:
  2347. $ref: '#/components/schemas/PendingItems'
  2348. required:
  2349. - exits
  2350. - pendingItems
  2351. additionalProperties: false
  2352. Account:
  2353. type: object
  2354. description: State tree leaf. It contains balance and nonce of an account.
  2355. properties:
  2356. itemId:
  2357. $ref: '#/components/schemas/ItemId'
  2358. accountIndex:
  2359. $ref: '#/components/schemas/AccountIndex'
  2360. nonce:
  2361. $ref: '#/components/schemas/Nonce'
  2362. balance:
  2363. $ref: '#/components/schemas/BigInt'
  2364. bjj:
  2365. $ref: '#/components/schemas/BJJ'
  2366. hezEthereumAddress:
  2367. $ref: '#/components/schemas/HezEthereumAddress'
  2368. token:
  2369. $ref: '#/components/schemas/Token'
  2370. example:
  2371. accountIndex: hez:ETH:259
  2372. balance: '2590000000000000000'
  2373. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2374. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2375. itemId: 4
  2376. nonce: 0
  2377. token:
  2378. USD: 500
  2379. decimals: 18
  2380. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2381. ethereumBlockNum: 0
  2382. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2383. id: 0
  2384. itemId: 1
  2385. name: Ether
  2386. symbol: ETH
  2387. additionalProperties: false
  2388. required:
  2389. - itemId
  2390. - accountIndex
  2391. - nonce
  2392. - balance
  2393. - bjj
  2394. - hezEthereumAddress
  2395. - token
  2396. Accounts:
  2397. type: object
  2398. properties:
  2399. accounts:
  2400. type: array
  2401. description: List of accounts.
  2402. items:
  2403. $ref: '#/components/schemas/Account'
  2404. pendingItems:
  2405. $ref: '#/components/schemas/PendingItems'
  2406. example:
  2407. accounts:
  2408. - accountIndex: hez:ETH:259
  2409. balance: '2590000000000000000'
  2410. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2411. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2412. itemId: 4
  2413. nonce: 0
  2414. token:
  2415. USD: 500
  2416. decimals: 18
  2417. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2418. ethereumBlockNum: 0
  2419. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2420. id: 0
  2421. itemId: 1
  2422. name: Ether
  2423. symbol: ETH
  2424. - accountIndex: hez:TKN1:261
  2425. balance: '2610000000'
  2426. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2427. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2428. itemId: 6
  2429. nonce: 0
  2430. token:
  2431. USD: 423
  2432. decimals: 18
  2433. ethereumAddress: '0x0000000000000000000000000000000000000064'
  2434. ethereumBlockNum: 2
  2435. fiatUpdate: '2020-11-26T09:53:47.456619Z'
  2436. id: 1
  2437. itemId: 2
  2438. name: Test Token 1
  2439. symbol: TKN1
  2440. pendingItems: 0
  2441. additionalProperties: false
  2442. required:
  2443. - accounts
  2444. - pendingItems
  2445. Slot:
  2446. type: object
  2447. description: Slot information.
  2448. properties:
  2449. itemId:
  2450. $ref: '#/components/schemas/ItemId'
  2451. slotNum:
  2452. $ref: '#/components/schemas/SlotNum'
  2453. firstBlock:
  2454. allOf:
  2455. - $ref: '#/components/schemas/EthBlockNum'
  2456. - description: Block in which the slot began or will begin
  2457. - example: 76238647846
  2458. lastBlock:
  2459. allOf:
  2460. - $ref: '#/components/schemas/EthBlockNum'
  2461. - description: Block in which the slot ended or will end
  2462. - example: 4475934
  2463. openAuction:
  2464. type: boolean
  2465. description: Whether the auction of the slot is open or not.
  2466. bestBid:
  2467. type: object
  2468. description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
  2469. nullable: true
  2470. properties:
  2471. itemId:
  2472. $ref: '#/components/schemas/ItemId'
  2473. bidderAddr:
  2474. $ref: '#/components/schemas/EthereumAddress'
  2475. forgerAddr:
  2476. $ref: '#/components/schemas/EthereumAddress'
  2477. slotNum:
  2478. $ref: '#/components/schemas/SlotNum'
  2479. URL:
  2480. $ref: '#/components/schemas/URL'
  2481. bidValue:
  2482. type: string
  2483. description: BigInt is an integer encoded as a string for numbers that are very large.
  2484. example: "8708856933496328593"
  2485. pattern: "^\\d+$"
  2486. ethereumBlockNum:
  2487. $ref: '#/components/schemas/EthBlockNum'
  2488. timestamp:
  2489. type: string
  2490. format: date-time
  2491. additionalProperties: false
  2492. required:
  2493. - bidderAddr
  2494. - forgerAddr
  2495. - slotNum
  2496. - URL
  2497. - bidValue
  2498. - ethereumBlockNum
  2499. - timestamp
  2500. additionalProperties: false
  2501. required:
  2502. - slotNum
  2503. - firstBlock
  2504. - lastBlock
  2505. - openAuction
  2506. - bestBid
  2507. Slots:
  2508. type: object
  2509. properties:
  2510. slots:
  2511. type: array
  2512. description: List of slots.
  2513. items:
  2514. allOf:
  2515. - $ref: '#/components/schemas/Slot'
  2516. - description: Last synchronized Etherum block.
  2517. pendingItems:
  2518. $ref: '#/components/schemas/PendingItems'
  2519. additionalProperties: false
  2520. required:
  2521. - slots
  2522. - pendingItems
  2523. NextForger:
  2524. type: object
  2525. description: Coordinator information along with the scheduled forging period
  2526. properties:
  2527. coordinator:
  2528. $ref: '#/components/schemas/Coordinator'
  2529. period:
  2530. type: object
  2531. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2532. properties:
  2533. slotNum:
  2534. $ref: '#/components/schemas/SlotNum'
  2535. fromBlock:
  2536. $ref: '#/components/schemas/EthBlockNum'
  2537. toBlock:
  2538. $ref: '#/components/schemas/EthBlockNum'
  2539. fromTimestamp:
  2540. type: string
  2541. format: date-time
  2542. toTimestamp:
  2543. type: string
  2544. format: date-time
  2545. required:
  2546. - slotNum
  2547. - fromBlock
  2548. - toBlock
  2549. - fromTimestamp
  2550. - toTimestamp
  2551. additionalProperties: false
  2552. required:
  2553. - coordinator
  2554. - period
  2555. additionalProperties: false
  2556. NextForgers:
  2557. type: array
  2558. description: List of next coordinators to forge.
  2559. items:
  2560. $ref: '#/components/schemas/NextForger'
  2561. State:
  2562. type: object
  2563. description: Gobal variables of the network
  2564. properties:
  2565. network:
  2566. $ref: '#/components/schemas/StateNetwork'
  2567. metrics:
  2568. $ref: '#/components/schemas/StateMetrics'
  2569. rollup:
  2570. $ref: '#/components/schemas/StateRollup'
  2571. auction:
  2572. $ref: '#/components/schemas/StateAuction'
  2573. withdrawalDelayer:
  2574. $ref: '#/components/schemas/StateWithdrawDelayer'
  2575. recommendedFee:
  2576. $ref: '#/components/schemas/RecommendedFee'
  2577. additionalProperties: false
  2578. required:
  2579. - network
  2580. - metrics
  2581. - rollup
  2582. - auction
  2583. - withdrawalDelayer
  2584. - recommendedFee
  2585. StateNetwork:
  2586. type: object
  2587. description: Gobal statistics of the network
  2588. properties:
  2589. lastEthereumBlock:
  2590. allOf:
  2591. - $ref: '#/components/schemas/EthBlockNum'
  2592. - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
  2593. - example: 3457437
  2594. lastSynchedBlock:
  2595. allOf:
  2596. - $ref: '#/components/schemas/EthBlockNum'
  2597. - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
  2598. - example: 3457437
  2599. lastBatch:
  2600. $ref: '#/components/schemas/Batch'
  2601. currentSlot:
  2602. allOf:
  2603. - $ref: '#/components/schemas/SlotNum'
  2604. - description: Slot where batches are currently being forged.
  2605. - example: 2334
  2606. nextForgers:
  2607. $ref: '#/components/schemas/NextForgers'
  2608. additionalProperties: false
  2609. required:
  2610. - lastEthereumBlock
  2611. - lastSynchedBlock
  2612. - lastBatch
  2613. - currentSlot
  2614. - nextForgers
  2615. StateAuction:
  2616. type: object
  2617. description: Auction parameters.
  2618. properties:
  2619. ethereumBlockNum:
  2620. $ref: '#/components/schemas/EthBlockNum'
  2621. bootCoordinator:
  2622. allOf:
  2623. - $ref: '#/components/schemas/EthereumAddress'
  2624. - description: Ethereum address of the boot coordinator.
  2625. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2626. bootCoordinatorUrl:
  2627. type: string
  2628. description: Boot Coordinator URL
  2629. example: "https://boot.coordinator.io"
  2630. slotDeadline:
  2631. type: integer
  2632. description: Number of blocks after the beginning of a slot after which any coordinator can forge if the winner has not forged any batch in that slot.
  2633. example: 3
  2634. closedAuctionSlots:
  2635. type: integer
  2636. description: Amount of slots between the current slot and the slot auction that is closed. Example if the value is 2, when slot 10 begins, the auction of the slot 12 gets closed.
  2637. example: 2
  2638. openAuctionSlots:
  2639. type: integer
  2640. description: Amount of days in advance are auctions opened.
  2641. defaultSlotSetBid:
  2642. type: array
  2643. description: "Initial minimal bid for each auction. Expressed as an array of 6 values. To calculate which value corresponds to each slot: `initialMinimalBidding[slotNum%6]`."
  2644. items:
  2645. type: string
  2646. example: ["32","0","68","21","55","99"]
  2647. defaultSlotSetBidSlotNum:
  2648. type: integer
  2649. description: Slot in which the changes will be applied for the first time.
  2650. outbidding:
  2651. type: number
  2652. description: Minimum outbid over the previous one to consider it valid.
  2653. example: 3.64
  2654. donationAddress:
  2655. allOf:
  2656. - $ref: '#/components/schemas/EthereumAddress'
  2657. - description: Ethereum address where the donations will go to.
  2658. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2659. allocationRatio:
  2660. type: array
  2661. description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
  2662. items:
  2663. type: integer
  2664. example: [80,10,10]
  2665. additionalProperties: false
  2666. required:
  2667. - ethereumBlockNum
  2668. - bootCoordinator
  2669. - bootCoordinatorUrl
  2670. - slotDeadline
  2671. - closedAuctionSlots
  2672. - openAuctionSlots
  2673. - defaultSlotSetBid
  2674. - outbidding
  2675. - donationAddress
  2676. - allocationRatio
  2677. StateRollup:
  2678. type: object
  2679. description: Rollup parameters
  2680. properties:
  2681. ethereumBlockNum:
  2682. $ref: '#/components/schemas/EthBlockNum'
  2683. forgeL1L2BatchTimeout:
  2684. type: integer
  2685. description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
  2686. example: 5
  2687. feeAddToken:
  2688. type: string
  2689. description: Fee to pay when registering tokens into the network.
  2690. example: "5698"
  2691. withdrawalDelay:
  2692. type: integer
  2693. description: Withdraw delay in seconds
  2694. example: 432000
  2695. buckets:
  2696. type: array
  2697. description: List of buckets state
  2698. items:
  2699. type: object
  2700. properties:
  2701. ceilUSD:
  2702. type: string
  2703. description: Max USD value
  2704. example: "1000"
  2705. withdrawals:
  2706. type: string
  2707. description: Available withdrawals of the bucket
  2708. example: "4"
  2709. blockWithdrawalRate:
  2710. type: string
  2711. description: Every `blockWithdrawalRate` blocks add 1 withdrawal
  2712. example: "8"
  2713. maxWithdrawals:
  2714. type: string
  2715. description: Max withdrawals the bucket can hold
  2716. example: "4"
  2717. additionalProperties: false
  2718. required:
  2719. - ceilUSD
  2720. - withdrawals
  2721. - blockWithdrawalRate
  2722. - maxWithdrawals
  2723. additionalProperties: false
  2724. required:
  2725. - ethereumBlockNum
  2726. - forgeL1L2BatchTimeout
  2727. - feeAddToken
  2728. - withdrawalDelay
  2729. - buckets
  2730. StateWithdrawDelayer:
  2731. type: object
  2732. description: Withdrawal delayer parameters
  2733. properties:
  2734. ethereumBlockNum:
  2735. $ref: '#/components/schemas/EthBlockNum'
  2736. hermezGovernanceAddress:
  2737. allOf:
  2738. - $ref: '#/components/schemas/EthereumAddress'
  2739. - description: Ethereum address of the governance.
  2740. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2741. emergencyCouncilAddress:
  2742. allOf:
  2743. - $ref: '#/components/schemas/EthereumAddress'
  2744. - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2745. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2746. withdrawalDelay:
  2747. allOf:
  2748. - $ref: '#/components/schemas/EthBlockNum'
  2749. - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
  2750. - example: 539573849
  2751. emergencyModeStartingBlock:
  2752. type: integer
  2753. description: Block number in which the emergency mode has been activated.
  2754. example: 10
  2755. emergencyMode:
  2756. type: boolean
  2757. description: Indicates if emergency mode has been activated.
  2758. example: false
  2759. additionalProperties: false
  2760. required:
  2761. - ethereumBlockNum
  2762. - hermezGovernanceAddress
  2763. - emergencyCouncilAddress
  2764. - withdrawalDelay
  2765. - emergencyModeStartingBlock
  2766. - emergencyMode
  2767. StateMetrics:
  2768. type: object
  2769. description: Metrics of the network
  2770. properties:
  2771. transactionsPerBatch:
  2772. type: number
  2773. description: Average transactions per batch in the last 24 hours.
  2774. example: 2002.7
  2775. batchFrequency:
  2776. type: number
  2777. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2778. example: 8.9
  2779. transactionsPerSecond:
  2780. type: number
  2781. description: Average transactions per second in the last 24 hours.
  2782. example: 302.3
  2783. totalAccounts:
  2784. type: integer
  2785. description: Number of created accounts.
  2786. example: 90473
  2787. totalBJJs:
  2788. type: integer
  2789. description: Number of different registered BJJs.
  2790. example: 23067
  2791. avgTransactionFee:
  2792. type: number
  2793. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2794. example: 1.54
  2795. additionalProperties: false
  2796. required:
  2797. - transactionsPerBatch
  2798. - batchFrequency
  2799. - transactionsPerSecond
  2800. - totalAccounts
  2801. - totalBJJs
  2802. - avgTransactionFee
  2803. PendingItems:
  2804. type: integer
  2805. description: Amount of items that will be returned in subsequent calls to the endpoint, as long as they are done with same filters. When the value is 0 it means that all items have been sent.
  2806. example: 15
  2807. Config:
  2808. type: object
  2809. description: Configuration parameters of the different smart contracts that power the Hermez Network.
  2810. properties:
  2811. hermez:
  2812. type: object
  2813. description: Constant configuration of the Hermez smart contract.
  2814. properties:
  2815. publicConstants:
  2816. type: object
  2817. description: Public Hermez smart contract constants
  2818. properties:
  2819. tokenHEZ:
  2820. allOf:
  2821. - $ref: '#/components/schemas/EthereumAddress'
  2822. - description: Ethereum address of the HEZ token.
  2823. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2824. absoluteMaxL1L2BatchTimeout:
  2825. type: integer
  2826. description: L1L2 Batch Timeout
  2827. example: 240
  2828. verifiers:
  2829. type: array
  2830. description: List of verifiers struct
  2831. items:
  2832. type: object
  2833. properties:
  2834. maxTx:
  2835. type: integer
  2836. description: Maximum rollup transactions in a batch
  2837. example: 512
  2838. nlevels:
  2839. type: integer
  2840. description: Number of levels of the circuit
  2841. example: 32
  2842. required:
  2843. - maxTx
  2844. - nlevels
  2845. additionalProperties: false
  2846. hermezAuctionContract:
  2847. allOf:
  2848. - $ref: '#/components/schemas/EthereumAddress'
  2849. - description: Ethereum address of the auction smart contract.
  2850. - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
  2851. hermezGovernanceAddress:
  2852. allOf:
  2853. - $ref: '#/components/schemas/EthereumAddress'
  2854. - description: Ethereum address of the governance.
  2855. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2856. withdrawDelayerContract:
  2857. allOf:
  2858. - $ref: '#/components/schemas/EthereumAddress'
  2859. - description: Ethereum address of the withdraw delayer contracts.
  2860. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2861. required:
  2862. - tokenHEZ
  2863. - absoluteMaxL1L2BatchTimeout
  2864. - verifiers
  2865. - hermezAuctionContract
  2866. - hermezGovernanceAddress
  2867. - withdrawDelayerContract
  2868. additionalProperties: false
  2869. maxFeeIdxCoordinator:
  2870. type: integer
  2871. description: is the maximum number of tokens the coordinator can use to collect fees.
  2872. example: 64
  2873. reservedIdx:
  2874. type: integer
  2875. description: First 256 indexes reserved, first user index will be the 256.
  2876. example: 255
  2877. exitIdx:
  2878. type: integer
  2879. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2880. example: 1
  2881. limitDepositAmount:
  2882. type: integer
  2883. description: Maximum deposit amount (L1 to L2) allowed.
  2884. example: 321
  2885. limitL2TransferAmount:
  2886. type: integer
  2887. description: Maximum amount (L2 to L2) allowed.
  2888. example: 837
  2889. limitTokens:
  2890. type: integer
  2891. description: Maximum number of different tokens that can be registered in the network.
  2892. example: 4294967295
  2893. l1CoordinatorTotalBytes:
  2894. type: integer
  2895. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2896. example: 101
  2897. l1UserTotalBytes:
  2898. type: integer
  2899. description: Number of bytes that a L1 user transaction has ([20 bytes] fromEthAddr + [32 bytes] fromBjj-compressed + [6 bytes] fromIdx + [2 bytes] depositAmountFloat16 + [2 bytes] amountFloat16 + [4 bytes] tokenId + [6 bytes] toIdx).
  2900. example: 72
  2901. maxL1UserTx:
  2902. type: integer
  2903. description: Maximum L1-user transactions allowed to be queued in a batch.
  2904. example: 128
  2905. maxL1Tx:
  2906. type: integer
  2907. description: Maximum L1 transactions allowed to be queued in a batch.
  2908. example: 256
  2909. inputSHAConstantBytes:
  2910. type: integer
  2911. description: Input SHA constant bytes
  2912. example: 18542
  2913. numBuckets:
  2914. type: integer
  2915. description: Number of buckets
  2916. example: 5
  2917. maxWithdrawalDelay:
  2918. type: integer
  2919. description: Maximum delay to withdraw tokens. Time is measured in seconds.
  2920. example: 2 * 7 * 24 * 60 * 60
  2921. exchangeMultiplier:
  2922. type: integer
  2923. description: exchange multiplier
  2924. example: 1e14
  2925. required:
  2926. - publicConstants
  2927. - reservedIdx
  2928. - exitIdx
  2929. - limitDepositAmount
  2930. - limitL2TransferAmount
  2931. - limitTokens
  2932. - l1CoordinatorTotalBytes
  2933. - l1UserTotalBytes
  2934. - maxL1UserTx
  2935. - maxL1Tx
  2936. - inputSHAConstantBytes
  2937. - numBuckets
  2938. - maxWithdrawalDelay
  2939. - exchangeMultiplier
  2940. additionalProperties: false
  2941. auction:
  2942. type: object
  2943. description: Constant configuration of the auction smart contract.
  2944. properties:
  2945. blocksPerSlot:
  2946. type: integer
  2947. description: Blocks per slot.
  2948. initialMinimalBidding:
  2949. type: integer
  2950. description: Minimum bid when no one has bid yet.
  2951. genesisBlockNum:
  2952. allOf:
  2953. - $ref: '#/components/schemas/EthBlockNum'
  2954. - description: Ethereum block number in which the smart contract starts operating.
  2955. tokenHEZ:
  2956. allOf:
  2957. - $ref: '#/components/schemas/EthereumAddress'
  2958. - description: Ethereum address of the HEZ token.
  2959. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  2960. hermezRollup:
  2961. allOf:
  2962. - $ref: '#/components/schemas/EthereumAddress'
  2963. - description: Ethereum address of the rollup smart contract.
  2964. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2965. governanceAddress:
  2966. allOf:
  2967. - $ref: '#/components/schemas/EthereumAddress'
  2968. - description: Ethereum address of the governance.
  2969. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2970. required:
  2971. - blocksPerSlot
  2972. - initialMinimalBidding
  2973. - genesisBlockNum
  2974. - tokenHEZ
  2975. - hermezRollup
  2976. - governanceAddress
  2977. additionalProperties: false
  2978. withdrawalDelayer:
  2979. type: object
  2980. description: Constant configuration of the withdrawal delayer smart contract.
  2981. properties:
  2982. maxWithdrawalDelay:
  2983. type: integer
  2984. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
  2985. example: 200
  2986. maxEmergencyModeTime:
  2987. type: integer
  2988. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
  2989. example: 2000
  2990. hermezRollup:
  2991. allOf:
  2992. - $ref: '#/components/schemas/EthereumAddress'
  2993. - description: Ethereum address of the rollup smart contract.
  2994. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2995. required:
  2996. - maxWithdrawalDelay
  2997. - maxEmergencyModeTime
  2998. - hermezRollup
  2999. additionalProperties: false
  3000. required:
  3001. - hermez
  3002. - auction
  3003. - withdrawalDelayer
  3004. additionalProperties: false
  3005. Error:
  3006. type: object
  3007. description: Error response.
  3008. properties:
  3009. message:
  3010. type: string
  3011. Error400:
  3012. allOf:
  3013. - $ref: '#/components/schemas/Error'
  3014. - example:
  3015. message: Invalid signature.
  3016. Error404:
  3017. allOf:
  3018. - $ref: '#/components/schemas/Error'
  3019. - example:
  3020. message: Item(s) not found.
  3021. Error500:
  3022. allOf:
  3023. - $ref: '#/components/schemas/Error'
  3024. - example:
  3025. message: Database error.