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.

3033 lines
106 KiB

4 years ago
4 years ago
4 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. Token:
  2184. type: object
  2185. description: Hermez Network compatible and registered token.
  2186. properties:
  2187. id:
  2188. $ref: '#/components/schemas/TokenId'
  2189. ethereumAddress:
  2190. allOf:
  2191. - $ref: '#/components/schemas/EthereumAddress'
  2192. - description: Ethereum address in which the token is deployed.
  2193. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  2194. itemId:
  2195. $ref: '#/components/schemas/ItemId'
  2196. name:
  2197. type: string
  2198. description: full name of the token
  2199. example: Maker Dai
  2200. symbol:
  2201. allOf:
  2202. - $ref: '#/components/schemas/TokenSymbol'
  2203. - example: DAI
  2204. decimals:
  2205. type: integer
  2206. description: Number of decimals of the token.
  2207. example: 18
  2208. ethereumBlockNum:
  2209. allOf:
  2210. - $ref: '#/components/schemas/EthBlockNum'
  2211. - description: Ethereum block number in which the token was added to the Hermez Network.
  2212. - example: 539847538
  2213. USD:
  2214. type: number
  2215. description: Value of the token in USD.
  2216. example: 1.01
  2217. nullable: true
  2218. fiatUpdate:
  2219. type: string
  2220. format: date-time
  2221. description: Timestamp of the moment the `USD` value was updated.
  2222. nullable: true
  2223. required:
  2224. - id
  2225. - ethereumAddress
  2226. - itemId
  2227. - name
  2228. - symbol
  2229. - decimals
  2230. - ethereumBlockNum
  2231. - USD
  2232. - fiatUpdate
  2233. additionalProperties: false
  2234. Tokens:
  2235. type: object
  2236. properties:
  2237. tokens:
  2238. type: array
  2239. description: List of tokens.
  2240. items:
  2241. $ref: '#/components/schemas/Token'
  2242. pendingItems:
  2243. $ref: '#/components/schemas/PendingItems'
  2244. Exit:
  2245. type: object
  2246. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  2247. properties:
  2248. batchNum:
  2249. allOf:
  2250. - $ref: '#/components/schemas/BatchNum'
  2251. - description: Batch in which the exit was forged.
  2252. - example: 7394
  2253. accountIndex:
  2254. $ref: '#/components/schemas/AccountIndex'
  2255. bjj:
  2256. $ref: '#/components/schemas/BJJ'
  2257. hezEthereumAddress:
  2258. $ref: '#/components/schemas/HezEthereumAddress'
  2259. itemId:
  2260. $ref: '#/components/schemas/ItemId'
  2261. merkleProof:
  2262. type: object
  2263. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  2264. properties:
  2265. root:
  2266. $ref: '#/components/schemas/BigInt'
  2267. siblings:
  2268. type: array
  2269. items:
  2270. $ref: '#/components/schemas/BigInt'
  2271. oldKey:
  2272. $ref: '#/components/schemas/BigInt'
  2273. oldValue:
  2274. $ref: '#/components/schemas/BigInt'
  2275. isOld0:
  2276. type: boolean
  2277. key:
  2278. $ref: '#/components/schemas/BigInt'
  2279. value:
  2280. $ref: '#/components/schemas/BigInt'
  2281. fnc:
  2282. type: integer
  2283. maximum: 3
  2284. minimum: 0
  2285. required:
  2286. - root
  2287. - siblings
  2288. - oldKey
  2289. - oldValue
  2290. - isOld0
  2291. - key
  2292. - value
  2293. - fnc
  2294. additionalProperties: false
  2295. balance:
  2296. $ref: '#/components/schemas/BigInt'
  2297. instantWithdraw:
  2298. type: integer
  2299. description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  2300. minimum: 0
  2301. maximum: 1.84467440737096e+19
  2302. example: 74747363
  2303. nullable: true
  2304. delayedWithdrawRequest:
  2305. type: integer
  2306. description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  2307. minimum: 0
  2308. maximum: 1.84467440737096e+19
  2309. example: null
  2310. nullable: true
  2311. delayedWithdraw:
  2312. type: integer
  2313. 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.
  2314. minimum: 0
  2315. maximum: 1.84467440737096e+19
  2316. example: null
  2317. nullable: true
  2318. token:
  2319. $ref: '#/components/schemas/Token'
  2320. required:
  2321. - batchNum
  2322. - accountIndex
  2323. - bjj
  2324. - hezEthereumAddress
  2325. - itemId
  2326. - merkleProof
  2327. - balance
  2328. - instantWithdraw
  2329. - delayedWithdrawRequest
  2330. - delayedWithdraw
  2331. - token
  2332. additionalProperties: false
  2333. Exits:
  2334. type: object
  2335. properties:
  2336. exits:
  2337. type: array
  2338. description: List of exits.
  2339. items:
  2340. $ref: '#/components/schemas/Exit'
  2341. pendingItems:
  2342. $ref: '#/components/schemas/PendingItems'
  2343. required:
  2344. - exits
  2345. - pendingItems
  2346. additionalProperties: false
  2347. Account:
  2348. type: object
  2349. description: State tree leaf. It contains balance and nonce of an account.
  2350. properties:
  2351. itemId:
  2352. $ref: '#/components/schemas/ItemId'
  2353. accountIndex:
  2354. $ref: '#/components/schemas/AccountIndex'
  2355. nonce:
  2356. $ref: '#/components/schemas/Nonce'
  2357. balance:
  2358. $ref: '#/components/schemas/BigInt'
  2359. bjj:
  2360. $ref: '#/components/schemas/BJJ'
  2361. hezEthereumAddress:
  2362. $ref: '#/components/schemas/HezEthereumAddress'
  2363. token:
  2364. $ref: '#/components/schemas/Token'
  2365. example:
  2366. accountIndex: hez:ETH:259
  2367. balance: '2590000000000000000'
  2368. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2369. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2370. itemId: 4
  2371. nonce: 0
  2372. token:
  2373. USD: 500
  2374. decimals: 18
  2375. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2376. ethereumBlockNum: 0
  2377. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2378. id: 0
  2379. itemId: 1
  2380. name: Ether
  2381. symbol: ETH
  2382. additionalProperties: false
  2383. required:
  2384. - itemId
  2385. - accountIndex
  2386. - nonce
  2387. - balance
  2388. - bjj
  2389. - hezEthereumAddress
  2390. - token
  2391. Accounts:
  2392. type: object
  2393. properties:
  2394. accounts:
  2395. type: array
  2396. description: List of accounts.
  2397. items:
  2398. $ref: '#/components/schemas/Account'
  2399. pendingItems:
  2400. $ref: '#/components/schemas/PendingItems'
  2401. example:
  2402. accounts:
  2403. - accountIndex: hez:ETH:259
  2404. balance: '2590000000000000000'
  2405. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2406. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2407. itemId: 4
  2408. nonce: 0
  2409. token:
  2410. USD: 500
  2411. decimals: 18
  2412. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2413. ethereumBlockNum: 0
  2414. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2415. id: 0
  2416. itemId: 1
  2417. name: Ether
  2418. symbol: ETH
  2419. - accountIndex: hez:TKN1:261
  2420. balance: '2610000000'
  2421. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2422. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2423. itemId: 6
  2424. nonce: 0
  2425. token:
  2426. USD: 423
  2427. decimals: 18
  2428. ethereumAddress: '0x0000000000000000000000000000000000000064'
  2429. ethereumBlockNum: 2
  2430. fiatUpdate: '2020-11-26T09:53:47.456619Z'
  2431. id: 1
  2432. itemId: 2
  2433. name: Test Token 1
  2434. symbol: TKN1
  2435. pendingItems: 0
  2436. additionalProperties: false
  2437. required:
  2438. - accounts
  2439. - pendingItems
  2440. Slot:
  2441. type: object
  2442. description: Slot information.
  2443. properties:
  2444. itemId:
  2445. $ref: '#/components/schemas/ItemId'
  2446. slotNum:
  2447. $ref: '#/components/schemas/SlotNum'
  2448. firstBlock:
  2449. allOf:
  2450. - $ref: '#/components/schemas/EthBlockNum'
  2451. - description: Block in which the slot began or will begin
  2452. - example: 76238647846
  2453. lastBlock:
  2454. allOf:
  2455. - $ref: '#/components/schemas/EthBlockNum'
  2456. - description: Block in which the slot ended or will end
  2457. - example: 4475934
  2458. openAuction:
  2459. type: boolean
  2460. description: Whether the auction of the slot is open or not.
  2461. bestBid:
  2462. type: object
  2463. description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
  2464. nullable: true
  2465. properties:
  2466. itemId:
  2467. $ref: '#/components/schemas/ItemId'
  2468. bidderAddr:
  2469. $ref: '#/components/schemas/EthereumAddress'
  2470. forgerAddr:
  2471. $ref: '#/components/schemas/EthereumAddress'
  2472. slotNum:
  2473. $ref: '#/components/schemas/SlotNum'
  2474. URL:
  2475. $ref: '#/components/schemas/URL'
  2476. bidValue:
  2477. type: string
  2478. description: BigInt is an integer encoded as a string for numbers that are very large.
  2479. example: "8708856933496328593"
  2480. pattern: "^\\d+$"
  2481. ethereumBlockNum:
  2482. $ref: '#/components/schemas/EthBlockNum'
  2483. timestamp:
  2484. type: string
  2485. format: date-time
  2486. additionalProperties: false
  2487. required:
  2488. - bidderAddr
  2489. - forgerAddr
  2490. - slotNum
  2491. - URL
  2492. - bidValue
  2493. - ethereumBlockNum
  2494. - timestamp
  2495. additionalProperties: false
  2496. required:
  2497. - slotNum
  2498. - firstBlock
  2499. - lastBlock
  2500. - openAuction
  2501. - bestBid
  2502. Slots:
  2503. type: object
  2504. properties:
  2505. slots:
  2506. type: array
  2507. description: List of slots.
  2508. items:
  2509. allOf:
  2510. - $ref: '#/components/schemas/Slot'
  2511. - description: Last synchronized Etherum block.
  2512. pendingItems:
  2513. $ref: '#/components/schemas/PendingItems'
  2514. additionalProperties: false
  2515. required:
  2516. - slots
  2517. - pendingItems
  2518. NextForger:
  2519. type: object
  2520. description: Coordinator information along with the scheduled forging period
  2521. properties:
  2522. coordinator:
  2523. $ref: '#/components/schemas/Coordinator'
  2524. period:
  2525. type: object
  2526. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2527. properties:
  2528. slotNum:
  2529. $ref: '#/components/schemas/SlotNum'
  2530. fromBlock:
  2531. $ref: '#/components/schemas/EthBlockNum'
  2532. toBlock:
  2533. $ref: '#/components/schemas/EthBlockNum'
  2534. fromTimestamp:
  2535. type: string
  2536. format: date-time
  2537. toTimestamp:
  2538. type: string
  2539. format: date-time
  2540. required:
  2541. - slotNum
  2542. - fromBlock
  2543. - toBlock
  2544. - fromTimestamp
  2545. - toTimestamp
  2546. additionalProperties: false
  2547. required:
  2548. - coordinator
  2549. - period
  2550. additionalProperties: false
  2551. NextForgers:
  2552. type: array
  2553. description: List of next coordinators to forge.
  2554. items:
  2555. $ref: '#/components/schemas/NextForger'
  2556. State:
  2557. type: object
  2558. description: Gobal variables of the network
  2559. properties:
  2560. network:
  2561. $ref: '#/components/schemas/StateNetwork'
  2562. metrics:
  2563. $ref: '#/components/schemas/StateMetrics'
  2564. rollup:
  2565. $ref: '#/components/schemas/StateRollup'
  2566. auction:
  2567. $ref: '#/components/schemas/StateAuction'
  2568. withdrawalDelayer:
  2569. $ref: '#/components/schemas/StateWithdrawDelayer'
  2570. recommendedFee:
  2571. $ref: '#/components/schemas/RecommendedFee'
  2572. additionalProperties: false
  2573. required:
  2574. - network
  2575. - metrics
  2576. - rollup
  2577. - auction
  2578. - withdrawalDelayer
  2579. - recommendedFee
  2580. StateNetwork:
  2581. type: object
  2582. description: Gobal statistics of the network
  2583. properties:
  2584. lastEthereumBlock:
  2585. allOf:
  2586. - $ref: '#/components/schemas/EthBlockNum'
  2587. - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
  2588. - example: 3457437
  2589. lastSynchedBlock:
  2590. allOf:
  2591. - $ref: '#/components/schemas/EthBlockNum'
  2592. - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
  2593. - example: 3457437
  2594. lastBatch:
  2595. $ref: '#/components/schemas/Batch'
  2596. currentSlot:
  2597. allOf:
  2598. - $ref: '#/components/schemas/SlotNum'
  2599. - description: Slot where batches are currently being forged.
  2600. - example: 2334
  2601. nextForgers:
  2602. $ref: '#/components/schemas/NextForgers'
  2603. additionalProperties: false
  2604. required:
  2605. - lastEthereumBlock
  2606. - lastSynchedBlock
  2607. - lastBatch
  2608. - currentSlot
  2609. - nextForgers
  2610. StateAuction:
  2611. type: object
  2612. description: Auction parameters.
  2613. properties:
  2614. ethereumBlockNum:
  2615. $ref: '#/components/schemas/EthBlockNum'
  2616. bootCoordinator:
  2617. allOf:
  2618. - $ref: '#/components/schemas/EthereumAddress'
  2619. - description: Ethereum address of the boot coordinator.
  2620. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2621. bootCoordinatorUrl:
  2622. type: string
  2623. description: Boot Coordinator URL
  2624. example: "https://boot.coordinator.io"
  2625. slotDeadline:
  2626. type: integer
  2627. 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.
  2628. example: 3
  2629. closedAuctionSlots:
  2630. type: integer
  2631. 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.
  2632. example: 2
  2633. openAuctionSlots:
  2634. type: integer
  2635. description: Amount of days in advance are auctions opened.
  2636. defaultSlotSetBid:
  2637. type: array
  2638. 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]`."
  2639. items:
  2640. type: integer
  2641. example: [32,0,68,21,55,99]
  2642. defaultSlotSetBidSlotNum:
  2643. type: integer
  2644. description: Slot in which the changes will be applied for the first time.
  2645. outbidding:
  2646. type: number
  2647. description: Minimum outbid over the previous one to consider it valid.
  2648. example: 3.64
  2649. donationAddress:
  2650. allOf:
  2651. - $ref: '#/components/schemas/EthereumAddress'
  2652. - description: Ethereum address where the donations will go to.
  2653. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2654. allocationRatio:
  2655. type: array
  2656. description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
  2657. items:
  2658. type: integer
  2659. example: [80,10,10]
  2660. additionalProperties: false
  2661. required:
  2662. - ethereumBlockNum
  2663. - bootCoordinator
  2664. - bootCoordinatorUrl
  2665. - slotDeadline
  2666. - closedAuctionSlots
  2667. - openAuctionSlots
  2668. - defaultSlotSetBid
  2669. - outbidding
  2670. - donationAddress
  2671. - allocationRatio
  2672. StateRollup:
  2673. type: object
  2674. description: Rollup parameters
  2675. properties:
  2676. ethereumBlockNum:
  2677. $ref: '#/components/schemas/EthBlockNum'
  2678. forgeL1L2BatchTimeout:
  2679. type: integer
  2680. description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
  2681. example: 5
  2682. feeAddToken:
  2683. type: string
  2684. description: Fee to pay when registering tokens into the network.
  2685. example: 5698
  2686. withdrawalDelay:
  2687. type: integer
  2688. description: Withdraw delay in seconds
  2689. example: 432000
  2690. buckets:
  2691. type: array
  2692. description: List of buckets state
  2693. items:
  2694. type: object
  2695. properties:
  2696. ceilUSD:
  2697. type: string
  2698. description: Max USD value
  2699. example: 1000
  2700. withdrawals:
  2701. type: string
  2702. description: Available withdrawals of the bucket
  2703. example: 4
  2704. blockWithdrawalRate:
  2705. type: string
  2706. description: Every `blockWithdrawalRate` blocks add 1 withdrawal
  2707. example: 8
  2708. maxWithdrawals:
  2709. type: string
  2710. description: Max withdrawals the bucket can hold
  2711. example: 4
  2712. additionalProperties: false
  2713. required:
  2714. - ceilUSD
  2715. - withdrawals
  2716. - blockWithdrawalRate
  2717. - maxWithdrawals
  2718. additionalProperties: false
  2719. required:
  2720. - ethereumBlockNum
  2721. - forgeL1L2BatchTimeout
  2722. - feeAddToken
  2723. - withdrawalDelay
  2724. - buckets
  2725. StateWithdrawDelayer:
  2726. type: object
  2727. description: Withdrawal delayer parameters
  2728. properties:
  2729. ethereumBlockNum:
  2730. $ref: '#/components/schemas/EthBlockNum'
  2731. hermezGovernanceAddress:
  2732. allOf:
  2733. - $ref: '#/components/schemas/EthereumAddress'
  2734. - description: Ethereum address of the governance.
  2735. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2736. emergencyCouncilAddress:
  2737. allOf:
  2738. - $ref: '#/components/schemas/EthereumAddress'
  2739. - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2740. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2741. withdrawalDelay:
  2742. allOf:
  2743. - $ref: '#/components/schemas/EthBlockNum'
  2744. - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
  2745. - example: 539573849
  2746. emergencyModeStartingBlock:
  2747. type: integer
  2748. description: Block number in which the emergency mode has been activated.
  2749. example: 10
  2750. emergencyMode:
  2751. type: boolean
  2752. description: Indicates if emergency mode has been activated.
  2753. example: false
  2754. additionalProperties: false
  2755. required:
  2756. - ethereumBlockNum
  2757. - hermezGovernanceAddress
  2758. - emergencyCouncilAddress
  2759. - withdrawalDelay
  2760. - emergencyModeStartingBlock
  2761. - emergencyMode
  2762. StateMetrics:
  2763. type: object
  2764. description: Metrics of the network
  2765. properties:
  2766. transactionsPerBatch:
  2767. type: number
  2768. description: Average transactions per batch in the last 24 hours.
  2769. example: 2002.7
  2770. batchFrequency:
  2771. type: number
  2772. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2773. example: 8.9
  2774. transactionsPerSecond:
  2775. type: number
  2776. description: Average transactions per second in the last 24 hours.
  2777. example: 302.3
  2778. totalAccounts:
  2779. type: integer
  2780. description: Number of created accounts.
  2781. example: 90473
  2782. totalBJJs:
  2783. type: integer
  2784. description: Number of different registered BJJs.
  2785. example: 23067
  2786. avgTransactionFee:
  2787. type: number
  2788. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2789. example: 1.54
  2790. additionalProperties: false
  2791. required:
  2792. - transactionsPerBatch
  2793. - batchFrequency
  2794. - transactionsPerSecond
  2795. - totalAccounts
  2796. - totalBJJs
  2797. - avgTransactionFee
  2798. PendingItems:
  2799. type: integer
  2800. 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.
  2801. example: 15
  2802. Config:
  2803. type: object
  2804. description: Configuration parameters of the different smart contracts that power the Hermez Network.
  2805. properties:
  2806. hermez:
  2807. type: object
  2808. description: Constant configuration of the Hermez smart contract.
  2809. properties:
  2810. publicConstants:
  2811. type: object
  2812. description: Public Hermez smart contract constants
  2813. properties:
  2814. tokenHEZ:
  2815. allOf:
  2816. - $ref: '#/components/schemas/EthereumAddress'
  2817. - description: Ethereum address of the HEZ token.
  2818. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2819. absoluteMaxL1L2BatchTimeout:
  2820. type: integer
  2821. description: L1L2 Batch Timeout
  2822. example: 240
  2823. verifiers:
  2824. type: array
  2825. description: List of verifiers struct
  2826. items:
  2827. type: object
  2828. properties:
  2829. maxTx:
  2830. type: integer
  2831. description: Maximum rollup transactions in a batch
  2832. example: 512
  2833. nlevels:
  2834. type: integer
  2835. description: Number of levels of the circuit
  2836. example: 32
  2837. required:
  2838. - maxTx
  2839. - nlevels
  2840. additionalProperties: false
  2841. hermezAuctionContract:
  2842. allOf:
  2843. - $ref: '#/components/schemas/EthereumAddress'
  2844. - description: Ethereum address of the auction smart contract.
  2845. - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
  2846. hermezGovernanceAddress:
  2847. allOf:
  2848. - $ref: '#/components/schemas/EthereumAddress'
  2849. - description: Ethereum address of the governance.
  2850. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2851. withdrawDelayerContract:
  2852. allOf:
  2853. - $ref: '#/components/schemas/EthereumAddress'
  2854. - description: Ethereum address of the withdraw delayer contracts.
  2855. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2856. required:
  2857. - tokenHEZ
  2858. - absoluteMaxL1L2BatchTimeout
  2859. - verifiers
  2860. - hermezAuctionContract
  2861. - hermezGovernanceAddress
  2862. - withdrawDelayerContract
  2863. additionalProperties: false
  2864. maxFeeIdxCoordinator:
  2865. type: integer
  2866. description: is the maximum number of tokens the coordinator can use to collect fees.
  2867. example: 64
  2868. reservedIdx:
  2869. type: integer
  2870. description: First 256 indexes reserved, first user index will be the 256.
  2871. example: 255
  2872. exitIdx:
  2873. type: integer
  2874. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2875. example: 1
  2876. limitDepositAmount:
  2877. type: integer
  2878. description: Maximum deposit amount (L1 to L2) allowed.
  2879. example: 321
  2880. limitL2TransferAmount:
  2881. type: integer
  2882. description: Maximum amount (L2 to L2) allowed.
  2883. example: 837
  2884. limitTokens:
  2885. type: integer
  2886. description: Maximum number of different tokens that can be registered in the network.
  2887. example: 4294967295
  2888. l1CoordinatorTotalBytes:
  2889. type: integer
  2890. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2891. example: 101
  2892. l1UserTotalBytes:
  2893. type: integer
  2894. 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).
  2895. example: 72
  2896. maxL1UserTx:
  2897. type: integer
  2898. description: Maximum L1-user transactions allowed to be queued in a batch.
  2899. example: 128
  2900. maxL1Tx:
  2901. type: integer
  2902. description: Maximum L1 transactions allowed to be queued in a batch.
  2903. example: 256
  2904. inputSHAConstantBytes:
  2905. type: integer
  2906. description: Input SHA constant bytes
  2907. example: 18542
  2908. numBuckets:
  2909. type: integer
  2910. description: Number of buckets
  2911. example: 5
  2912. maxWithdrawalDelay:
  2913. type: integer
  2914. description: Maximum delay to withdraw tokens. Time is measured in seconds.
  2915. example: 2 * 7 * 24 * 60 * 60
  2916. exchangeMultiplier:
  2917. type: integer
  2918. description: exchange multiplier
  2919. example: 1e14
  2920. required:
  2921. - publicConstants
  2922. - reservedIdx
  2923. - exitIdx
  2924. - limitDepositAmount
  2925. - limitL2TransferAmount
  2926. - limitTokens
  2927. - l1CoordinatorTotalBytes
  2928. - l1UserTotalBytes
  2929. - maxL1UserTx
  2930. - maxL1Tx
  2931. - inputSHAConstantBytes
  2932. - numBuckets
  2933. - maxWithdrawalDelay
  2934. - exchangeMultiplier
  2935. additionalProperties: false
  2936. auction:
  2937. type: object
  2938. description: Constant configuration of the auction smart contract.
  2939. properties:
  2940. blocksPerSlot:
  2941. type: integer
  2942. description: Blocks per slot.
  2943. initialMinimalBidding:
  2944. type: integer
  2945. description: Minimum bid when no one has bid yet.
  2946. genesisBlockNum:
  2947. allOf:
  2948. - $ref: '#/components/schemas/EthBlockNum'
  2949. - description: Ethereum block number in which the smart contract starts operating.
  2950. tokenHEZ:
  2951. allOf:
  2952. - $ref: '#/components/schemas/EthereumAddress'
  2953. - description: Ethereum address of the HEZ token.
  2954. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  2955. hermezRollup:
  2956. allOf:
  2957. - $ref: '#/components/schemas/EthereumAddress'
  2958. - description: Ethereum address of the rollup smart contract.
  2959. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2960. governanceAddress:
  2961. allOf:
  2962. - $ref: '#/components/schemas/EthereumAddress'
  2963. - description: Ethereum address of the governance.
  2964. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2965. required:
  2966. - blocksPerSlot
  2967. - initialMinimalBidding
  2968. - genesisBlockNum
  2969. - tokenHEZ
  2970. - hermezRollup
  2971. - governanceAddress
  2972. additionalProperties: false
  2973. withdrawalDelayer:
  2974. type: object
  2975. description: Constant configuration of the withdrawal delayer smart contract.
  2976. properties:
  2977. maxWithdrawalDelay:
  2978. type: integer
  2979. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
  2980. example: 200
  2981. maxEmergencyModeTime:
  2982. type: integer
  2983. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
  2984. example: 2000
  2985. hermezRollup:
  2986. allOf:
  2987. - $ref: '#/components/schemas/EthereumAddress'
  2988. - description: Ethereum address of the rollup smart contract.
  2989. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2990. required:
  2991. - maxWithdrawalDelay
  2992. - maxEmergencyModeTime
  2993. - hermezRollup
  2994. additionalProperties: false
  2995. required:
  2996. - hermez
  2997. - auction
  2998. - withdrawalDelayer
  2999. additionalProperties: false
  3000. Error:
  3001. type: object
  3002. description: Error response.
  3003. properties:
  3004. message:
  3005. type: string
  3006. Error400:
  3007. allOf:
  3008. - $ref: '#/components/schemas/Error'
  3009. - example:
  3010. message: Invalid signature.
  3011. Error404:
  3012. allOf:
  3013. - $ref: '#/components/schemas/Error'
  3014. - example:
  3015. message: Item(s) not found.
  3016. Error500:
  3017. allOf:
  3018. - $ref: '#/components/schemas/Error'
  3019. - example:
  3020. message: Database error.