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.

3101 lines
108 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: forgerAddr
  1135. in: query
  1136. required: false
  1137. description: Get coordinators by it's forger address.
  1138. schema:
  1139. $ref: '#/components/schemas/EthereumAddress'
  1140. - name: bidderAddr
  1141. in: query
  1142. required: false
  1143. description: Get coordinators by it's bidder address.
  1144. schema:
  1145. $ref: '#/components/schemas/EthereumAddress'
  1146. - name: fromItem
  1147. in: query
  1148. required: false
  1149. description: Indicates the desired first item (using the itemId property) to be included in the response.
  1150. schema:
  1151. type: number
  1152. - name: order
  1153. in: query
  1154. required: false
  1155. description: Order of the returned items. Coordinators will be ordered by increasing (ethereumBlock, forgerAddr).
  1156. schema:
  1157. type: string
  1158. default: ASC
  1159. enum:
  1160. - ASC
  1161. - DESC
  1162. - name: limit
  1163. in: query
  1164. required: false
  1165. description: Maximum number of items to be returned.
  1166. schema:
  1167. type: integer
  1168. minimum: 1
  1169. maximum: 2049
  1170. responses:
  1171. '200':
  1172. description: Successful operation.
  1173. content:
  1174. application/json:
  1175. schema:
  1176. $ref: '#/components/schemas/Coordinators'
  1177. '400':
  1178. description: Bad request.
  1179. content:
  1180. application/json:
  1181. schema:
  1182. $ref: '#/components/schemas/Error400'
  1183. '500':
  1184. description: Internal server error.
  1185. content:
  1186. application/json:
  1187. schema:
  1188. $ref: '#/components/schemas/Error500'
  1189. components:
  1190. schemas:
  1191. ItemId:
  1192. type: integer
  1193. description: Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
  1194. PostPoolL2Transaction:
  1195. type: object
  1196. description: L2 transaction to be posted.
  1197. properties:
  1198. id:
  1199. $ref: '#/components/schemas/TransactionId'
  1200. type:
  1201. $ref: '#/components/schemas/TransactionTypeL2'
  1202. tokenId:
  1203. $ref: '#/components/schemas/TokenId'
  1204. fromAccountIndex:
  1205. $ref: '#/components/schemas/AccountIndex'
  1206. toAccountIndex:
  1207. type: string
  1208. description: >-
  1209. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1210. The identifier is built using: `hez:` + `token symbol:` + `index`. If this is provided, toHezEthereumAddress and toBjj
  1211. must be null. To perform an exit the value hez:EXIT:1 must be used.
  1212. example: null
  1213. nullable: true
  1214. toHezEthereumAddress:
  1215. type: string
  1216. description: "Address of an Etherum account linked to the Hermez Network. If this is provided, toAccountIndex and toBjj must be null."
  1217. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1218. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1219. nullable: true
  1220. toBjj:
  1221. type: string
  1222. description: >-
  1223. 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.
  1224. If this is provided, toAccountIndex must be null and toHezEthereumAddress must be hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.
  1225. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1226. example: null
  1227. nullable: true
  1228. amount:
  1229. allOf:
  1230. - $ref: '#/components/schemas/BigInt'
  1231. - description: Amount of tokens to be sent.
  1232. example: "6300000000000000000"
  1233. fee:
  1234. $ref: '#/components/schemas/FeeSelector'
  1235. nonce:
  1236. $ref: '#/components/schemas/Nonce'
  1237. signature:
  1238. allOf:
  1239. - $ref: '#/components/schemas/BJJSignature'
  1240. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1241. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1242. requestFromAccountIndex:
  1243. type: string
  1244. description: References the `fromAccountIndex` of the requested transaction.
  1245. example: null
  1246. nullable: true
  1247. requestToAccountIndex:
  1248. type: string
  1249. description: References the `toAccountIndex` of the requested transaction.
  1250. example: null
  1251. nullable: true
  1252. requestToHezEthereumAddress:
  1253. type: string
  1254. description: References the `toHezEthereumAddress` of the requested transaction.
  1255. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1256. example: null
  1257. nullable: true
  1258. requestToBjj:
  1259. type: string
  1260. description: References the `toBjj` of the requested transaction.
  1261. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1262. example: null
  1263. nullable: true
  1264. requestTokenId:
  1265. type: integer
  1266. description: References the `tokenId` of the requested transaction.
  1267. example: null
  1268. nullable: true
  1269. requestAmount:
  1270. type: string
  1271. description: References the `amount` of the requested transaction.
  1272. example: null
  1273. nullable: true
  1274. requestFee:
  1275. type: integer
  1276. description: References the `fee` of the requested transaction.
  1277. example: null
  1278. nullable: true
  1279. requestNonce:
  1280. type: integer
  1281. description: References the `nonce` of the requested transaction.
  1282. example: null
  1283. nullable: true
  1284. example:
  1285. id: '0x020000000001000000000006'
  1286. type: Transfer
  1287. tokenId: 6
  1288. fromAccountIndex: hez:DAI:256
  1289. toAccountIndex: hez:DAI:257
  1290. toHezEthereumAddress:
  1291. toBjj:
  1292. amount: '100000000000000'
  1293. fee: 0
  1294. nonce: 6
  1295. signature: 1a79dd5e661d58266901a0de8afb046b466c4c1af937100f627a421771f2911fa3fde8ea2e272b4802a8b1f1229689292acd6f7e8ab4cadc4ab37b6b9e13a101
  1296. additionalProperties: false
  1297. required:
  1298. - id
  1299. - type
  1300. - tokenId
  1301. - fromAccountIndex
  1302. - amount
  1303. - fee
  1304. - nonce
  1305. - signature
  1306. PoolL2Transaction:
  1307. type: object
  1308. properties:
  1309. id:
  1310. $ref: '#/components/schemas/TransactionId'
  1311. type:
  1312. $ref: '#/components/schemas/TransactionTypeL2'
  1313. fromAccountIndex:
  1314. $ref: '#/components/schemas/AccountIndex'
  1315. fromHezEthereumAddress:
  1316. type: string
  1317. description: "Address of an Etherum account linked to the Hermez Network."
  1318. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1319. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1320. nullable: true
  1321. fromBJJ:
  1322. type: string
  1323. 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."
  1324. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1325. example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
  1326. nullable: true
  1327. toAccountIndex:
  1328. type: string
  1329. description: >-
  1330. Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
  1331. The identifier is built using: `hez:` + `token symbol:` + `index`
  1332. example: "hez:DAI:309"
  1333. nullable: true
  1334. toHezEthereumAddress:
  1335. type: string
  1336. description: "Address of an Etherum account linked to the Hermez Network."
  1337. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1338. example: null
  1339. nullable: true
  1340. toBjj:
  1341. type: string
  1342. 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."
  1343. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1344. example: null
  1345. nullable: true
  1346. amount:
  1347. allOf:
  1348. - $ref: '#/components/schemas/BigInt'
  1349. - description: Amount of tokens to be sent.
  1350. example: "6303020000000000000"
  1351. fee:
  1352. $ref: '#/components/schemas/FeeSelector'
  1353. nonce:
  1354. $ref: '#/components/schemas/Nonce'
  1355. state:
  1356. $ref: '#/components/schemas/PoolL2TransactionState'
  1357. signature:
  1358. allOf:
  1359. - $ref: '#/components/schemas/BJJSignature'
  1360. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1361. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1362. timestamp:
  1363. type: string
  1364. description: Moment in which the transaction was added to the pool.
  1365. format: date-time
  1366. batchNum:
  1367. type: integer
  1368. description: Identifier of a batch. Every new forged batch increases by one the batchNum, starting at 0.
  1369. minimum: 0
  1370. maximum: 4294967295
  1371. nullable: true
  1372. example: null
  1373. requestFromAccountIndex:
  1374. type: string
  1375. description: >-
  1376. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1377. The identifier is built using: `hez:` + `token symbol:` + `index`
  1378. nullable: true
  1379. example: null
  1380. requestToAccountIndex:
  1381. type: string
  1382. description: >-
  1383. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1384. The identifier is built using: `hez:` + `token symbol:` + `index`
  1385. nullable: true
  1386. example: null
  1387. requestToHezEthereumAddress:
  1388. type: string
  1389. description: "Address of an Etherum account linked to the Hermez Network."
  1390. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1391. nullable: true
  1392. example: null
  1393. requestToBJJ:
  1394. type: string
  1395. 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."
  1396. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1397. nullable: true
  1398. example: null
  1399. requestTokenId:
  1400. type: integer
  1401. description: References the `tokenId` of the requested transaction.
  1402. example: null
  1403. nullable: true
  1404. requestAmount:
  1405. type: string
  1406. description: BigInt is an integer encoded as a string for numbers that are very large.
  1407. nullable: true
  1408. example: null
  1409. requestFee:
  1410. type: integer
  1411. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1412. minimum: 0
  1413. maximum: 256
  1414. nullable: true
  1415. example: null
  1416. requestNonce:
  1417. type: integer
  1418. description: Number that can only be used once per account. Increments by one with each transaction.
  1419. minimum: 0
  1420. maximum: 1.84467440737096e+19
  1421. nullable: true
  1422. example: null
  1423. token:
  1424. $ref: '#/components/schemas/Token'
  1425. example:
  1426. amount: '100000000000000'
  1427. batchNum:
  1428. fee: 0
  1429. fromAccountIndex: hez:SCC:256
  1430. fromBJJ: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1431. fromHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1432. id: '0x020000000001000000000006'
  1433. nonce: 6
  1434. requestAmount:
  1435. requestFee: 0
  1436. requestFromAccountIndex:
  1437. requestNonce: 0
  1438. requestToAccountIndex:
  1439. requestToBJJ:
  1440. requestToHezEthereumAddress:
  1441. requestTokenId:
  1442. signature: 5ee9c7b5baa243ba282d18596a55cc357b01513eaed75165365f802102cce4a7a1dd35e3ab31cf9039e2b8a9f570d935115be9379a3dd47813dfc014031ab201
  1443. state: pend
  1444. timestamp: '2020-11-17T13:58:54.422232Z'
  1445. toAccountIndex: hez:SCC:257
  1446. toBjj: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
  1447. toHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
  1448. token:
  1449. USD: 23.74
  1450. decimals: 7
  1451. ethereumAddress: '0x0000000000000000000000000000000000000006'
  1452. ethereumBlockNum: 2
  1453. fiatUpdate:
  1454. id: 6
  1455. itemId: 7
  1456. name: Some Cool Coin
  1457. symbol: 'SCC'
  1458. type: Transfer
  1459. required:
  1460. - id
  1461. - type
  1462. - fromAccountIndex
  1463. - fromHezEthereumAddress
  1464. - fromBJJ
  1465. - toAccountIndex
  1466. - toHezEthereumAddress
  1467. - toBjj
  1468. - amount
  1469. - fee
  1470. - nonce
  1471. - state
  1472. - signature
  1473. - timestamp
  1474. - batchNum
  1475. - requestFromAccountIndex
  1476. - requestToAccountIndex
  1477. - requestToHezEthereumAddress
  1478. - requestToBJJ
  1479. - requestTokenId
  1480. - requestAmount
  1481. - requestFee
  1482. - requestNonce
  1483. - token
  1484. TransactionId:
  1485. type: string
  1486. 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)
  1487. example: "0x00000000000001e240004700"
  1488. EthereumAddress:
  1489. type: string
  1490. description: "Address of an Etherum account."
  1491. pattern: "^0x[a-fA-F0-9]{40}$"
  1492. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1493. HezEthereumAddress:
  1494. type: string
  1495. description: "Address of an Etherum account linked to the Hermez Network."
  1496. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1497. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1498. BJJ:
  1499. type: string
  1500. 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."
  1501. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1502. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1503. AccountIndex:
  1504. type: string
  1505. description: >-
  1506. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1507. The identifier is built using: `hez:` + `token symbol:` + `index`
  1508. example: "hez:DAI:4444"
  1509. TransactionType:
  1510. type: string
  1511. description: Type of transaction.
  1512. enum:
  1513. - Exit
  1514. - Transfer
  1515. - Deposit
  1516. - CreateAccountDeposit
  1517. - CreateAccountDepositTransfer
  1518. - DepositTransfer
  1519. - ForceTransfer
  1520. - ForceExit
  1521. - TransferToEthAddr
  1522. - TransferToBJJ
  1523. TransactionTypeL2:
  1524. type: string
  1525. description: Type of transaction.
  1526. enum:
  1527. - Exit
  1528. - Transfer
  1529. - TransferToEthAddr
  1530. - TransferToBJJ
  1531. TokenId:
  1532. type: integer
  1533. description: Identifier of a token registered in the network.
  1534. minimum: 0
  1535. maximum: 4294967295
  1536. example: 98765
  1537. BigInt:
  1538. type: string
  1539. description: BigInt is an integer encoded as a string for numbers that are very large.
  1540. example: "8708856933496328593"
  1541. pattern: "^\\d+$"
  1542. FeeSelector:
  1543. type: integer
  1544. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1545. minimum: 0
  1546. maximum: 256
  1547. example: 36
  1548. Nonce:
  1549. type: integer
  1550. description: Number that can only be used once per account, increments by one at each transaction.
  1551. minimum: 0
  1552. maximum: 1.84467440737096e+19
  1553. example: 121
  1554. PoolL2TransactionState:
  1555. type: string
  1556. description: >
  1557. State of a L2 transaction from the coordinator pool.
  1558. * pend: Pending
  1559. * fing: Forging
  1560. * fged: Forged
  1561. * invl: Invalid
  1562. enum:
  1563. - pend
  1564. - fing
  1565. - fged
  1566. - invl
  1567. ETHSignature:
  1568. type: string
  1569. description: Ethereum signature.
  1570. pattern: "^0x[a-fA-F0-9]{130}$"
  1571. example: "0xf9161cd688394772d93aa3e7b3f8f9553ca4f94f65b7cece93ed4a239d5c0b4677dca6d1d459e3a5c271a34de735d4664a43e5a8960a9a6e027d12c562dd448e1c"
  1572. BJJSignature:
  1573. type: string
  1574. description: BabyJubJub compressed signature.
  1575. pattern: "^[a-fA-F0-9]{128}$"
  1576. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1577. BatchNum:
  1578. type: integer
  1579. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1580. minimum: 0
  1581. maximum: 4294967295
  1582. example: 5432
  1583. AccountCreationAuthorizationPost:
  1584. type: object
  1585. properties:
  1586. hezEthereumAddress:
  1587. $ref: '#/components/schemas/HezEthereumAddress'
  1588. bjj:
  1589. $ref: '#/components/schemas/BJJ'
  1590. signature:
  1591. $ref: '#/components/schemas/ETHSignature'
  1592. example:
  1593. hezEthereumAddress: hez:0xb5270eB4ae11c6fAAff6F5fa0A5202B8d963634C
  1594. bjj: hez:hg2Ydsb8O66H-steBR3cnHl944ua7E-PkTJ_SbPBBg5r
  1595. signature: '0xb7cf237c4a2ff3d4df57752e7b9deb236fa384f03a79d39acf17ec5f8d12a3cf00b017c2466611310cb2bacac68460e96778278646842c6d2bcb79979271c28501'
  1596. required:
  1597. - hezEthereumAddress
  1598. - bjj
  1599. - signature
  1600. AccountCreationAuthorization:
  1601. type: object
  1602. properties:
  1603. timestamp:
  1604. type: string
  1605. format: date-time
  1606. hezEthereumAddress:
  1607. $ref: '#/components/schemas/HezEthereumAddress'
  1608. bjj:
  1609. $ref: '#/components/schemas/BJJ'
  1610. signature:
  1611. $ref: '#/components/schemas/ETHSignature'
  1612. example:
  1613. hezEthereumAddress: hez:0x74a549b410d01d9eC56346aE52b8550515B283b2
  1614. bjj: hez:dEZ-Tj7d5h0TAqbnRTTYURYDEo5KZzB87_2WknUU8gCN
  1615. signature: '0x8db6db2ad6cbe21297fb8ee01c59b01b52d4df7ea92a0f0dee0be0075a8f224a06b367407c8f402cfe0490c142a1c92da3fc29b51162ae160d35e1577d3071bb01'
  1616. timestamp: '2020-11-17T13:25:36.784295Z'
  1617. additionalProperties: false
  1618. required:
  1619. - timestamp
  1620. - hezEthereumAddress
  1621. - bjj
  1622. - signature
  1623. HistoryTransaction:
  1624. type: object
  1625. description: Transaction of the Hermez Network
  1626. properties:
  1627. L1orL2:
  1628. type: string
  1629. enum:
  1630. - L1
  1631. - L2
  1632. id:
  1633. $ref: '#/components/schemas/TransactionId'
  1634. itemId:
  1635. $ref: '#/components/schemas/ItemId'
  1636. type:
  1637. $ref: '#/components/schemas/TransactionType'
  1638. position:
  1639. $ref: '#/components/schemas/TransactionPosition'
  1640. fromAccountIndex:
  1641. type: string
  1642. description: >-
  1643. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1644. The identifier is built using: `hez:` + `token symbol:` + `index`
  1645. example: "hez:DAI:4444"
  1646. nullable: true
  1647. fromHezEthereumAddress:
  1648. type: string
  1649. description: "Address of an Etherum account linked to the Hermez Network."
  1650. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1651. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1652. nullable: true
  1653. fromBJJ:
  1654. type: string
  1655. 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."
  1656. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1657. example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
  1658. nullable: true
  1659. toAccountIndex:
  1660. allOf:
  1661. - $ref: '#/components/schemas/AccountIndex'
  1662. - example: "hez:DAI:672"
  1663. toHezEthereumAddress:
  1664. type: string
  1665. description: "Address of an Etherum account linked to the Hermez Network."
  1666. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1667. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1668. nullable: true
  1669. toBJJ:
  1670. type: string
  1671. 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."
  1672. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1673. example: "hez:f1J78_6uqTyjX6jrVCqN4RFeRBnWQAGl477ZFtOnH6Sm"
  1674. nullable: true
  1675. amount:
  1676. allOf:
  1677. - $ref: '#/components/schemas/BigInt'
  1678. - description: Amount of tokens to be sent.
  1679. - example: "4903020000000000000"
  1680. batchNum:
  1681. type: integer
  1682. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1683. minimum: 0
  1684. maximum: 4294967295
  1685. example: 5432
  1686. nullable: true
  1687. historicUSD:
  1688. type: number
  1689. description: Value in USD at the moment the transaction was forged.
  1690. example: 49.7
  1691. nullable: true
  1692. timestamp:
  1693. type: string
  1694. format: date-time
  1695. 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.
  1696. token:
  1697. $ref: '#/components/schemas/Token'
  1698. L1Info:
  1699. type: object
  1700. description: Additional information that only applies to L1 transactions.
  1701. nullable: true
  1702. properties:
  1703. toForgeL1TransactionsNum:
  1704. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1705. userOrigin:
  1706. type: boolean
  1707. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1708. depositAmount:
  1709. allOf:
  1710. - $ref: '#/components/schemas/BigInt'
  1711. - description: Tokens transfered from L1 to L2.
  1712. - example: "4900000000000000000"
  1713. amountSuccess:
  1714. type: boolean
  1715. description: >-
  1716. Indicates if the amount specified by the user has been sent propperly. If false, the amount that actualy has been sent is 0.
  1717. 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.
  1718. An example were this value could be false: a user send a `DepositTransfer` transaction, but when the tx is forged there are not
  1719. 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.
  1720. example: true
  1721. depositAmountSuccess:
  1722. type: boolean
  1723. description: >-
  1724. 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.
  1725. 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.
  1726. 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.
  1727. In this case transaction won't be effective making the deposit amount have a real value of 0.
  1728. example: true
  1729. historicDepositAmountUSD:
  1730. type: number
  1731. description: Deposit amount in USD, at the moment the transaction was made.
  1732. example: 3.897
  1733. nullable: true
  1734. ethereumBlockNum:
  1735. allOf:
  1736. - $ref: '#/components/schemas/EthBlockNum'
  1737. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1738. - example: 258723049
  1739. required:
  1740. - toForgeL1TransactionsNum
  1741. - userOrigin
  1742. - depositAmount
  1743. - amountSuccess
  1744. - depositAmountSuccess
  1745. - historicDepositAmountUSD
  1746. - ethereumBlockNum
  1747. additionalProperties: false
  1748. L2Info:
  1749. type: object
  1750. description: Additional information that only applies to L2 transactions.
  1751. nullable: true
  1752. properties:
  1753. fee:
  1754. $ref: '#/components/schemas/FeeSelector'
  1755. historicFeeUSD:
  1756. type: number
  1757. description: Fee in USD, at the moment the transaction was forged.
  1758. example: 263.89
  1759. nullable: true
  1760. nonce:
  1761. $ref: '#/components/schemas/Nonce'
  1762. example: null
  1763. required:
  1764. - fee
  1765. - historicFeeUSD
  1766. - nonce
  1767. additionalProperties: false
  1768. example:
  1769. L1Info:
  1770. ethereumBlockNum: 1
  1771. historicDepositAmountUSD: 232.47
  1772. depositAmount: '261'
  1773. toForgeL1TransactionsNum: 10
  1774. userOrigin: true
  1775. L1orL2: L1
  1776. L2Info:
  1777. amount: '261'
  1778. batchNum: 1
  1779. fromAccountIndex: hez:ETH:276
  1780. fromBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1781. fromHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1782. historicUSD: 3784.19
  1783. id: '0x00000000000000000a000400'
  1784. itemId: 2
  1785. position: 4
  1786. timestamp: '2020-11-17T14:08:12.197554Z'
  1787. toAccountIndex: hez:ETH:276
  1788. toBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
  1789. toHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
  1790. token:
  1791. USD: 234.56
  1792. decimals: 18
  1793. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1794. ethereumBlockNum: 0
  1795. fiatUpdate:
  1796. id: 0
  1797. itemId: 1
  1798. name: Ether
  1799. symbol: ETH
  1800. type: CreateAccountDeposit
  1801. required:
  1802. - L1orL2
  1803. - id
  1804. - itemId
  1805. - type
  1806. - position
  1807. - fromAccountIndex
  1808. - fromHezEthereumAddress
  1809. - fromBJJ
  1810. - toAccountIndex
  1811. - toHezEthereumAddress
  1812. - toBJJ
  1813. - amount
  1814. - batchNum
  1815. - historicUSD
  1816. - timestamp
  1817. - token
  1818. - L1Info
  1819. - L2Info
  1820. additionalProperties: false
  1821. HistoryTransactions:
  1822. type: object
  1823. properties:
  1824. transactions:
  1825. type: array
  1826. description: List of history transactions.
  1827. items:
  1828. $ref: '#/components/schemas/HistoryTransaction'
  1829. pendingItems:
  1830. $ref: '#/components/schemas/PendingItems'
  1831. example:
  1832. transactions:
  1833. - L1Info:
  1834. ethereumBlockNum: 3
  1835. historicDepositAmountUSD:
  1836. depositAmount: '0'
  1837. toForgeL1TransactionsNum: 7
  1838. userOrigin: true
  1839. L1orL2: L1
  1840. L2Info:
  1841. amount: '88888800000000000'
  1842. batchNum: 9
  1843. fromAccountIndex: hez:ETH:262
  1844. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1845. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1846. historicUSD: 44.4444
  1847. id: '0x000000000000000007000300'
  1848. itemId: 28
  1849. position: 3
  1850. timestamp: '2020-11-26T09:18:40.004749Z'
  1851. toAccountIndex: hez:EXIT:1
  1852. toBJJ:
  1853. toHezEthereumAddress:
  1854. token:
  1855. USD: 500
  1856. decimals: 18
  1857. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1858. ethereumBlockNum: 0
  1859. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1860. id: 0
  1861. itemId: 1
  1862. name: Ether
  1863. symbol: ETH
  1864. type: ForceExit
  1865. - L1Info:
  1866. L1orL2: L2
  1867. L2Info:
  1868. fee: 123
  1869. historicFeeUSD: 2.15037380962404
  1870. nonce: 1
  1871. amount: '55555500000000000'
  1872. batchNum: 8
  1873. fromAccountIndex: hez:TKN1:264
  1874. fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1875. fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1876. historicUSD: 23.4999765
  1877. id: '0x020000000001080000000001'
  1878. itemId: 19
  1879. position: 2
  1880. timestamp: '2020-11-26T09:18:40.004749Z'
  1881. toAccountIndex: hez:TKN1:260
  1882. toBJJ: hez:81h61cx0FKR1RXcLbHW8cZMPY8SR6yKU3ei4pmcLjpaQ
  1883. toHezEthereumAddress: hez:0x6813Eb9362372EEF6200f3b1dbC3f819671cBA69
  1884. token:
  1885. USD: 423
  1886. decimals: 18
  1887. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1888. ethereumBlockNum: 2
  1889. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1890. id: 1
  1891. itemId: 2
  1892. name: Test Token 1
  1893. symbol: TKN1
  1894. type: Transfer
  1895. - L1Info:
  1896. L1orL2: L2
  1897. L2Info:
  1898. fee: 44
  1899. historicFeeUSD: 0.1973587359744
  1900. nonce: 2
  1901. amount: '66666600000000000'
  1902. batchNum: 8
  1903. fromAccountIndex: hez:ETH:259
  1904. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1905. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1906. historicUSD: 33.3333
  1907. id: '0x020000000001030000000002'
  1908. itemId: 20
  1909. position: 3
  1910. timestamp: '2020-11-26T09:18:40.004749Z'
  1911. toAccountIndex: hez:EXIT:1
  1912. toBJJ:
  1913. toHezEthereumAddress:
  1914. token:
  1915. USD: 500
  1916. decimals: 18
  1917. ethereumAddress: '0x0000000000000000000000000000000000000000'
  1918. ethereumBlockNum: 0
  1919. fiatUpdate: '2020-11-26T09:18:27.034866Z'
  1920. id: 0
  1921. itemId: 1
  1922. name: Ether
  1923. symbol: ETH
  1924. type: Exit
  1925. - L1Info:
  1926. ethereumBlockNum: 3
  1927. historicDepositAmountUSD: 14099.9999859
  1928. depositAmount: '33333333300000000000'
  1929. toForgeL1TransactionsNum: 2
  1930. userOrigin: true
  1931. L1orL2: L1
  1932. L2Info:
  1933. amount: '0'
  1934. batchNum: 4
  1935. fromAccountIndex: hez:TKN1:0
  1936. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1937. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1938. historicUSD:
  1939. id: '0x000000000000000002000000'
  1940. itemId: 9
  1941. position: 0
  1942. timestamp: '2020-11-26T09:18:40.004749Z'
  1943. toAccountIndex: hez:TKN1:0
  1944. toBJJ:
  1945. toHezEthereumAddress:
  1946. token:
  1947. USD: 423
  1948. decimals: 18
  1949. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1950. ethereumBlockNum: 2
  1951. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1952. id: 1
  1953. itemId: 2
  1954. name: Test Token 1
  1955. symbol: TKN1
  1956. type: CreateAccountDeposit
  1957. - L1Info:
  1958. L1orL2: L2
  1959. L2Info:
  1960. fee: 2
  1961. historicFeeUSD: 3.87833366166246e-17
  1962. nonce: 1
  1963. amount: '11111100000000000'
  1964. batchNum: 7
  1965. fromAccountIndex: hez:TKN1:261
  1966. fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  1967. fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  1968. historicUSD: 4.6999953
  1969. id: '0x020000000001050000000001'
  1970. itemId: 15
  1971. position: 2
  1972. timestamp: '2020-11-26T09:18:40.004749Z'
  1973. toAccountIndex: hez:TKN1:264
  1974. toBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
  1975. toHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
  1976. token:
  1977. USD: 423
  1978. decimals: 18
  1979. ethereumAddress: '0x0000000000000000000000000000000000000064'
  1980. ethereumBlockNum: 2
  1981. fiatUpdate: '2020-11-26T09:18:27.04357Z'
  1982. id: 1
  1983. itemId: 2
  1984. name: Test Token 1
  1985. symbol: TKN1
  1986. type: Transfer
  1987. pendingItems: 23
  1988. required:
  1989. - transactions
  1990. - pendingItems
  1991. additionalProperties: false
  1992. EthBlockNum:
  1993. type: integer
  1994. description: Ethereum block number
  1995. minimum: 0
  1996. maximum: 1.84467440737096e+19
  1997. example: 762375478
  1998. ToForgeL1TransactionsNum:
  1999. type: integer
  2000. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  2001. minimum: 0
  2002. maximum: 4294967295
  2003. example: 784
  2004. nullable: true
  2005. TransactionPosition:
  2006. type: integer
  2007. description: Position that a transaction occupies in a batch.
  2008. minimum: 0
  2009. example: 5
  2010. URL:
  2011. type: string
  2012. description: HTTP URL
  2013. example: "https://hermez.io"
  2014. TokenSymbol:
  2015. type: string
  2016. description: Abreviation of the token name.
  2017. example: "DAI"
  2018. TokenName:
  2019. type: string
  2020. description: Token name.
  2021. example: "Dai"
  2022. CollectedFees:
  2023. type: object
  2024. 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.
  2025. additionalProperties:
  2026. type: string
  2027. example:
  2028. 1234: "425632785672345647"
  2029. 4321: "86538967235465432654352"
  2030. Batch:
  2031. type: object
  2032. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  2033. properties:
  2034. itemId:
  2035. $ref: '#/components/schemas/ItemId'
  2036. batchNum:
  2037. $ref: '#/components/schemas/BatchNum'
  2038. ethereumBlockNum:
  2039. $ref: '#/components/schemas/EthBlockNum'
  2040. ethereumBlockHash:
  2041. type: string
  2042. description: hash of the Ethereum block in which the batch was forged
  2043. example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
  2044. timestamp:
  2045. type: string
  2046. format: date-time
  2047. description: Time in which the batch was forged.
  2048. forgerAddr:
  2049. $ref: '#/components/schemas/EthereumAddress'
  2050. collectedFees:
  2051. $ref: '#/components/schemas/CollectedFees'
  2052. historicTotalCollectedFeesUSD:
  2053. type: number
  2054. description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
  2055. example: 23.3
  2056. stateRoot:
  2057. allOf:
  2058. - $ref: '#/components/schemas/Hash'
  2059. - description: Root of the accounts Merkle Tree.
  2060. - example: "2734657026572a8708d883"
  2061. numAccounts:
  2062. type: integer
  2063. description: Number of registered accounts in this batch.
  2064. exitRoot:
  2065. allOf:
  2066. - $ref: '#/components/schemas/Hash'
  2067. - description: Root of the exit Merkle Tree associated to this batch.
  2068. - example: "2734657026572a8708d883"
  2069. forgeL1TransactionsNum:
  2070. type: integer
  2071. description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  2072. example: 5
  2073. nullable: true
  2074. slotNum:
  2075. $ref: '#/components/schemas/SlotNum'
  2076. forgedTransactions:
  2077. type: integer
  2078. description: Amount of forged transactions in this batch.
  2079. example: 318
  2080. additionalProperties: false
  2081. required:
  2082. - itemId
  2083. - batchNum
  2084. - ethereumBlockNum
  2085. - ethereumBlockHash
  2086. - timestamp
  2087. - forgerAddr
  2088. - collectedFees
  2089. - historicTotalCollectedFeesUSD
  2090. - stateRoot
  2091. - numAccounts
  2092. - exitRoot
  2093. - forgeL1TransactionsNum
  2094. - slotNum
  2095. - forgedTransactions
  2096. FullBatch:
  2097. type: object
  2098. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  2099. properties:
  2100. batch:
  2101. $ref: '#/components/schemas/Batch'
  2102. transactions:
  2103. type: array
  2104. description: List of forged transactions in the batch
  2105. items:
  2106. $ref: '#/components/schemas/HistoryTransaction'
  2107. nullable: true
  2108. additionalProperties: false
  2109. required:
  2110. - batch
  2111. - transactions
  2112. Hash:
  2113. type: string
  2114. description: hashed data
  2115. example: "2734657026572a8708d883"
  2116. SlotNum:
  2117. type: integer
  2118. description: Identifier of a slot.
  2119. minimum: 0
  2120. maximum: 4294967295
  2121. example: 784
  2122. Batches:
  2123. type: object
  2124. properties:
  2125. batches:
  2126. type: array
  2127. description: List of batches.
  2128. items:
  2129. $ref: '#/components/schemas/Batch'
  2130. pendingItems:
  2131. $ref: '#/components/schemas/PendingItems'
  2132. additionalProperties: false
  2133. required:
  2134. - batches
  2135. - pendingItems
  2136. Coordinator:
  2137. type: object
  2138. properties:
  2139. itemId:
  2140. $ref: '#/components/schemas/ItemId'
  2141. forgerAddr:
  2142. $ref: '#/components/schemas/EthereumAddress'
  2143. bidderAddr:
  2144. $ref: '#/components/schemas/EthereumAddress'
  2145. URL:
  2146. $ref: '#/components/schemas/URL'
  2147. ethereumBlock:
  2148. allOf:
  2149. - $ref: '#/components/schemas/EthBlockNum'
  2150. - description: Ethereum block in which the coordinator registered into the network.
  2151. - example: 5735943738
  2152. additionalProperties: false
  2153. required:
  2154. - itemId
  2155. - forgerAddr
  2156. - bidderAddr
  2157. - URL
  2158. - ethereumBlock
  2159. Coordinators:
  2160. type: object
  2161. properties:
  2162. coordinators:
  2163. type: array
  2164. description: List of coordinators.
  2165. items:
  2166. $ref: '#/components/schemas/Coordinator'
  2167. pendingItems:
  2168. $ref: '#/components/schemas/PendingItems'
  2169. additionalProperties: false
  2170. required:
  2171. - coordinators
  2172. - pendingItems
  2173. Bid:
  2174. type: object
  2175. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  2176. properties:
  2177. itemId:
  2178. $ref: '#/components/schemas/ItemId'
  2179. bidderAddr:
  2180. $ref: '#/components/schemas/EthereumAddress'
  2181. forgerAddr:
  2182. $ref: '#/components/schemas/EthereumAddress'
  2183. slotNum:
  2184. $ref: '#/components/schemas/SlotNum'
  2185. URL:
  2186. $ref: '#/components/schemas/URL'
  2187. bidValue:
  2188. $ref: '#/components/schemas/BigInt'
  2189. ethereumBlockNum:
  2190. $ref: '#/components/schemas/EthBlockNum'
  2191. timestamp:
  2192. type: string
  2193. format: date-time
  2194. additionalProperties: false
  2195. required:
  2196. - bidderAddr
  2197. - forgerAddr
  2198. - slotNum
  2199. - URL
  2200. - bidValue
  2201. - ethereumBlockNum
  2202. - timestamp
  2203. Bids:
  2204. type: object
  2205. properties:
  2206. bids:
  2207. type: array
  2208. description: List of bids.
  2209. items:
  2210. $ref: '#/components/schemas/Bid'
  2211. pendingItems:
  2212. $ref: '#/components/schemas/PendingItems'
  2213. additionalProperties: false
  2214. required:
  2215. - bids
  2216. - pendingItems
  2217. RecommendedFee:
  2218. type: object
  2219. description: Fee that the coordinator recommends per transaction in USD.
  2220. properties:
  2221. existingAccount:
  2222. type: number
  2223. description: Recommended fee if the destination account of the transaction already exists.
  2224. minimum: 0
  2225. example: 0.1
  2226. createAccount:
  2227. type: number
  2228. 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.
  2229. minimum: 0
  2230. example: 1.3
  2231. createAccountInternal:
  2232. type: number
  2233. 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.
  2234. minimum: 0
  2235. example: 0.5
  2236. Token:
  2237. type: object
  2238. description: Hermez Network compatible and registered token.
  2239. properties:
  2240. id:
  2241. $ref: '#/components/schemas/TokenId'
  2242. ethereumAddress:
  2243. allOf:
  2244. - $ref: '#/components/schemas/EthereumAddress'
  2245. - description: Ethereum address in which the token is deployed.
  2246. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  2247. itemId:
  2248. $ref: '#/components/schemas/ItemId'
  2249. name:
  2250. type: string
  2251. description: full name of the token
  2252. example: Maker Dai
  2253. symbol:
  2254. allOf:
  2255. - $ref: '#/components/schemas/TokenSymbol'
  2256. - example: DAI
  2257. decimals:
  2258. type: integer
  2259. description: Number of decimals of the token.
  2260. example: 18
  2261. ethereumBlockNum:
  2262. allOf:
  2263. - $ref: '#/components/schemas/EthBlockNum'
  2264. - description: Ethereum block number in which the token was added to the Hermez Network.
  2265. - example: 539847538
  2266. USD:
  2267. type: number
  2268. description: Value of the token in USD.
  2269. example: 1.01
  2270. nullable: true
  2271. fiatUpdate:
  2272. type: string
  2273. format: date-time
  2274. description: Timestamp of the moment the `USD` value was updated.
  2275. nullable: true
  2276. required:
  2277. - id
  2278. - ethereumAddress
  2279. - itemId
  2280. - name
  2281. - symbol
  2282. - decimals
  2283. - ethereumBlockNum
  2284. - USD
  2285. - fiatUpdate
  2286. additionalProperties: false
  2287. Tokens:
  2288. type: object
  2289. properties:
  2290. tokens:
  2291. type: array
  2292. description: List of tokens.
  2293. items:
  2294. $ref: '#/components/schemas/Token'
  2295. pendingItems:
  2296. $ref: '#/components/schemas/PendingItems'
  2297. Exit:
  2298. type: object
  2299. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  2300. properties:
  2301. batchNum:
  2302. allOf:
  2303. - $ref: '#/components/schemas/BatchNum'
  2304. - description: Batch in which the exit was forged.
  2305. - example: 7394
  2306. accountIndex:
  2307. $ref: '#/components/schemas/AccountIndex'
  2308. bjj:
  2309. $ref: '#/components/schemas/BJJ'
  2310. hezEthereumAddress:
  2311. $ref: '#/components/schemas/HezEthereumAddress'
  2312. itemId:
  2313. $ref: '#/components/schemas/ItemId'
  2314. merkleProof:
  2315. type: object
  2316. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  2317. properties:
  2318. root:
  2319. $ref: '#/components/schemas/BigInt'
  2320. siblings:
  2321. type: array
  2322. items:
  2323. $ref: '#/components/schemas/BigInt'
  2324. oldKey:
  2325. $ref: '#/components/schemas/BigInt'
  2326. oldValue:
  2327. $ref: '#/components/schemas/BigInt'
  2328. isOld0:
  2329. type: boolean
  2330. key:
  2331. $ref: '#/components/schemas/BigInt'
  2332. value:
  2333. $ref: '#/components/schemas/BigInt'
  2334. fnc:
  2335. type: integer
  2336. maximum: 3
  2337. minimum: 0
  2338. required:
  2339. - root
  2340. - siblings
  2341. - oldKey
  2342. - oldValue
  2343. - isOld0
  2344. - key
  2345. - value
  2346. - fnc
  2347. additionalProperties: false
  2348. balance:
  2349. $ref: '#/components/schemas/BigInt'
  2350. instantWithdrawn:
  2351. type: integer
  2352. description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  2353. minimum: 0
  2354. maximum: 1.84467440737096e+19
  2355. example: 74747363
  2356. nullable: true
  2357. delayedWithdrawRequest:
  2358. type: integer
  2359. description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  2360. minimum: 0
  2361. maximum: 1.84467440737096e+19
  2362. example: null
  2363. nullable: true
  2364. delayedWithdrawn:
  2365. type: integer
  2366. 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.
  2367. minimum: 0
  2368. maximum: 1.84467440737096e+19
  2369. example: null
  2370. nullable: true
  2371. token:
  2372. $ref: '#/components/schemas/Token'
  2373. required:
  2374. - batchNum
  2375. - accountIndex
  2376. - bjj
  2377. - hezEthereumAddress
  2378. - itemId
  2379. - merkleProof
  2380. - balance
  2381. - instantWithdrawn
  2382. - delayedWithdrawRequest
  2383. - delayedWithdrawn
  2384. - token
  2385. additionalProperties: false
  2386. Exits:
  2387. type: object
  2388. properties:
  2389. exits:
  2390. type: array
  2391. description: List of exits.
  2392. items:
  2393. $ref: '#/components/schemas/Exit'
  2394. pendingItems:
  2395. $ref: '#/components/schemas/PendingItems'
  2396. required:
  2397. - exits
  2398. - pendingItems
  2399. additionalProperties: false
  2400. Account:
  2401. type: object
  2402. description: State tree leaf. It contains balance and nonce of an account.
  2403. properties:
  2404. itemId:
  2405. $ref: '#/components/schemas/ItemId'
  2406. accountIndex:
  2407. $ref: '#/components/schemas/AccountIndex'
  2408. nonce:
  2409. $ref: '#/components/schemas/Nonce'
  2410. balance:
  2411. $ref: '#/components/schemas/BigInt'
  2412. bjj:
  2413. $ref: '#/components/schemas/BJJ'
  2414. hezEthereumAddress:
  2415. $ref: '#/components/schemas/HezEthereumAddress'
  2416. token:
  2417. $ref: '#/components/schemas/Token'
  2418. example:
  2419. exits:
  2420. - accountIndex: hez:ETH:259
  2421. balance: '66666600000000000'
  2422. batchNum: 8
  2423. delayedWithdrawRequest:
  2424. delayedWithdrawn:
  2425. instantWithdrawn:
  2426. itemId: 1
  2427. merkleProof:
  2428. Fnc: 0
  2429. IsOld0: true
  2430. Key: '256'
  2431. OldKey: '256'
  2432. OldValue: '256'
  2433. Root: '256'
  2434. Siblings:
  2435. - '0'
  2436. - '1'
  2437. - '2'
  2438. Value: '256'
  2439. token:
  2440. USD: 500
  2441. decimals: 18
  2442. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2443. ethereumBlockNum: 0
  2444. fiatUpdate: '2020-11-26T09:57:29.110879Z'
  2445. id: 0
  2446. itemId: 1
  2447. name: Ether
  2448. symbol: ETH
  2449. pendingItems: 0
  2450. additionalProperties: false
  2451. required:
  2452. - itemId
  2453. - accountIndex
  2454. - nonce
  2455. - balance
  2456. - bjj
  2457. - hezEthereumAddress
  2458. - token
  2459. Accounts:
  2460. type: object
  2461. properties:
  2462. accounts:
  2463. type: array
  2464. description: List of accounts.
  2465. items:
  2466. $ref: '#/components/schemas/Account'
  2467. pendingItems:
  2468. $ref: '#/components/schemas/PendingItems'
  2469. example:
  2470. accounts:
  2471. - accountIndex: hez:ETH:259
  2472. balance: '2590000000000000000'
  2473. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2474. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2475. itemId: 4
  2476. nonce: 0
  2477. token:
  2478. USD: 500
  2479. decimals: 18
  2480. ethereumAddress: '0x0000000000000000000000000000000000000000'
  2481. ethereumBlockNum: 0
  2482. fiatUpdate: '2020-11-26T09:53:47.444444Z'
  2483. id: 0
  2484. itemId: 1
  2485. name: Ether
  2486. symbol: ETH
  2487. - accountIndex: hez:TKN1:261
  2488. balance: '2610000000'
  2489. bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
  2490. hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
  2491. itemId: 6
  2492. nonce: 0
  2493. token:
  2494. USD: 423
  2495. decimals: 18
  2496. ethereumAddress: '0x0000000000000000000000000000000000000064'
  2497. ethereumBlockNum: 2
  2498. fiatUpdate: '2020-11-26T09:53:47.456619Z'
  2499. id: 1
  2500. itemId: 2
  2501. name: Test Token 1
  2502. symbol: TKN1
  2503. pendingItems: 0
  2504. additionalProperties: false
  2505. required:
  2506. - accounts
  2507. - pendingItems
  2508. Slot:
  2509. type: object
  2510. description: Slot information.
  2511. properties:
  2512. itemId:
  2513. $ref: '#/components/schemas/ItemId'
  2514. slotNum:
  2515. $ref: '#/components/schemas/SlotNum'
  2516. firstBlock:
  2517. allOf:
  2518. - $ref: '#/components/schemas/EthBlockNum'
  2519. - description: Block in which the slot began or will begin
  2520. - example: 76238647846
  2521. lastBlock:
  2522. allOf:
  2523. - $ref: '#/components/schemas/EthBlockNum'
  2524. - description: Block in which the slot ended or will end
  2525. - example: 4475934
  2526. openAuction:
  2527. type: boolean
  2528. description: Whether the auction of the slot is open or not.
  2529. bestBid:
  2530. type: object
  2531. description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
  2532. nullable: true
  2533. properties:
  2534. itemId:
  2535. $ref: '#/components/schemas/ItemId'
  2536. bidderAddr:
  2537. $ref: '#/components/schemas/EthereumAddress'
  2538. forgerAddr:
  2539. $ref: '#/components/schemas/EthereumAddress'
  2540. slotNum:
  2541. $ref: '#/components/schemas/SlotNum'
  2542. URL:
  2543. $ref: '#/components/schemas/URL'
  2544. bidValue:
  2545. type: string
  2546. description: BigInt is an integer encoded as a string for numbers that are very large.
  2547. example: "8708856933496328593"
  2548. pattern: "^\\d+$"
  2549. ethereumBlockNum:
  2550. $ref: '#/components/schemas/EthBlockNum'
  2551. timestamp:
  2552. type: string
  2553. format: date-time
  2554. additionalProperties: false
  2555. required:
  2556. - bidderAddr
  2557. - forgerAddr
  2558. - slotNum
  2559. - URL
  2560. - bidValue
  2561. - ethereumBlockNum
  2562. - timestamp
  2563. additionalProperties: false
  2564. required:
  2565. - slotNum
  2566. - firstBlock
  2567. - lastBlock
  2568. - openAuction
  2569. - bestBid
  2570. Slots:
  2571. type: object
  2572. properties:
  2573. slots:
  2574. type: array
  2575. description: List of slots.
  2576. items:
  2577. allOf:
  2578. - $ref: '#/components/schemas/Slot'
  2579. - description: Last synchronized Etherum block.
  2580. pendingItems:
  2581. $ref: '#/components/schemas/PendingItems'
  2582. additionalProperties: false
  2583. required:
  2584. - slots
  2585. - pendingItems
  2586. NextForger:
  2587. type: object
  2588. description: Coordinator information along with the scheduled forging period
  2589. properties:
  2590. coordinator:
  2591. $ref: '#/components/schemas/Coordinator'
  2592. period:
  2593. type: object
  2594. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  2595. properties:
  2596. slotNum:
  2597. $ref: '#/components/schemas/SlotNum'
  2598. fromBlock:
  2599. $ref: '#/components/schemas/EthBlockNum'
  2600. toBlock:
  2601. $ref: '#/components/schemas/EthBlockNum'
  2602. fromTimestamp:
  2603. type: string
  2604. format: date-time
  2605. toTimestamp:
  2606. type: string
  2607. format: date-time
  2608. required:
  2609. - slotNum
  2610. - fromBlock
  2611. - toBlock
  2612. - fromTimestamp
  2613. - toTimestamp
  2614. additionalProperties: false
  2615. required:
  2616. - coordinator
  2617. - period
  2618. additionalProperties: false
  2619. NextForgers:
  2620. type: array
  2621. description: List of next coordinators to forge.
  2622. items:
  2623. $ref: '#/components/schemas/NextForger'
  2624. State:
  2625. type: object
  2626. description: Gobal variables of the network
  2627. properties:
  2628. network:
  2629. $ref: '#/components/schemas/StateNetwork'
  2630. metrics:
  2631. $ref: '#/components/schemas/StateMetrics'
  2632. rollup:
  2633. $ref: '#/components/schemas/StateRollup'
  2634. auction:
  2635. $ref: '#/components/schemas/StateAuction'
  2636. withdrawalDelayer:
  2637. $ref: '#/components/schemas/StateWithdrawDelayer'
  2638. recommendedFee:
  2639. $ref: '#/components/schemas/RecommendedFee'
  2640. additionalProperties: false
  2641. required:
  2642. - network
  2643. - metrics
  2644. - rollup
  2645. - auction
  2646. - withdrawalDelayer
  2647. - recommendedFee
  2648. StateNetwork:
  2649. type: object
  2650. description: Gobal statistics of the network
  2651. properties:
  2652. lastEthereumBlock:
  2653. allOf:
  2654. - $ref: '#/components/schemas/EthBlockNum'
  2655. - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
  2656. - example: 3457437
  2657. lastSynchedBlock:
  2658. allOf:
  2659. - $ref: '#/components/schemas/EthBlockNum'
  2660. - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
  2661. - example: 3457437
  2662. lastBatch:
  2663. $ref: '#/components/schemas/Batch'
  2664. currentSlot:
  2665. allOf:
  2666. - $ref: '#/components/schemas/SlotNum'
  2667. - description: Slot where batches are currently being forged.
  2668. - example: 2334
  2669. nextForgers:
  2670. $ref: '#/components/schemas/NextForgers'
  2671. additionalProperties: false
  2672. required:
  2673. - lastEthereumBlock
  2674. - lastSynchedBlock
  2675. - lastBatch
  2676. - currentSlot
  2677. - nextForgers
  2678. StateAuction:
  2679. type: object
  2680. description: Auction parameters.
  2681. properties:
  2682. ethereumBlockNum:
  2683. $ref: '#/components/schemas/EthBlockNum'
  2684. bootCoordinator:
  2685. allOf:
  2686. - $ref: '#/components/schemas/EthereumAddress'
  2687. - description: Ethereum address of the boot coordinator.
  2688. - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
  2689. bootCoordinatorUrl:
  2690. type: string
  2691. description: Boot Coordinator URL
  2692. example: "https://boot.coordinator.io"
  2693. slotDeadline:
  2694. type: integer
  2695. 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.
  2696. example: 3
  2697. closedAuctionSlots:
  2698. type: integer
  2699. 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.
  2700. example: 2
  2701. openAuctionSlots:
  2702. type: integer
  2703. description: Amount of days in advance are auctions opened.
  2704. defaultSlotSetBid:
  2705. type: array
  2706. 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]`."
  2707. items:
  2708. type: integer
  2709. example: [32,0,68,21,55,99]
  2710. defaultSlotSetBidSlotNum:
  2711. type: integer
  2712. description: Slot in which the changes will be applied for the first time.
  2713. outbidding:
  2714. type: number
  2715. description: Minimum outbid over the previous one to consider it valid.
  2716. example: 3.64
  2717. donationAddress:
  2718. allOf:
  2719. - $ref: '#/components/schemas/EthereumAddress'
  2720. - description: Ethereum address where the donations will go to.
  2721. - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
  2722. allocationRatio:
  2723. type: array
  2724. description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
  2725. items:
  2726. type: integer
  2727. example: [80,10,10]
  2728. additionalProperties: false
  2729. required:
  2730. - ethereumBlockNum
  2731. - bootCoordinator
  2732. - bootCoordinatorUrl
  2733. - slotDeadline
  2734. - closedAuctionSlots
  2735. - openAuctionSlots
  2736. - defaultSlotSetBid
  2737. - outbidding
  2738. - donationAddress
  2739. - allocationRatio
  2740. StateRollup:
  2741. type: object
  2742. description: Rollup parameters
  2743. properties:
  2744. ethereumBlockNum:
  2745. $ref: '#/components/schemas/EthBlockNum'
  2746. forgeL1L2BatchTimeout:
  2747. type: integer
  2748. description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
  2749. example: 5
  2750. feeAddToken:
  2751. type: integer
  2752. description: Fee to pay when registering tokens into the network.
  2753. example: 5698
  2754. withdrawalDelay:
  2755. type: integer
  2756. description: Withdraw delay in seconds
  2757. example: 432000
  2758. buckets:
  2759. type: array
  2760. description: List of buckets state
  2761. items:
  2762. type: object
  2763. properties:
  2764. ceilUSD:
  2765. type: integer
  2766. description: Max USD value
  2767. example: 1000
  2768. withdrawals:
  2769. type: integer
  2770. description: Available withdrawals of the bucket
  2771. example: 4
  2772. blockWithdrawalRate:
  2773. type: integer
  2774. description: Every `blockWithdrawalRate` blocks add 1 withdrawal
  2775. example: 8
  2776. maxWithdrawals:
  2777. type: integer
  2778. description: Max withdrawals the bucket can hold
  2779. example: 4
  2780. additionalProperties: false
  2781. required:
  2782. - ceilUSD
  2783. - withdrawals
  2784. - blockWithdrawalRate
  2785. - maxWithdrawals
  2786. additionalProperties: false
  2787. required:
  2788. - ethereumBlockNum
  2789. - forgeL1L2BatchTimeout
  2790. - feeAddToken
  2791. - withdrawalDelay
  2792. - buckets
  2793. StateWithdrawDelayer:
  2794. type: object
  2795. description: Withdrawal delayer parameters
  2796. properties:
  2797. ethereumBlockNum:
  2798. $ref: '#/components/schemas/EthBlockNum'
  2799. hermezGovernanceAddress:
  2800. allOf:
  2801. - $ref: '#/components/schemas/EthereumAddress'
  2802. - description: Ethereum address of the governance.
  2803. - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
  2804. emergencyCouncilAddress:
  2805. allOf:
  2806. - $ref: '#/components/schemas/EthereumAddress'
  2807. - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2808. - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
  2809. withdrawalDelay:
  2810. allOf:
  2811. - $ref: '#/components/schemas/EthBlockNum'
  2812. - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
  2813. - example: 539573849
  2814. emergencyModeStartingBlock:
  2815. type: integer
  2816. description: Block number in which the emergency mode has been activated.
  2817. example: 10
  2818. emergencyMode:
  2819. type: boolean
  2820. description: Indicates if emergency mode has been activated.
  2821. example: false
  2822. additionalProperties: false
  2823. required:
  2824. - ethereumBlockNum
  2825. - hermezGovernanceAddress
  2826. - emergencyCouncilAddress
  2827. - withdrawalDelay
  2828. - emergencyModeStartingBlock
  2829. - emergencyMode
  2830. StateMetrics:
  2831. type: object
  2832. description: Metrics of the network
  2833. properties:
  2834. transactionsPerBatch:
  2835. type: number
  2836. description: Average transactions per batch in the last 24 hours.
  2837. example: 2002.7
  2838. batchFrequency:
  2839. type: number
  2840. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2841. example: 8.9
  2842. transactionsPerSecond:
  2843. type: number
  2844. description: Average transactions per second in the last 24 hours.
  2845. example: 302.3
  2846. totalAccounts:
  2847. type: integer
  2848. description: Number of created accounts.
  2849. example: 90473
  2850. totalBJJs:
  2851. type: integer
  2852. description: Number of different registered BJJs.
  2853. example: 23067
  2854. avgTransactionFee:
  2855. type: number
  2856. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2857. example: 1.54
  2858. additionalProperties: false
  2859. required:
  2860. - transactionsPerBatch
  2861. - batchFrequency
  2862. - transactionsPerSecond
  2863. - totalAccounts
  2864. - totalBJJs
  2865. - avgTransactionFee
  2866. PendingItems:
  2867. type: integer
  2868. 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.
  2869. example: 15
  2870. Config:
  2871. type: object
  2872. description: Configuration parameters of the different smart contracts that power the Hermez Network.
  2873. properties:
  2874. hermez:
  2875. type: object
  2876. description: Constant configuration of the Hermez smart contract.
  2877. properties:
  2878. publicConstants:
  2879. type: object
  2880. description: Public Hermez smart contract constants
  2881. properties:
  2882. tokenHEZ:
  2883. allOf:
  2884. - $ref: '#/components/schemas/EthereumAddress'
  2885. - description: Ethereum address of the HEZ token.
  2886. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2887. absoluteMaxL1L2BatchTimeout:
  2888. type: integer
  2889. description: L1L2 Batch Timeout
  2890. example: 240
  2891. verifiers:
  2892. type: array
  2893. description: List of verifiers struct
  2894. items:
  2895. type: object
  2896. properties:
  2897. maxTx:
  2898. type: integer
  2899. description: Maximum rollup transactions in a batch
  2900. example: 512
  2901. nlevels:
  2902. type: integer
  2903. description: Number of levels of the circuit
  2904. example: 32
  2905. required:
  2906. - maxTx
  2907. - nlevels
  2908. additionalProperties: false
  2909. hermezAuctionContract:
  2910. allOf:
  2911. - $ref: '#/components/schemas/EthereumAddress'
  2912. - description: Ethereum address of the auction smart contract.
  2913. - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
  2914. hermezGovernanceAddress:
  2915. allOf:
  2916. - $ref: '#/components/schemas/EthereumAddress'
  2917. - description: Ethereum address of the governance.
  2918. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  2919. withdrawDelayerContract:
  2920. allOf:
  2921. - $ref: '#/components/schemas/EthereumAddress'
  2922. - description: Ethereum address of the withdraw delayer contracts.
  2923. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  2924. required:
  2925. - tokenHEZ
  2926. - absoluteMaxL1L2BatchTimeout
  2927. - verifiers
  2928. - hermezAuctionContract
  2929. - hermezGovernanceAddress
  2930. - withdrawDelayerContract
  2931. additionalProperties: false
  2932. maxFeeIdxCoordinator:
  2933. type: integer
  2934. description: is the maximum number of tokens the coordinator can use to collect fees.
  2935. example: 64
  2936. reservedIdx:
  2937. type: integer
  2938. description: First 256 indexes reserved, first user index will be the 256.
  2939. example: 255
  2940. exitIdx:
  2941. type: integer
  2942. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2943. example: 1
  2944. limitDepositAmount:
  2945. type: integer
  2946. description: Maximum deposit amount (L1 to L2) allowed.
  2947. example: 321
  2948. limitL2TransferAmount:
  2949. type: integer
  2950. description: Maximum amount (L2 to L2) allowed.
  2951. example: 837
  2952. limitTokens:
  2953. type: integer
  2954. description: Maximum number of different tokens that can be registered in the network.
  2955. example: 4294967295
  2956. l1CoordinatorTotalBytes:
  2957. type: integer
  2958. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2959. example: 101
  2960. l1UserTotalBytes:
  2961. type: integer
  2962. 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).
  2963. example: 72
  2964. maxL1UserTx:
  2965. type: integer
  2966. description: Maximum L1-user transactions allowed to be queued in a batch.
  2967. example: 128
  2968. maxL1Tx:
  2969. type: integer
  2970. description: Maximum L1 transactions allowed to be queued in a batch.
  2971. example: 256
  2972. inputSHAConstantBytes:
  2973. type: integer
  2974. description: Input SHA constant bytes
  2975. example: 18542
  2976. numBuckets:
  2977. type: integer
  2978. description: Number of buckets
  2979. example: 5
  2980. maxWithdrawalDelay:
  2981. type: integer
  2982. description: Maximum delay to withdraw tokens. Time is measured in seconds.
  2983. example: 2 * 7 * 24 * 60 * 60
  2984. exchangeMultiplier:
  2985. type: integer
  2986. description: exchange multiplier
  2987. example: 1e14
  2988. required:
  2989. - publicConstants
  2990. - reservedIdx
  2991. - exitIdx
  2992. - limitDepositAmount
  2993. - limitL2TransferAmount
  2994. - limitTokens
  2995. - l1CoordinatorTotalBytes
  2996. - l1UserTotalBytes
  2997. - maxL1UserTx
  2998. - maxL1Tx
  2999. - inputSHAConstantBytes
  3000. - numBuckets
  3001. - maxWithdrawalDelay
  3002. - exchangeMultiplier
  3003. additionalProperties: false
  3004. auction:
  3005. type: object
  3006. description: Constant configuration of the auction smart contract.
  3007. properties:
  3008. blocksPerSlot:
  3009. type: integer
  3010. description: Blocks per slot.
  3011. initialMinimalBidding:
  3012. type: integer
  3013. description: Minimum bid when no one has bid yet.
  3014. genesisBlockNum:
  3015. allOf:
  3016. - $ref: '#/components/schemas/EthBlockNum'
  3017. - description: Ethereum block number in which the smart contract starts operating.
  3018. tokenHEZ:
  3019. allOf:
  3020. - $ref: '#/components/schemas/EthereumAddress'
  3021. - description: Ethereum address of the HEZ token.
  3022. - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
  3023. hermezRollup:
  3024. allOf:
  3025. - $ref: '#/components/schemas/EthereumAddress'
  3026. - description: Ethereum address of the rollup smart contract.
  3027. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  3028. governanceAddress:
  3029. allOf:
  3030. - $ref: '#/components/schemas/EthereumAddress'
  3031. - description: Ethereum address of the governance.
  3032. - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
  3033. required:
  3034. - blocksPerSlot
  3035. - initialMinimalBidding
  3036. - genesisBlockNum
  3037. - tokenHEZ
  3038. - hermezRollup
  3039. - governanceAddress
  3040. additionalProperties: false
  3041. withdrawalDelayer:
  3042. type: object
  3043. description: Constant configuration of the withdrawal delayer smart contract.
  3044. properties:
  3045. maxWithdrawalDelay:
  3046. type: integer
  3047. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
  3048. example: 200
  3049. maxEmergencyModeTime:
  3050. type: integer
  3051. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
  3052. example: 2000
  3053. hermezRollup:
  3054. allOf:
  3055. - $ref: '#/components/schemas/EthereumAddress'
  3056. - description: Ethereum address of the rollup smart contract.
  3057. - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
  3058. required:
  3059. - maxWithdrawalDelay
  3060. - maxEmergencyModeTime
  3061. - hermezRollup
  3062. additionalProperties: false
  3063. required:
  3064. - hermez
  3065. - auction
  3066. - withdrawalDelayer
  3067. additionalProperties: false
  3068. Error:
  3069. type: object
  3070. description: Error response.
  3071. properties:
  3072. message:
  3073. type: string
  3074. Error400:
  3075. allOf:
  3076. - $ref: '#/components/schemas/Error'
  3077. - example:
  3078. message: Invalid signature.
  3079. Error404:
  3080. allOf:
  3081. - $ref: '#/components/schemas/Error'
  3082. - example:
  3083. message: Item(s) not found.
  3084. Error500:
  3085. allOf:
  3086. - $ref: '#/components/schemas/Error'
  3087. - example:
  3088. message: Database error.