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.

3045 lines
107 KiB

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