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.

3068 lines
108 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/v1
  51. - description: Localhost mock Up
  52. url: http://localhost:4010/v1
  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. info:
  1305. type: string
  1306. description: "Info contains information about the status & State of the transaction. As for example, if the Tx has not been selected in the last batch due not enough Balance at the Sender account, this reason would appear at this parameter."
  1307. pattern: ".*"
  1308. example: "Tx not selected due not enough Balance at the sender."
  1309. nullable: true
  1310. signature:
  1311. allOf:
  1312. - $ref: '#/components/schemas/BJJSignature'
  1313. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1314. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1315. timestamp:
  1316. type: string
  1317. description: Moment in which the transaction was added to the pool.
  1318. format: date-time
  1319. requestFromAccountIndex:
  1320. type: string
  1321. description: >-
  1322. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1323. The identifier is built using: `hez:` + `token symbol:` + `index`
  1324. nullable: true
  1325. example: null
  1326. requestToAccountIndex:
  1327. type: string
  1328. description: >-
  1329. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1330. The identifier is built using: `hez:` + `token symbol:` + `index`
  1331. nullable: true
  1332. example: null
  1333. requestToHezEthereumAddress:
  1334. type: string
  1335. description: "Address of an Etherum account linked to the Hermez Network."
  1336. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1337. nullable: true
  1338. example: null
  1339. requestToBJJ:
  1340. type: string
  1341. 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."
  1342. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1343. nullable: true
  1344. example: null
  1345. requestTokenId:
  1346. type: integer
  1347. description: References the `tokenId` of the requested transaction.
  1348. example: null
  1349. nullable: true
  1350. requestAmount:
  1351. type: string
  1352. description: BigInt is an integer encoded as a string for numbers that are very large.
  1353. nullable: true
  1354. example: null
  1355. requestFee:
  1356. type: integer
  1357. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1358. minimum: 0
  1359. maximum: 256
  1360. nullable: true
  1361. example: null
  1362. requestNonce:
  1363. type: integer
  1364. description: Number that can only be used once per account. Increments by one with each transaction.
  1365. minimum: 0
  1366. maximum: 1.84467440737096e+19
  1367. nullable: true
  1368. example: null
  1369. token:
  1370. $ref: '#/components/schemas/Token'
  1371. example:
  1372. amount: '100000000000000'
  1373. fee: 0
  1374. fromAccountIndex: hez:SCC:256
  1375. fromBJJ: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1376. fromHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1377. id: '0x020000000001000000000006'
  1378. nonce: 6
  1379. requestAmount:
  1380. requestFee: 0
  1381. requestFromAccountIndex:
  1382. requestNonce: 0
  1383. requestToAccountIndex:
  1384. requestToBJJ:
  1385. requestToHezEthereumAddress:
  1386. requestTokenId:
  1387. signature: 5ee9c7b5baa243ba282d18596a55cc357b01513eaed75165365f802102cce4a7a1dd35e3ab31cf9039e2b8a9f570d935115be9379a3dd47813dfc014031ab201
  1388. state: pend
  1389. timestamp: '2020-11-17T13:58:54.422232Z'
  1390. toAccountIndex: hez:SCC:257
  1391. toBjj: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1392. toHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1393. token:
  1394. USD: 23.74
  1395. decimals: 7
  1396. ethereumAddress: '0x0000000000000000000000000000000000000006'
  1397. ethereumBlockNum: 2
  1398. fiatUpdate:
  1399. id: 6
  1400. itemId: 7
  1401. name: Some Cool Coin
  1402. symbol: 'SCC'
  1403. type: Transfer
  1404. required:
  1405. - id
  1406. - type
  1407. - fromAccountIndex
  1408. - fromHezEthereumAddress
  1409. - fromBJJ
  1410. - toAccountIndex
  1411. - toHezEthereumAddress
  1412. - toBjj
  1413. - amount
  1414. - fee
  1415. - nonce
  1416. - state
  1417. - info
  1418. - signature
  1419. - timestamp
  1420. - requestFromAccountIndex
  1421. - requestToAccountIndex
  1422. - requestToHezEthereumAddress
  1423. - requestToBJJ
  1424. - requestTokenId
  1425. - requestAmount
  1426. - requestFee
  1427. - requestNonce
  1428. - token
  1429. TransactionId:
  1430. type: string
  1431. 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)
  1432. example: "0x00000000000001e240004700"
  1433. EthereumAddress:
  1434. type: string
  1435. description: "Address of an Etherum account."
  1436. pattern: "^0x[a-fA-F0-9]{40}$"
  1437. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1438. HezEthereumAddress:
  1439. type: string
  1440. description: "Address of an Etherum account linked to the Hermez Network."
  1441. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1442. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1443. BJJ:
  1444. type: string
  1445. 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."
  1446. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1447. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1448. AccountIndex:
  1449. type: string
  1450. description: >-
  1451. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1452. The identifier is built using: `hez:` + `token symbol:` + `index`
  1453. example: "hez:DAI:4444"
  1454. TransactionType:
  1455. type: string
  1456. description: Type of transaction.
  1457. enum:
  1458. - Exit
  1459. - Transfer
  1460. - Deposit
  1461. - CreateAccountDeposit
  1462. - CreateAccountDepositTransfer
  1463. - DepositTransfer
  1464. - ForceTransfer
  1465. - ForceExit
  1466. - TransferToEthAddr
  1467. - TransferToBJJ
  1468. TransactionTypeL2:
  1469. type: string
  1470. description: Type of transaction.
  1471. enum:
  1472. - Exit
  1473. - Transfer
  1474. - TransferToEthAddr
  1475. - TransferToBJJ
  1476. TokenId:
  1477. type: integer
  1478. description: Identifier of a token registered in the network.
  1479. minimum: 0
  1480. maximum: 4294967295
  1481. example: 98765
  1482. BigInt:
  1483. type: string
  1484. description: BigInt is an integer encoded as a string for numbers that are very large.
  1485. example: "8708856933496328593"
  1486. pattern: "^\\d+$"
  1487. FeeSelector:
  1488. type: integer
  1489. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1490. minimum: 0
  1491. maximum: 256
  1492. example: 36
  1493. Nonce:
  1494. type: integer
  1495. description: Number that can only be used once per account, increments by one at each transaction.
  1496. minimum: 0
  1497. maximum: 1.84467440737096e+19
  1498. example: 121
  1499. PoolL2TransactionState:
  1500. type: string
  1501. description: >
  1502. State of a L2 transaction from the coordinator pool.
  1503. * pend: Pending
  1504. * fing: Forging
  1505. * fged: Forged
  1506. * invl: Invalid
  1507. enum:
  1508. - pend
  1509. - fing
  1510. - fged
  1511. - invl
  1512. ETHSignature:
  1513. type: string
  1514. description: Ethereum signature.
  1515. pattern: "^0x[a-fA-F0-9]{130}$"
  1516. example: "0xf9161cd688394772d93aa3e7b3f8f9553ca4f94f65b7cece93ed4a239d5c0b4677dca6d1d459e3a5c271a34de735d4664a43e5a8960a9a6e027d12c562dd448e1c"
  1517. BJJSignature:
  1518. type: string
  1519. description: BabyJubJub compressed signature.
  1520. pattern: "^[a-fA-F0-9]{128}$"
  1521. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1522. BatchNum:
  1523. type: integer
  1524. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1525. minimum: 0
  1526. maximum: 4294967295
  1527. example: 5432
  1528. AccountCreationAuthorizationPost:
  1529. type: object
  1530. properties:
  1531. hezEthereumAddress:
  1532. $ref: '#/components/schemas/HezEthereumAddress'
  1533. bjj:
  1534. $ref: '#/components/schemas/BJJ'
  1535. signature:
  1536. $ref: '#/components/schemas/ETHSignature'
  1537. example:
  1538. hezEthereumAddress: hez:0xb5270eB4ae11c6fAAff6F5fa0A5202B8d963634C
  1539. bjj: hez:hg2Ydsb8O66H-steBR3cnHl944ua7E-PkTJ_SbPBBg5r
  1540. signature: '0xb7cf237c4a2ff3d4df57752e7b9deb236fa384f03a79d39acf17ec5f8d12a3cf00b017c2466611310cb2bacac68460e96778278646842c6d2bcb79979271c28501'
  1541. required:
  1542. - hezEthereumAddress
  1543. - bjj
  1544. - signature
  1545. AccountCreationAuthorization:
  1546. type: object
  1547. properties:
  1548. timestamp:
  1549. type: string
  1550. format: date-time
  1551. hezEthereumAddress:
  1552. $ref: '#/components/schemas/HezEthereumAddress'
  1553. bjj:
  1554. $ref: '#/components/schemas/BJJ'
  1555. signature:
  1556. $ref: '#/components/schemas/ETHSignature'
  1557. example:
  1558. hezEthereumAddress: hez:0x74a549b410d01d9eC56346aE52b8550515B283b2
  1559. bjj: hez:dEZ-Tj7d5h0TAqbnRTTYURYDEo5KZzB87_2WknUU8gCN
  1560. signature: '0x8db6db2ad6cbe21297fb8ee01c59b01b52d4df7ea92a0f0dee0be0075a8f224a06b367407c8f402cfe0490c142a1c92da3fc29b51162ae160d35e1577d3071bb01'
  1561. timestamp: '2020-11-17T13:25:36.784295Z'
  1562. additionalProperties: false
  1563. required:
  1564. - timestamp
  1565. - hezEthereumAddress
  1566. - bjj
  1567. - signature
  1568. HistoryTransaction:
  1569. type: object
  1570. description: Transaction of the Hermez Network
  1571. properties:
  1572. L1orL2:
  1573. type: string
  1574. enum:
  1575. - L1
  1576. - L2
  1577. id:
  1578. $ref: '#/components/schemas/TransactionId'
  1579. itemId:
  1580. $ref: '#/components/schemas/ItemId'
  1581. type:
  1582. $ref: '#/components/schemas/TransactionType'
  1583. position:
  1584. $ref: '#/components/schemas/TransactionPosition'
  1585. fromAccountIndex:
  1586. type: string
  1587. description: >-
  1588. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1589. The identifier is built using: `hez:` + `token symbol:` + `index`
  1590. example: "hez:DAI:4444"
  1591. nullable: true
  1592. fromHezEthereumAddress:
  1593. type: string
  1594. description: "Address of an Etherum account linked to the Hermez Network."
  1595. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1596. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1597. nullable: true
  1598. fromBJJ:
  1599. type: string
  1600. 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."
  1601. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1602. example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
  1603. nullable: true
  1604. toAccountIndex:
  1605. allOf:
  1606. - $ref: '#/components/schemas/AccountIndex'
  1607. - example: "hez:DAI:672"
  1608. toHezEthereumAddress:
  1609. type: string
  1610. description: "Address of an Etherum account linked to the Hermez Network."
  1611. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1612. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1613. nullable: true
  1614. toBJJ:
  1615. type: string
  1616. 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."
  1617. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1618. example: "hez:f1J78_6uqTyjX6jrVCqN4RFeRBnWQAGl477ZFtOnH6Sm"
  1619. nullable: true
  1620. amount:
  1621. allOf:
  1622. - $ref: '#/components/schemas/BigInt'
  1623. - description: Amount of tokens to be sent.
  1624. - example: "4903020000000000000"
  1625. batchNum:
  1626. type: integer
  1627. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1628. minimum: 0
  1629. maximum: 4294967295
  1630. example: 5432
  1631. nullable: true
  1632. historicUSD:
  1633. type: number
  1634. description: Value in USD at the moment the transaction was forged.
  1635. example: 49.7
  1636. nullable: true
  1637. timestamp:
  1638. type: string
  1639. format: date-time
  1640. 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.
  1641. token:
  1642. $ref: '#/components/schemas/Token'
  1643. L1Info:
  1644. type: object
  1645. description: Additional information that only applies to L1 transactions.
  1646. nullable: true
  1647. properties:
  1648. toForgeL1TransactionsNum:
  1649. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1650. userOrigin:
  1651. type: boolean
  1652. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1653. depositAmount:
  1654. allOf:
  1655. - $ref: '#/components/schemas/BigInt'
  1656. - description: Tokens transfered from L1 to L2.
  1657. - example: "4900000000000000000"
  1658. amountSuccess:
  1659. type: boolean
  1660. description: >-
  1661. Indicates if the amount specified by the user has been sent propperly. If false, the amount that actualy has been sent is 0.
  1662. 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.
  1663. An example were this value could be false: a user send a `DepositTransfer` transaction, but when the tx is forged there are not
  1664. 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.
  1665. example: true
  1666. depositAmountSuccess:
  1667. type: boolean
  1668. description: >-
  1669. 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.
  1670. 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.
  1671. 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.
  1672. In this case transaction won't be effective making the deposit amount have a real value of 0.
  1673. example: true
  1674. historicDepositAmountUSD:
  1675. type: number
  1676. description: Deposit amount in USD, at the moment the transaction was made.
  1677. example: 3.897
  1678. nullable: true
  1679. ethereumBlockNum:
  1680. allOf:
  1681. - $ref: '#/components/schemas/EthBlockNum'
  1682. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1683. - example: 258723049
  1684. required:
  1685. - toForgeL1TransactionsNum
  1686. - userOrigin
  1687. - depositAmount
  1688. - amountSuccess
  1689. - depositAmountSuccess
  1690. - historicDepositAmountUSD
  1691. - ethereumBlockNum
  1692. additionalProperties: false
  1693. L2Info:
  1694. type: object
  1695. description: Additional information that only applies to L2 transactions.
  1696. nullable: true
  1697. properties:
  1698. fee:
  1699. $ref: '#/components/schemas/FeeSelector'
  1700. historicFeeUSD:
  1701. type: number
  1702. description: Fee in USD, at the moment the transaction was forged.
  1703. example: 263.89
  1704. nullable: true
  1705. nonce:
  1706. $ref: '#/components/schemas/Nonce'
  1707. example: null
  1708. required:
  1709. - fee
  1710. - historicFeeUSD
  1711. - nonce
  1712. additionalProperties: false
  1713. example:
  1714. L1Info:
  1715. ethereumBlockNum: 1
  1716. historicDepositAmountUSD: 232.47
  1717. depositAmount: '261'
  1718. toForgeL1TransactionsNum: 10
  1719. userOrigin: true
  1720. L1orL2: L1
  1721. L2Info:
  1722. amount: '261'
  1723. batchNum: 1
  1724. fromAccountIndex: hez:ETH:276
  1725. fromBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1726. fromHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1727. historicUSD: 3784.19
  1728. id: '0x00000000000000000a000400'
  1729. itemId: 2
  1730. position: 4
  1731. timestamp: '2020-11-17T14:08:12.197554Z'
  1732. toAccountIndex: hez:ETH:276
  1733. toBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1734. toHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1735. token:
  1736. USD: 234.56
  1737. decimals: 18
  1738. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1739. ethereumBlockNum: 0
  1740. fiatUpdate:
  1741. id: 0
  1742. itemId: 1
  1743. name: Ether
  1744. symbol: ETH
  1745. type: CreateAccountDeposit
  1746. required:
  1747. - L1orL2
  1748. - id
  1749. - itemId
  1750. - type
  1751. - position
  1752. - fromAccountIndex
  1753. - fromHezEthereumAddress
  1754. - fromBJJ
  1755. - toAccountIndex
  1756. - toHezEthereumAddress
  1757. - toBJJ
  1758. - amount
  1759. - batchNum
  1760. - historicUSD
  1761. - timestamp
  1762. - token
  1763. - L1Info
  1764. - L2Info
  1765. additionalProperties: false
  1766. HistoryTransactions:
  1767. type: object
  1768. properties:
  1769. transactions:
  1770. type: array
  1771. description: List of history transactions.
  1772. items:
  1773. $ref: '#/components/schemas/HistoryTransaction'
  1774. pendingItems:
  1775. $ref: '#/components/schemas/PendingItems'
  1776. example:
  1777. transactions:
  1778. - L1Info:
  1779. ethereumBlockNum: 3
  1780. historicDepositAmountUSD:
  1781. depositAmount: '0'
  1782. toForgeL1TransactionsNum: 7
  1783. userOrigin: true
  1784. L1orL2: L1
  1785. L2Info:
  1786. amount: '88888800000000000'
  1787. batchNum: 9
  1788. fromAccountIndex: hez:ETH:262
  1789. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1790. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1791. historicUSD: 44.4444
  1792. id: '0x000000000000000007000300'
  1793. itemId: 28
  1794. position: 3
  1795. timestamp: '2020-11-26T09:18:40.004749Z'
  1796. toAccountIndex: hez:EXIT:1
  1797. toBJJ:
  1798. toHezEthereumAddress:
  1799. token:
  1800. USD: 500
  1801. decimals: 18
  1802. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1803. ethereumBlockNum: 0
  1804. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1805. id: 0
  1806. itemId: 1
  1807. name: Ether
  1808. symbol: ETH
  1809. type: ForceExit
  1810. - L1Info:
  1811. L1orL2: L2
  1812. L2Info:
  1813. fee: 123
  1814. historicFeeUSD: 2.15037380962404
  1815. nonce: 1
  1816. amount: '55555500000000000'
  1817. batchNum: 8
  1818. fromAccountIndex: hez:TKN1:264
  1819. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1820. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1821. historicUSD: 23.4999765
  1822. id: '0x020000000001080000000001'
  1823. itemId: 19
  1824. position: 2
  1825. timestamp: '2020-11-26T09:18:40.004749Z'
  1826. toAccountIndex: hez:TKN1:260
  1827. toBJJ: hez:81h61cx0FKR1RXcLbHW8cZMPY8SR6yKU3ei4pmcLjpaQ
  1828. toHezEthereumAddress: hez:0x6813Eb9362372EEF6200f3b1dbC3f819671cBA69
  1829. token:
  1830. USD: 423
  1831. decimals: 18
  1832. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1833. ethereumBlockNum: 2
  1834. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1835. id: 1
  1836. itemId: 2
  1837. name: Test Token 1
  1838. symbol: TKN1
  1839. type: Transfer
  1840. - L1Info:
  1841. L1orL2: L2
  1842. L2Info:
  1843. fee: 44
  1844. historicFeeUSD: 0.1973587359744
  1845. nonce: 2
  1846. amount: '66666600000000000'
  1847. batchNum: 8
  1848. fromAccountIndex: hez:ETH:259
  1849. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1850. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1851. historicUSD: 33.3333
  1852. id: '0x020000000001030000000002'
  1853. itemId: 20
  1854. position: 3
  1855. timestamp: '2020-11-26T09:18:40.004749Z'
  1856. toAccountIndex: hez:EXIT:1
  1857. toBJJ:
  1858. toHezEthereumAddress:
  1859. token:
  1860. USD: 500
  1861. decimals: 18
  1862. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1863. ethereumBlockNum: 0
  1864. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1865. id: 0
  1866. itemId: 1
  1867. name: Ether
  1868. symbol: ETH
  1869. type: Exit
  1870. - L1Info:
  1871. ethereumBlockNum: 3
  1872. historicDepositAmountUSD: 14099.9999859
  1873. depositAmount: '33333333300000000000'
  1874. toForgeL1TransactionsNum: 2
  1875. userOrigin: true
  1876. L1orL2: L1
  1877. L2Info:
  1878. amount: '0'
  1879. batchNum: 4
  1880. fromAccountIndex: hez:TKN1:0
  1881. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1882. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1883. historicUSD:
  1884. id: '0x000000000000000002000000'
  1885. itemId: 9
  1886. position: 0
  1887. timestamp: '2020-11-26T09:18:40.004749Z'
  1888. toAccountIndex: hez:TKN1:0
  1889. toBJJ:
  1890. toHezEthereumAddress:
  1891. token:
  1892. USD: 423
  1893. decimals: 18
  1894. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1895. ethereumBlockNum: 2
  1896. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1897. id: 1
  1898. itemId: 2
  1899. name: Test Token 1
  1900. symbol: TKN1
  1901. type: CreateAccountDeposit
  1902. - L1Info:
  1903. L1orL2: L2
  1904. L2Info:
  1905. fee: 2
  1906. historicFeeUSD: 3.87833366166246e-17
  1907. nonce: 1
  1908. amount: '11111100000000000'
  1909. batchNum: 7
  1910. fromAccountIndex: hez:TKN1:261
  1911. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1912. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1913. historicUSD: 4.6999953
  1914. id: '0x020000000001050000000001'
  1915. itemId: 15
  1916. position: 2
  1917. timestamp: '2020-11-26T09:18:40.004749Z'
  1918. toAccountIndex: hez:TKN1:264
  1919. toBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1920. toHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1921. token:
  1922. USD: 423
  1923. decimals: 18
  1924. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1925. ethereumBlockNum: 2
  1926. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1927. id: 1
  1928. itemId: 2
  1929. name: Test Token 1
  1930. symbol: TKN1
  1931. type: Transfer
  1932. pendingItems: 23
  1933. required:
  1934. - transactions
  1935. - pendingItems
  1936. additionalProperties: false
  1937. EthBlockNum:
  1938. type: integer
  1939. description: Ethereum block number
  1940. minimum: 0
  1941. maximum: 1.84467440737096e+19
  1942. example: 762375478
  1943. ToForgeL1TransactionsNum:
  1944. type: integer
  1945. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  1946. minimum: 0
  1947. maximum: 4294967295
  1948. example: 784
  1949. nullable: true
  1950. TransactionPosition:
  1951. type: integer
  1952. description: Position that a transaction occupies in a batch.
  1953. minimum: 0
  1954. example: 5
  1955. URL:
  1956. type: string
  1957. description: HTTP URL
  1958. example: "https://apimock.hermez.network"
  1959. TokenSymbol:
  1960. type: string
  1961. description: Abreviation of the token name.
  1962. example: "DAI"
  1963. TokenName:
  1964. type: string
  1965. description: Token name.
  1966. example: "Dai"
  1967. CollectedFees:
  1968. type: object
  1969. 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.
  1970. additionalProperties:
  1971. type: string
  1972. example:
  1973. 1234: "425632785672345647"
  1974. 4321: "86538967235465432654352"
  1975. Batch:
  1976. type: object
  1977. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1978. properties:
  1979. itemId:
  1980. $ref: '#/components/schemas/ItemId'
  1981. batchNum:
  1982. $ref: '#/components/schemas/BatchNum'
  1983. ethereumBlockNum:
  1984. $ref: '#/components/schemas/EthBlockNum'
  1985. ethereumBlockHash:
  1986. type: string
  1987. description: hash of the Ethereum block in which the batch was forged
  1988. example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
  1989. timestamp:
  1990. type: string
  1991. format: date-time
  1992. description: Time in which the batch was forged.
  1993. forgerAddr:
  1994. $ref: '#/components/schemas/EthereumAddress'
  1995. collectedFees:
  1996. $ref: '#/components/schemas/CollectedFees'
  1997. historicTotalCollectedFeesUSD:
  1998. type: number
  1999. description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
  2000. example: 23.3
  2001. stateRoot:
  2002. allOf:
  2003. - $ref: '#/components/schemas/Hash'
  2004. - description: Root of the accounts Merkle Tree.
  2005. - example: "2734657026572a8708d883"
  2006. numAccounts:
  2007. type: integer
  2008. description: Number of registered accounts in this batch.
  2009. exitRoot:
  2010. allOf:
  2011. - $ref: '#/components/schemas/Hash'
  2012. - description: Root of the exit Merkle Tree associated to this batch.
  2013. - example: "2734657026572a8708d883"
  2014. forgeL1TransactionsNum:
  2015. type: integer
  2016. description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  2017. example: 5
  2018. nullable: true
  2019. slotNum:
  2020. $ref: '#/components/schemas/SlotNum'
  2021. forgedTransactions:
  2022. type: integer
  2023. description: Amount of forged transactions in this batch.
  2024. example: 318
  2025. additionalProperties: false
  2026. required:
  2027. - itemId
  2028. - batchNum
  2029. - ethereumBlockNum
  2030. - ethereumBlockHash
  2031. - timestamp
  2032. - forgerAddr
  2033. - collectedFees
  2034. - historicTotalCollectedFeesUSD
  2035. - stateRoot
  2036. - numAccounts
  2037. - exitRoot
  2038. - forgeL1TransactionsNum
  2039. - slotNum
  2040. - forgedTransactions
  2041. FullBatch:
  2042. type: object
  2043. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  2044. properties:
  2045. batch:
  2046. $ref: '#/components/schemas/Batch'
  2047. transactions:
  2048. type: array
  2049. description: List of forged transactions in the batch
  2050. items:
  2051. $ref: '#/components/schemas/HistoryTransaction'
  2052. nullable: true
  2053. additionalProperties: false
  2054. required:
  2055. - batch
  2056. - transactions
  2057. Hash:
  2058. type: string
  2059. description: hashed data
  2060. example: "2734657026572a8708d883"
  2061. SlotNum:
  2062. type: integer
  2063. description: Identifier of a slot.
  2064. minimum: 0
  2065. maximum: 4294967295
  2066. example: 784
  2067. Batches:
  2068. type: object
  2069. properties:
  2070. batches:
  2071. type: array
  2072. description: List of batches.
  2073. items:
  2074. $ref: '#/components/schemas/Batch'
  2075. pendingItems:
  2076. $ref: '#/components/schemas/PendingItems'
  2077. additionalProperties: false
  2078. required:
  2079. - batches
  2080. - pendingItems
  2081. Coordinator:
  2082. type: object
  2083. properties:
  2084. itemId:
  2085. $ref: '#/components/schemas/ItemId'
  2086. forgerAddr:
  2087. $ref: '#/components/schemas/EthereumAddress'
  2088. bidderAddr:
  2089. $ref: '#/components/schemas/EthereumAddress'
  2090. URL:
  2091. $ref: '#/components/schemas/URL'
  2092. ethereumBlock:
  2093. allOf:
  2094. - $ref: '#/components/schemas/EthBlockNum'
  2095. - description: Ethereum block in which the coordinator registered into the network.
  2096. - example: 5735943738
  2097. additionalProperties: false
  2098. required:
  2099. - itemId
  2100. - forgerAddr
  2101. - bidderAddr
  2102. - URL
  2103. - ethereumBlock
  2104. Coordinators:
  2105. type: object
  2106. properties:
  2107. coordinators:
  2108. type: array
  2109. description: List of coordinators.
  2110. items:
  2111. $ref: '#/components/schemas/Coordinator'
  2112. pendingItems:
  2113. $ref: '#/components/schemas/PendingItems'
  2114. additionalProperties: false
  2115. required:
  2116. - coordinators
  2117. - pendingItems
  2118. Bid:
  2119. type: object
  2120. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  2121. properties:
  2122. itemId:
  2123. $ref: '#/components/schemas/ItemId'
  2124. bidderAddr:
  2125. $ref: '#/components/schemas/EthereumAddress'
  2126. forgerAddr:
  2127. $ref: '#/components/schemas/EthereumAddress'
  2128. slotNum:
  2129. $ref: '#/components/schemas/SlotNum'
  2130. URL:
  2131. $ref: '#/components/schemas/URL'
  2132. bidValue:
  2133. $ref: '#/components/schemas/BigInt'
  2134. ethereumBlockNum:
  2135. $ref: '#/components/schemas/EthBlockNum'
  2136. timestamp:
  2137. type: string
  2138. format: date-time
  2139. additionalProperties: false
  2140. required:
  2141. - bidderAddr
  2142. - forgerAddr
  2143. - slotNum
  2144. - URL
  2145. - bidValue
  2146. - ethereumBlockNum
  2147. - timestamp
  2148. Bids:
  2149. type: object
  2150. properties:
  2151. bids:
  2152. type: array
  2153. description: List of bids.
  2154. items:
  2155. $ref: '#/components/schemas/Bid'
  2156. pendingItems:
  2157. $ref: '#/components/schemas/PendingItems'
  2158. additionalProperties: false
  2159. required:
  2160. - bids
  2161. - pendingItems
  2162. RecommendedFee:
  2163. type: object
  2164. description: Fee that the coordinator recommends per transaction in USD.
  2165. properties:
  2166. existingAccount:
  2167. type: number
  2168. description: Recommended fee if the destination account of the transaction already exists.
  2169. minimum: 0
  2170. example: 0.1
  2171. createAccount:
  2172. type: number
  2173. 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.
  2174. minimum: 0
  2175. example: 1.3
  2176. createAccountInternal:
  2177. type: number
  2178. 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.
  2179. minimum: 0
  2180. example: 0.5
  2181. required:
  2182. - existingAccount
  2183. - createAccount
  2184. - createAccountInternal
  2185. additionalProperties: false
  2186. Token:
  2187. type: object
  2188. description: Hermez Network compatible and registered token.
  2189. properties:
  2190. id:
  2191. $ref: '#/components/schemas/TokenId'
  2192. ethereumAddress:
  2193. allOf:
  2194. - $ref: '#/components/schemas/EthereumAddress'
  2195. - description: Ethereum address in which the token is deployed.
  2196. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  2197. itemId:
  2198. $ref: '#/components/schemas/ItemId'
  2199. name:
  2200. type: string
  2201. description: full name of the token
  2202. example: Maker Dai
  2203. symbol:
  2204. allOf:
  2205. - $ref: '#/components/schemas/TokenSymbol'
  2206. - example: DAI
  2207. decimals:
  2208. type: integer
  2209. description: Number of decimals of the token.
  2210. example: 18
  2211. ethereumBlockNum:
  2212. allOf:
  2213. - $ref: '#/components/schemas/EthBlockNum'
  2214. - description: Ethereum block number in which the token was added to the Hermez Network.
  2215. - example: 539847538
  2216. USD:
  2217. type: number
  2218. description: Value of the token in USD.
  2219. example: 1.01
  2220. nullable: true
  2221. fiatUpdate:
  2222. type: string
  2223. format: date-time
  2224. description: Timestamp of the moment the `USD` value was updated.
  2225. nullable: true
  2226. required:
  2227. - id
  2228. - ethereumAddress
  2229. - itemId
  2230. - name
  2231. - symbol
  2232. - decimals
  2233. - ethereumBlockNum
  2234. - USD
  2235. - fiatUpdate
  2236. additionalProperties: false
  2237. Tokens:
  2238. type: object
  2239. properties:
  2240. tokens:
  2241. type: array
  2242. description: List of tokens.
  2243. items:
  2244. $ref: '#/components/schemas/Token'
  2245. pendingItems:
  2246. $ref: '#/components/schemas/PendingItems'
  2247. Exit:
  2248. type: object
  2249. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  2250. properties:
  2251. batchNum:
  2252. allOf:
  2253. - $ref: '#/components/schemas/BatchNum'
  2254. - description: Batch in which the exit was forged.
  2255. - example: 7394
  2256. accountIndex:
  2257. $ref: '#/components/schemas/AccountIndex'
  2258. bjj:
  2259. $ref: '#/components/schemas/BJJ'
  2260. hezEthereumAddress:
  2261. $ref: '#/components/schemas/HezEthereumAddress'
  2262. itemId:
  2263. $ref: '#/components/schemas/ItemId'
  2264. merkleProof:
  2265. type: object
  2266. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  2267. properties:
  2268. root:
  2269. $ref: '#/components/schemas/BigInt'
  2270. siblings:
  2271. type: array
  2272. items:
  2273. $ref: '#/components/schemas/BigInt'
  2274. oldKey:
  2275. $ref: '#/components/schemas/BigInt'
  2276. oldValue:
  2277. $ref: '#/components/schemas/BigInt'
  2278. isOld0:
  2279. type: boolean
  2280. key:
  2281. $ref: '#/components/schemas/BigInt'
  2282. value:
  2283. $ref: '#/components/schemas/BigInt'
  2284. fnc:
  2285. type: integer
  2286. maximum: 3
  2287. minimum: 0
  2288. required:
  2289. - root
  2290. - siblings
  2291. - oldKey
  2292. - oldValue
  2293. - isOld0
  2294. - key
  2295. - value
  2296. - fnc
  2297. additionalProperties: false
  2298. balance:
  2299. $ref: '#/components/schemas/BigInt'
  2300. instantWithdraw:
  2301. type: integer
  2302. description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  2303. minimum: 0
  2304. maximum: 1.84467440737096e+19
  2305. example: 74747363
  2306. nullable: true
  2307. delayedWithdrawRequest:
  2308. type: integer
  2309. description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  2310. minimum: 0
  2311. maximum: 1.84467440737096e+19
  2312. example: null
  2313. nullable: true
  2314. delayedWithdraw:
  2315. type: integer
  2316. 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.
  2317. minimum: 0
  2318. maximum: 1.84467440737096e+19
  2319. example: null
  2320. nullable: true
  2321. token:
  2322. $ref: '#/components/schemas/Token'
  2323. required:
  2324. - batchNum
  2325. - accountIndex
  2326. - bjj
  2327. - hezEthereumAddress
  2328. - itemId
  2329. - merkleProof
  2330. - balance
  2331. - instantWithdraw
  2332. - delayedWithdrawRequest
  2333. - delayedWithdraw
  2334. - token
  2335. additionalProperties: false
  2336. Exits:
  2337. type: object
  2338. properties:
  2339. exits:
  2340. type: array
  2341. description: List of exits.
  2342. items:
  2343. $ref: '#/components/schemas/Exit'
  2344. pendingItems:
  2345. $ref: '#/components/schemas/PendingItems'
  2346. required:
  2347. - exits
  2348. - pendingItems
  2349. additionalProperties: false
  2350. Account:
  2351. type: object
  2352. description: State tree leaf. It contains balance and nonce of an account.
  2353. properties:
  2354. itemId:
  2355. $ref: '#/components/schemas/ItemId'
  2356. accountIndex:
  2357. $ref: '#/components/schemas/AccountIndex'
  2358. nonce:
  2359. $ref: '#/components/schemas/Nonce'
  2360. balance:
  2361. $ref: '#/components/schemas/BigInt'
  2362. bjj:
  2363. $ref: '#/components/schemas/BJJ'
  2364. hezEthereumAddress:
  2365. $ref: '#/components/schemas/HezEthereumAddress'
  2366. token:
  2367. $ref: '#/components/schemas/Token'
  2368. example:
  2369. accountIndex: hez:ETH:259
  2370. balance: '2590000000000000000'
  2371. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2372. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2373. itemId: 4
  2374. nonce: 0
  2375. token:
  2376. USD: 500
  2377. decimals: 18
  2378. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2379. ethereumBlockNum: 0
  2380. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2381. id: 0
  2382. itemId: 1
  2383. name: Ether
  2384. symbol: ETH
  2385. additionalProperties: false
  2386. required:
  2387. - itemId
  2388. - accountIndex
  2389. - nonce
  2390. - balance
  2391. - bjj
  2392. - hezEthereumAddress
  2393. - token
  2394. Accounts:
  2395. type: object
  2396. properties:
  2397. accounts:
  2398. type: array
  2399. description: List of accounts.
  2400. items:
  2401. $ref: '#/components/schemas/Account'
  2402. pendingItems:
  2403. $ref: '#/components/schemas/PendingItems'
  2404. example:
  2405. accounts:
  2406. - accountIndex: hez:ETH:259
  2407. balance: '2590000000000000000'
  2408. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2409. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2410. itemId: 4
  2411. nonce: 0
  2412. token:
  2413. USD: 500
  2414. decimals: 18
  2415. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2416. ethereumBlockNum: 0
  2417. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2418. id: 0
  2419. itemId: 1
  2420. name: Ether
  2421. symbol: ETH
  2422. - accountIndex: hez:TKN1:261
  2423. balance: '2610000000'
  2424. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2425. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2426. itemId: 6
  2427. nonce: 0
  2428. token:
  2429. USD: 423
  2430. decimals: 18
  2431. ethereumAddress: '0x0000000000000000000000000000000000000064'
  2432. ethereumBlockNum: 2
  2433. fiatUpdate: '2020-11-26T09:53:47.456619Z'
  2434. id: 1
  2435. itemId: 2
  2436. name: Test Token 1
  2437. symbol: TKN1
  2438. pendingItems: 0
  2439. additionalProperties: false
  2440. required:
  2441. - accounts
  2442. - pendingItems
  2443. Slot:
  2444. type: object
  2445. description: Slot information.
  2446. properties:
  2447. itemId:
  2448. $ref: '#/components/schemas/ItemId'
  2449. slotNum:
  2450. $ref: '#/components/schemas/SlotNum'
  2451. firstBlock:
  2452. allOf:
  2453. - $ref: '#/components/schemas/EthBlockNum'
  2454. - description: Block in which the slot began or will begin
  2455. - example: 76238647846
  2456. lastBlock:
  2457. allOf:
  2458. - $ref: '#/components/schemas/EthBlockNum'
  2459. - description: Block in which the slot ended or will end
  2460. - example: 4475934
  2461. openAuction:
  2462. type: boolean
  2463. description: Whether the auction of the slot is open or not.
  2464. bestBid:
  2465. type: object
  2466. description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
  2467. nullable: true
  2468. properties:
  2469. itemId:
  2470. $ref: '#/components/schemas/ItemId'
  2471. bidderAddr:
  2472. $ref: '#/components/schemas/EthereumAddress'
  2473. forgerAddr:
  2474. $ref: '#/components/schemas/EthereumAddress'
  2475. slotNum:
  2476. $ref: '#/components/schemas/SlotNum'
  2477. URL:
  2478. $ref: '#/components/schemas/URL'
  2479. bidValue:
  2480. type: string
  2481. description: BigInt is an integer encoded as a string for numbers that are very large.
  2482. example: "8708856933496328593"
  2483. pattern: "^\\d+$"
  2484. ethereumBlockNum:
  2485. $ref: '#/components/schemas/EthBlockNum'
  2486. timestamp:
  2487. type: string
  2488. format: date-time
  2489. additionalProperties: false
  2490. required:
  2491. - bidderAddr
  2492. - forgerAddr
  2493. - slotNum
  2494. - URL
  2495. - bidValue
  2496. - ethereumBlockNum
  2497. - timestamp
  2498. additionalProperties: false
  2499. required:
  2500. - slotNum
  2501. - firstBlock
  2502. - lastBlock
  2503. - openAuction
  2504. - bestBid
  2505. Slots:
  2506. type: object
  2507. properties:
  2508. slots:
  2509. type: array
  2510. description: List of slots.
  2511. items:
  2512. allOf:
  2513. - $ref: '#/components/schemas/Slot'
  2514. - description: Last synchronized Etherum block.
  2515. pendingItems:
  2516. $ref: '#/components/schemas/PendingItems'
  2517. additionalProperties: false
  2518. required:
  2519. - slots
  2520. - pendingItems
  2521. NextForger:
  2522. type: object
  2523. description: Coordinator information along with the scheduled forging period
  2524. properties:
  2525. coordinator:
  2526. $ref: '#/components/schemas/Coordinator'
  2527. period:
  2528. type: object
  2529. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2530. properties:
  2531. slotNum:
  2532. $ref: '#/components/schemas/SlotNum'
  2533. fromBlock:
  2534. $ref: '#/components/schemas/EthBlockNum'
  2535. toBlock:
  2536. $ref: '#/components/schemas/EthBlockNum'
  2537. fromTimestamp:
  2538. type: string
  2539. format: date-time
  2540. toTimestamp:
  2541. type: string
  2542. format: date-time
  2543. required:
  2544. - slotNum
  2545. - fromBlock
  2546. - toBlock
  2547. - fromTimestamp
  2548. - toTimestamp
  2549. additionalProperties: false
  2550. required:
  2551. - coordinator
  2552. - period
  2553. additionalProperties: false
  2554. NextForgers:
  2555. type: array
  2556. description: List of next coordinators to forge.
  2557. items:
  2558. $ref: '#/components/schemas/NextForger'
  2559. Node:
  2560. type: object
  2561. description: Configuration and metrics of the coordinator node. Note that this is specific for each coordinator.
  2562. properties:
  2563. forgeDelay:
  2564. type: number
  2565. description: |
  2566. Delay in seconds after which a batch is forged if the slot is
  2567. already committed. If set to 0s, the coordinator will continuously
  2568. forge at the maximum rate. Note that this is a configuration parameter of a node,
  2569. so each coordinator may have a different value.
  2570. example: 193.4
  2571. poolLoad:
  2572. type: number
  2573. description: Number of pending transactions in the pool
  2574. example: 23201
  2575. additionalProperties: false
  2576. required:
  2577. - forgeDelay
  2578. - poolLoad
  2579. State:
  2580. type: object
  2581. description: Gobal variables of the network
  2582. properties:
  2583. network:
  2584. $ref: '#/components/schemas/StateNetwork'
  2585. metrics:
  2586. $ref: '#/components/schemas/StateMetrics'
  2587. rollup:
  2588. $ref: '#/components/schemas/StateRollup'
  2589. auction:
  2590. $ref: '#/components/schemas/StateAuction'
  2591. withdrawalDelayer:
  2592. $ref: '#/components/schemas/StateWithdrawDelayer'
  2593. recommendedFee:
  2594. $ref: '#/components/schemas/RecommendedFee'
  2595. node:
  2596. $ref: '#/components/schemas/Node'
  2597. additionalProperties: false
  2598. required:
  2599. - network
  2600. - metrics
  2601. - rollup
  2602. - auction
  2603. - withdrawalDelayer
  2604. - recommendedFee
  2605. - node
  2606. StateNetwork:
  2607. type: object
  2608. description: Gobal statistics of the network
  2609. properties:
  2610. lastEthereumBlock:
  2611. allOf:
  2612. - $ref: '#/components/schemas/EthBlockNum'
  2613. - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
  2614. - example: 3457437
  2615. lastSynchedBlock:
  2616. allOf:
  2617. - $ref: '#/components/schemas/EthBlockNum'
  2618. - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
  2619. - example: 3457437
  2620. lastBatch:
  2621. $ref: '#/components/schemas/Batch'
  2622. currentSlot:
  2623. allOf:
  2624. - $ref: '#/components/schemas/SlotNum'
  2625. - description: Slot where batches are currently being forged.
  2626. - example: 2334
  2627. nextForgers:
  2628. $ref: '#/components/schemas/NextForgers'
  2629. pendingL1Transactions:
  2630. type: number
  2631. description: Number of pending L1 transactions (added in the smart contract queue but not forged).
  2632. example: 22
  2633. additionalProperties: false
  2634. required:
  2635. - lastEthereumBlock
  2636. - lastSynchedBlock
  2637. - lastBatch
  2638. - currentSlot
  2639. - nextForgers
  2640. StateAuction:
  2641. type: object
  2642. description: Auction parameters.
  2643. properties:
  2644. ethereumBlockNum:
  2645. $ref: '#/components/schemas/EthBlockNum'
  2646. bootCoordinator:
  2647. allOf:
  2648. - $ref: '#/components/schemas/EthereumAddress'
  2649. - description: Ethereum address of the boot coordinator.
  2650. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2651. bootCoordinatorUrl:
  2652. type: string
  2653. description: Boot Coordinator URL
  2654. example: "https://boot.coordinator.io"
  2655. slotDeadline:
  2656. type: integer
  2657. 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.
  2658. example: 3
  2659. closedAuctionSlots:
  2660. type: integer
  2661. 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.
  2662. example: 2
  2663. openAuctionSlots:
  2664. type: integer
  2665. description: Amount of days in advance are auctions opened.
  2666. defaultSlotSetBid:
  2667. type: array
  2668. 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]`."
  2669. items:
  2670. type: string
  2671. example: ["32","0","68","21","55","99"]
  2672. defaultSlotSetBidSlotNum:
  2673. type: integer
  2674. description: Slot in which the changes will be applied for the first time.
  2675. outbidding:
  2676. type: number
  2677. description: Minimum outbid over the previous one to consider it valid.
  2678. example: 3.64
  2679. donationAddress:
  2680. allOf:
  2681. - $ref: '#/components/schemas/EthereumAddress'
  2682. - description: Ethereum address where the donations will go to.
  2683. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2684. allocationRatio:
  2685. type: array
  2686. description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
  2687. items:
  2688. type: integer
  2689. example: [80,10,10]
  2690. additionalProperties: false
  2691. required:
  2692. - ethereumBlockNum
  2693. - bootCoordinator
  2694. - bootCoordinatorUrl
  2695. - slotDeadline
  2696. - closedAuctionSlots
  2697. - openAuctionSlots
  2698. - defaultSlotSetBid
  2699. - outbidding
  2700. - donationAddress
  2701. - allocationRatio
  2702. StateRollup:
  2703. type: object
  2704. description: Rollup parameters
  2705. properties:
  2706. ethereumBlockNum:
  2707. $ref: '#/components/schemas/EthBlockNum'
  2708. forgeL1L2BatchTimeout:
  2709. type: integer
  2710. description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
  2711. example: 5
  2712. feeAddToken:
  2713. type: string
  2714. description: Fee to pay when registering tokens into the network.
  2715. example: "5698"
  2716. withdrawalDelay:
  2717. type: integer
  2718. description: Withdraw delay in seconds
  2719. example: 432000
  2720. buckets:
  2721. type: array
  2722. description: List of buckets state
  2723. items:
  2724. type: object
  2725. properties:
  2726. ceilUSD:
  2727. type: string
  2728. description: Max USD value
  2729. example: "1000"
  2730. withdrawals:
  2731. type: string
  2732. description: Available withdrawals of the bucket
  2733. example: "4"
  2734. blockWithdrawalRate:
  2735. type: string
  2736. description: Every `blockWithdrawalRate` blocks add 1 withdrawal
  2737. example: "8"
  2738. maxWithdrawals:
  2739. type: string
  2740. description: Max withdrawals the bucket can hold
  2741. example: "4"
  2742. additionalProperties: false
  2743. required:
  2744. - ceilUSD
  2745. - withdrawals
  2746. - blockWithdrawalRate
  2747. - maxWithdrawals
  2748. additionalProperties: false
  2749. required:
  2750. - ethereumBlockNum
  2751. - forgeL1L2BatchTimeout
  2752. - feeAddToken
  2753. - withdrawalDelay
  2754. - buckets
  2755. StateWithdrawDelayer:
  2756. type: object
  2757. description: Withdrawal delayer parameters
  2758. properties:
  2759. ethereumBlockNum:
  2760. $ref: '#/components/schemas/EthBlockNum'
  2761. hermezGovernanceAddress:
  2762. allOf:
  2763. - $ref: '#/components/schemas/EthereumAddress'
  2764. - description: Ethereum address of the governance.
  2765. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2766. emergencyCouncilAddress:
  2767. allOf:
  2768. - $ref: '#/components/schemas/EthereumAddress'
  2769. - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2770. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2771. withdrawalDelay:
  2772. allOf:
  2773. - $ref: '#/components/schemas/EthBlockNum'
  2774. - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
  2775. - example: 539573849
  2776. emergencyModeStartingBlock:
  2777. type: integer
  2778. description: Block number in which the emergency mode has been activated.
  2779. example: 10
  2780. emergencyMode:
  2781. type: boolean
  2782. description: Indicates if emergency mode has been activated.
  2783. example: false
  2784. additionalProperties: false
  2785. required:
  2786. - ethereumBlockNum
  2787. - hermezGovernanceAddress
  2788. - emergencyCouncilAddress
  2789. - withdrawalDelay
  2790. - emergencyModeStartingBlock
  2791. - emergencyMode
  2792. StateMetrics:
  2793. type: object
  2794. description: Metrics of the network
  2795. properties:
  2796. transactionsPerBatch:
  2797. type: number
  2798. description: Average transactions per batch in the last 24 hours.
  2799. example: 2002.7
  2800. batchFrequency:
  2801. type: number
  2802. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2803. example: 8.9
  2804. transactionsPerSecond:
  2805. type: number
  2806. description: Average transactions per second in the last 24 hours.
  2807. example: 302.3
  2808. tokenAccounts:
  2809. type: integer
  2810. description: Number of created accounts.
  2811. example: 90473
  2812. wallets:
  2813. type: integer
  2814. description: Number of different registered BJJs.
  2815. example: 23067
  2816. avgTransactionFee:
  2817. type: number
  2818. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2819. example: 1.54
  2820. estimatedTimeToForgeL1:
  2821. type: number
  2822. description: Estimated time needed to forge a L1 transaction, from the time it's added on the smart contract, until it's actualy forged. In seconds.
  2823. example: 193.4
  2824. additionalProperties: false
  2825. required:
  2826. - transactionsPerBatch
  2827. - batchFrequency
  2828. - transactionsPerSecond
  2829. - tokenAccounts
  2830. - wallets
  2831. - avgTransactionFee
  2832. - estimatedTimeToForgeL1
  2833. PendingItems:
  2834. type: integer
  2835. 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.
  2836. example: 15
  2837. Config:
  2838. type: object
  2839. description: Configuration parameters of the different smart contracts that power the Hermez Network.
  2840. properties:
  2841. hermez:
  2842. type: object
  2843. description: Constant configuration of the Hermez smart contract.
  2844. properties:
  2845. publicConstants:
  2846. type: object
  2847. description: Public Hermez smart contract constants
  2848. properties:
  2849. tokenHEZ:
  2850. allOf:
  2851. - $ref: '#/components/schemas/EthereumAddress'
  2852. - description: Ethereum address of the HEZ token.
  2853. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2854. absoluteMaxL1L2BatchTimeout:
  2855. type: integer
  2856. description: L1L2 Batch Timeout
  2857. example: 240
  2858. verifiers:
  2859. type: array
  2860. description: List of verifiers struct
  2861. items:
  2862. type: object
  2863. properties:
  2864. maxTx:
  2865. type: integer
  2866. description: Maximum rollup transactions in a batch
  2867. example: 512
  2868. nlevels:
  2869. type: integer
  2870. description: Number of levels of the circuit
  2871. example: 32
  2872. required:
  2873. - maxTx
  2874. - nlevels
  2875. additionalProperties: false
  2876. hermezAuctionContract:
  2877. allOf:
  2878. - $ref: '#/components/schemas/EthereumAddress'
  2879. - description: Ethereum address of the auction smart contract.
  2880. - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
  2881. hermezGovernanceAddress:
  2882. allOf:
  2883. - $ref: '#/components/schemas/EthereumAddress'
  2884. - description: Ethereum address of the governance.
  2885. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2886. withdrawDelayerContract:
  2887. allOf:
  2888. - $ref: '#/components/schemas/EthereumAddress'
  2889. - description: Ethereum address of the withdraw delayer contracts.
  2890. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2891. required:
  2892. - tokenHEZ
  2893. - absoluteMaxL1L2BatchTimeout
  2894. - verifiers
  2895. - hermezAuctionContract
  2896. - hermezGovernanceAddress
  2897. - withdrawDelayerContract
  2898. additionalProperties: false
  2899. maxFeeIdxCoordinator:
  2900. type: integer
  2901. description: is the maximum number of tokens the coordinator can use to collect fees.
  2902. example: 64
  2903. reservedIdx:
  2904. type: integer
  2905. description: First 256 indexes reserved, first user index will be the 256.
  2906. example: 255
  2907. exitIdx:
  2908. type: integer
  2909. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2910. example: 1
  2911. limitDepositAmount:
  2912. type: integer
  2913. description: Maximum deposit amount (L1 to L2) allowed.
  2914. example: 321
  2915. limitL2TransferAmount:
  2916. type: integer
  2917. description: Maximum amount (L2 to L2) allowed.
  2918. example: 837
  2919. limitTokens:
  2920. type: integer
  2921. description: Maximum number of different tokens that can be registered in the network.
  2922. example: 4294967295
  2923. l1CoordinatorTotalBytes:
  2924. type: integer
  2925. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2926. example: 101
  2927. l1UserTotalBytes:
  2928. type: integer
  2929. description: Number of bytes that a L1 user transaction has ([20 bytes] fromEthAddr + [32 bytes] fromBjj-compressed + [6 bytes] fromIdx + [5 bytes] depositAmountFloat40 + [5 bytes] amountFloat40 + [4 bytes] tokenId + [6 bytes] toIdx).
  2930. example: 72
  2931. maxL1UserTx:
  2932. type: integer
  2933. description: Maximum L1-user transactions allowed to be queued in a batch.
  2934. example: 128
  2935. maxL1Tx:
  2936. type: integer
  2937. description: Maximum L1 transactions allowed to be queued in a batch.
  2938. example: 256
  2939. inputSHAConstantBytes:
  2940. type: integer
  2941. description: Input SHA constant bytes
  2942. example: 18542
  2943. numBuckets:
  2944. type: integer
  2945. description: Number of buckets
  2946. example: 5
  2947. maxWithdrawalDelay:
  2948. type: integer
  2949. description: Maximum delay to withdraw tokens. Time is measured in seconds.
  2950. example: 2 * 7 * 24 * 60 * 60
  2951. exchangeMultiplier:
  2952. type: integer
  2953. description: exchange multiplier
  2954. example: 1e14
  2955. required:
  2956. - publicConstants
  2957. - reservedIdx
  2958. - exitIdx
  2959. - limitDepositAmount
  2960. - limitL2TransferAmount
  2961. - limitTokens
  2962. - l1CoordinatorTotalBytes
  2963. - l1UserTotalBytes
  2964. - maxL1UserTx
  2965. - maxL1Tx
  2966. - inputSHAConstantBytes
  2967. - numBuckets
  2968. - maxWithdrawalDelay
  2969. - exchangeMultiplier
  2970. additionalProperties: false
  2971. auction:
  2972. type: object
  2973. description: Constant configuration of the auction smart contract.
  2974. properties:
  2975. blocksPerSlot:
  2976. type: integer
  2977. description: Blocks per slot.
  2978. initialMinimalBidding:
  2979. type: integer
  2980. description: Minimum bid when no one has bid yet.
  2981. genesisBlockNum:
  2982. allOf:
  2983. - $ref: '#/components/schemas/EthBlockNum'
  2984. - description: Ethereum block number in which the smart contract starts operating.
  2985. tokenHEZ:
  2986. allOf:
  2987. - $ref: '#/components/schemas/EthereumAddress'
  2988. - description: Ethereum address of the HEZ token.
  2989. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  2990. hermezRollup:
  2991. allOf:
  2992. - $ref: '#/components/schemas/EthereumAddress'
  2993. - description: Ethereum address of the rollup smart contract.
  2994. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2995. governanceAddress:
  2996. allOf:
  2997. - $ref: '#/components/schemas/EthereumAddress'
  2998. - description: Ethereum address of the governance.
  2999. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  3000. required:
  3001. - blocksPerSlot
  3002. - initialMinimalBidding
  3003. - genesisBlockNum
  3004. - tokenHEZ
  3005. - hermezRollup
  3006. - governanceAddress
  3007. additionalProperties: false
  3008. withdrawalDelayer:
  3009. type: object
  3010. description: Constant configuration of the withdrawal delayer smart contract.
  3011. properties:
  3012. maxWithdrawalDelay:
  3013. type: integer
  3014. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
  3015. example: 200
  3016. maxEmergencyModeTime:
  3017. type: integer
  3018. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
  3019. example: 2000
  3020. hermezRollup:
  3021. allOf:
  3022. - $ref: '#/components/schemas/EthereumAddress'
  3023. - description: Ethereum address of the rollup smart contract.
  3024. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  3025. required:
  3026. - maxWithdrawalDelay
  3027. - maxEmergencyModeTime
  3028. - hermezRollup
  3029. additionalProperties: false
  3030. required:
  3031. - hermez
  3032. - auction
  3033. - withdrawalDelayer
  3034. additionalProperties: false
  3035. Error:
  3036. type: object
  3037. description: Error response.
  3038. properties:
  3039. message:
  3040. type: string
  3041. Error400:
  3042. allOf:
  3043. - $ref: '#/components/schemas/Error'
  3044. - example:
  3045. message: Invalid signature.
  3046. Error404:
  3047. allOf:
  3048. - $ref: '#/components/schemas/Error'
  3049. - example:
  3050. message: Item(s) not found.
  3051. Error500:
  3052. allOf:
  3053. - $ref: '#/components/schemas/Error'
  3054. - example:
  3055. message: Database error.