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.

3059 lines
107 KiB

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