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.

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