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.

2362 lines
83 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. type: string
  1235. description: >-
  1236. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1237. The identifier is built using: `hez:` + `token symbol:` + `index`
  1238. example: null
  1239. nullable: true
  1240. toHezEthereumAddress:
  1241. type: string
  1242. description: "Address of an Etherum account linked to the Hermez network."
  1243. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1244. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1245. nullable: true
  1246. toBjj:
  1247. type: string
  1248. 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."
  1249. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1250. example: null
  1251. nullable: true
  1252. amount:
  1253. allOf:
  1254. - $ref: '#/components/schemas/BigInt'
  1255. - description: Amount of tokens to be sent.
  1256. example: "63"
  1257. fee:
  1258. $ref: '#/components/schemas/FeeSelector'
  1259. nonce:
  1260. $ref: '#/components/schemas/Nonce'
  1261. signature:
  1262. allOf:
  1263. - $ref: '#/components/schemas/Signature'
  1264. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1265. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1266. requestFromAccountIndex:
  1267. type: string
  1268. description: References the `fromAccountIndex` of the requested transaction.
  1269. example: null
  1270. nullable: true
  1271. requestToAccountIndex:
  1272. type: string
  1273. description: References the `toAccountIndex` of the requested transaction.
  1274. example: null
  1275. nullable: true
  1276. requestToHezEthereumAddress:
  1277. type: string
  1278. description: References the `toHezEthereumAddress` of the requested transaction.
  1279. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1280. example: null
  1281. nullable: true
  1282. requestToBJJ:
  1283. type: string
  1284. description: References the `toBJJ` of the requested transaction.
  1285. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1286. example: null
  1287. nullable: true
  1288. requestTokenId:
  1289. type: integer
  1290. description: References the `tokenId` of the requested transaction.
  1291. example: null
  1292. nullable: true
  1293. requestAmount:
  1294. type: string
  1295. description: References the `amount` of the requested transaction.
  1296. example: null
  1297. nullable: true
  1298. requestFee:
  1299. type: integer
  1300. description: References the `fee` of the requested transaction.
  1301. example: null
  1302. nullable: true
  1303. requestNonce:
  1304. type: integer
  1305. description: References the `nonce` of the requested transaction.
  1306. example: null
  1307. nullable: true
  1308. required:
  1309. - id
  1310. - type
  1311. - tokenId
  1312. - fromAccountIndex
  1313. - toAccountIndex
  1314. - toHezAccountIndex
  1315. - toHezEthereumAddress
  1316. - toBjj
  1317. - amount
  1318. - fee
  1319. - nonce
  1320. - signature
  1321. - requestFromAccountIndex
  1322. - requestToAccountIndex
  1323. - requestToHezEthereumAddress
  1324. - requestToBJJ
  1325. - requestTokenId
  1326. - requestAmount
  1327. - requestFee
  1328. - requestNonce
  1329. PoolL2Transaction:
  1330. type: object
  1331. properties:
  1332. id:
  1333. $ref: '#/components/schemas/TransactionId'
  1334. type:
  1335. $ref: '#/components/schemas/TransactionType'
  1336. fromAccountIndex:
  1337. $ref: '#/components/schemas/AccountIndex'
  1338. toAccountIndex:
  1339. type: string
  1340. description: >-
  1341. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1342. The identifier is built using: `hez:` + `token symbol:` + `index`
  1343. example: "hez:DAI:309"
  1344. nullable: true
  1345. toHezEthereumAddress:
  1346. type: string
  1347. description: "Address of an Etherum account linked to the Hermez network."
  1348. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1349. example: null
  1350. nullable: true
  1351. toBjj:
  1352. type: string
  1353. 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."
  1354. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1355. example: null
  1356. nullable: true
  1357. amount:
  1358. allOf:
  1359. - $ref: '#/components/schemas/BigInt'
  1360. - description: Amount of tokens to be sent.
  1361. example: "63"
  1362. fee:
  1363. $ref: '#/components/schemas/FeeSelector'
  1364. nonce:
  1365. $ref: '#/components/schemas/Nonce'
  1366. state:
  1367. $ref: '#/components/schemas/PoolL2TransactionState'
  1368. signature:
  1369. allOf:
  1370. - $ref: '#/components/schemas/Signature'
  1371. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1372. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1373. timestamp:
  1374. type: string
  1375. description: Moment in which the transaction was added to the pool.
  1376. format: date-time
  1377. batchNum:
  1378. allOf:
  1379. - $ref: '#/components/schemas/BatchNum'
  1380. - nullable: true
  1381. - example: 5432
  1382. requestFromAccountIndex:
  1383. allOf:
  1384. - $ref: '#/components/schemas/AccountIndex'
  1385. - nullable: true
  1386. - example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1387. requestToAccountIndex:
  1388. allOf:
  1389. - $ref: '#/components/schemas/AccountIndex'
  1390. - nullable: true
  1391. - example: "hez:DAI:33"
  1392. requestToHezEthereumAddress:
  1393. allOf:
  1394. - $ref: '#/components/schemas/HezEthereumAddress'
  1395. - nullable: true
  1396. - example: "hez:0xbb942cfcd25ad4d90a62358b0dd84f33b3982699"
  1397. requestToBJJ:
  1398. allOf:
  1399. - $ref: '#/components/schemas/BJJ'
  1400. - nullable: true
  1401. - example: "hez:HVrB8xQHAYt9QTpPUsj3RGOzDmrCI4IgrYslTeTqo6Ix"
  1402. requestTokenId:
  1403. allOf:
  1404. - $ref: '#/components/schemas/TokenId'
  1405. - nullable: true
  1406. - example: 4444
  1407. requestAmount:
  1408. allOf:
  1409. - $ref: '#/components/schemas/BigInt'
  1410. - description: Amount of tokens to be sent.
  1411. - example: "7"
  1412. - nullable: true
  1413. requestFee:
  1414. allOf:
  1415. - $ref: '#/components/schemas/FeeSelector'
  1416. - nullable: true
  1417. - example: 8
  1418. requestNonce:
  1419. allOf:
  1420. - $ref: '#/components/schemas/Nonce'
  1421. - nullable: true
  1422. - example: 6
  1423. token:
  1424. $ref: '#/components/schemas/Token'
  1425. required:
  1426. - fromAccountIndex
  1427. - toHezAccountIndex
  1428. - toHezEthereumAddress
  1429. - toBjj
  1430. - tokenId
  1431. - amount
  1432. - fee
  1433. - nonce
  1434. - signature
  1435. TransactionId:
  1436. type: string
  1437. 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)
  1438. example: "0x00000000000001e240004700"
  1439. EthereumAddress:
  1440. type: string
  1441. description: "Address of an Etherum account."
  1442. pattern: "^0x[a-fA-F0-9]{40}$"
  1443. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1444. HezEthereumAddress:
  1445. type: string
  1446. description: "Address of an Etherum account linked to the Hermez network."
  1447. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1448. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1449. BJJ:
  1450. type: string
  1451. 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."
  1452. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1453. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1454. AccountIndex:
  1455. type: string
  1456. description: >-
  1457. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1458. The identifier is built using: `hez:` + `token symbol:` + `index`
  1459. example: "hez:DAI:4444"
  1460. TransactionType:
  1461. type: string
  1462. description: Type of transaction.
  1463. enum:
  1464. - Exit
  1465. - Transfer
  1466. - Deposit
  1467. - CreateAccountDeposit
  1468. - CreateAccountDepositTransfer
  1469. - DepositTransfer
  1470. - ForceTransfer
  1471. - ForceExit
  1472. - TransferToEthAddr
  1473. - TransferToBJJ
  1474. TokenId:
  1475. type: integer
  1476. description: Identifier of a token registered in the network.
  1477. minimum: 0
  1478. maximum: 4294967295
  1479. example: 4444
  1480. BigInt:
  1481. type: string
  1482. description: BigInt is an integer encoded as a string for numbers that are very large.
  1483. example: "8708856933496328593"
  1484. FeeSelector:
  1485. type: integer
  1486. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1487. minimum: 0
  1488. maximum: 256
  1489. example: 36
  1490. Nonce:
  1491. type: integer
  1492. description: Number that can only be used once per account, increments by one at each transaction.
  1493. minimum: 0
  1494. maximum: 1.84467440737096e+19
  1495. example: 121
  1496. PoolL2TransactionState:
  1497. type: string
  1498. description: >
  1499. State of a L2 transaction from the coordinator pool.
  1500. * pend: Pending
  1501. * fing: Forging
  1502. * fged: Forged
  1503. * invl: Invalid
  1504. enum:
  1505. - pend
  1506. - fing
  1507. - fged
  1508. - invl
  1509. Signature:
  1510. type: string
  1511. description: BabyJubJub compressed signature.
  1512. pattern: "^[a-fA-F0-9]{128}$"
  1513. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1514. BatchNum:
  1515. type: integer
  1516. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1517. minimum: 0
  1518. maximum: 4294967295
  1519. example: 5432
  1520. AccountCreationAuthorization:
  1521. type: object
  1522. properties:
  1523. timestamp:
  1524. type: string
  1525. format: date-time
  1526. hezEthereumAddress:
  1527. $ref: '#/components/schemas/HezEthereumAddress'
  1528. bjj:
  1529. $ref: '#/components/schemas/BJJ'
  1530. signature:
  1531. allOf:
  1532. - $ref: '#/components/schemas/Signature'
  1533. - description: Signature of the auth message. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=regular-rollup-account).
  1534. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1535. required:
  1536. - ethereumAddress
  1537. - bjj
  1538. - signature
  1539. HistoryTransaction:
  1540. type: object
  1541. description: Transaction of the Hermez network
  1542. properties:
  1543. L1orL2:
  1544. type: string
  1545. enum:
  1546. - L1
  1547. - L2
  1548. id:
  1549. $ref: '#/components/schemas/TransactionId'
  1550. type:
  1551. $ref: '#/components/schemas/TransactionType'
  1552. position:
  1553. $ref: '#/components/schemas/TransactionPosition'
  1554. fromAccountIndex:
  1555. type: string
  1556. description: >-
  1557. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1558. The identifier is built using: `hez:` + `token symbol:` + `index`
  1559. example: "hez:DAI:4444"
  1560. nullable: true
  1561. toAccountIndex:
  1562. allOf:
  1563. - $ref: '#/components/schemas/AccountIndex'
  1564. - example: "hez:DAI:672"
  1565. amount:
  1566. allOf:
  1567. - $ref: '#/components/schemas/BigInt'
  1568. - description: Amount of tokens to be sent.
  1569. - example: "49"
  1570. batchNum:
  1571. type: integer
  1572. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1573. minimum: 0
  1574. maximum: 4294967295
  1575. example: 5432
  1576. nullable: true
  1577. historicUSD:
  1578. type: number
  1579. description: Value in USD at the moment the transaction was forged.
  1580. example: 49.7
  1581. nullable: true
  1582. timestamp:
  1583. type: string
  1584. format: date-time
  1585. 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.
  1586. token:
  1587. $ref: '#/components/schemas/Token'
  1588. L1Info:
  1589. type: object
  1590. description: Additional information that only applies to L1 transactions.
  1591. nullable: true
  1592. properties:
  1593. toForgeL1TransactionsNum:
  1594. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1595. userOrigin:
  1596. type: boolean
  1597. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1598. fromHezEthereumAddress:
  1599. $ref: '#/components/schemas/HezEthereumAddress'
  1600. fromBJJ:
  1601. $ref: '#/components/schemas/BJJ'
  1602. loadAmount:
  1603. allOf:
  1604. - $ref: '#/components/schemas/BigInt'
  1605. - description: Tokens transfered from L1 to L2.
  1606. - example: "49"
  1607. historicLoadAmountUSD:
  1608. type: number
  1609. description: Load amount in USD, at the moment the transaction was made.
  1610. example: 3.897
  1611. nullable: true
  1612. ethereumBlockNum:
  1613. allOf:
  1614. - $ref: '#/components/schemas/EthBlockNum'
  1615. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1616. - example: 258723049
  1617. required:
  1618. - toForgeL1TransactionsNum
  1619. - userOrigin
  1620. - fromHezEthereumAddress
  1621. - fromBJJ
  1622. - loadAmount
  1623. - historicLoadAmountUSD
  1624. - ethereumBlockNum
  1625. additionalProperties: false
  1626. L2Info:
  1627. type: object
  1628. description: Additional information that only applies to L2 transactions.
  1629. nullable: true
  1630. properties:
  1631. fee:
  1632. $ref: '#/components/schemas/FeeSelector'
  1633. historicFeeUSD:
  1634. type: number
  1635. description: Fee in USD, at the moment the transaction was forged.
  1636. example: 263.89
  1637. nullable: true
  1638. nonce:
  1639. $ref: '#/components/schemas/Nonce'
  1640. example: null
  1641. required:
  1642. - fee
  1643. - historicFeeUSD
  1644. - nonce
  1645. additionalProperties: false
  1646. required:
  1647. - L1orL2
  1648. - id
  1649. - type
  1650. - position
  1651. - fromAccountIndex
  1652. - toAccountIndex
  1653. - amount
  1654. - batchNum
  1655. - historicUSD
  1656. - timestamp
  1657. - token
  1658. - L1Info
  1659. - L2Info
  1660. additionalProperties: false
  1661. HistoryTransactions:
  1662. type: object
  1663. properties:
  1664. transactions:
  1665. type: array
  1666. description: List of history transactions.
  1667. items:
  1668. $ref: '#/components/schemas/HistoryTransaction'
  1669. pagination:
  1670. $ref: '#/components/schemas/PaginationInfo'
  1671. required:
  1672. - transactions
  1673. - pagination
  1674. additionalProperties: false
  1675. EthBlockNum:
  1676. type: integer
  1677. description: Ethereum block number
  1678. minimum: 0
  1679. maximum: 1.84467440737096e+19
  1680. example: 762375478
  1681. ToForgeL1TransactionsNum:
  1682. type: integer
  1683. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  1684. minimum: 0
  1685. maximum: 4294967295
  1686. example: 784
  1687. nullable: true
  1688. TransactionPosition:
  1689. type: integer
  1690. description: Position that a transaction occupies in a batch.
  1691. minimum: 0
  1692. example: 5
  1693. URL:
  1694. type: string
  1695. description: HTTP URL
  1696. example: "https://hermez.io"
  1697. TokenSymbol:
  1698. type: string
  1699. description: Abreviation of the token name.
  1700. example: "DAI"
  1701. TokenName:
  1702. type: string
  1703. description: Token name.
  1704. example: "Dai"
  1705. CollectedFees:
  1706. type: array
  1707. description: Collected fees by the forger of the batch. A maximum of 64 different tokens can be used.
  1708. items:
  1709. type: object
  1710. properties:
  1711. tokenId:
  1712. $ref: '#/components/schemas/TokenId'
  1713. amount:
  1714. allOf:
  1715. - $ref: '#/components/schemas/BigInt'
  1716. - description: Ammount of collected tokens
  1717. - example: "53"
  1718. Batch:
  1719. type: object
  1720. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1721. properties:
  1722. batchNum:
  1723. $ref: '#/components/schemas/BatchNum'
  1724. ethereumBlockNum:
  1725. $ref: '#/components/schemas/EthBlockNum'
  1726. ethereumBlockHash:
  1727. type: string
  1728. description: hash of the Ethereum block in which the batch was forged
  1729. example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
  1730. timestamp:
  1731. type: string
  1732. format: date-time
  1733. description: Time in which the batch was forged.
  1734. forgerAddr:
  1735. $ref: '#/components/schemas/EthereumAddress'
  1736. collectedFees:
  1737. $ref: '#/components/schemas/CollectedFees'
  1738. totalCollectedFeesUSD:
  1739. type: number
  1740. 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.
  1741. historicTotalCollectedFeesUSD:
  1742. type: number
  1743. description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
  1744. example: 23.3
  1745. stateRoot:
  1746. allOf:
  1747. - $ref: '#/components/schemas/Hash'
  1748. - description: Root of the accounts Merkle Tree.
  1749. - example: "2734657026572a8708d883"
  1750. numAccounts:
  1751. type: integer
  1752. description: Number of registered accounts in this batch.
  1753. exitRoot:
  1754. allOf:
  1755. - $ref: '#/components/schemas/Hash'
  1756. - description: Root of the exit Merkle Tree associated to this batch.
  1757. - example: "2734657026572a8708d883"
  1758. forgeL1TransactionsNum:
  1759. allOf:
  1760. - $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1761. - description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  1762. - example: 5
  1763. slotNum:
  1764. $ref: '#/components/schemas/SlotNum'
  1765. FullBatch:
  1766. type: object
  1767. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1768. properties:
  1769. batch:
  1770. $ref: '#/components/schemas/Batch'
  1771. transactions:
  1772. type: array
  1773. description: List of forged transactions in the batch
  1774. items:
  1775. $ref: '#/components/schemas/HistoryTransaction'
  1776. Hash:
  1777. type: string
  1778. description: hashed data
  1779. example: "2734657026572a8708d883"
  1780. SlotNum:
  1781. type: integer
  1782. description: Identifier of a slot.
  1783. minimum: 0
  1784. maximum: 4294967295
  1785. example: 784
  1786. Batches:
  1787. type: object
  1788. properties:
  1789. batches:
  1790. type: array
  1791. description: List of batches.
  1792. items:
  1793. $ref: '#/components/schemas/Batch'
  1794. pagination:
  1795. $ref: '#/components/schemas/PaginationInfo'
  1796. Coordinator:
  1797. type: object
  1798. properties:
  1799. forgerAddr:
  1800. $ref: '#/components/schemas/EthereumAddress'
  1801. withdrawAddr:
  1802. $ref: '#/components/schemas/EthereumAddress'
  1803. URL:
  1804. $ref: '#/components/schemas/URL'
  1805. ethereumBlock:
  1806. allOf:
  1807. - $ref: '#/components/schemas/EthBlockNum'
  1808. - description: Ethereum block in which the coordinator registered into the network.
  1809. - example: 5735943738
  1810. Coordinators:
  1811. type: object
  1812. properties:
  1813. coordinators:
  1814. type: array
  1815. description: List of coordinators.
  1816. items:
  1817. $ref: '#/components/schemas/Coordinator'
  1818. pagination:
  1819. $ref: '#/components/schemas/PaginationInfo'
  1820. Bid:
  1821. type: object
  1822. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  1823. properties:
  1824. forgerAddr:
  1825. $ref: '#/components/schemas/EthereumAddress'
  1826. slotNum:
  1827. $ref: '#/components/schemas/SlotNum'
  1828. withdrawAddr:
  1829. $ref: '#/components/schemas/EthereumAddress'
  1830. URL:
  1831. $ref: '#/components/schemas/URL'
  1832. bidValue:
  1833. $ref: '#/components/schemas/BigInt'
  1834. ethereumBlockNum:
  1835. $ref: '#/components/schemas/EthBlockNum'
  1836. timestamp:
  1837. type: string
  1838. format: date-time
  1839. Bids:
  1840. type: object
  1841. properties:
  1842. bids:
  1843. type: array
  1844. description: List of bids.
  1845. items:
  1846. $ref: '#/components/schemas/Bid'
  1847. pagination:
  1848. $ref: '#/components/schemas/PaginationInfo'
  1849. RecommendedFee:
  1850. type: object
  1851. description: Fee that the coordinator recommends per transaction in USD.
  1852. properties:
  1853. existingAccount:
  1854. type: number
  1855. description: Recommended fee if the destination account of the transaction already exists.
  1856. minimum: 0
  1857. example: 0.1
  1858. createAccount:
  1859. type: number
  1860. 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.
  1861. minimum: 0
  1862. example: 1.3
  1863. createAccountInternal:
  1864. type: number
  1865. 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.
  1866. minimum: 0
  1867. example: 0.5
  1868. Token:
  1869. type: object
  1870. description: Hermez network compatible and registered token.
  1871. properties:
  1872. id:
  1873. $ref: '#/components/schemas/TokenId'
  1874. ethereumAddress:
  1875. allOf:
  1876. - $ref: '#/components/schemas/EthereumAddress'
  1877. - description: Ethereum address in which the token is deployed.
  1878. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1879. name:
  1880. type: string
  1881. description: full name of the token
  1882. example: Maker Dai
  1883. symbol:
  1884. allOf:
  1885. - $ref: '#/components/schemas/TokenSymbol'
  1886. - example: DAI
  1887. decimals:
  1888. type: integer
  1889. description: Number of decimals of the token.
  1890. example: 18
  1891. ethereumBlockNum:
  1892. allOf:
  1893. - $ref: '#/components/schemas/EthBlockNum'
  1894. - description: Ethereum block number in which the token was added to the Hermez network.
  1895. - example: 539847538
  1896. USD:
  1897. type: number
  1898. description: Value of the token in USD.
  1899. example: 1.01
  1900. nullable: true
  1901. fiatUpdate:
  1902. type: string
  1903. format: date-time
  1904. description: Timestamp of the moment the `USD` value was updated.
  1905. nullable: true
  1906. required:
  1907. - id
  1908. - ethereumAddress
  1909. - name
  1910. - symbol
  1911. - decimals
  1912. - ethereumBlockNum
  1913. - USD
  1914. - fiatUpdate
  1915. additionalProperties: false
  1916. Tokens:
  1917. type: object
  1918. properties:
  1919. tokens:
  1920. type: array
  1921. description: List of tokens.
  1922. items:
  1923. $ref: '#/components/schemas/Token'
  1924. pagination:
  1925. $ref: '#/components/schemas/PaginationInfo'
  1926. Exit:
  1927. type: object
  1928. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  1929. properties:
  1930. batchNum:
  1931. allOf:
  1932. - $ref: '#/components/schemas/BatchNum'
  1933. - description: Batch in which the exit was forged.
  1934. - example: 7394
  1935. accountIndex:
  1936. $ref: '#/components/schemas/AccountIndex'
  1937. merkleProof:
  1938. type: string
  1939. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  1940. example: "0x347089321de8971320489793a823470918fffeab"
  1941. balance:
  1942. $ref: '#/components/schemas/BigInt'
  1943. instantWithdrawn:
  1944. allOf:
  1945. - $ref: '#/components/schemas/EthBlockNum'
  1946. - description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  1947. - example: 74747363
  1948. delayedWithdrawRequest:
  1949. allOf:
  1950. - $ref: '#/components/schemas/EthBlockNum'
  1951. - description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  1952. - example: null
  1953. delayedWithdrawn:
  1954. allOf:
  1955. - $ref: '#/components/schemas/EthBlockNum'
  1956. - 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.
  1957. - example: null
  1958. token:
  1959. $ref: '#/components/schemas/Token'
  1960. Exits:
  1961. type: object
  1962. properties:
  1963. exits:
  1964. type: array
  1965. description: List of exits.
  1966. items:
  1967. $ref: '#/components/schemas/Exit'
  1968. pagination:
  1969. $ref: '#/components/schemas/PaginationInfo'
  1970. Account:
  1971. type: object
  1972. description: State tree leaf. It contains balance and nonce of an account.
  1973. properties:
  1974. accountIndex:
  1975. $ref: '#/components/schemas/AccountIndex'
  1976. nonce:
  1977. $ref: '#/components/schemas/Nonce'
  1978. balance:
  1979. $ref: '#/components/schemas/BigInt'
  1980. bjj:
  1981. $ref: '#/components/schemas/BJJ'
  1982. hezEthereumAddress:
  1983. $ref: '#/components/schemas/HezEthereumAddress'
  1984. token:
  1985. $ref: '#/components/schemas/Token'
  1986. Accounts:
  1987. type: object
  1988. properties:
  1989. accounts:
  1990. type: array
  1991. description: List of accounts.
  1992. items:
  1993. $ref: '#/components/schemas/Account'
  1994. pagination:
  1995. $ref: '#/components/schemas/PaginationInfo'
  1996. Slot:
  1997. type: object
  1998. description: Slot information.
  1999. properties:
  2000. slotNum:
  2001. $ref: '#/components/schemas/SlotNum'
  2002. firstBlock:
  2003. allOf:
  2004. - $ref: '#/components/schemas/EthBlockNum'
  2005. - description: Block in which the slot began or will begin
  2006. - example: 76238647846
  2007. lastBlock:
  2008. allOf:
  2009. - $ref: '#/components/schemas/EthBlockNum'
  2010. - description: Block in which the slot ended or will end
  2011. - example: 4475934
  2012. closedAuction:
  2013. type: boolean
  2014. description: Whether the auction of the slot has finished or not.
  2015. winner:
  2016. allOf:
  2017. - $ref: '#/components/schemas/Coordinator'
  2018. - description: Coordinator who won the auction. Only applicable if the auction is closed.
  2019. - nullable: true
  2020. - example: null
  2021. batchNums:
  2022. type: array
  2023. description: List of batch numbers that were forged during the slot
  2024. items:
  2025. $ref: '#/components/schemas/BatchNum'
  2026. Slots:
  2027. type: object
  2028. properties:
  2029. nextForgers:
  2030. type: array
  2031. description: List of slots.
  2032. items:
  2033. $ref: '#/components/schemas/Slot'
  2034. pagination:
  2035. $ref: '#/components/schemas/PaginationInfo'
  2036. NextForger:
  2037. type: object
  2038. description: Coordinator information along with the scheduled forging period
  2039. properties:
  2040. coordinator:
  2041. $ref: '#/components/schemas/Coordinator'
  2042. period:
  2043. type: object
  2044. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2045. properties:
  2046. fromBlock:
  2047. $ref: '#/components/schemas/EthBlockNum'
  2048. toBlock:
  2049. $ref: '#/components/schemas/EthBlockNum'
  2050. fromTimestamp:
  2051. type: string
  2052. format: date-time
  2053. toTimestamp:
  2054. type: string
  2055. format: date-time
  2056. NextForgers:
  2057. type: object
  2058. properties:
  2059. nextForgers:
  2060. type: array
  2061. description: List of next coordinators to forge.
  2062. items:
  2063. $ref: '#/components/schemas/NextForger'
  2064. pagination:
  2065. $ref: '#/components/schemas/PaginationInfo'
  2066. State:
  2067. type: object
  2068. description: Gobal statistics of the network.
  2069. properties:
  2070. lastBlock:
  2071. allOf:
  2072. - $ref: '#/components/schemas/EthBlockNum'
  2073. - description: Last synchronized Etherum block.
  2074. - example: 3457437
  2075. lastBatch:
  2076. allOf:
  2077. - $ref: '#/components/schemas/BatchNum'
  2078. - description: Last batch that has been forged.
  2079. - example: 76523
  2080. currentSlot:
  2081. allOf:
  2082. - $ref: '#/components/schemas/SlotNum'
  2083. - description: Slot where batches are currently being forged.
  2084. - example: 2334
  2085. transactionsPerBatch:
  2086. type: number
  2087. description: Average transactions per batch in the last 24 hours.
  2088. example: 2002.7
  2089. batchFrequency:
  2090. type: number
  2091. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2092. example: 8.9
  2093. transactionsPerSecond:
  2094. type: number
  2095. description: Average transactions per second in the last 24 hours.
  2096. example: 302.3
  2097. totalAccounts:
  2098. type: integer
  2099. description: Number of created accounts.
  2100. example: 90473
  2101. totalBJJs:
  2102. type: integer
  2103. description: Number of different registered BJJs.
  2104. example: 23067
  2105. avgTransactionFee:
  2106. type: number
  2107. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2108. example: 1.54
  2109. governance:
  2110. type: object
  2111. description: Network setings that are updatable by the governance.
  2112. properties:
  2113. rollup:
  2114. type: object
  2115. description: Rollup parameters.
  2116. properties:
  2117. forgeTimeout:
  2118. type: integer
  2119. 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.
  2120. example: 5
  2121. feeAddToken:
  2122. type: integer
  2123. description: fee to pay when registering tokens into the network.
  2124. example: 5698
  2125. auction:
  2126. type: object
  2127. description: Auction parameters.
  2128. properties:
  2129. bootCoordinator:
  2130. allOf:
  2131. - $ref: '#/components/schemas/EthereumAddress'
  2132. - description: Ethereum address of the boot coordinator.
  2133. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2134. slotDeadline:
  2135. type: integer
  2136. description: Number of blocks at the end of a slot in which any coordinator can forge if the winner has not forged one before.
  2137. example: 3
  2138. closedAuctionSlots:
  2139. type: integer
  2140. 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.
  2141. example: 2
  2142. openAuctionSlots:
  2143. type: integer
  2144. description: How many days in advance are auctions opened.
  2145. defaultSlotSetBid:
  2146. type: array
  2147. 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]`."
  2148. items:
  2149. type: integer
  2150. example: [32,0,68,21,55,99]
  2151. outbidding:
  2152. type: number
  2153. description: Minimum outbid over the previous one to consider it valid.
  2154. example: 3.64
  2155. donationAddress:
  2156. allOf:
  2157. - $ref: '#/components/schemas/EthereumAddress'
  2158. - description: Ethereum address where the donations will go to.
  2159. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2160. allocationRatio:
  2161. type: array
  2162. description: Percentage in which fees will be splitted between donations, governance and burning. The sum of the tree values should be 100.
  2163. items:
  2164. type: integer
  2165. example: [80,10,10]
  2166. withdrawalDelayer:
  2167. type: object
  2168. description: Withdrawal delayer parameters.
  2169. properties:
  2170. rollupAddress:
  2171. allOf:
  2172. - $ref: '#/components/schemas/EthereumAddress'
  2173. - description: Ethereum address of the rollup smart contract.
  2174. - example: "0x777dc4262BCDbf85190C01c996b4C06a461d2430"
  2175. governanceAddress:
  2176. allOf:
  2177. - $ref: '#/components/schemas/EthereumAddress'
  2178. - description: Ethereum address of the governance mechanism.
  2179. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2180. whitheHackerGroupAddress:
  2181. allOf:
  2182. - $ref: '#/components/schemas/EthereumAddress'
  2183. - description: Ethereum Address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2184. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2185. keeperAddress:
  2186. allOf:
  2187. - $ref: '#/components/schemas/EthereumAddress'
  2188. - description: Ethereum Address that can enable emergency mode and modify the delay to make a withdrawal.
  2189. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2190. withdrawalDelay:
  2191. allOf:
  2192. - $ref: '#/components/schemas/EthBlockNum'
  2193. - description: The time that anyone needs to wait until a withdrawal of the funds is allowed, in Ethereum blocks.
  2194. - example: 539573849
  2195. emergencyModeStartingTime:
  2196. type: integer
  2197. description: Ethereum block in which the emergency mode will be activated.
  2198. example: 10
  2199. emergencyMode:
  2200. type: boolean
  2201. description: Indicates if emergency mode has been activated.
  2202. PaginationInfo:
  2203. type: object
  2204. description: Give pagination information
  2205. properties:
  2206. totalItems:
  2207. type: integer
  2208. description: Amount of items that the endpoint can return given the filters and the current state of the database.
  2209. example: 2048
  2210. lastReturnedItem:
  2211. type: integer
  2212. description: Index of the last returned item. Useful to query next items.
  2213. example: 439
  2214. Config:
  2215. type: object
  2216. description: Configuration parameters of the different smart contracts that power the Hermez network.
  2217. properties:
  2218. hermez:
  2219. type: object
  2220. description: Constant configuration of the Hermez smart contract.
  2221. properties:
  2222. HEZTokenAddress:
  2223. allOf:
  2224. - $ref: '#/components/schemas/EthereumAddress'
  2225. - description: Ethereum address of the HEZ token.
  2226. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2227. maxTxVerifiers:
  2228. type: integer
  2229. description: Maximum transactions of the verifiers.
  2230. example: 100
  2231. maxLoadAmount:
  2232. type: integer
  2233. description: Maximum load amount (L1 to L2) allowed.
  2234. example: 321
  2235. maxAmount:
  2236. type: integer
  2237. description: Maximum amount (L2 to L2) allowed.
  2238. example: 837
  2239. maxTokens:
  2240. type: integer
  2241. description: Maximum number of different tokens that can be registered in the network.
  2242. example: 4294967295
  2243. reservedAccountIndex:
  2244. type: integer
  2245. description: First user index. Bellow this number the indexes are reserved for the protocol.
  2246. example: 256
  2247. lastAccountIndex:
  2248. type: integer
  2249. description: Biggest account index that can be registered.
  2250. example: 4294967295
  2251. exitAccountIndex:
  2252. type: integer
  2253. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2254. example: 1
  2255. L1CoordinatorBytes:
  2256. type: integer
  2257. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2258. example: 23
  2259. L1UserBytes:
  2260. type: integer
  2261. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2262. example: 32
  2263. L2Bytes:
  2264. type: integer
  2265. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2266. example: 33
  2267. maxL1Transactions:
  2268. type: integer
  2269. description: Maximum L1 transactions allowed to be queued in a batch.
  2270. example: 128
  2271. maxL1UserTransactions:
  2272. type: integer
  2273. description: Maximum L1 transactions allowed to be queued in a batch by users (anyone who is not a coordinator).
  2274. example: 32
  2275. RField:
  2276. allOf:
  2277. - $ref: '#/components/schemas/BigInt'
  2278. - description: Modulus zkSNARK.
  2279. withdrawManager:
  2280. type: object
  2281. description: Constant configuration of the withdraw manager smart contract.
  2282. properties:
  2283. noLimit:
  2284. type: integer
  2285. description: Reserved bucket index when the token value is 0 USD.
  2286. example: 0
  2287. amountOfBuckets:
  2288. type: integer
  2289. description: Number of buckets
  2290. maxWithdrawalDelay:
  2291. type: integer
  2292. description: Maximum delay to withdraw tokens. Time is measured in Ethereum blocks.
  2293. auction:
  2294. type: object
  2295. description: Constant configuration of the auction smart contract.
  2296. properties:
  2297. HEZTokenAddress:
  2298. allOf:
  2299. - $ref: '#/components/schemas/EthereumAddress'
  2300. - description: Ethereum address of the HEZ token.
  2301. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  2302. rollupAddress:
  2303. allOf:
  2304. - $ref: '#/components/schemas/EthereumAddress'
  2305. - description: Ethereum address of the rollup smart contract.
  2306. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2307. genesisBlockNum:
  2308. allOf:
  2309. - $ref: '#/components/schemas/EthBlockNum'
  2310. - description: Ethereum block number in which the smart contract starts operating.
  2311. delayGenesis:
  2312. type: integer
  2313. description: Time delay between `genesisBlockNum` and the beginning of the first block. Time is measured in Ethereum blocks.
  2314. blocksPerSlot:
  2315. type: integer
  2316. description: Blocks per slot.
  2317. initialMinimalBidding:
  2318. type: integer
  2319. description: Minimum bid when no one has bid yet.
  2320. withdrawalDelayer:
  2321. type: object
  2322. description: Constant configuration of the withdrawal delayer smart contract.
  2323. properties:
  2324. maxWithdrawalDelay:
  2325. type: integer
  2326. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in Ethereum blocks.
  2327. example: 200
  2328. maxEmergencyModeTime:
  2329. type: integer
  2330. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in Ethereum blocks.
  2331. example: 2000
  2332. Error:
  2333. type: object
  2334. description: Error response.
  2335. properties:
  2336. message:
  2337. type: string
  2338. Error400:
  2339. allOf:
  2340. - $ref: '#/components/schemas/Error'
  2341. - example:
  2342. message: Invalid signature.
  2343. Error404:
  2344. allOf:
  2345. - $ref: '#/components/schemas/Error'
  2346. - example:
  2347. message: Item(s) not found.
  2348. Error500:
  2349. allOf:
  2350. - $ref: '#/components/schemas/Error'
  2351. - example:
  2352. message: Database error.