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.

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