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.

3072 lines
108 KiB

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