You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3119 lines
110 KiB

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