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.

2460 lines
86 KiB

  1. openapi: 3.0.0
  2. info:
  3. description: |
  4. This API server is the layer that allows 3rd party apps and services interfacing with the coordinator to explore, monitor and use the Hermez rollup.
  5. Example of these apps are:
  6. * Wallet: send L2 transactions, check balance, ...
  7. * Explorer: List transactions, slots, batches, ...
  8. * Exchange integrations
  9. ### Pagination
  10. #### Usage
  11. All the endpoints that return a list of undefined size use pagination. Unless the opposite is explicitly said.
  12. In order to use pagination, three query parameters are used:
  13. * `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).
  14. * `order`: all pginated items are ordered chronologicaly. 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.
  15. * `limit`: maximum amount of items to include in each response. Default is 20, maximum 2049.
  16. Responses for those endpoint will always include a `pagination` object. This object includes the total amount of items that the endpoint will return at a given time with the given filters. Apart from that, it also includes the `itemId` of the last and first items that will be returned (not in a single response but within the total items). These two properties can be used to know when to stop querying.
  17. #### Reorgs and safetyness
  18. Since all the items are ordered chronologicaly, there are no safety problems when fetching items in ascending order, except for reorgs (more on this later).
  19. 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 queryng without the `fromItem` set to `pagination.lastItem`.
  20. To handle reorgs, the `itemId` can be used since it will change. This is important since other identifiers may be the same but with different content. As an example, if the batch 424 get's reorged, it will be deleted, but eventualy, a new batch 424 will appear with potentialy different content.
  21. ### Signatures
  22. The POST endpoint require to be signed using BabyJubJub or Ethereum keys. TODO: add references to libraries / examples / ...
  23. version: "0.0.1"
  24. title: Hermez Network API
  25. # termsOfService: 'http://swagger.io/terms/'
  26. # contact:
  27. # email: apiteam@swagger.io
  28. # license:
  29. # name: Apache 2.0
  30. # url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  31. externalDocs:
  32. description: Find out more about Hermez.
  33. url: 'https://hermez.io'
  34. servers:
  35. - description: Hosted mock up
  36. url: http://167.71.59.190:4010
  37. - description: Localhost mock Up
  38. url: http://localhost:4010
  39. tags:
  40. - name: Account
  41. description: Hermez account and the tokens it holds.
  42. externalDocs:
  43. description: Find out more.
  44. url: 'https://idocs.hermez.io/#/spec/zkrollup/README?id=account-types'
  45. - name: Transaction
  46. description: Send tokens off chain and track transactions.
  47. externalDocs:
  48. description: Find out more
  49. url: 'https://idocs.hermez.io/#/spec/zkrollup/README?id=transaction-types'
  50. - name: Hermez status
  51. description: Info about operators, tokens, auctions and more.
  52. externalDocs:
  53. description: Find out more.
  54. url: 'https://idocs.hermez.io/#/spec/zkrollup/README'
  55. paths:
  56. '/account-creation-authorization':
  57. post:
  58. tags:
  59. - Account
  60. summary: Send an authorization that will allow the coordinator to register accounts associated to an Ethereum address on behalf of the user.
  61. description: >-
  62. Send an authorization to create rollup accounts associated to an Ethereum address. Each account creation (an account can only hold a specific token) is effective once the coordinator forges the corresponding L1CoordinatorTx (which are always of type *account creation*).
  63. operationId: postRegister
  64. requestBody:
  65. description: Account creation authorization.
  66. required: true
  67. content:
  68. application/json:
  69. schema:
  70. $ref: '#/components/schemas/AccountCreationAuthorization'
  71. responses:
  72. '200':
  73. description: Successful operation.
  74. '400':
  75. description: Bad request.
  76. content:
  77. application/json:
  78. schema:
  79. $ref: '#/components/schemas/Error400'
  80. '500':
  81. description: Internal server error.
  82. content:
  83. application/json:
  84. schema:
  85. $ref: '#/components/schemas/Error500'
  86. '/account-creation-authorization/{hezEthereumAddress}':
  87. get:
  88. tags:
  89. - Account
  90. summary: Get to know if the coordinator has the ability to create accounts associated to an Ethereum address.
  91. description: >-
  92. True if the coordinator has the required authorization to perform an account creation with the given Ethereum address on behalf of the Ethereum address holder.
  93. operationId: getAccountCreationAuthorization
  94. parameters:
  95. - name: hezEthereumAddress
  96. in: path
  97. description: Ethereum address.
  98. required: true
  99. schema:
  100. $ref: '#/components/schemas/HezEthereumAddress'
  101. responses:
  102. '200':
  103. description: Successful operation.
  104. content:
  105. application/json:
  106. schema:
  107. $ref: '#/components/schemas/AccountCreationAuthorization'
  108. '400':
  109. description: Bad request.
  110. content:
  111. application/json:
  112. schema:
  113. $ref: '#/components/schemas/Error400'
  114. '404':
  115. description: Not found.
  116. content:
  117. application/json:
  118. schema:
  119. $ref: '#/components/schemas/Error404'
  120. '500':
  121. description: Internal server error.
  122. content:
  123. application/json:
  124. schema:
  125. $ref: '#/components/schemas/Error500'
  126. '/accounts':
  127. get:
  128. tags:
  129. - Account
  130. summary: Get accounts balances and other associated information.
  131. description: Get accounts balances and other associated information.
  132. operationId: getAccounts
  133. parameters:
  134. - name: hezEthereumAddress
  135. in: query
  136. description: Only get accounts associated to an Ethereum address. Incompatible with the query `BJJ`.
  137. required: false
  138. schema:
  139. $ref: '#/components/schemas/HezEthereumAddress'
  140. - name: BJJ
  141. in: query
  142. description: Only get accounts associated to a BabyJubJub public key. Incompatible with the query `hezEthereumAddress`.
  143. required: false
  144. schema:
  145. $ref: '#/components/schemas/BJJ'
  146. - name: tokenIds
  147. in: query
  148. required: false
  149. description: Only get accounts of specific tokens.
  150. schema:
  151. type: string
  152. description: Comma separated list of token identifiers.
  153. example: "3,87,91"
  154. - name: fromItem
  155. in: query
  156. required: false
  157. description: Indicates the desired first item (using the itemId property) to be included in the response.
  158. schema:
  159. type: number
  160. - name: order
  161. in: query
  162. required: false
  163. description: Order of the returned items. Accounts will be ordered by increasing account index.
  164. schema:
  165. type: string
  166. default: ASC
  167. enum:
  168. - ASC
  169. - DESC
  170. - name: limit
  171. in: query
  172. required: false
  173. description: Maximum number of items to be returned.
  174. schema:
  175. type: integer
  176. minimum: 1
  177. maximum: 2049
  178. responses:
  179. '200':
  180. description: Successful operation.
  181. content:
  182. application/json:
  183. schema:
  184. $ref: '#/components/schemas/Accounts'
  185. '400':
  186. description: Bad request.
  187. content:
  188. application/json:
  189. schema:
  190. $ref: '#/components/schemas/Error400'
  191. '404':
  192. description: Not found.
  193. content:
  194. application/json:
  195. schema:
  196. $ref: '#/components/schemas/Error404'
  197. '500':
  198. description: Internal server error.
  199. content:
  200. application/json:
  201. schema:
  202. $ref: '#/components/schemas/Error500'
  203. '/accounts/{accountIndex}':
  204. get:
  205. tags:
  206. - Account
  207. summary: Get an account by its index.
  208. description: Get an account by its index.
  209. operationId: getAccount
  210. parameters:
  211. - name: accountIndex
  212. in: path
  213. description: Identifier of an account.
  214. required: true
  215. schema:
  216. $ref: '#/components/schemas/AccountIndex'
  217. responses:
  218. '200':
  219. description: Successful operation.
  220. content:
  221. application/json:
  222. schema:
  223. $ref: '#/components/schemas/Account'
  224. '400':
  225. description: Bad request.
  226. content:
  227. application/json:
  228. schema:
  229. $ref: '#/components/schemas/Error400'
  230. '404':
  231. description: Not found.
  232. content:
  233. application/json:
  234. schema:
  235. $ref: '#/components/schemas/Error404'
  236. '500':
  237. description: Internal server error.
  238. content:
  239. application/json:
  240. schema:
  241. $ref: '#/components/schemas/Error500'
  242. '/exits':
  243. get:
  244. tags:
  245. - Account
  246. summary: Get exit information. This information is required to perform a withdraw.
  247. description: Get exit information. This information is required to perform a withdraw.
  248. operationId: getExits
  249. parameters:
  250. - name: tokenId
  251. in: query
  252. required: false
  253. description: Only get exits of specific token
  254. schema:
  255. $ref: '#/components/schemas/TokenId'
  256. - name: hezEthereumAddress
  257. in: query
  258. description: Get exits associated to a Ethereum address. Incompatible with query `BJJ` and `accountIndex`.
  259. required: false
  260. schema:
  261. $ref: '#/components/schemas/HezEthereumAddress'
  262. - name: BJJ
  263. in: query
  264. description: Get exits associated to a BabyJubJub public key. Incompatible with query `hezEthereumAddress` and `accountIndex`.
  265. required: false
  266. schema:
  267. $ref: '#/components/schemas/BJJ'
  268. - name: accountIndex
  269. in: query
  270. description: Get exits associated to a specific account. Incompatible with queries `tokenId`, `hezEthereumAddress` and `BJJ`.
  271. required: false
  272. schema:
  273. $ref: '#/components/schemas/AccountIndex'
  274. - name: batchNum
  275. in: query
  276. description: Get exits from the exit tree of a specific batch.
  277. required: false
  278. schema:
  279. $ref: '#/components/schemas/BatchNum'
  280. - name: fromItem
  281. in: query
  282. required: false
  283. description: Indicates the desired first item (using the itemId property) to be included in the response.
  284. schema:
  285. type: number
  286. - name: order
  287. in: query
  288. required: false
  289. description: Order of the returned items. Exits will be ordered by increasing (batchNum, accountIndex).
  290. schema:
  291. type: string
  292. default: ASC
  293. enum:
  294. - ASC
  295. - DESC
  296. - name: limit
  297. in: query
  298. required: false
  299. description: Maximum number of items to be returned.
  300. schema:
  301. type: integer
  302. minimum: 1
  303. maximum: 2049
  304. responses:
  305. '200':
  306. description: Successful operation.
  307. content:
  308. application/json:
  309. schema:
  310. $ref: '#/components/schemas/Exits'
  311. '400':
  312. description: Bad request.
  313. content:
  314. application/json:
  315. schema:
  316. $ref: '#/components/schemas/Error400'
  317. '404':
  318. description: Not found.
  319. content:
  320. application/json:
  321. schema:
  322. $ref: '#/components/schemas/Error404'
  323. '500':
  324. description: Internal server error.
  325. content:
  326. application/json:
  327. schema:
  328. $ref: '#/components/schemas/Error500'
  329. '/exits/{batchNum}/{accountIndex}':
  330. get:
  331. tags:
  332. - Account
  333. summary: Get specific exit information.
  334. description: Get exit information form a specific exit tree and account. This information is required to perform a withdraw.
  335. operationId: getExit
  336. parameters:
  337. - name: batchNum
  338. in: path
  339. description: Batch of the exit tree.
  340. required: true
  341. schema:
  342. $ref: '#/components/schemas/BatchNum'
  343. - name: accountIndex
  344. in: path
  345. description: Account identifier.
  346. required: true
  347. schema:
  348. $ref: '#/components/schemas/AccountIndex'
  349. responses:
  350. '200':
  351. description: Successful operation.
  352. content:
  353. application/json:
  354. schema:
  355. $ref: '#/components/schemas/Exit'
  356. '400':
  357. description: Bad request.
  358. content:
  359. application/json:
  360. schema:
  361. $ref: '#/components/schemas/Error400'
  362. '404':
  363. description: Not found.
  364. content:
  365. application/json:
  366. schema:
  367. $ref: '#/components/schemas/Error404'
  368. '500':
  369. description: Internal server error.
  370. content:
  371. application/json:
  372. schema:
  373. $ref: '#/components/schemas/Error500'
  374. '/transactions-pool':
  375. post:
  376. tags:
  377. - Transaction
  378. summary: Add an L2 transaction to the coordinator's pool
  379. description: >-
  380. Send L2 transaction. The transaction will be stored in the transaction pool of the coordinator and eventually forged.
  381. operationId: postTx
  382. requestBody:
  383. description: Signed transaction.
  384. required: true
  385. content:
  386. application/json:
  387. schema:
  388. $ref: '#/components/schemas/PostPoolL2Transaction'
  389. responses:
  390. '200':
  391. description: Successful operation.
  392. content:
  393. application/json:
  394. schema:
  395. $ref: '#/components/schemas/TransactionId'
  396. '400':
  397. description: Bad request.
  398. content:
  399. application/json:
  400. schema:
  401. $ref: '#/components/schemas/Error400'
  402. '500':
  403. description: Internal server error.
  404. content:
  405. application/json:
  406. schema:
  407. $ref: '#/components/schemas/Error500'
  408. '/transactions-pool/{id}':
  409. get:
  410. tags:
  411. - Transaction
  412. summary: Get details and status of a transaction that is in the pool.
  413. description: >-
  414. 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.
  415. Only transactions from the pool will be returned.
  416. Note that the transaction pool is different for each coordinator and therefore only a coordinator that has received a specific transaction
  417. will be able to provide information about that transaction.
  418. operationId: getPoolTx
  419. parameters:
  420. - name: id
  421. in: path
  422. description: Transaction identifier.
  423. required: true
  424. schema:
  425. $ref: '#/components/schemas/TransactionId'
  426. responses:
  427. '200':
  428. description: Successful operation.
  429. content:
  430. application/json:
  431. schema:
  432. $ref: '#/components/schemas/PoolL2Transaction'
  433. '400':
  434. description: Bad request.
  435. content:
  436. application/json:
  437. schema:
  438. $ref: '#/components/schemas/Error400'
  439. '404':
  440. description: Not found.
  441. content:
  442. application/json:
  443. schema:
  444. $ref: '#/components/schemas/Error404'
  445. '500':
  446. description: Internal server error.
  447. content:
  448. application/json:
  449. schema:
  450. $ref: '#/components/schemas/Error500'
  451. '/transactions-history':
  452. get:
  453. tags:
  454. - Transaction
  455. summary: Get details and status of transactions that have been forged.
  456. description: >-
  457. Get historical transactions. This endpoint will return all the different types of transactions except for:
  458. - Transactions that are still in the transaction pool of any coordinator. These transactions can be fetched using `GET /transactions-pool/{id}`.
  459. - L1 transactions sent by users that have not been forged yet. These transactions can be fetched using `GET /transactions-history/{id}`.
  460. operationId: getHistoryTxs
  461. parameters:
  462. - name: tokenId
  463. in: query
  464. required: false
  465. description: Only get transactions of specific token
  466. schema:
  467. $ref: '#/components/schemas/TokenId'
  468. - name: hezEthereumAddress
  469. in: query
  470. required: false
  471. description: Only get transactions sent from or to an account associated to an Ethereum address Incompatible with the queries `BJJ` and `accountIndex`.
  472. schema:
  473. $ref: '#/components/schemas/HezEthereumAddress'
  474. - name: BJJ
  475. in: query
  476. description: Only get transactions associated to a BabyJubJub public key. Incompatible with the queries `hezEthereumAddress` and `accountIndex`.
  477. required: false
  478. schema:
  479. $ref: '#/components/schemas/BJJ'
  480. - name: accountIndex
  481. in: query
  482. required: false
  483. description: Only get transactions sent from or to a specific account. Incompatible with the queries `tokenId`, `hezEthereumAddress` and `BJJ`.
  484. schema:
  485. $ref: '#/components/schemas/AccountIndex'
  486. - name: batchNum
  487. in: query
  488. required: false
  489. description: Only get transactions forged in a specific batch.
  490. schema:
  491. $ref: '#/components/schemas/BatchNum'
  492. - name: type
  493. in: query
  494. required: false
  495. description: Only get transactions of a specific type.
  496. schema:
  497. $ref: '#/components/schemas/TransactionType'
  498. - name: fromItem
  499. in: query
  500. required: false
  501. description: Indicates the desired first item (using the itemId property) to be included in the response.
  502. schema:
  503. type: number
  504. - name: order
  505. in: query
  506. required: false
  507. description: Order of the returned items. History transactions will be ordered by (batchNum, position).
  508. schema:
  509. type: string
  510. default: ASC
  511. enum:
  512. - ASC
  513. - DESC
  514. - name: limit
  515. in: query
  516. required: false
  517. description: Maximum number of items to be returned.
  518. schema:
  519. type: integer
  520. minimum: 1
  521. maximum: 2049
  522. responses:
  523. '200':
  524. description: Successful operation.
  525. content:
  526. application/json:
  527. schema:
  528. $ref: '#/components/schemas/HistoryTransactions'
  529. '400':
  530. description: Bad request.
  531. content:
  532. application/json:
  533. schema:
  534. $ref: '#/components/schemas/Error400'
  535. '404':
  536. description: Not found.
  537. content:
  538. application/json:
  539. schema:
  540. $ref: '#/components/schemas/Error404'
  541. '500':
  542. description: Internal server error.
  543. content:
  544. application/json:
  545. schema:
  546. $ref: '#/components/schemas/Error500'
  547. '/transactions-history/{id}':
  548. get:
  549. tags:
  550. - Transaction
  551. summary: Get details and status of a historical transaction.
  552. description: >-
  553. Get transaction from the history by its id. This endpoint will return all the different types of transactions except those that are still in the pool of any coordinator.
  554. operationId: getHistoryTx
  555. parameters:
  556. - name: id
  557. in: path
  558. description: Transaction identifier.
  559. required: true
  560. schema:
  561. $ref: '#/components/schemas/TransactionId'
  562. responses:
  563. '200':
  564. description: Successful operation.
  565. content:
  566. application/json:
  567. schema:
  568. $ref: '#/components/schemas/HistoryTransaction'
  569. '400':
  570. description: Bad request.
  571. content:
  572. application/json:
  573. schema:
  574. $ref: '#/components/schemas/Error400'
  575. '404':
  576. description: Not found.
  577. content:
  578. application/json:
  579. schema:
  580. $ref: '#/components/schemas/Error404'
  581. '500':
  582. description: Internal server error.
  583. content:
  584. application/json:
  585. schema:
  586. $ref: '#/components/schemas/Error500'
  587. '/batches':
  588. get:
  589. tags:
  590. - Hermez status
  591. summary: Get information about forged batches.
  592. description: >-
  593. Get information about forged batches.
  594. operationId: getBatches
  595. parameters:
  596. - name: minBatchNum
  597. in: query
  598. required: false
  599. description: Include only `batchNum < minBatchNum` batches.
  600. schema:
  601. $ref: '#/components/schemas/BatchNum'
  602. - name: maxBatchNum
  603. in: query
  604. required: false
  605. description: Include only `batchNum > maxBatchNum` batches.
  606. schema:
  607. type: number
  608. - name: forgerAddr
  609. in: query
  610. required: false
  611. description: Include only batches forged by `forgerAddr`
  612. schema:
  613. $ref: '#/components/schemas/EthereumAddress'
  614. - name: fromItem
  615. in: query
  616. required: false
  617. description: Indicates the desired first item (using the itemId property) to be included in the response.
  618. schema:
  619. type: number
  620. - name: order
  621. in: query
  622. required: false
  623. description: Order of the returned items. Batches will be ordered by increasing `batchNum`.
  624. schema:
  625. type: string
  626. default: ASC
  627. enum:
  628. - ASC
  629. - DESC
  630. - name: limit
  631. in: query
  632. required: false
  633. description: Maximum number of items to be returned.
  634. schema:
  635. type: integer
  636. minimum: 1
  637. maximum: 2049
  638. responses:
  639. '200':
  640. description: Successful operation.
  641. content:
  642. application/json:
  643. schema:
  644. $ref: '#/components/schemas/Batches'
  645. '400':
  646. description: Bad request.
  647. content:
  648. application/json:
  649. schema:
  650. $ref: '#/components/schemas/Error400'
  651. '404':
  652. description: Not found.
  653. content:
  654. application/json:
  655. schema:
  656. $ref: '#/components/schemas/Error404'
  657. '500':
  658. description: Internal server error.
  659. content:
  660. application/json:
  661. schema:
  662. $ref: '#/components/schemas/Error500'
  663. '/batches/{batchNum}':
  664. get:
  665. tags:
  666. - Hermez status
  667. summary: Get a specific batch.
  668. description: >-
  669. Get a specific batch.
  670. operationId: getBatch
  671. parameters:
  672. - name: batchNum
  673. in: path
  674. description: Batch identifier.
  675. required: true
  676. schema:
  677. $ref: '#/components/schemas/BatchNum'
  678. responses:
  679. '200':
  680. description: Successful operation
  681. content:
  682. application/json:
  683. schema:
  684. $ref: '#/components/schemas/Batch'
  685. '400':
  686. description: Bad request.
  687. content:
  688. application/json:
  689. schema:
  690. $ref: '#/components/schemas/Error400'
  691. '404':
  692. description: Not found.
  693. content:
  694. application/json:
  695. schema:
  696. $ref: '#/components/schemas/Error404'
  697. '500':
  698. description: Internal server error.
  699. content:
  700. application/json:
  701. schema:
  702. $ref: '#/components/schemas/Error500'
  703. '/full-batches/{batchNum}':
  704. get:
  705. tags:
  706. - Hermez status
  707. summary: Get a full batch
  708. description: >-
  709. Get a specific batch, including the associated transactions. The object returned in this method can be a bit heavy.
  710. If you're devloping a front end, you may consider using a combinaton of `GET /batches/{batchnum}` and `GET /history-transactions?batchNum={batchNum}`.
  711. operationId: getFullBatch
  712. parameters:
  713. - name: batchNum
  714. in: path
  715. description: Batch identifier
  716. required: true
  717. schema:
  718. $ref: '#/components/schemas/BatchNum'
  719. responses:
  720. '200':
  721. description: successful operation
  722. content:
  723. application/json:
  724. schema:
  725. $ref: '#/components/schemas/FullBatch'
  726. '400':
  727. description: Bad request.
  728. content:
  729. application/json:
  730. schema:
  731. $ref: '#/components/schemas/Error400'
  732. '404':
  733. description: Not found.
  734. content:
  735. application/json:
  736. schema:
  737. $ref: '#/components/schemas/Error404'
  738. '500':
  739. description: Internal server error.
  740. content:
  741. application/json:
  742. schema:
  743. $ref: '#/components/schemas/Error500'
  744. '/slots':
  745. get:
  746. tags:
  747. - Hermez status
  748. summary: Get information about slots.
  749. description: >-
  750. Get information about slots.
  751. operationId: getSlots
  752. parameters:
  753. - name: minSlotNum
  754. in: query
  755. required: false
  756. description: Only include batches with `slotNum < minSlotNum`.
  757. schema:
  758. $ref: '#/components/schemas/SlotNum'
  759. - name: maxSlothNum
  760. in: query
  761. required: false
  762. description: Only include batches with `slotNum > maxSlotNum`.
  763. schema:
  764. $ref: '#/components/schemas/SlotNum'
  765. - name: wonByEthereumAddress
  766. in: query
  767. required: false
  768. description: Only include slots won by a coordinator whose `forgerAddr == wonByEthereumAddress`.
  769. schema:
  770. $ref: '#/components/schemas/EthereumAddress'
  771. - name: finishedAuction
  772. in: query
  773. required: false
  774. description: If set to true, only include slots whose auction has finished.
  775. schema:
  776. type: boolean
  777. - name: fromItem
  778. in: query
  779. required: false
  780. description: Indicates the desired first item (using the itemId property) to be included in the response.
  781. schema:
  782. type: number
  783. - name: order
  784. in: query
  785. required: false
  786. description: Order of the returned items. Slots will be ordered by increasing `slotNum`.
  787. schema:
  788. type: string
  789. default: ASC
  790. enum:
  791. - ASC
  792. - DESC
  793. - name: limit
  794. in: query
  795. required: false
  796. description: Maximum number of items to be returned.
  797. schema:
  798. type: integer
  799. minimum: 1
  800. maximum: 2049
  801. responses:
  802. '200':
  803. description: Successful operation.
  804. content:
  805. application/json:
  806. schema:
  807. $ref: '#/components/schemas/Slots'
  808. '400':
  809. description: Bad request.
  810. content:
  811. application/json:
  812. schema:
  813. $ref: '#/components/schemas/Error400'
  814. '404':
  815. description: Not found.
  816. content:
  817. application/json:
  818. schema:
  819. $ref: '#/components/schemas/Error404'
  820. '500':
  821. description: Internal server error.
  822. content:
  823. application/json:
  824. schema:
  825. $ref: '#/components/schemas/Error500'
  826. '/slots/{slotNum}':
  827. get:
  828. tags:
  829. - Hermez status
  830. summary: Get information about a specific slot.
  831. description: >-
  832. Get information about a specific slot.
  833. operationId: getSlot
  834. parameters:
  835. - name: slotNum
  836. in: path
  837. required: true
  838. description: Identifier of the slot.
  839. schema:
  840. $ref: '#/components/schemas/SlotNum'
  841. responses:
  842. '200':
  843. description: Successful operation.
  844. content:
  845. application/json:
  846. schema:
  847. $ref: '#/components/schemas/Slot'
  848. '400':
  849. description: Bad request.
  850. content:
  851. application/json:
  852. schema:
  853. $ref: '#/components/schemas/Error400'
  854. '404':
  855. description: Not found.
  856. content:
  857. application/json:
  858. schema:
  859. $ref: '#/components/schemas/Error404'
  860. '500':
  861. description: Internal server error.
  862. content:
  863. application/json:
  864. schema:
  865. $ref: '#/components/schemas/Error500'
  866. '/bids':
  867. get:
  868. tags:
  869. - Hermez status
  870. summary: Get a list of bids made for a specific slot auction.
  871. description: Get a list of bids made for a specific slot auction.
  872. operationId: getSlotBids
  873. parameters:
  874. - name: slotNum
  875. in: query
  876. description: Slot identifier. Specify the auction where the returned bids were made.
  877. required: false
  878. schema:
  879. $ref: '#/components/schemas/SlotNum'
  880. - name: forgerAddr
  881. in: query
  882. description: Get only bids made by a coordinator identified by its forger address.
  883. required: false
  884. schema:
  885. $ref: '#/components/schemas/EthereumAddress'
  886. - name: fromItem
  887. in: query
  888. required: false
  889. description: Indicates the desired first item (using the itemId property) to be included in the response.
  890. schema:
  891. type: number
  892. - name: order
  893. in: query
  894. required: false
  895. description: Order of the returned items. Bids will be ordered by increasing (slotNum, bidValue)`.
  896. schema:
  897. type: string
  898. default: ASC
  899. enum:
  900. - ASC
  901. - DESC
  902. - name: limit
  903. in: query
  904. required: false
  905. description: Maximum number of items to be returned.
  906. schema:
  907. type: integer
  908. minimum: 1
  909. maximum: 2049
  910. responses:
  911. '200':
  912. description: Successful operation
  913. content:
  914. application/json:
  915. schema:
  916. $ref: '#/components/schemas/Bids'
  917. '400':
  918. description: Bad request.
  919. content:
  920. application/json:
  921. schema:
  922. $ref: '#/components/schemas/Error400'
  923. '404':
  924. description: Not found.
  925. content:
  926. application/json:
  927. schema:
  928. $ref: '#/components/schemas/Error404'
  929. '500':
  930. description: Internal server error.
  931. content:
  932. application/json:
  933. schema:
  934. $ref: '#/components/schemas/Error500'
  935. '/next-forgers':
  936. get:
  937. tags:
  938. - Hermez status
  939. summary: Get next coordinators to forge.
  940. description: >-
  941. Return a list of the coordinators that will forge in the next slots.
  942. The response includes the coordinator that is currently forging, and the ones that have won the upcomming slots whose auctions are closed.
  943. operationId: getNextForgers
  944. responses:
  945. '200':
  946. description: Successful operation.
  947. content:
  948. application/json:
  949. schema:
  950. $ref: '#/components/schemas/NextForgers'
  951. '400':
  952. description: Bad request.
  953. content:
  954. application/json:
  955. schema:
  956. $ref: '#/components/schemas/Error400'
  957. '500':
  958. description: Internal server error.
  959. content:
  960. application/json:
  961. schema:
  962. $ref: '#/components/schemas/Error500'
  963. '/state':
  964. get:
  965. tags:
  966. - Hermez status
  967. summary: Return global statistics and metrics of the network.
  968. description: Return global statistics and metrics of the network.
  969. operationId: getState
  970. responses:
  971. '200':
  972. description: Successful operation.
  973. content:
  974. application/json:
  975. schema:
  976. $ref: '#/components/schemas/State'
  977. '400':
  978. description: Bad request.
  979. content:
  980. application/json:
  981. schema:
  982. $ref: '#/components/schemas/Error400'
  983. '500':
  984. description: Internal server error.
  985. content:
  986. application/json:
  987. schema:
  988. $ref: '#/components/schemas/Error500'
  989. '/config':
  990. get:
  991. tags:
  992. - Hermez status
  993. summary: Return constant configuration of the network.
  994. description: Return constant configuration of the network.
  995. operationId: getConfig
  996. responses:
  997. '200':
  998. description: Successful operation.
  999. content:
  1000. application/json:
  1001. schema:
  1002. $ref: '#/components/schemas/Config'
  1003. '500':
  1004. description: Internal server error.
  1005. content:
  1006. application/json:
  1007. schema:
  1008. $ref: '#/components/schemas/Error500'
  1009. '/tokens':
  1010. get:
  1011. tags:
  1012. - Hermez status
  1013. summary: Get information of the supported tokens in the Hermez network.
  1014. description: Get information of the supported tokens in the Hermez network.
  1015. operationId: getTokens
  1016. parameters:
  1017. - name: ids
  1018. in: query
  1019. required: false
  1020. description: Include only specific tokens by their Hermez identifiers.
  1021. schema:
  1022. type: string
  1023. description: Comma separated list of token identifiers
  1024. example: "2,44,689"
  1025. - name: symbols
  1026. in: query
  1027. required: false
  1028. description: Include only specific tokens by their symbols.
  1029. schema:
  1030. type: string
  1031. description: Comma separated list of token symbols.
  1032. example: "DAI,NEC,UMA"
  1033. - name: name
  1034. in: query
  1035. required: false
  1036. description: Include token(s) by their names (or a substring of the name).
  1037. schema:
  1038. type: string
  1039. - name: fromItem
  1040. in: query
  1041. required: false
  1042. description: Indicates the desired first item (using the itemId property) to be included in the response.
  1043. schema:
  1044. type: number
  1045. - name: order
  1046. in: query
  1047. required: false
  1048. description: Order of the returned items. Tokens will be ordered by increasing tokenID.
  1049. schema:
  1050. type: string
  1051. default: ASC
  1052. enum:
  1053. - ASC
  1054. - DESC
  1055. - name: limit
  1056. in: query
  1057. required: false
  1058. description: Maximum number of items to be returned.
  1059. schema:
  1060. type: integer
  1061. minimum: 1
  1062. maximum: 2049
  1063. responses:
  1064. '200':
  1065. description: Successful operation.
  1066. content:
  1067. application/json:
  1068. schema:
  1069. $ref: '#/components/schemas/Tokens'
  1070. '400':
  1071. description: Bad request.
  1072. content:
  1073. application/json:
  1074. schema:
  1075. $ref: '#/components/schemas/Error400'
  1076. '404':
  1077. description: Not found.
  1078. content:
  1079. application/json:
  1080. schema:
  1081. $ref: '#/components/schemas/Error404'
  1082. '500':
  1083. description: Internal server error.
  1084. content:
  1085. application/json:
  1086. schema:
  1087. $ref: '#/components/schemas/Error500'
  1088. '/tokens/{id}':
  1089. get:
  1090. tags:
  1091. - Hermez status
  1092. summary: Get information of a token supported by Hermez network.
  1093. description: Get information of a token supported by Hermez network.
  1094. operationId: getToken
  1095. parameters:
  1096. - name: id
  1097. in: path
  1098. description: Token identifier
  1099. required: true
  1100. schema:
  1101. $ref: '#/components/schemas/TokenId'
  1102. responses:
  1103. '200':
  1104. description: Successful operation.
  1105. content:
  1106. application/json:
  1107. schema:
  1108. $ref: '#/components/schemas/Token'
  1109. '400':
  1110. description: Bad request.
  1111. content:
  1112. application/json:
  1113. schema:
  1114. $ref: '#/components/schemas/Error400'
  1115. '404':
  1116. description: Not found.
  1117. content:
  1118. application/json:
  1119. schema:
  1120. $ref: '#/components/schemas/Error404'
  1121. '500':
  1122. description: Internal server error.
  1123. content:
  1124. application/json:
  1125. schema:
  1126. $ref: '#/components/schemas/Error500'
  1127. '/recommended-fee':
  1128. get:
  1129. tags:
  1130. - Hermez status
  1131. summary: Get recommended fee in USD.
  1132. description: >-
  1133. Get recommended fee in USD. Recommended price to pay according to the status of the destination account.
  1134. operationId: getFee
  1135. responses:
  1136. '200':
  1137. description: Successful operation
  1138. content:
  1139. application/json:
  1140. schema:
  1141. $ref: '#/components/schemas/RecommendedFee'
  1142. '500':
  1143. description: Internal server error.
  1144. content:
  1145. application/json:
  1146. schema:
  1147. $ref: '#/components/schemas/Error500'
  1148. '/coordinators':
  1149. get:
  1150. tags:
  1151. - Hermez status
  1152. summary: Get information about coordinators.
  1153. description: Get information about coordinators.
  1154. operationId: getCoordinators
  1155. parameters:
  1156. - name: fromItem
  1157. in: query
  1158. required: false
  1159. description: Indicates the desired first item (using the itemId property) to be included in the response.
  1160. schema:
  1161. type: number
  1162. - name: order
  1163. in: query
  1164. required: false
  1165. description: Order of the returned items. Coordinators will be ordered by increasing (ethereumBlock, forgerAddr).
  1166. schema:
  1167. type: string
  1168. default: ASC
  1169. enum:
  1170. - ASC
  1171. - DESC
  1172. - name: limit
  1173. in: query
  1174. required: false
  1175. description: Maximum number of items to be returned.
  1176. schema:
  1177. type: integer
  1178. minimum: 1
  1179. maximum: 2049
  1180. responses:
  1181. '200':
  1182. description: Successful operation.
  1183. content:
  1184. application/json:
  1185. schema:
  1186. $ref: '#/components/schemas/Coordinators'
  1187. '400':
  1188. description: Bad request.
  1189. content:
  1190. application/json:
  1191. schema:
  1192. $ref: '#/components/schemas/Error400'
  1193. '500':
  1194. description: Internal server error.
  1195. content:
  1196. application/json:
  1197. schema:
  1198. $ref: '#/components/schemas/Error500'
  1199. '/coordinators/{forgerAddr}':
  1200. get:
  1201. tags:
  1202. - Hermez status
  1203. summary: Get the information of a coordinator.
  1204. description: Get the information of a coordinator.
  1205. operationId: getCoordinator
  1206. parameters:
  1207. - name: forgerAddr
  1208. in: path
  1209. description: Coordinator identifier
  1210. required: true
  1211. schema:
  1212. $ref: '#/components/schemas/EthereumAddress'
  1213. responses:
  1214. '200':
  1215. description: Successful operation.
  1216. content:
  1217. application/json:
  1218. schema:
  1219. $ref: '#/components/schemas/Coordinator'
  1220. '400':
  1221. description: Bad request.
  1222. content:
  1223. application/json:
  1224. schema:
  1225. $ref: '#/components/schemas/Error400'
  1226. '404':
  1227. description: Not found.
  1228. content:
  1229. application/json:
  1230. schema:
  1231. $ref: '#/components/schemas/Error404'
  1232. '500':
  1233. description: Internal server error.
  1234. content:
  1235. application/json:
  1236. schema:
  1237. $ref: '#/components/schemas/Error500'
  1238. components:
  1239. schemas:
  1240. ItemId:
  1241. type: integer
  1242. description: Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
  1243. PostPoolL2Transaction:
  1244. type: object
  1245. properties:
  1246. id:
  1247. $ref: '#/components/schemas/TransactionId'
  1248. type:
  1249. $ref: '#/components/schemas/TransactionTypeL2'
  1250. tokenId:
  1251. $ref: '#/components/schemas/TokenId'
  1252. fromAccountIndex:
  1253. $ref: '#/components/schemas/AccountIndex'
  1254. toAccountIndex:
  1255. type: string
  1256. description: >-
  1257. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1258. The identifier is built using: `hez:` + `token symbol:` + `index`
  1259. example: null
  1260. nullable: true
  1261. toHezEthereumAddress:
  1262. type: string
  1263. description: "Address of an Etherum account linked to the Hermez network."
  1264. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1265. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1266. nullable: true
  1267. toBjj:
  1268. type: string
  1269. description: "BabyJubJub 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."
  1270. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1271. example: null
  1272. nullable: true
  1273. amount:
  1274. allOf:
  1275. - $ref: '#/components/schemas/BigInt'
  1276. - description: Amount of tokens to be sent.
  1277. example: "63"
  1278. fee:
  1279. $ref: '#/components/schemas/FeeSelector'
  1280. nonce:
  1281. $ref: '#/components/schemas/Nonce'
  1282. signature:
  1283. allOf:
  1284. - $ref: '#/components/schemas/Signature'
  1285. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1286. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1287. requestFromAccountIndex:
  1288. type: string
  1289. description: References the `fromAccountIndex` of the requested transaction.
  1290. example: null
  1291. nullable: true
  1292. requestToAccountIndex:
  1293. type: string
  1294. description: References the `toAccountIndex` of the requested transaction.
  1295. example: null
  1296. nullable: true
  1297. requestToHezEthereumAddress:
  1298. type: string
  1299. description: References the `toHezEthereumAddress` of the requested transaction.
  1300. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1301. example: null
  1302. nullable: true
  1303. requestToBJJ:
  1304. type: string
  1305. description: References the `toBJJ` of the requested transaction.
  1306. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1307. example: null
  1308. nullable: true
  1309. requestTokenId:
  1310. type: integer
  1311. description: References the `tokenId` of the requested transaction.
  1312. example: null
  1313. nullable: true
  1314. requestAmount:
  1315. type: string
  1316. description: References the `amount` of the requested transaction.
  1317. example: null
  1318. nullable: true
  1319. requestFee:
  1320. type: integer
  1321. description: References the `fee` of the requested transaction.
  1322. example: null
  1323. nullable: true
  1324. requestNonce:
  1325. type: integer
  1326. description: References the `nonce` of the requested transaction.
  1327. example: null
  1328. nullable: true
  1329. required:
  1330. - id
  1331. - type
  1332. - tokenId
  1333. - fromAccountIndex
  1334. - toAccountIndex
  1335. - toHezAccountIndex
  1336. - toHezEthereumAddress
  1337. - toBjj
  1338. - amount
  1339. - fee
  1340. - nonce
  1341. - signature
  1342. - requestFromAccountIndex
  1343. - requestToAccountIndex
  1344. - requestToHezEthereumAddress
  1345. - requestToBJJ
  1346. - requestTokenId
  1347. - requestAmount
  1348. - requestFee
  1349. - requestNonce
  1350. PoolL2Transaction:
  1351. type: object
  1352. properties:
  1353. id:
  1354. $ref: '#/components/schemas/TransactionId'
  1355. type:
  1356. $ref: '#/components/schemas/TransactionTypeL2'
  1357. fromAccountIndex:
  1358. $ref: '#/components/schemas/AccountIndex'
  1359. toAccountIndex:
  1360. type: string
  1361. description: >-
  1362. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1363. The identifier is built using: `hez:` + `token symbol:` + `index`
  1364. example: "hez:DAI:309"
  1365. nullable: true
  1366. toHezEthereumAddress:
  1367. type: string
  1368. description: "Address of an Etherum account linked to the Hermez network."
  1369. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1370. example: null
  1371. nullable: true
  1372. toBjj:
  1373. type: string
  1374. description: "BabyJubJub 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."
  1375. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1376. example: null
  1377. nullable: true
  1378. amount:
  1379. allOf:
  1380. - $ref: '#/components/schemas/BigInt'
  1381. - description: Amount of tokens to be sent.
  1382. example: "63"
  1383. fee:
  1384. $ref: '#/components/schemas/FeeSelector'
  1385. nonce:
  1386. $ref: '#/components/schemas/Nonce'
  1387. state:
  1388. $ref: '#/components/schemas/PoolL2TransactionState'
  1389. signature:
  1390. allOf:
  1391. - $ref: '#/components/schemas/Signature'
  1392. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1393. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1394. timestamp:
  1395. type: string
  1396. description: Moment in which the transaction was added to the pool.
  1397. format: date-time
  1398. batchNum:
  1399. allOf:
  1400. - $ref: '#/components/schemas/BatchNum'
  1401. - nullable: true
  1402. - example: 5432
  1403. requestFromAccountIndex:
  1404. allOf:
  1405. - $ref: '#/components/schemas/AccountIndex'
  1406. - nullable: true
  1407. - example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1408. requestToAccountIndex:
  1409. allOf:
  1410. - $ref: '#/components/schemas/AccountIndex'
  1411. - nullable: true
  1412. - example: "hez:DAI:33"
  1413. requestToHezEthereumAddress:
  1414. allOf:
  1415. - $ref: '#/components/schemas/HezEthereumAddress'
  1416. - nullable: true
  1417. - example: "hez:0xbb942cfcd25ad4d90a62358b0dd84f33b3982699"
  1418. requestToBJJ:
  1419. allOf:
  1420. - $ref: '#/components/schemas/BJJ'
  1421. - nullable: true
  1422. - example: "hez:HVrB8xQHAYt9QTpPUsj3RGOzDmrCI4IgrYslTeTqo6Ix"
  1423. requestTokenId:
  1424. allOf:
  1425. - $ref: '#/components/schemas/TokenId'
  1426. - nullable: true
  1427. - example: 4444
  1428. requestAmount:
  1429. allOf:
  1430. - $ref: '#/components/schemas/BigInt'
  1431. - description: Amount of tokens to be sent.
  1432. - example: "7"
  1433. - nullable: true
  1434. requestFee:
  1435. allOf:
  1436. - $ref: '#/components/schemas/FeeSelector'
  1437. - nullable: true
  1438. - example: 8
  1439. requestNonce:
  1440. allOf:
  1441. - $ref: '#/components/schemas/Nonce'
  1442. - nullable: true
  1443. - example: 6
  1444. token:
  1445. $ref: '#/components/schemas/Token'
  1446. required:
  1447. - fromAccountIndex
  1448. - toHezAccountIndex
  1449. - toHezEthereumAddress
  1450. - toBjj
  1451. - tokenId
  1452. - amount
  1453. - fee
  1454. - nonce
  1455. - signature
  1456. TransactionId:
  1457. type: string
  1458. 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)
  1459. example: "0x00000000000001e240004700"
  1460. EthereumAddress:
  1461. type: string
  1462. description: "Address of an Etherum account."
  1463. pattern: "^0x[a-fA-F0-9]{40}$"
  1464. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1465. HezEthereumAddress:
  1466. type: string
  1467. description: "Address of an Etherum account linked to the Hermez network."
  1468. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1469. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1470. BJJ:
  1471. type: string
  1472. description: "BabyJubJub 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."
  1473. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1474. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1475. AccountIndex:
  1476. type: string
  1477. description: >-
  1478. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1479. The identifier is built using: `hez:` + `token symbol:` + `index`
  1480. example: "hez:DAI:4444"
  1481. TransactionType:
  1482. type: string
  1483. description: Type of transaction.
  1484. enum:
  1485. - Exit
  1486. - Transfer
  1487. - Deposit
  1488. - CreateAccountDeposit
  1489. - CreateAccountDepositTransfer
  1490. - DepositTransfer
  1491. - ForceTransfer
  1492. - ForceExit
  1493. - TransferToEthAddr
  1494. - TransferToBJJ
  1495. TransactionTypeL2:
  1496. type: string
  1497. description: Type of transaction.
  1498. enum:
  1499. - Exit
  1500. - Transfer
  1501. - TransferToEthAddr
  1502. - TransferToBJJ
  1503. TokenId:
  1504. type: integer
  1505. description: Identifier of a token registered in the network.
  1506. minimum: 0
  1507. maximum: 4294967295
  1508. example: 4444
  1509. BigInt:
  1510. type: string
  1511. description: BigInt is an integer encoded as a string for numbers that are very large.
  1512. example: "8708856933496328593"
  1513. FeeSelector:
  1514. type: integer
  1515. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1516. minimum: 0
  1517. maximum: 256
  1518. example: 36
  1519. Nonce:
  1520. type: integer
  1521. description: Number that can only be used once per account, increments by one at each transaction.
  1522. minimum: 0
  1523. maximum: 1.84467440737096e+19
  1524. example: 121
  1525. PoolL2TransactionState:
  1526. type: string
  1527. description: >
  1528. State of a L2 transaction from the coordinator pool.
  1529. * pend: Pending
  1530. * fing: Forging
  1531. * fged: Forged
  1532. * invl: Invalid
  1533. enum:
  1534. - pend
  1535. - fing
  1536. - fged
  1537. - invl
  1538. Signature:
  1539. type: string
  1540. description: BabyJubJub compressed signature.
  1541. pattern: "^[a-fA-F0-9]{128}$"
  1542. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1543. BatchNum:
  1544. type: integer
  1545. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1546. minimum: 0
  1547. maximum: 4294967295
  1548. example: 5432
  1549. AccountCreationAuthorization:
  1550. type: object
  1551. properties:
  1552. timestamp:
  1553. type: string
  1554. format: date-time
  1555. hezEthereumAddress:
  1556. $ref: '#/components/schemas/HezEthereumAddress'
  1557. bjj:
  1558. $ref: '#/components/schemas/BJJ'
  1559. signature:
  1560. allOf:
  1561. - $ref: '#/components/schemas/Signature'
  1562. - description: Signature of the auth message. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=regular-rollup-account).
  1563. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1564. required:
  1565. - ethereumAddress
  1566. - bjj
  1567. - signature
  1568. HistoryTransaction:
  1569. type: object
  1570. description: Transaction of the Hermez network
  1571. properties:
  1572. L1orL2:
  1573. type: string
  1574. enum:
  1575. - L1
  1576. - L2
  1577. id:
  1578. $ref: '#/components/schemas/TransactionId'
  1579. itemId:
  1580. $ref: '#/components/schemas/ItemId'
  1581. type:
  1582. $ref: '#/components/schemas/TransactionType'
  1583. position:
  1584. $ref: '#/components/schemas/TransactionPosition'
  1585. fromAccountIndex:
  1586. type: string
  1587. description: >-
  1588. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1589. The identifier is built using: `hez:` + `token symbol:` + `index`
  1590. example: "hez:DAI:4444"
  1591. nullable: true
  1592. toAccountIndex:
  1593. allOf:
  1594. - $ref: '#/components/schemas/AccountIndex'
  1595. - example: "hez:DAI:672"
  1596. amount:
  1597. allOf:
  1598. - $ref: '#/components/schemas/BigInt'
  1599. - description: Amount of tokens to be sent.
  1600. - example: "49"
  1601. batchNum:
  1602. type: integer
  1603. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1604. minimum: 0
  1605. maximum: 4294967295
  1606. example: 5432
  1607. nullable: true
  1608. historicUSD:
  1609. type: number
  1610. description: Value in USD at the moment the transaction was forged.
  1611. example: 49.7
  1612. nullable: true
  1613. timestamp:
  1614. type: string
  1615. format: date-time
  1616. 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.
  1617. token:
  1618. $ref: '#/components/schemas/Token'
  1619. L1Info:
  1620. type: object
  1621. description: Additional information that only applies to L1 transactions.
  1622. nullable: true
  1623. properties:
  1624. toForgeL1TransactionsNum:
  1625. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1626. userOrigin:
  1627. type: boolean
  1628. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1629. fromHezEthereumAddress:
  1630. $ref: '#/components/schemas/HezEthereumAddress'
  1631. fromBJJ:
  1632. $ref: '#/components/schemas/BJJ'
  1633. loadAmount:
  1634. allOf:
  1635. - $ref: '#/components/schemas/BigInt'
  1636. - description: Tokens transfered from L1 to L2.
  1637. - example: "49"
  1638. historicLoadAmountUSD:
  1639. type: number
  1640. description: Load amount in USD, at the moment the transaction was made.
  1641. example: 3.897
  1642. nullable: true
  1643. ethereumBlockNum:
  1644. allOf:
  1645. - $ref: '#/components/schemas/EthBlockNum'
  1646. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1647. - example: 258723049
  1648. required:
  1649. - toForgeL1TransactionsNum
  1650. - userOrigin
  1651. - fromHezEthereumAddress
  1652. - fromBJJ
  1653. - loadAmount
  1654. - historicLoadAmountUSD
  1655. - ethereumBlockNum
  1656. additionalProperties: false
  1657. L2Info:
  1658. type: object
  1659. description: Additional information that only applies to L2 transactions.
  1660. nullable: true
  1661. properties:
  1662. fee:
  1663. $ref: '#/components/schemas/FeeSelector'
  1664. historicFeeUSD:
  1665. type: number
  1666. description: Fee in USD, at the moment the transaction was forged.
  1667. example: 263.89
  1668. nullable: true
  1669. nonce:
  1670. $ref: '#/components/schemas/Nonce'
  1671. example: null
  1672. required:
  1673. - fee
  1674. - historicFeeUSD
  1675. - nonce
  1676. additionalProperties: false
  1677. required:
  1678. - L1orL2
  1679. - id
  1680. - itemId
  1681. - type
  1682. - position
  1683. - fromAccountIndex
  1684. - toAccountIndex
  1685. - amount
  1686. - batchNum
  1687. - historicUSD
  1688. - timestamp
  1689. - token
  1690. - L1Info
  1691. - L2Info
  1692. additionalProperties: false
  1693. HistoryTransactions:
  1694. type: object
  1695. properties:
  1696. transactions:
  1697. type: array
  1698. description: List of history transactions.
  1699. items:
  1700. $ref: '#/components/schemas/HistoryTransaction'
  1701. pagination:
  1702. $ref: '#/components/schemas/PaginationInfo'
  1703. required:
  1704. - transactions
  1705. - pagination
  1706. additionalProperties: false
  1707. EthBlockNum:
  1708. type: integer
  1709. description: Ethereum block number
  1710. minimum: 0
  1711. maximum: 1.84467440737096e+19
  1712. example: 762375478
  1713. ToForgeL1TransactionsNum:
  1714. type: integer
  1715. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  1716. minimum: 0
  1717. maximum: 4294967295
  1718. example: 784
  1719. nullable: true
  1720. TransactionPosition:
  1721. type: integer
  1722. description: Position that a transaction occupies in a batch.
  1723. minimum: 0
  1724. example: 5
  1725. URL:
  1726. type: string
  1727. description: HTTP URL
  1728. example: "https://hermez.io"
  1729. TokenSymbol:
  1730. type: string
  1731. description: Abreviation of the token name.
  1732. example: "DAI"
  1733. TokenName:
  1734. type: string
  1735. description: Token name.
  1736. example: "Dai"
  1737. CollectedFees:
  1738. type: array
  1739. description: Collected fees by the forger of the batch. A maximum of 64 different tokens can be used.
  1740. items:
  1741. type: object
  1742. properties:
  1743. tokenId:
  1744. $ref: '#/components/schemas/TokenId'
  1745. amount:
  1746. allOf:
  1747. - $ref: '#/components/schemas/BigInt'
  1748. - description: Ammount of collected tokens
  1749. - example: "53"
  1750. Batch:
  1751. type: object
  1752. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1753. properties:
  1754. batchNum:
  1755. $ref: '#/components/schemas/BatchNum'
  1756. ethereumBlockNum:
  1757. $ref: '#/components/schemas/EthBlockNum'
  1758. ethereumBlockHash:
  1759. type: string
  1760. description: hash of the Ethereum block in which the batch was forged
  1761. example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
  1762. timestamp:
  1763. type: string
  1764. format: date-time
  1765. description: Time in which the batch was forged.
  1766. forgerAddr:
  1767. $ref: '#/components/schemas/EthereumAddress'
  1768. collectedFees:
  1769. $ref: '#/components/schemas/CollectedFees'
  1770. totalCollectedFeesUSD:
  1771. type: number
  1772. description: Value in USD of the collected tokens by the forger in concept of fees. This is calculated at the moment the batch is forged, with the conversion rates at that time.
  1773. historicTotalCollectedFeesUSD:
  1774. type: number
  1775. description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
  1776. example: 23.3
  1777. stateRoot:
  1778. allOf:
  1779. - $ref: '#/components/schemas/Hash'
  1780. - description: Root of the accounts Merkle Tree.
  1781. - example: "2734657026572a8708d883"
  1782. numAccounts:
  1783. type: integer
  1784. description: Number of registered accounts in this batch.
  1785. exitRoot:
  1786. allOf:
  1787. - $ref: '#/components/schemas/Hash'
  1788. - description: Root of the exit Merkle Tree associated to this batch.
  1789. - example: "2734657026572a8708d883"
  1790. forgeL1TransactionsNum:
  1791. allOf:
  1792. - $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1793. - description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  1794. - example: 5
  1795. slotNum:
  1796. $ref: '#/components/schemas/SlotNum'
  1797. FullBatch:
  1798. type: object
  1799. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1800. properties:
  1801. batch:
  1802. $ref: '#/components/schemas/Batch'
  1803. transactions:
  1804. type: array
  1805. description: List of forged transactions in the batch
  1806. items:
  1807. $ref: '#/components/schemas/HistoryTransaction'
  1808. Hash:
  1809. type: string
  1810. description: hashed data
  1811. example: "2734657026572a8708d883"
  1812. SlotNum:
  1813. type: integer
  1814. description: Identifier of a slot.
  1815. minimum: 0
  1816. maximum: 4294967295
  1817. example: 784
  1818. Batches:
  1819. type: object
  1820. properties:
  1821. batches:
  1822. type: array
  1823. description: List of batches.
  1824. items:
  1825. $ref: '#/components/schemas/Batch'
  1826. pagination:
  1827. $ref: '#/components/schemas/PaginationInfo'
  1828. Coordinator:
  1829. type: object
  1830. properties:
  1831. forgerAddr:
  1832. $ref: '#/components/schemas/EthereumAddress'
  1833. withdrawAddr:
  1834. $ref: '#/components/schemas/EthereumAddress'
  1835. URL:
  1836. $ref: '#/components/schemas/URL'
  1837. ethereumBlock:
  1838. allOf:
  1839. - $ref: '#/components/schemas/EthBlockNum'
  1840. - description: Ethereum block in which the coordinator registered into the network.
  1841. - example: 5735943738
  1842. Coordinators:
  1843. type: object
  1844. properties:
  1845. coordinators:
  1846. type: array
  1847. description: List of coordinators.
  1848. items:
  1849. $ref: '#/components/schemas/Coordinator'
  1850. pagination:
  1851. $ref: '#/components/schemas/PaginationInfo'
  1852. Bid:
  1853. type: object
  1854. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  1855. properties:
  1856. forgerAddr:
  1857. $ref: '#/components/schemas/EthereumAddress'
  1858. slotNum:
  1859. $ref: '#/components/schemas/SlotNum'
  1860. withdrawAddr:
  1861. $ref: '#/components/schemas/EthereumAddress'
  1862. URL:
  1863. $ref: '#/components/schemas/URL'
  1864. bidValue:
  1865. $ref: '#/components/schemas/BigInt'
  1866. ethereumBlockNum:
  1867. $ref: '#/components/schemas/EthBlockNum'
  1868. timestamp:
  1869. type: string
  1870. format: date-time
  1871. Bids:
  1872. type: object
  1873. properties:
  1874. bids:
  1875. type: array
  1876. description: List of bids.
  1877. items:
  1878. $ref: '#/components/schemas/Bid'
  1879. pagination:
  1880. $ref: '#/components/schemas/PaginationInfo'
  1881. RecommendedFee:
  1882. type: object
  1883. description: Fee that the coordinator recommends per transaction in USD.
  1884. properties:
  1885. existingAccount:
  1886. type: number
  1887. description: Recommended fee if the destination account of the transaction already exists.
  1888. minimum: 0
  1889. example: 0.1
  1890. createAccount:
  1891. type: number
  1892. 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.
  1893. minimum: 0
  1894. example: 1.3
  1895. createAccountInternal:
  1896. type: number
  1897. 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 to an Ethereum address and therefore can only operate in L2.
  1898. minimum: 0
  1899. example: 0.5
  1900. Token:
  1901. type: object
  1902. description: Hermez network compatible and registered token.
  1903. properties:
  1904. id:
  1905. $ref: '#/components/schemas/TokenId'
  1906. ethereumAddress:
  1907. allOf:
  1908. - $ref: '#/components/schemas/EthereumAddress'
  1909. - description: Ethereum address in which the token is deployed.
  1910. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1911. name:
  1912. type: string
  1913. description: full name of the token
  1914. example: Maker Dai
  1915. symbol:
  1916. allOf:
  1917. - $ref: '#/components/schemas/TokenSymbol'
  1918. - example: DAI
  1919. decimals:
  1920. type: integer
  1921. description: Number of decimals of the token.
  1922. example: 18
  1923. ethereumBlockNum:
  1924. allOf:
  1925. - $ref: '#/components/schemas/EthBlockNum'
  1926. - description: Ethereum block number in which the token was added to the Hermez network.
  1927. - example: 539847538
  1928. USD:
  1929. type: number
  1930. description: Value of the token in USD.
  1931. example: 1.01
  1932. nullable: true
  1933. fiatUpdate:
  1934. type: string
  1935. format: date-time
  1936. description: Timestamp of the moment the `USD` value was updated.
  1937. nullable: true
  1938. required:
  1939. - id
  1940. - ethereumAddress
  1941. - name
  1942. - symbol
  1943. - decimals
  1944. - ethereumBlockNum
  1945. - USD
  1946. - fiatUpdate
  1947. additionalProperties: false
  1948. Tokens:
  1949. type: object
  1950. properties:
  1951. tokens:
  1952. type: array
  1953. description: List of tokens.
  1954. items:
  1955. $ref: '#/components/schemas/Token'
  1956. pagination:
  1957. $ref: '#/components/schemas/PaginationInfo'
  1958. Exit:
  1959. type: object
  1960. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  1961. properties:
  1962. batchNum:
  1963. allOf:
  1964. - $ref: '#/components/schemas/BatchNum'
  1965. - description: Batch in which the exit was forged.
  1966. - example: 7394
  1967. accountIndex:
  1968. $ref: '#/components/schemas/AccountIndex'
  1969. itemId:
  1970. $ref: '#/components/schemas/ItemId'
  1971. merkleProof:
  1972. type: object
  1973. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  1974. properties:
  1975. Root:
  1976. type: array
  1977. items:
  1978. type: integer
  1979. Siblings:
  1980. type: array
  1981. items:
  1982. type: integer
  1983. OldKey:
  1984. type: array
  1985. items:
  1986. type: integer
  1987. OldValue:
  1988. type: array
  1989. items:
  1990. type: integer
  1991. IsOld0:
  1992. type: boolean
  1993. Key:
  1994. type: array
  1995. items:
  1996. type: integer
  1997. Value:
  1998. type: array
  1999. items:
  2000. type: integer
  2001. Fnc:
  2002. type: integer
  2003. required:
  2004. - Root
  2005. - Siblings
  2006. - OldKey
  2007. - OldValue
  2008. - IsOld0
  2009. - Key
  2010. - Value
  2011. - Fnc
  2012. additionalProperties: false
  2013. example: {"Root":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Siblings":[0,1,2],"OldKey":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"OldValue":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"IsOld0":true,"Key":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Value":[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Fnc":0}
  2014. balance:
  2015. $ref: '#/components/schemas/BigInt'
  2016. instantWithdrawn:
  2017. type: integer
  2018. description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  2019. minimum: 0
  2020. maximum: 1.84467440737096e+19
  2021. example: 74747363
  2022. nullable: true
  2023. delayedWithdrawRequest:
  2024. type: integer
  2025. description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  2026. minimum: 0
  2027. maximum: 1.84467440737096e+19
  2028. example: null
  2029. nullable: true
  2030. delayedWithdrawn:
  2031. type: integer
  2032. 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.
  2033. minimum: 0
  2034. maximum: 1.84467440737096e+19
  2035. example: null
  2036. nullable: true
  2037. token:
  2038. $ref: '#/components/schemas/Token'
  2039. required:
  2040. - batchNum
  2041. - accountIndex
  2042. - itemId
  2043. - merkleProof
  2044. - balance
  2045. - instantWithdrawn
  2046. - delayedWithdrawRequest
  2047. - delayedWithdrawn
  2048. - token
  2049. additionalProperties: false
  2050. Exits:
  2051. type: object
  2052. properties:
  2053. exits:
  2054. type: array
  2055. description: List of exits.
  2056. items:
  2057. $ref: '#/components/schemas/Exit'
  2058. pagination:
  2059. $ref: '#/components/schemas/PaginationInfo'
  2060. required:
  2061. - exits
  2062. - pagination
  2063. additionalProperties: false
  2064. Account:
  2065. type: object
  2066. description: State tree leaf. It contains balance and nonce of an account.
  2067. properties:
  2068. accountIndex:
  2069. $ref: '#/components/schemas/AccountIndex'
  2070. nonce:
  2071. $ref: '#/components/schemas/Nonce'
  2072. balance:
  2073. $ref: '#/components/schemas/BigInt'
  2074. bjj:
  2075. $ref: '#/components/schemas/BJJ'
  2076. hezEthereumAddress:
  2077. $ref: '#/components/schemas/HezEthereumAddress'
  2078. token:
  2079. $ref: '#/components/schemas/Token'
  2080. Accounts:
  2081. type: object
  2082. properties:
  2083. accounts:
  2084. type: array
  2085. description: List of accounts.
  2086. items:
  2087. $ref: '#/components/schemas/Account'
  2088. pagination:
  2089. $ref: '#/components/schemas/PaginationInfo'
  2090. Slot:
  2091. type: object
  2092. description: Slot information.
  2093. properties:
  2094. slotNum:
  2095. $ref: '#/components/schemas/SlotNum'
  2096. firstBlock:
  2097. allOf:
  2098. - $ref: '#/components/schemas/EthBlockNum'
  2099. - description: Block in which the slot began or will begin
  2100. - example: 76238647846
  2101. lastBlock:
  2102. allOf:
  2103. - $ref: '#/components/schemas/EthBlockNum'
  2104. - description: Block in which the slot ended or will end
  2105. - example: 4475934
  2106. closedAuction:
  2107. type: boolean
  2108. description: Whether the auction of the slot has finished or not.
  2109. winner:
  2110. allOf:
  2111. - $ref: '#/components/schemas/Coordinator'
  2112. - description: Coordinator who won the auction. Only applicable if the auction is closed.
  2113. - nullable: true
  2114. - example: null
  2115. batchNums:
  2116. type: array
  2117. description: List of batch numbers that were forged during the slot
  2118. items:
  2119. $ref: '#/components/schemas/BatchNum'
  2120. Slots:
  2121. type: object
  2122. properties:
  2123. nextForgers:
  2124. type: array
  2125. description: List of slots.
  2126. items:
  2127. $ref: '#/components/schemas/Slot'
  2128. pagination:
  2129. $ref: '#/components/schemas/PaginationInfo'
  2130. NextForger:
  2131. type: object
  2132. description: Coordinator information along with the scheduled forging period
  2133. properties:
  2134. coordinator:
  2135. $ref: '#/components/schemas/Coordinator'
  2136. period:
  2137. type: object
  2138. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2139. properties:
  2140. fromBlock:
  2141. $ref: '#/components/schemas/EthBlockNum'
  2142. toBlock:
  2143. $ref: '#/components/schemas/EthBlockNum'
  2144. fromTimestamp:
  2145. type: string
  2146. format: date-time
  2147. toTimestamp:
  2148. type: string
  2149. format: date-time
  2150. NextForgers:
  2151. type: object
  2152. properties:
  2153. nextForgers:
  2154. type: array
  2155. description: List of next coordinators to forge.
  2156. items:
  2157. $ref: '#/components/schemas/NextForger'
  2158. pagination:
  2159. $ref: '#/components/schemas/PaginationInfo'
  2160. State:
  2161. type: object
  2162. description: Gobal statistics of the network.
  2163. properties:
  2164. lastBlock:
  2165. allOf:
  2166. - $ref: '#/components/schemas/EthBlockNum'
  2167. - description: Last synchronized Etherum block.
  2168. - example: 3457437
  2169. lastBatch:
  2170. allOf:
  2171. - $ref: '#/components/schemas/BatchNum'
  2172. - description: Last batch that has been forged.
  2173. - example: 76523
  2174. currentSlot:
  2175. allOf:
  2176. - $ref: '#/components/schemas/SlotNum'
  2177. - description: Slot where batches are currently being forged.
  2178. - example: 2334
  2179. transactionsPerBatch:
  2180. type: number
  2181. description: Average transactions per batch in the last 24 hours.
  2182. example: 2002.7
  2183. batchFrequency:
  2184. type: number
  2185. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2186. example: 8.9
  2187. transactionsPerSecond:
  2188. type: number
  2189. description: Average transactions per second in the last 24 hours.
  2190. example: 302.3
  2191. totalAccounts:
  2192. type: integer
  2193. description: Number of created accounts.
  2194. example: 90473
  2195. totalBJJs:
  2196. type: integer
  2197. description: Number of different registered BJJs.
  2198. example: 23067
  2199. avgTransactionFee:
  2200. type: number
  2201. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2202. example: 1.54
  2203. governance:
  2204. type: object
  2205. description: Network setings that are updatable by the governance.
  2206. properties:
  2207. rollup:
  2208. type: object
  2209. description: Rollup parameters.
  2210. properties:
  2211. forgeTimeout:
  2212. type: integer
  2213. description: Time delay between the beggining of a slot and the beggining of the period in which anyone can forge if the auction winner of the slot hasn't forged any batch yet. Time is measured in Ethereum blocks.
  2214. example: 5
  2215. feeAddToken:
  2216. type: integer
  2217. description: fee to pay when registering tokens into the network.
  2218. example: 5698
  2219. auction:
  2220. type: object
  2221. description: Auction parameters.
  2222. properties:
  2223. bootCoordinator:
  2224. allOf:
  2225. - $ref: '#/components/schemas/EthereumAddress'
  2226. - description: Ethereum address of the boot coordinator.
  2227. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2228. slotDeadline:
  2229. type: integer
  2230. description: Number of blocks at the end of a slot in which any coordinator can forge if the winner has not forged one before.
  2231. example: 3
  2232. closedAuctionSlots:
  2233. type: integer
  2234. 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.
  2235. example: 2
  2236. openAuctionSlots:
  2237. type: integer
  2238. description: How many days in advance are auctions opened.
  2239. defaultSlotSetBid:
  2240. type: array
  2241. 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]`."
  2242. items:
  2243. type: integer
  2244. example: [32,0,68,21,55,99]
  2245. outbidding:
  2246. type: number
  2247. description: Minimum outbid over the previous one to consider it valid.
  2248. example: 3.64
  2249. donationAddress:
  2250. allOf:
  2251. - $ref: '#/components/schemas/EthereumAddress'
  2252. - description: Ethereum address where the donations will go to.
  2253. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2254. allocationRatio:
  2255. type: array
  2256. description: Percentage in which fees will be splitted between donations, governance and burning. The sum of the tree values should be 100.
  2257. items:
  2258. type: integer
  2259. example: [80,10,10]
  2260. withdrawalDelayer:
  2261. type: object
  2262. description: Withdrawal delayer parameters.
  2263. properties:
  2264. rollupAddress:
  2265. allOf:
  2266. - $ref: '#/components/schemas/EthereumAddress'
  2267. - description: Ethereum address of the rollup smart contract.
  2268. - example: "0x777dc4262BCDbf85190C01c996b4C06a461d2430"
  2269. governanceAddress:
  2270. allOf:
  2271. - $ref: '#/components/schemas/EthereumAddress'
  2272. - description: Ethereum address of the governance mechanism.
  2273. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2274. whitheHackerGroupAddress:
  2275. allOf:
  2276. - $ref: '#/components/schemas/EthereumAddress'
  2277. - description: Ethereum Address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2278. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2279. keeperAddress:
  2280. allOf:
  2281. - $ref: '#/components/schemas/EthereumAddress'
  2282. - description: Ethereum Address that can enable emergency mode and modify the delay to make a withdrawal.
  2283. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2284. withdrawalDelay:
  2285. allOf:
  2286. - $ref: '#/components/schemas/EthBlockNum'
  2287. - description: The time that anyone needs to wait until a withdrawal of the funds is allowed, in Ethereum blocks.
  2288. - example: 539573849
  2289. emergencyModeStartingTime:
  2290. type: integer
  2291. description: Ethereum block in which the emergency mode will be activated.
  2292. example: 10
  2293. emergencyMode:
  2294. type: boolean
  2295. description: Indicates if emergency mode has been activated.
  2296. PaginationInfo:
  2297. type: object
  2298. description: Give pagination information
  2299. properties:
  2300. totalItems:
  2301. type: integer
  2302. description: Amount of items that the endpoint can return given the filters and the current state of the database.
  2303. example: 2048
  2304. firstItem:
  2305. type: integer
  2306. description: The smallest itemId that the endpoint will return with the given filters.
  2307. example: 50
  2308. lastItem:
  2309. type: integer
  2310. description: The greatest itemId that the endpoint will return with the given filters.
  2311. example: 2130
  2312. Config:
  2313. type: object
  2314. description: Configuration parameters of the different smart contracts that power the Hermez network.
  2315. properties:
  2316. hermez:
  2317. type: object
  2318. description: Constant configuration of the Hermez smart contract.
  2319. properties:
  2320. HEZTokenAddress:
  2321. allOf:
  2322. - $ref: '#/components/schemas/EthereumAddress'
  2323. - description: Ethereum address of the HEZ token.
  2324. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2325. maxTxVerifiers:
  2326. type: integer
  2327. description: Maximum transactions of the verifiers.
  2328. example: 100
  2329. maxLoadAmount:
  2330. type: integer
  2331. description: Maximum load amount (L1 to L2) allowed.
  2332. example: 321
  2333. maxAmount:
  2334. type: integer
  2335. description: Maximum amount (L2 to L2) allowed.
  2336. example: 837
  2337. maxTokens:
  2338. type: integer
  2339. description: Maximum number of different tokens that can be registered in the network.
  2340. example: 4294967295
  2341. reservedAccountIndex:
  2342. type: integer
  2343. description: First user index. Bellow this number the indexes are reserved for the protocol.
  2344. example: 256
  2345. lastAccountIndex:
  2346. type: integer
  2347. description: Biggest account index that can be registered.
  2348. example: 4294967295
  2349. exitAccountIndex:
  2350. type: integer
  2351. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2352. example: 1
  2353. L1CoordinatorBytes:
  2354. type: integer
  2355. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2356. example: 23
  2357. L1UserBytes:
  2358. type: integer
  2359. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2360. example: 32
  2361. L2Bytes:
  2362. type: integer
  2363. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2364. example: 33
  2365. maxL1Transactions:
  2366. type: integer
  2367. description: Maximum L1 transactions allowed to be queued in a batch.
  2368. example: 128
  2369. maxL1UserTransactions:
  2370. type: integer
  2371. description: Maximum L1 transactions allowed to be queued in a batch by users (anyone who is not a coordinator).
  2372. example: 32
  2373. RField:
  2374. allOf:
  2375. - $ref: '#/components/schemas/BigInt'
  2376. - description: Modulus zkSNARK.
  2377. withdrawManager:
  2378. type: object
  2379. description: Constant configuration of the withdraw manager smart contract.
  2380. properties:
  2381. noLimit:
  2382. type: integer
  2383. description: Reserved bucket index when the token value is 0 USD.
  2384. example: 0
  2385. amountOfBuckets:
  2386. type: integer
  2387. description: Number of buckets
  2388. maxWithdrawalDelay:
  2389. type: integer
  2390. description: Maximum delay to withdraw tokens. Time is measured in Ethereum blocks.
  2391. auction:
  2392. type: object
  2393. description: Constant configuration of the auction smart contract.
  2394. properties:
  2395. HEZTokenAddress:
  2396. allOf:
  2397. - $ref: '#/components/schemas/EthereumAddress'
  2398. - description: Ethereum address of the HEZ token.
  2399. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  2400. rollupAddress:
  2401. allOf:
  2402. - $ref: '#/components/schemas/EthereumAddress'
  2403. - description: Ethereum address of the rollup smart contract.
  2404. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2405. genesisBlockNum:
  2406. allOf:
  2407. - $ref: '#/components/schemas/EthBlockNum'
  2408. - description: Ethereum block number in which the smart contract starts operating.
  2409. delayGenesis:
  2410. type: integer
  2411. description: Time delay between `genesisBlockNum` and the beginning of the first block. Time is measured in Ethereum blocks.
  2412. blocksPerSlot:
  2413. type: integer
  2414. description: Blocks per slot.
  2415. initialMinimalBidding:
  2416. type: integer
  2417. description: Minimum bid when no one has bid yet.
  2418. withdrawalDelayer:
  2419. type: object
  2420. description: Constant configuration of the withdrawal delayer smart contract.
  2421. properties:
  2422. maxWithdrawalDelay:
  2423. type: integer
  2424. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in Ethereum blocks.
  2425. example: 200
  2426. maxEmergencyModeTime:
  2427. type: integer
  2428. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in Ethereum blocks.
  2429. example: 2000
  2430. Error:
  2431. type: object
  2432. description: Error response.
  2433. properties:
  2434. message:
  2435. type: string
  2436. Error400:
  2437. allOf:
  2438. - $ref: '#/components/schemas/Error'
  2439. - example:
  2440. message: Invalid signature.
  2441. Error404:
  2442. allOf:
  2443. - $ref: '#/components/schemas/Error'
  2444. - example:
  2445. message: Item(s) not found.
  2446. Error500:
  2447. allOf:
  2448. - $ref: '#/components/schemas/Error'
  2449. - example:
  2450. message: Database error.