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.

3077 lines
108 KiB

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