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.

3119 lines
109 KiB

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