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.

2266 lines
79 KiB

  1. openapi: 3.0.0
  2. info:
  3. description: |
  4. This API server is the layer that allows 3rd party apps and services interfacing with the coordinator to explore, monitor and use 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. All the endpoints that return a list of undefined size use pagination. Unless the opposite is explicitly said.
  10. All the retunred items are ordered by ascending chronological order.
  11. This may not be trivial to deduce as the atributes used to order are not timestamps but the protocol ensures that those atributes follow the mentioned chronological order.
  12. Each endpoint description clarify this in the `offset` description.
  13. The response of the calls to these endpoints will always include a `pagination` object that includes `totalItems` and `lastReturnedItem`.
  14. To iterate over the items the following query parameters are used:
  15. - `offset`: Indicates the first item that will be returned. Defaul 0. Incompatible with `last`.
  16. - `limit`: Indicates the maximum number of returned items. Default 20. Maximum 2049.
  17. - `last`: When true the last `limit` items are returned. Default false. Incompatible with `offset`.
  18. Iterate items in ascending chronological order:
  19. 1. Call the endpoint with no `offset` nor `last`.
  20. 2. Call the endpoint with `offset=<lastReturnedItem + 1>` until `lastReturnedItem == totalItems - 1`.
  21. Iterate items in descending chronological order:
  22. 1. Call the endpoint with `last`.
  23. 2. Call the endpoint with `offset=<min(0, lastReturnedItem - 2*limit)>`. Once the `calculated offset == 0`, it will be known that that call will return the first item and therefore no subsequent calls need to be done.
  24. If the `totalItems` change while iterating, it means that new items have been added at the end of the list. To fetch this items, use the following: `offset=<first received lastReturnedItem + 1>`, and from there iterate as decribed in *Iterate items in ascending chronological order*.
  25. **Note:** The returned list will alway be in ascending chronlogical order, so the returned arrays must be iterated from end to start in order to achieve reverse chronological order.
  26. **Note:** Pagination safety can be affected by Ethereum reorgs. In most of the cases this means that the last page can be changed, but older items should be safe.
  27. version: "0.0.1"
  28. title: Hermez Network API
  29. # termsOfService: 'http://swagger.io/terms/'
  30. # contact:
  31. # email: apiteam@swagger.io
  32. # license:
  33. # name: Apache 2.0
  34. # url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  35. externalDocs:
  36. description: Find out more about Hermez.
  37. url: 'https://hermez.io'
  38. servers:
  39. - description: Hosted mock up
  40. url: http://167.71.59.190:4010
  41. - description: Localhost mock Up
  42. url: http://localhost:4010
  43. tags:
  44. - name: Account
  45. description: Hermez account and the tokens it holds.
  46. externalDocs:
  47. description: Find out more.
  48. url: 'https://idocs.hermez.io/#/spec/zkrollup/README?id=account-types'
  49. - name: Transaction
  50. description: Send tokens off chain and track transactions.
  51. externalDocs:
  52. description: Find out more
  53. url: 'https://idocs.hermez.io/#/spec/zkrollup/README?id=transaction-types'
  54. - name: Hermez status
  55. description: Info about operators, tokens, auctions and more.
  56. externalDocs:
  57. description: Find out more.
  58. url: 'https://idocs.hermez.io/#/spec/zkrollup/README'
  59. paths:
  60. '/account-creation-authorization':
  61. post:
  62. tags:
  63. - Account
  64. summary: Send an authorization that will allow the coordinator to register accounts associated to an Ethereum address on behalf of the user.
  65. description: >-
  66. Send an authorization to create rollup accounts associated to an Ethereum address. Each account creation (an account can only hold a specific token) is effective once the coordinator forges the corresponding L1CoordinatorTx (which are always of type *account creation*).
  67. operationId: postRegister
  68. requestBody:
  69. description: Account creation authorization.
  70. required: true
  71. content:
  72. application/json:
  73. schema:
  74. $ref: '#/components/schemas/AccountCreationAuthorization'
  75. responses:
  76. '200':
  77. description: Successful operation.
  78. '400':
  79. description: Bad request.
  80. content:
  81. application/json:
  82. schema:
  83. $ref: '#/components/schemas/Error400'
  84. '500':
  85. description: Internal server error.
  86. content:
  87. application/json:
  88. schema:
  89. $ref: '#/components/schemas/Error500'
  90. '/account-creation-authorization/{hermezEthereumAddress}':
  91. get:
  92. tags:
  93. - Account
  94. summary: Get to know if the coordinator has the ability to create accounts associated to an Ethereum address.
  95. description: >-
  96. True if the coordinator has the required authorization to perform an account creation with the given Ethereum address on behalf of the Ethereum address holder.
  97. operationId: getAccountCreationAuthorization
  98. parameters:
  99. - name: hermezEthereumAddress
  100. in: path
  101. description: Ethereum address.
  102. required: true
  103. schema:
  104. $ref: '#/components/schemas/HermezEthereumAddress'
  105. responses:
  106. '200':
  107. description: Successful operation.
  108. content:
  109. application/json:
  110. schema:
  111. $ref: '#/components/schemas/AccountCreationAuthorization'
  112. '400':
  113. description: Bad request.
  114. content:
  115. application/json:
  116. schema:
  117. $ref: '#/components/schemas/Error400'
  118. '404':
  119. description: Not found.
  120. content:
  121. application/json:
  122. schema:
  123. $ref: '#/components/schemas/Error404'
  124. '500':
  125. description: Internal server error.
  126. content:
  127. application/json:
  128. schema:
  129. $ref: '#/components/schemas/Error500'
  130. '/accounts':
  131. get:
  132. tags:
  133. - Account
  134. summary: Get accounts balances and other associated information.
  135. description: Get accounts balances and other associated information.
  136. operationId: getAccounts
  137. parameters:
  138. - name: hermezEthereumAddress
  139. in: query
  140. description: Only get accounts associated to an Ethereum address. Incompatible with the query `BJJ`.
  141. required: false
  142. schema:
  143. $ref: '#/components/schemas/HermezEthereumAddress'
  144. - name: BJJ
  145. in: query
  146. description: Only get accounts associated to a BabyJubJub public key. Incompatible with the query `hermezEthereumAddress`.
  147. required: false
  148. schema:
  149. $ref: '#/components/schemas/BJJ'
  150. - name: tokenIds
  151. in: query
  152. required: false
  153. description: Only get accounts of specific tokens.
  154. schema:
  155. type: string
  156. description: Comma separated list of token identifiers.
  157. example: "3,87,91"
  158. - name: offset
  159. in: query
  160. required: false
  161. description: |
  162. - Order: accounts will be ordered by increasing account index.
  163. - Default first item: the first account to be returned will be the one that has the smallest account index.
  164. schema:
  165. type: number
  166. - name: last
  167. in: query
  168. required: false
  169. description: Get the last page.
  170. schema:
  171. type: boolean
  172. - name: limit
  173. in: query
  174. required: false
  175. description: Maximum number of items to be returned.
  176. schema:
  177. type: integer
  178. minimum: 1
  179. maximum: 2049
  180. responses:
  181. '200':
  182. description: Successful operation.
  183. content:
  184. application/json:
  185. schema:
  186. $ref: '#/components/schemas/Accounts'
  187. '400':
  188. description: Bad request.
  189. content:
  190. application/json:
  191. schema:
  192. $ref: '#/components/schemas/Error400'
  193. '404':
  194. description: Not found.
  195. content:
  196. application/json:
  197. schema:
  198. $ref: '#/components/schemas/Error404'
  199. '500':
  200. description: Internal server error.
  201. content:
  202. application/json:
  203. schema:
  204. $ref: '#/components/schemas/Error500'
  205. '/accounts/{accountIndex}':
  206. get:
  207. tags:
  208. - Account
  209. summary: Get an account by its index.
  210. description: Get an account by its index.
  211. operationId: getAccount
  212. parameters:
  213. - name: accountIndex
  214. in: path
  215. description: Identifier of an account.
  216. required: true
  217. schema:
  218. $ref: '#/components/schemas/AccountIndex'
  219. responses:
  220. '200':
  221. description: Successful operation.
  222. content:
  223. application/json:
  224. schema:
  225. $ref: '#/components/schemas/Account'
  226. '400':
  227. description: Bad request.
  228. content:
  229. application/json:
  230. schema:
  231. $ref: '#/components/schemas/Error400'
  232. '404':
  233. description: Not found.
  234. content:
  235. application/json:
  236. schema:
  237. $ref: '#/components/schemas/Error404'
  238. '500':
  239. description: Internal server error.
  240. content:
  241. application/json:
  242. schema:
  243. $ref: '#/components/schemas/Error500'
  244. '/exits':
  245. get:
  246. tags:
  247. - Account
  248. summary: Get exit information. This information is required to perform a withdraw.
  249. description: Get exit information. This information is required to perform a withdraw.
  250. operationId: getExits
  251. parameters:
  252. - name: hermezEthereumAddress
  253. in: query
  254. description: Get exits associated to a Ethereum address. Incompatible with query `BJJ` and `accountIndex`.
  255. required: false
  256. schema:
  257. $ref: '#/components/schemas/HermezEthereumAddress'
  258. - name: BJJ
  259. in: query
  260. description: Get exits associated to a BabyJubJub public key. Incompatible with query `hermezEthereumAddress` and `accountIndex`.
  261. required: false
  262. schema:
  263. $ref: '#/components/schemas/BJJ'
  264. - name: accountIndex
  265. in: query
  266. description: Get exits associated to a specific account. Incompatible with queries `hermezEthereumAddress` and `BJJ`.
  267. required: false
  268. schema:
  269. $ref: '#/components/schemas/AccountIndex'
  270. - name: batchNum
  271. in: query
  272. description: Get exits from the exit tree of a specific batch.
  273. required: false
  274. schema:
  275. $ref: '#/components/schemas/BatchNum'
  276. - name: offset
  277. in: query
  278. required: false
  279. description: |
  280. - Order: exits will be ordered by increasing (batchNum, accountIndex).
  281. - Default first item: the first exit to be returned will be the one that has the smallest (baychNum, accountIndex).
  282. schema:
  283. type: number
  284. - name: last
  285. in: query
  286. required: false
  287. description: Get the last page.
  288. schema:
  289. type: boolean
  290. - name: limit
  291. in: query
  292. required: false
  293. description: Maximum number of items to be returned.
  294. schema:
  295. type: integer
  296. minimum: 1
  297. maximum: 2049
  298. responses:
  299. '200':
  300. description: Successful operation.
  301. content:
  302. application/json:
  303. schema:
  304. $ref: '#/components/schemas/Exits'
  305. '400':
  306. description: Bad request.
  307. content:
  308. application/json:
  309. schema:
  310. $ref: '#/components/schemas/Error400'
  311. '404':
  312. description: Not found.
  313. content:
  314. application/json:
  315. schema:
  316. $ref: '#/components/schemas/Error404'
  317. '500':
  318. description: Internal server error.
  319. content:
  320. application/json:
  321. schema:
  322. $ref: '#/components/schemas/Error500'
  323. '/exits/{batchNum}/{accountIndex}':
  324. get:
  325. tags:
  326. - Account
  327. summary: Get specific exit information.
  328. description: Get exit information form a specific exit tree and account. This information is required to perform a withdraw.
  329. operationId: getExit
  330. parameters:
  331. - name: batchNum
  332. in: path
  333. description: Batch of the exit tree.
  334. required: true
  335. schema:
  336. $ref: '#/components/schemas/BatchNum'
  337. - name: accountIndex
  338. in: path
  339. description: Account identifier.
  340. required: true
  341. schema:
  342. $ref: '#/components/schemas/AccountIndex'
  343. responses:
  344. '200':
  345. description: Successful operation.
  346. content:
  347. application/json:
  348. schema:
  349. $ref: '#/components/schemas/Exit'
  350. '400':
  351. description: Bad request.
  352. content:
  353. application/json:
  354. schema:
  355. $ref: '#/components/schemas/Error400'
  356. '404':
  357. description: Not found.
  358. content:
  359. application/json:
  360. schema:
  361. $ref: '#/components/schemas/Error404'
  362. '500':
  363. description: Internal server error.
  364. content:
  365. application/json:
  366. schema:
  367. $ref: '#/components/schemas/Error500'
  368. '/transactions-pool':
  369. post:
  370. tags:
  371. - Transaction
  372. summary: Add an L2 transaction to the coordinator's pool
  373. description: >-
  374. Send L2 transaction. The transaction will be stored in the transaction pool of the coordinator and eventually forged.
  375. operationId: postTx
  376. requestBody:
  377. description: Signed transaction.
  378. required: true
  379. content:
  380. application/json:
  381. schema:
  382. $ref: '#/components/schemas/PoolL2Transaction'
  383. responses:
  384. '200':
  385. description: Successful operation.
  386. content:
  387. application/json:
  388. schema:
  389. $ref: '#/components/schemas/TransactionId'
  390. '400':
  391. description: Bad request.
  392. content:
  393. application/json:
  394. schema:
  395. $ref: '#/components/schemas/Error400'
  396. '500':
  397. description: Internal server error.
  398. content:
  399. application/json:
  400. schema:
  401. $ref: '#/components/schemas/Error500'
  402. '/transactions-pool/{id}':
  403. get:
  404. tags:
  405. - Transaction
  406. summary: Get details and status of a transaction that is in the pool.
  407. description: >-
  408. 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.
  409. Only transactions from the pool will be returned.
  410. Note that the transaction pool is different for each coordinator and therefore only a coordinator that has received a specific transaction
  411. will be able to provide information about that transaction.
  412. operationId: getPoolTx
  413. parameters:
  414. - name: id
  415. in: path
  416. description: Transaction identifier.
  417. required: true
  418. schema:
  419. $ref: '#/components/schemas/TransactionId'
  420. responses:
  421. '200':
  422. description: Successful operation.
  423. content:
  424. application/json:
  425. schema:
  426. $ref: '#/components/schemas/PoolL2Transaction'
  427. '400':
  428. description: Bad request.
  429. content:
  430. application/json:
  431. schema:
  432. $ref: '#/components/schemas/Error400'
  433. '404':
  434. description: Not found.
  435. content:
  436. application/json:
  437. schema:
  438. $ref: '#/components/schemas/Error404'
  439. '500':
  440. description: Internal server error.
  441. content:
  442. application/json:
  443. schema:
  444. $ref: '#/components/schemas/Error500'
  445. '/transactions-history':
  446. get:
  447. tags:
  448. - Transaction
  449. summary: Get details and status of transactions that have been forged.
  450. description: >-
  451. Get historical transactions. This endpoint will return all the different types of transactions except for:
  452. - Transactions that are still in the transaction pool of any coordinator. These transactions can be fetched using `GET /transactions-pool/{id}`.
  453. - L1 transactions that have not been forged yet. These transactions can be fetched using `GET /transactions-history/{id}`.
  454. operationId: getHistoryTxs
  455. parameters:
  456. - name: tokenId
  457. in: query
  458. required: false
  459. description: Only get transactions of specific token
  460. schema:
  461. $ref: '#/components/schemas/TokenId'
  462. - name: hermezEthereumAddress
  463. in: query
  464. required: false
  465. description: Only get transactions sent from or to an account associated to an Ethereum address Incompatible with the queries `BJJ` and `accountIndex`.
  466. schema:
  467. $ref: '#/components/schemas/HermezEthereumAddress'
  468. - name: BJJ
  469. in: query
  470. description: Only get transactions associated to a BabyJubJub public key. Incompatible with the queries `hermezEthereumAddress` and `accountIndex`.
  471. required: false
  472. schema:
  473. $ref: '#/components/schemas/BJJ'
  474. - name: accountIndex
  475. in: query
  476. required: false
  477. description: Only get transactions sent from or to a specific account. Incompatible with the queries `tokenId`, `hermezEthereumAddress` and `BJJ`.
  478. schema:
  479. $ref: '#/components/schemas/AccountIndex'
  480. - name: batchNum
  481. in: query
  482. required: false
  483. description: Only get transactions forged in a specific batch.
  484. schema:
  485. $ref: '#/components/schemas/BatchNum'
  486. - name: type
  487. in: query
  488. required: false
  489. description: Only get transactions of a specific type.
  490. schema:
  491. $ref: '#/components/schemas/TransactionType'
  492. - name: offset
  493. in: query
  494. required: false
  495. description: |
  496. - Order: History transactions will be ordered by increasing (batchNum, position).
  497. - Default first item: the first transaction to be returned will be the one that has the smallest (batchNum, position).
  498. schema:
  499. type: number
  500. - name: last
  501. in: query
  502. required: false
  503. description: Get the last page.
  504. schema:
  505. type: boolean
  506. - name: limit
  507. in: query
  508. required: false
  509. description: Maximum number of items to be returned.
  510. schema:
  511. type: integer
  512. minimum: 1
  513. maximum: 2049
  514. responses:
  515. '200':
  516. description: Successful operation.
  517. content:
  518. application/json:
  519. schema:
  520. $ref: '#/components/schemas/HistoryTransactions'
  521. '400':
  522. description: Bad request.
  523. content:
  524. application/json:
  525. schema:
  526. $ref: '#/components/schemas/Error400'
  527. '404':
  528. description: Not found.
  529. content:
  530. application/json:
  531. schema:
  532. $ref: '#/components/schemas/Error404'
  533. '500':
  534. description: Internal server error.
  535. content:
  536. application/json:
  537. schema:
  538. $ref: '#/components/schemas/Error500'
  539. '/transactions-history/{id}':
  540. get:
  541. tags:
  542. - Transaction
  543. summary: Get details and status of a historical transaction.
  544. description: >-
  545. Get transaction from the history by its id. This endpoint will return all the different types of transactions except those that are still in the pool of any coordinator.
  546. operationId: getHistoryTx
  547. parameters:
  548. - name: id
  549. in: path
  550. description: Transaction identifier.
  551. required: true
  552. schema:
  553. $ref: '#/components/schemas/TransactionId'
  554. responses:
  555. '200':
  556. description: Successful operation.
  557. content:
  558. application/json:
  559. schema:
  560. $ref: '#/components/schemas/HistoryTransaction'
  561. '400':
  562. description: Bad request.
  563. content:
  564. application/json:
  565. schema:
  566. $ref: '#/components/schemas/Error400'
  567. '404':
  568. description: Not found.
  569. content:
  570. application/json:
  571. schema:
  572. $ref: '#/components/schemas/Error404'
  573. '500':
  574. description: Internal server error.
  575. content:
  576. application/json:
  577. schema:
  578. $ref: '#/components/schemas/Error500'
  579. '/batches':
  580. get:
  581. tags:
  582. - Hermez status
  583. summary: Get information about forged batches.
  584. description: >-
  585. Get information about forged batches.
  586. operationId: getBatches
  587. parameters:
  588. - name: minBatchNum
  589. in: query
  590. required: false
  591. description: Include only `batchNum < minBatchNum` batches.
  592. schema:
  593. $ref: '#/components/schemas/BatchNum'
  594. - name: maxBatchNum
  595. in: query
  596. required: false
  597. description: Include only `batchNum > maxBatchNum` batches.
  598. schema:
  599. type: number
  600. - name: forgerAddr
  601. in: query
  602. required: false
  603. description: Include only batches forged by `forgerAddr`
  604. schema:
  605. $ref: '#/components/schemas/EthereumAddress'
  606. - name: offset
  607. in: query
  608. required: false
  609. description: |
  610. - Order: batches will be ordered by increasing `batchNum`.
  611. - Default first item: the first batch to be returned will be the one that has the smallest `batchNum`.
  612. schema:
  613. type: number
  614. - name: last
  615. in: query
  616. required: false
  617. description: Get the last page.
  618. schema:
  619. type: boolean
  620. - name: limit
  621. in: query
  622. required: false
  623. description: Maximum number of items to be returned.
  624. schema:
  625. type: integer
  626. minimum: 1
  627. maximum: 2049
  628. responses:
  629. '200':
  630. description: Successful operation.
  631. content:
  632. application/json:
  633. schema:
  634. $ref: '#/components/schemas/Batches'
  635. '400':
  636. description: Bad request.
  637. content:
  638. application/json:
  639. schema:
  640. $ref: '#/components/schemas/Error400'
  641. '404':
  642. description: Not found.
  643. content:
  644. application/json:
  645. schema:
  646. $ref: '#/components/schemas/Error404'
  647. '500':
  648. description: Internal server error.
  649. content:
  650. application/json:
  651. schema:
  652. $ref: '#/components/schemas/Error500'
  653. '/batches/{batchNum}':
  654. get:
  655. tags:
  656. - Hermez status
  657. summary: Get a specific batch.
  658. description: >-
  659. Get a specific batch.
  660. operationId: getBatch
  661. parameters:
  662. - name: batchNum
  663. in: path
  664. description: Batch identifier.
  665. required: true
  666. schema:
  667. $ref: '#/components/schemas/BatchNum'
  668. responses:
  669. '200':
  670. description: Successful operation
  671. content:
  672. application/json:
  673. schema:
  674. $ref: '#/components/schemas/Batch'
  675. '400':
  676. description: Bad request.
  677. content:
  678. application/json:
  679. schema:
  680. $ref: '#/components/schemas/Error400'
  681. '404':
  682. description: Not found.
  683. content:
  684. application/json:
  685. schema:
  686. $ref: '#/components/schemas/Error404'
  687. '500':
  688. description: Internal server error.
  689. content:
  690. application/json:
  691. schema:
  692. $ref: '#/components/schemas/Error500'
  693. '/full-batches/{batchNum}':
  694. get:
  695. tags:
  696. - Hermez status
  697. summary: Get a full batch
  698. description: >-
  699. Get a specific batch, including the associated transactions. The object returned in this method can be a bit heavy.
  700. If you're devloping a front end, you may consider using a combinaton of `GET /batches/{batchnum}` and `GET /history-transactions?batchNum={batchNum}`.
  701. operationId: getFullBatch
  702. parameters:
  703. - name: batchNum
  704. in: path
  705. description: Batch identifier
  706. required: true
  707. schema:
  708. $ref: '#/components/schemas/BatchNum'
  709. responses:
  710. '200':
  711. description: successful operation
  712. content:
  713. application/json:
  714. schema:
  715. $ref: '#/components/schemas/FullBatch'
  716. '400':
  717. description: Bad request.
  718. content:
  719. application/json:
  720. schema:
  721. $ref: '#/components/schemas/Error400'
  722. '404':
  723. description: Not found.
  724. content:
  725. application/json:
  726. schema:
  727. $ref: '#/components/schemas/Error404'
  728. '500':
  729. description: Internal server error.
  730. content:
  731. application/json:
  732. schema:
  733. $ref: '#/components/schemas/Error500'
  734. '/slots':
  735. get:
  736. tags:
  737. - Hermez status
  738. summary: Get information about slots.
  739. description: >-
  740. Get information about slots.
  741. operationId: getSlots
  742. parameters:
  743. - name: minSlotNum
  744. in: query
  745. required: false
  746. description: Only include batches with `slotNum < minSlotNum`.
  747. schema:
  748. $ref: '#/components/schemas/SlotNum'
  749. - name: maxSlothNum
  750. in: query
  751. required: false
  752. description: Only include batches with `slotNum > maxSlotNum`.
  753. schema:
  754. $ref: '#/components/schemas/SlotNum'
  755. - name: wonByEthereumAddress
  756. in: query
  757. required: false
  758. description: Only include slots won by a coordinator whose `forgerAddr == wonByEthereumAddress`.
  759. schema:
  760. $ref: '#/components/schemas/EthereumAddress'
  761. - name: finishedAuction
  762. in: query
  763. required: false
  764. description: If set to true, only include slots whose auction has finished.
  765. schema:
  766. type: boolean
  767. - name: offset
  768. in: query
  769. required: false
  770. description: |
  771. - Order: slots will be ordered by increasing `slotNum`.
  772. - Default first item: the first slot to be returned will be the one that has the smallest `slotNum`.
  773. schema:
  774. type: number
  775. - name: last
  776. in: query
  777. required: false
  778. description: Get the last page.
  779. schema:
  780. type: boolean
  781. - name: limit
  782. in: query
  783. required: false
  784. description: Maximum number of items to be returned.
  785. schema:
  786. type: integer
  787. minimum: 1
  788. maximum: 2049
  789. responses:
  790. '200':
  791. description: Successful operation.
  792. content:
  793. application/json:
  794. schema:
  795. $ref: '#/components/schemas/Slots'
  796. '400':
  797. description: Bad request.
  798. content:
  799. application/json:
  800. schema:
  801. $ref: '#/components/schemas/Error400'
  802. '404':
  803. description: Not found.
  804. content:
  805. application/json:
  806. schema:
  807. $ref: '#/components/schemas/Error404'
  808. '500':
  809. description: Internal server error.
  810. content:
  811. application/json:
  812. schema:
  813. $ref: '#/components/schemas/Error500'
  814. '/slots/{slotNum}':
  815. get:
  816. tags:
  817. - Hermez status
  818. summary: Get information about a specific slot.
  819. description: >-
  820. Get information about a specific slot.
  821. operationId: getSlot
  822. parameters:
  823. - name: slotNum
  824. in: path
  825. required: true
  826. description: Identifier of the slot.
  827. schema:
  828. $ref: '#/components/schemas/SlotNum'
  829. responses:
  830. '200':
  831. description: Successful operation.
  832. content:
  833. application/json:
  834. schema:
  835. $ref: '#/components/schemas/Slot'
  836. '400':
  837. description: Bad request.
  838. content:
  839. application/json:
  840. schema:
  841. $ref: '#/components/schemas/Error400'
  842. '404':
  843. description: Not found.
  844. content:
  845. application/json:
  846. schema:
  847. $ref: '#/components/schemas/Error404'
  848. '500':
  849. description: Internal server error.
  850. content:
  851. application/json:
  852. schema:
  853. $ref: '#/components/schemas/Error500'
  854. '/bids':
  855. get:
  856. tags:
  857. - Hermez status
  858. summary: Get a list of bids made for a specific slot auction.
  859. description: Get a list of bids made for a specific slot auction.
  860. operationId: getSlotBids
  861. parameters:
  862. - name: slotNum
  863. in: query
  864. description: Slot identifier. Specify the auction where the returned bids were made.
  865. required: false
  866. schema:
  867. $ref: '#/components/schemas/SlotNum'
  868. - name: forgerAddr
  869. in: query
  870. description: Get only bids made by a coordinator identified by its forger address.
  871. required: false
  872. schema:
  873. $ref: '#/components/schemas/EthereumAddress'
  874. - name: offset
  875. in: query
  876. required: false
  877. description: |
  878. - Order: bids will be ordered by increasing (slotNum, bidValue)`.
  879. - Default first item: the first bid to be returned will be the one that has the smallest (slotNum, bidValue).
  880. schema:
  881. type: number
  882. - name: last
  883. in: query
  884. required: false
  885. description: Get the last page.
  886. schema:
  887. type: boolean
  888. - name: limit
  889. in: query
  890. required: false
  891. description: Maximum number of items to be returned.
  892. schema:
  893. type: integer
  894. minimum: 1
  895. maximum: 2049
  896. responses:
  897. '200':
  898. description: Successful operation
  899. content:
  900. application/json:
  901. schema:
  902. $ref: '#/components/schemas/Bids'
  903. '400':
  904. description: Bad request.
  905. content:
  906. application/json:
  907. schema:
  908. $ref: '#/components/schemas/Error400'
  909. '404':
  910. description: Not found.
  911. content:
  912. application/json:
  913. schema:
  914. $ref: '#/components/schemas/Error404'
  915. '500':
  916. description: Internal server error.
  917. content:
  918. application/json:
  919. schema:
  920. $ref: '#/components/schemas/Error500'
  921. '/next-forgers':
  922. get:
  923. tags:
  924. - Hermez status
  925. summary: Get next coordinators to forge.
  926. description: >-
  927. Return a list of the coordinators that will forge in the next slots.
  928. The response includes the coordinator that is currently forging, and the ones that have won the upcomming slots whose auctions are closed.
  929. operationId: getNextForgers
  930. responses:
  931. '200':
  932. description: Successful operation.
  933. content:
  934. application/json:
  935. schema:
  936. $ref: '#/components/schemas/NextForgers'
  937. '400':
  938. description: Bad request.
  939. content:
  940. application/json:
  941. schema:
  942. $ref: '#/components/schemas/Error400'
  943. '500':
  944. description: Internal server error.
  945. content:
  946. application/json:
  947. schema:
  948. $ref: '#/components/schemas/Error500'
  949. '/state':
  950. get:
  951. tags:
  952. - Hermez status
  953. summary: Return global statistics and metrics of the network.
  954. description: Return global statistics and metrics of the network.
  955. operationId: getState
  956. responses:
  957. '200':
  958. description: Successful operation.
  959. content:
  960. application/json:
  961. schema:
  962. $ref: '#/components/schemas/State'
  963. '400':
  964. description: Bad request.
  965. content:
  966. application/json:
  967. schema:
  968. $ref: '#/components/schemas/Error400'
  969. '500':
  970. description: Internal server error.
  971. content:
  972. application/json:
  973. schema:
  974. $ref: '#/components/schemas/Error500'
  975. '/config':
  976. get:
  977. tags:
  978. - Hermez status
  979. summary: Return constant configuration of the network.
  980. description: Return constant configuration of the network.
  981. operationId: getConfig
  982. responses:
  983. '200':
  984. description: Successful operation.
  985. content:
  986. application/json:
  987. schema:
  988. $ref: '#/components/schemas/Config'
  989. '500':
  990. description: Internal server error.
  991. content:
  992. application/json:
  993. schema:
  994. $ref: '#/components/schemas/Error500'
  995. '/tokens':
  996. get:
  997. tags:
  998. - Hermez status
  999. summary: Get information of the supported tokens in the Hermez network.
  1000. description: Get information of the supported tokens in the Hermez network.
  1001. operationId: getTokens
  1002. parameters:
  1003. - name: ids
  1004. in: query
  1005. required: false
  1006. description: Include only specific tokens by their Hermez identifiers.
  1007. schema:
  1008. type: string
  1009. description: Comma separated list of token identifiers
  1010. example: "2,44,689"
  1011. - name: symbols
  1012. in: query
  1013. required: false
  1014. description: Include only specific tokens by their symbols.
  1015. schema:
  1016. type: string
  1017. description: Comma separated list of token symbols.
  1018. example: "DAI,NEC,UMA"
  1019. - name: name
  1020. in: query
  1021. required: false
  1022. description: Include token(s) by their names (or a substring of the name).
  1023. schema:
  1024. type: string
  1025. - name: offset
  1026. in: query
  1027. required: false
  1028. description: |
  1029. - Order: tokens will be ordered by increasing tokenID.
  1030. - Default first item: the first token to be returned will be the one that has the smallest tokenID.
  1031. schema:
  1032. type: number
  1033. - name: last
  1034. in: query
  1035. required: false
  1036. description: Get the last page.
  1037. schema:
  1038. type: boolean
  1039. - name: limit
  1040. in: query
  1041. required: false
  1042. description: Maximum number of items to be returned.
  1043. schema:
  1044. type: integer
  1045. minimum: 1
  1046. maximum: 2049
  1047. responses:
  1048. '200':
  1049. description: Successful operation.
  1050. content:
  1051. application/json:
  1052. schema:
  1053. $ref: '#/components/schemas/Tokens'
  1054. '400':
  1055. description: Bad request.
  1056. content:
  1057. application/json:
  1058. schema:
  1059. $ref: '#/components/schemas/Error400'
  1060. '404':
  1061. description: Not found.
  1062. content:
  1063. application/json:
  1064. schema:
  1065. $ref: '#/components/schemas/Error404'
  1066. '500':
  1067. description: Internal server error.
  1068. content:
  1069. application/json:
  1070. schema:
  1071. $ref: '#/components/schemas/Error500'
  1072. '/tokens/{id}':
  1073. get:
  1074. tags:
  1075. - Hermez status
  1076. summary: Get information of a token supported by Hermez network.
  1077. description: Get information of a token supported by Hermez network.
  1078. operationId: getToken
  1079. parameters:
  1080. - name: id
  1081. in: path
  1082. description: Token identifier
  1083. required: true
  1084. schema:
  1085. $ref: '#/components/schemas/TokenId'
  1086. responses:
  1087. '200':
  1088. description: Successful operation.
  1089. content:
  1090. application/json:
  1091. schema:
  1092. $ref: '#/components/schemas/Token'
  1093. '400':
  1094. description: Bad request.
  1095. content:
  1096. application/json:
  1097. schema:
  1098. $ref: '#/components/schemas/Error400'
  1099. '404':
  1100. description: Not found.
  1101. content:
  1102. application/json:
  1103. schema:
  1104. $ref: '#/components/schemas/Error404'
  1105. '500':
  1106. description: Internal server error.
  1107. content:
  1108. application/json:
  1109. schema:
  1110. $ref: '#/components/schemas/Error500'
  1111. '/recommended-fee':
  1112. get:
  1113. tags:
  1114. - Hermez status
  1115. summary: Get recommended fee in USD.
  1116. description: >-
  1117. Get recommended fee in USD. Recommended price to pay according to the status of the destination account.
  1118. operationId: getFee
  1119. responses:
  1120. '200':
  1121. description: Successful operation
  1122. content:
  1123. application/json:
  1124. schema:
  1125. $ref: '#/components/schemas/RecommendedFee'
  1126. '500':
  1127. description: Internal server error.
  1128. content:
  1129. application/json:
  1130. schema:
  1131. $ref: '#/components/schemas/Error500'
  1132. '/coordinators':
  1133. get:
  1134. tags:
  1135. - Hermez status
  1136. summary: Get information about coordinators.
  1137. description: Get information about coordinators.
  1138. operationId: getCoordinators
  1139. parameters:
  1140. - name: offset
  1141. in: query
  1142. required: false
  1143. description: |
  1144. - Order: coordinators will be ordered by increasing (ethereumBlock, forgerAddr).
  1145. - Default first item: the first token to be returned will be the one that has the smallest (ethereumBlock, forgerAddr).
  1146. schema:
  1147. type: number
  1148. - name: last
  1149. in: query
  1150. required: false
  1151. description: Get the last page.
  1152. schema:
  1153. type: boolean
  1154. - name: limit
  1155. in: query
  1156. required: false
  1157. description: Maximum number of items to be returned.
  1158. schema:
  1159. type: integer
  1160. minimum: 1
  1161. maximum: 2049
  1162. responses:
  1163. '200':
  1164. description: Successful operation.
  1165. content:
  1166. application/json:
  1167. schema:
  1168. $ref: '#/components/schemas/Coordinators'
  1169. '400':
  1170. description: Bad request.
  1171. content:
  1172. application/json:
  1173. schema:
  1174. $ref: '#/components/schemas/Error400'
  1175. '500':
  1176. description: Internal server error.
  1177. content:
  1178. application/json:
  1179. schema:
  1180. $ref: '#/components/schemas/Error500'
  1181. '/coordinators/{forgerAddr}':
  1182. get:
  1183. tags:
  1184. - Hermez status
  1185. summary: Get the information of a coordinator.
  1186. description: Get the information of a coordinator.
  1187. operationId: getCoordinator
  1188. parameters:
  1189. - name: forgerAddr
  1190. in: path
  1191. description: Coordinator identifier
  1192. required: true
  1193. schema:
  1194. $ref: '#/components/schemas/EthereumAddress'
  1195. responses:
  1196. '200':
  1197. description: Successful operation.
  1198. content:
  1199. application/json:
  1200. schema:
  1201. $ref: '#/components/schemas/Coordinator'
  1202. '400':
  1203. description: Bad request.
  1204. content:
  1205. application/json:
  1206. schema:
  1207. $ref: '#/components/schemas/Error400'
  1208. '404':
  1209. description: Not found.
  1210. content:
  1211. application/json:
  1212. schema:
  1213. $ref: '#/components/schemas/Error404'
  1214. '500':
  1215. description: Internal server error.
  1216. content:
  1217. application/json:
  1218. schema:
  1219. $ref: '#/components/schemas/Error500'
  1220. components:
  1221. schemas:
  1222. PoolL2Transaction:
  1223. type: object
  1224. properties:
  1225. id:
  1226. $ref: '#/components/schemas/TransactionId'
  1227. type:
  1228. $ref: '#/components/schemas/TransactionType'
  1229. fromAccountIndex:
  1230. $ref: '#/components/schemas/AccountIndex'
  1231. toAccountIndex:
  1232. allOf:
  1233. - $ref: '#/components/schemas/AccountIndex'
  1234. - example: "hez:DAI:672"
  1235. toEthereumAddress:
  1236. $ref: '#/components/schemas/HermezEthereumAddress'
  1237. toBjj:
  1238. $ref: '#/components/schemas/BJJ'
  1239. tokenId:
  1240. $ref: '#/components/schemas/TokenId'
  1241. USD:
  1242. type: number
  1243. description: Value of the token in USD.
  1244. example: 4.53
  1245. fiatUpdate:
  1246. type: string
  1247. format: date-time
  1248. description: Timestamp of the moment the `USD` value was updated.
  1249. amount:
  1250. allOf:
  1251. - $ref: '#/components/schemas/BigInt'
  1252. - description: Amount of tokens to be sent.
  1253. example: "63"
  1254. fee:
  1255. $ref: '#/components/schemas/FeeSelector'
  1256. feeUSD:
  1257. type: number
  1258. description: Fee in USD.
  1259. example: 0.75
  1260. nonce:
  1261. $ref: '#/components/schemas/Nonce'
  1262. state:
  1263. $ref: '#/components/schemas/PoolL2TransactionState'
  1264. signature:
  1265. allOf:
  1266. - $ref: '#/components/schemas/Signature'
  1267. - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
  1268. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1269. timestamp:
  1270. type: string
  1271. description: Moment in which the transaction was added to the pool.
  1272. format: date-time
  1273. batchNum:
  1274. allOf:
  1275. - $ref: '#/components/schemas/BatchNum'
  1276. - nullable: true
  1277. - example: 5432
  1278. requestFromAccountIndex:
  1279. allOf:
  1280. - $ref: '#/components/schemas/AccountIndex'
  1281. - nullable: true
  1282. - example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1283. requestToAccountIndex:
  1284. allOf:
  1285. - $ref: '#/components/schemas/AccountIndex'
  1286. - nullable: true
  1287. - example: "hez:DAI:33"
  1288. requestToEthereumAddress:
  1289. allOf:
  1290. - $ref: '#/components/schemas/HermezEthereumAddress'
  1291. - nullable: true
  1292. - example: "hez:0xbb942cfcd25ad4d90a62358b0dd84f33b3982699"
  1293. requestToBJJ:
  1294. allOf:
  1295. - $ref: '#/components/schemas/BJJ'
  1296. - nullable: true
  1297. - example: "hez:HVrB8xQHAYt9QTpPUsj3RGOzDmrCI4IgrYslTeTqo6Ix"
  1298. requestTokenId:
  1299. allOf:
  1300. - $ref: '#/components/schemas/TokenId'
  1301. - nullable: true
  1302. - example: 4444
  1303. requestAmount:
  1304. allOf:
  1305. - $ref: '#/components/schemas/BigInt'
  1306. - description: Amount of tokens to be sent.
  1307. - example: "7"
  1308. - nullable: true
  1309. requestFee:
  1310. allOf:
  1311. - $ref: '#/components/schemas/FeeSelector'
  1312. - nullable: true
  1313. - example: 8
  1314. requestNonce:
  1315. allOf:
  1316. - $ref: '#/components/schemas/Nonce'
  1317. - nullable: true
  1318. - example: 6
  1319. tokenSymbol:
  1320. $ref: '#/components/schemas/TokenSymbol'
  1321. required:
  1322. - fromAccountIndex
  1323. - toAccountIndex
  1324. - toEthereumAddress
  1325. - toBjj
  1326. - tokenId
  1327. - amount
  1328. - fee
  1329. - nonce
  1330. - signature
  1331. TransactionId:
  1332. type: string
  1333. 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)
  1334. example: "0x0040e2010000000000470000"
  1335. EthereumAddress:
  1336. type: string
  1337. description: "Address of an Etherum account."
  1338. pattern: "^0x[a-fA-F0-9]{40}$"
  1339. example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1340. HermezEthereumAddress:
  1341. type: string
  1342. description: "Address of an Etherum account linked to the Hermez network."
  1343. pattern: "^hez:0x[a-fA-F0-9]{40}$"
  1344. example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1345. BJJ:
  1346. type: string
  1347. description: "BabyJubJub public key, encoded as base64, which result in 33 bytes (last byte used as checksum)."
  1348. pattern: "^hez:[A-Za-z0-9_-]{44}$"
  1349. example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
  1350. AccountIndex:
  1351. type: string
  1352. description: >-
  1353. Identifier of an account. It references the position where the account is inside the state Merkle tree.
  1354. The identifier is built using: `hez:` + `token symbol:` + `index`
  1355. example: "hez:DAI:4444"
  1356. TransactionType:
  1357. type: string
  1358. description: Type of transaction.
  1359. enum:
  1360. - Exit
  1361. - Withdrawn
  1362. - Transfer
  1363. - Deposit
  1364. - CreateAccountDeposit
  1365. - CreateAccountDepositTransfer
  1366. - DepositTransfer
  1367. - ForceTransfer
  1368. - ForceExit
  1369. - TransferToEthAddr
  1370. - TransferToBJJ
  1371. TokenId:
  1372. type: integer
  1373. description: Identifier of a token registered in the network.
  1374. minimum: 0
  1375. maximum: 4294967295
  1376. example: 4444
  1377. BigInt:
  1378. type: string
  1379. description: BigInt is an integer encoded as a string for numbers that are very large.
  1380. example: "870885693"
  1381. FeeSelector:
  1382. type: integer
  1383. description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
  1384. minimum: 0
  1385. maximum: 256
  1386. example: 36
  1387. Nonce:
  1388. type: integer
  1389. description: Number that can only be used once per account, increments by one at each transaction.
  1390. minimum: 0
  1391. maximum: 1.84467440737096e+19
  1392. example: 121
  1393. PoolL2TransactionState:
  1394. type: string
  1395. description: >
  1396. State of a L2 transaction from the coordinator pool.
  1397. * pend: Pending
  1398. * fing: Forging
  1399. * fged: Forged
  1400. * invl: Invalid
  1401. enum:
  1402. - pend
  1403. - fing
  1404. - fged
  1405. - invl
  1406. Signature:
  1407. type: string
  1408. description: BabyJubJub compressed signature.
  1409. pattern: "^[a-fA-F0-9]{128}$"
  1410. example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1411. BatchNum:
  1412. type: integer
  1413. description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
  1414. minimum: 0
  1415. maximum: 4294967295
  1416. example: 5432
  1417. AccountCreationAuthorization:
  1418. type: object
  1419. properties:
  1420. timestamp:
  1421. type: string
  1422. format: date-time
  1423. ethereumAddress:
  1424. $ref: '#/components/schemas/HermezEthereumAddress'
  1425. bjj:
  1426. $ref: '#/components/schemas/BJJ'
  1427. signature:
  1428. allOf:
  1429. - $ref: '#/components/schemas/Signature'
  1430. - description: Signature of the auth message. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=regular-rollup-account).
  1431. - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
  1432. required:
  1433. - ethereumAddress
  1434. - bjj
  1435. - signature
  1436. HistoryTransaction:
  1437. type: object
  1438. description: Transaction of the Hermez network
  1439. properties:
  1440. L1orL2:
  1441. type: string
  1442. enum:
  1443. - L1
  1444. - L2
  1445. id:
  1446. $ref: '#/components/schemas/TransactionId'
  1447. type:
  1448. $ref: '#/components/schemas/TransactionType'
  1449. position:
  1450. $ref: '#/components/schemas/TransactionPosition'
  1451. fromAccountIndex:
  1452. $ref: '#/components/schemas/AccountIndex'
  1453. toAccountIndex:
  1454. allOf:
  1455. - $ref: '#/components/schemas/AccountIndex'
  1456. - example: "hez:DAI:672"
  1457. amount:
  1458. allOf:
  1459. - $ref: '#/components/schemas/BigInt'
  1460. - description: Amount of tokens to be sent.
  1461. - example: "49"
  1462. batchNum:
  1463. type: integer
  1464. description: Batch in which the transaction was forged. Null indicates not forged yet.
  1465. minimum: 0
  1466. maximum: 4294967295
  1467. example: 5432
  1468. nullable: true
  1469. tokenId:
  1470. $ref: '#/components/schemas/TokenId'
  1471. tokenSymbol:
  1472. $ref: '#/components/schemas/TokenSymbol'
  1473. historicUSD:
  1474. type: number
  1475. description: Value in USD at the moment the transaction was forged.
  1476. example: 49.7
  1477. currentUSD:
  1478. type: number
  1479. description: Value in USD at the current token/USD conversion.
  1480. example: 50.01
  1481. fiatUpdate:
  1482. type: string
  1483. format: date-time
  1484. description: Timestamp of the moment the `currentUSD` value was updated.
  1485. timestamp:
  1486. type: string
  1487. format: date-time
  1488. 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.
  1489. L1Info:
  1490. type: object
  1491. description: Additional information that only applies to L1 transactions.
  1492. nullable: true
  1493. properties:
  1494. toForgeL1TransactionsNum:
  1495. $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1496. userOrigin:
  1497. type: boolean
  1498. description: True if the transaction was sent by a user. False if it was sent by a coordinator.
  1499. fromEthereumAddress:
  1500. $ref: '#/components/schemas/HermezEthereumAddress'
  1501. fromBJJ:
  1502. $ref: '#/components/schemas/BJJ'
  1503. loadAmount:
  1504. allOf:
  1505. - $ref: '#/components/schemas/BigInt'
  1506. - description: Tokens transfered from L1 to L2.
  1507. - example: "49"
  1508. loadAmountUSD:
  1509. type: number
  1510. description: Load amount in USD, at the moment the transaction was made.
  1511. example: 3.897
  1512. ethereumBlockNum:
  1513. allOf:
  1514. - $ref: '#/components/schemas/EthBlockNum'
  1515. - description: Ethereum block in which the transaction was added to the smart contract forge queue.
  1516. - example: 258723049
  1517. required:
  1518. - toForgeL1TransactionsNum
  1519. - userOrigin
  1520. - fromEthereumAddress
  1521. - fromBJJ
  1522. - loadAmount
  1523. - loadAmountUSD
  1524. - ethereumBlockNum
  1525. additionalProperties: false
  1526. L2Info:
  1527. type: object
  1528. description: Additional information that only applies to L2 transactions.
  1529. nullable: true
  1530. properties:
  1531. fee:
  1532. $ref: '#/components/schemas/FeeSelector'
  1533. feeUSD:
  1534. type: number
  1535. description: Fee in USD, at the moment the transaction was forged.
  1536. example: 263.89
  1537. nonce:
  1538. $ref: '#/components/schemas/Nonce'
  1539. example: null
  1540. required:
  1541. - fee
  1542. - feeUSD
  1543. - nonce
  1544. additionalProperties: false
  1545. required:
  1546. - L1orL2
  1547. - id
  1548. - type
  1549. - position
  1550. - fromAccountIndex
  1551. - toAccountIndex
  1552. - amount
  1553. - batchNum
  1554. - tokenId
  1555. - tokenSymbol
  1556. - historicUSD
  1557. - currentUSD
  1558. - fiatUpdate
  1559. - timestamp
  1560. - L1Info
  1561. - L2Info
  1562. additionalProperties: false
  1563. HistoryTransactions:
  1564. type: object
  1565. properties:
  1566. transactions:
  1567. type: array
  1568. description: List of history transactions.
  1569. items:
  1570. $ref: '#/components/schemas/HistoryTransaction'
  1571. pagination:
  1572. $ref: '#/components/schemas/PaginationInfo'
  1573. required:
  1574. - transactions
  1575. - pagination
  1576. additionalProperties: false
  1577. EthBlockNum:
  1578. type: integer
  1579. description: Ethereum block number
  1580. minimum: 0
  1581. maximum: 1.84467440737096e+19
  1582. example: 762375478
  1583. ToForgeL1TransactionsNum:
  1584. type: integer
  1585. description: Reference to know in which batch a L1 transaction was forged / will be forged.
  1586. minimum: 0
  1587. maximum: 4294967295
  1588. example: 784
  1589. TransactionPosition:
  1590. type: integer
  1591. description: Position that a transaction occupies in a batch.
  1592. minimum: 0
  1593. example: 5
  1594. URL:
  1595. type: string
  1596. description: HTTP URL
  1597. example: "https://hermez.io"
  1598. TokenSymbol:
  1599. type: string
  1600. description: Abreviation of the token name.
  1601. example: "DAI"
  1602. TokenName:
  1603. type: string
  1604. description: Token name.
  1605. example: "Dai"
  1606. CollectedFees:
  1607. type: array
  1608. description: Collected fees by the forger of the batch. A maximum of 64 different tokens can be used.
  1609. items:
  1610. type: object
  1611. properties:
  1612. tokenId:
  1613. $ref: '#/components/schemas/TokenId'
  1614. tokenSymbol:
  1615. $ref: '#/components/schemas/TokenSymbol'
  1616. amount:
  1617. allOf:
  1618. - $ref: '#/components/schemas/BigInt'
  1619. - description: Ammount of collected tokens
  1620. - example: "53"
  1621. Batch:
  1622. type: object
  1623. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1624. properties:
  1625. batchNum:
  1626. $ref: '#/components/schemas/BatchNum'
  1627. ethereumBlockNum:
  1628. $ref: '#/components/schemas/EthBlockNum'
  1629. forgerAddr:
  1630. $ref: '#/components/schemas/EthereumAddress'
  1631. collectedFees:
  1632. $ref: '#/components/schemas/CollectedFees'
  1633. totalCollectedFeesUSD:
  1634. type: number
  1635. description: Sum of the all the fees collected, in USD.
  1636. example: 23.3
  1637. stateRoot:
  1638. allOf:
  1639. - $ref: '#/components/schemas/Hash'
  1640. - description: Root of the accounts Merkle Tree.
  1641. - example: "2734657026572a8708d883"
  1642. numAccounts:
  1643. type: integer
  1644. description: Number of registered accounts in this batch.
  1645. exitRoot:
  1646. allOf:
  1647. - $ref: '#/components/schemas/Hash'
  1648. - description: Root of the exit Merkle Tree associated to this batch.
  1649. - example: "2734657026572a8708d883"
  1650. forgeL1TransactionsNum:
  1651. allOf:
  1652. - $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1653. - description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  1654. - nullable: true
  1655. - example: 5
  1656. slotNum:
  1657. $ref: '#/components/schemas/SlotNum'
  1658. FullBatch:
  1659. type: object
  1660. description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
  1661. properties:
  1662. batchNum:
  1663. $ref: '#/components/schemas/BatchNum'
  1664. forgerAddr:
  1665. $ref: '#/components/schemas/EthereumAddress'
  1666. collectedFees:
  1667. $ref: '#/components/schemas/CollectedFees'
  1668. ethereumBlockNum:
  1669. $ref: '#/components/schemas/EthBlockNum'
  1670. stateRoot:
  1671. allOf:
  1672. - $ref: '#/components/schemas/Hash'
  1673. - description: Root of the accounts Merkle Tree.
  1674. - example: "2734657026572a8708d883"
  1675. numAccounts:
  1676. type: integer
  1677. description: Number of registered accounts in this batch.
  1678. exitRoot:
  1679. allOf:
  1680. - $ref: '#/components/schemas/Hash'
  1681. - description: Root of the exit Merkle Tree associated to this batch.
  1682. - example: "2734657026572a8708d883"
  1683. forgeL1TransactionsNum:
  1684. allOf:
  1685. - $ref: '#/components/schemas/ToForgeL1TransactionsNum'
  1686. - description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
  1687. - nullable: true
  1688. - example: 9
  1689. slotNum:
  1690. $ref: '#/components/schemas/SlotNum'
  1691. transactions:
  1692. type: array
  1693. description: List of forged transactions in the batch
  1694. items:
  1695. $ref: '#/components/schemas/HistoryTransaction'
  1696. Hash:
  1697. type: string
  1698. description: hashed data
  1699. example: "2734657026572a8708d883"
  1700. SlotNum:
  1701. type: integer
  1702. description: Identifier of a slot.
  1703. minimum: 0
  1704. maximum: 4294967295
  1705. example: 784
  1706. Batches:
  1707. type: object
  1708. properties:
  1709. batches:
  1710. type: array
  1711. description: List of batches.
  1712. items:
  1713. $ref: '#/components/schemas/Batch'
  1714. pagination:
  1715. $ref: '#/components/schemas/PaginationInfo'
  1716. Coordinator:
  1717. type: object
  1718. properties:
  1719. forgerAddr:
  1720. $ref: '#/components/schemas/EthereumAddress'
  1721. withdrawAddr:
  1722. $ref: '#/components/schemas/EthereumAddress'
  1723. URL:
  1724. $ref: '#/components/schemas/URL'
  1725. ethereumBlock:
  1726. allOf:
  1727. - $ref: '#/components/schemas/EthBlockNum'
  1728. - description: Ethereum block in which the coordinator registered into the network.
  1729. - example: 5735943738
  1730. Coordinators:
  1731. type: object
  1732. properties:
  1733. coordinators:
  1734. type: array
  1735. description: List of coordinators.
  1736. items:
  1737. $ref: '#/components/schemas/Coordinator'
  1738. pagination:
  1739. $ref: '#/components/schemas/PaginationInfo'
  1740. Bid:
  1741. type: object
  1742. description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
  1743. properties:
  1744. forgerAddr:
  1745. $ref: '#/components/schemas/EthereumAddress'
  1746. withdrawAddr:
  1747. $ref: '#/components/schemas/EthereumAddress'
  1748. URL:
  1749. $ref: '#/components/schemas/URL'
  1750. bidValue:
  1751. $ref: '#/components/schemas/BigInt'
  1752. ethereumBlockNum:
  1753. $ref: '#/components/schemas/EthBlockNum'
  1754. timestamp:
  1755. type: string
  1756. format: date-time
  1757. Bids:
  1758. type: object
  1759. properties:
  1760. bids:
  1761. type: array
  1762. description: List of bids.
  1763. items:
  1764. $ref: '#/components/schemas/Bid'
  1765. pagination:
  1766. $ref: '#/components/schemas/PaginationInfo'
  1767. RecommendedFee:
  1768. type: object
  1769. description: Fee that the coordinator recommends per transaction in USD.
  1770. properties:
  1771. existingAccount:
  1772. type: number
  1773. description: Recommended fee if the destination account of the transaction already exists.
  1774. minimum: 0
  1775. example: 0.1
  1776. createAccount:
  1777. type: number
  1778. 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.
  1779. minimum: 0
  1780. example: 1.3
  1781. createAccountInternal:
  1782. type: number
  1783. 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 to an Ethereum address and therefore can only operate in L2.
  1784. minimum: 0
  1785. example: 0.5
  1786. Token:
  1787. type: object
  1788. description: Hermez network compatible and registered token.
  1789. properties:
  1790. id:
  1791. $ref: '#/components/schemas/TokenId'
  1792. ethereumAddress:
  1793. allOf:
  1794. - $ref: '#/components/schemas/EthereumAddress'
  1795. - description: Ethereum address in which the token is deployed.
  1796. - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
  1797. name:
  1798. type: string
  1799. description: full name of the token
  1800. example: Maker Dai
  1801. symbol:
  1802. allOf:
  1803. - $ref: '#/components/schemas/TokenSymbol'
  1804. - example: DAI
  1805. decimals:
  1806. type: integer
  1807. description: Number of decimals of the token.
  1808. example: 5
  1809. ethereumBlockNum:
  1810. allOf:
  1811. - $ref: '#/components/schemas/EthBlockNum'
  1812. - description: Ethereum block number in which the token was added to the Hermez network.
  1813. - example: 539847538
  1814. USD:
  1815. type: number
  1816. description: Value of the token in USD.
  1817. example: 4.53
  1818. fiatUpdate:
  1819. type: string
  1820. format: date-time
  1821. description: Timestamp of the moment the `USD` value was updated.
  1822. Tokens:
  1823. type: object
  1824. properties:
  1825. tokens:
  1826. type: array
  1827. description: List of tokens.
  1828. items:
  1829. $ref: '#/components/schemas/Token'
  1830. pagination:
  1831. $ref: '#/components/schemas/PaginationInfo'
  1832. Exit:
  1833. type: object
  1834. description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
  1835. properties:
  1836. batchNum:
  1837. allOf:
  1838. - $ref: '#/components/schemas/BatchNum'
  1839. - description: Batch in which the exit was forged.
  1840. - example: 7394
  1841. accountIndex:
  1842. $ref: '#/components/schemas/AccountIndex'
  1843. merkleProof:
  1844. type: string
  1845. description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
  1846. example: "0x347089321de8971320489793a823470918fffeab"
  1847. balance:
  1848. $ref: '#/components/schemas/BigInt'
  1849. nullifier:
  1850. $ref: '#/components/schemas/BigInt'
  1851. instantWithdrawn:
  1852. allOf:
  1853. - $ref: '#/components/schemas/EthBlockNum'
  1854. - description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
  1855. - example: 74747363
  1856. delayedWithdrawRequest:
  1857. allOf:
  1858. - $ref: '#/components/schemas/EthBlockNum'
  1859. - description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
  1860. - example: null
  1861. delayedWithdrawn:
  1862. allOf:
  1863. - $ref: '#/components/schemas/EthBlockNum'
  1864. - 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.
  1865. - example: null
  1866. Exits:
  1867. type: object
  1868. properties:
  1869. exits:
  1870. type: array
  1871. description: List of exits.
  1872. items:
  1873. $ref: '#/components/schemas/Exit'
  1874. pagination:
  1875. $ref: '#/components/schemas/PaginationInfo'
  1876. Account:
  1877. type: object
  1878. description: State tree leaf. It contains balance and nonce of an account.
  1879. properties:
  1880. accountIndex:
  1881. $ref: '#/components/schemas/AccountIndex'
  1882. tokenId:
  1883. $ref: '#/components/schemas/TokenId'
  1884. tokenSymbol:
  1885. $ref: '#/components/schemas/TokenSymbol'
  1886. tokenName:
  1887. $ref: '#/components/schemas/TokenName'
  1888. nonce:
  1889. $ref: '#/components/schemas/Nonce'
  1890. balance:
  1891. $ref: '#/components/schemas/BigInt'
  1892. balanceUSD:
  1893. type: integer
  1894. description: Balance of the account in USD
  1895. example: 1304
  1896. bjj:
  1897. $ref: '#/components/schemas/BJJ'
  1898. ethereumAddress:
  1899. $ref: '#/components/schemas/HermezEthereumAddress'
  1900. Accounts:
  1901. type: object
  1902. properties:
  1903. accounts:
  1904. type: array
  1905. description: List of accounts.
  1906. items:
  1907. $ref: '#/components/schemas/Account'
  1908. pagination:
  1909. $ref: '#/components/schemas/PaginationInfo'
  1910. Slot:
  1911. type: object
  1912. description: Slot information.
  1913. properties:
  1914. slotNum:
  1915. $ref: '#/components/schemas/SlotNum'
  1916. firstBlock:
  1917. allOf:
  1918. - $ref: '#/components/schemas/EthBlockNum'
  1919. - description: Block in which the slot began or will begin
  1920. - example: 76238647846
  1921. lastBlock:
  1922. allOf:
  1923. - $ref: '#/components/schemas/EthBlockNum'
  1924. - description: Block in which the slot ended or will end
  1925. - example: 4475934
  1926. closedAuction:
  1927. type: boolean
  1928. description: Whether the auction of the slot has finished or not.
  1929. winner:
  1930. allOf:
  1931. - $ref: '#/components/schemas/Coordinator'
  1932. - description: Coordinator who won the auction. Only applicable if the auction is closed.
  1933. - nullable: true
  1934. - example: null
  1935. batchNums:
  1936. type: array
  1937. description: List of batch numbers that were forged during the slot
  1938. items:
  1939. $ref: '#/components/schemas/BatchNum'
  1940. Slots:
  1941. type: object
  1942. properties:
  1943. nextForgers:
  1944. type: array
  1945. description: List of slots.
  1946. items:
  1947. $ref: '#/components/schemas/Slot'
  1948. pagination:
  1949. $ref: '#/components/schemas/PaginationInfo'
  1950. NextForger:
  1951. type: object
  1952. description: Coordinator information along with the scheduled forging period
  1953. properties:
  1954. coordinator:
  1955. $ref: '#/components/schemas/Coordinator'
  1956. period:
  1957. type: object
  1958. description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
  1959. properties:
  1960. fromBlock:
  1961. $ref: '#/components/schemas/EthBlockNum'
  1962. toBlock:
  1963. $ref: '#/components/schemas/EthBlockNum'
  1964. fromTimestamp:
  1965. type: string
  1966. format: date-time
  1967. toTimestamp:
  1968. type: string
  1969. format: date-time
  1970. NextForgers:
  1971. type: object
  1972. properties:
  1973. nextForgers:
  1974. type: array
  1975. description: List of next coordinators to forge.
  1976. items:
  1977. $ref: '#/components/schemas/NextForger'
  1978. pagination:
  1979. $ref: '#/components/schemas/PaginationInfo'
  1980. State:
  1981. type: object
  1982. description: Gobal statistics of the network.
  1983. properties:
  1984. lastBlock:
  1985. allOf:
  1986. - $ref: '#/components/schemas/EthBlockNum'
  1987. - description: Last synchronized Etherum block.
  1988. - example: 3457437
  1989. lastBatch:
  1990. allOf:
  1991. - $ref: '#/components/schemas/BatchNum'
  1992. - description: Last batch that has been forged.
  1993. - example: 76523
  1994. currentSlot:
  1995. allOf:
  1996. - $ref: '#/components/schemas/SlotNum'
  1997. - description: Slot where batches are currently being forged.
  1998. - example: 2334
  1999. transactionsPerBatch:
  2000. type: number
  2001. description: Average transactions per batch in the last 24 hours.
  2002. example: 2002.7
  2003. batchFrequency:
  2004. type: number
  2005. description: Average elapsed time between batches in the last 24 hours, in seconds.
  2006. example: 8.9
  2007. transactionsPerSecond:
  2008. type: number
  2009. description: Average transactions per second in the last 24 hours.
  2010. example: 302.3
  2011. totalAccounts:
  2012. type: integer
  2013. description: Number of created accounts.
  2014. example: 90473
  2015. totalBJJs:
  2016. type: integer
  2017. description: Number of different registered BJJs.
  2018. example: 23067
  2019. avgTransactionFee:
  2020. type: number
  2021. description: Average fee percentage paid for L2 transactions in the last 24 hours.
  2022. example: 1.54
  2023. governance:
  2024. type: object
  2025. description: Network setings that are updatable by the governance.
  2026. properties:
  2027. rollup:
  2028. type: object
  2029. description: Rollup parameters.
  2030. properties:
  2031. forgeTimeout:
  2032. type: integer
  2033. description: Time delay between the beggining of a slot and the beggining of the period in which anyone can forge if the auction winner of the slot hasn't forged any batch yet. Time is measured in Ethereum blocks.
  2034. example: 5
  2035. feeAddToken:
  2036. type: integer
  2037. description: fee to pay when registering tokens into the network.
  2038. example: 5698
  2039. auction:
  2040. type: object
  2041. description: Auction parameters.
  2042. properties:
  2043. bootCoordinator:
  2044. allOf:
  2045. - $ref: '#/components/schemas/EthereumAddress'
  2046. - description: Ethereum address of the boot coordinator.
  2047. slotDeadline:
  2048. type: integer
  2049. description: Number of blocks at the end of a slot in which any coordinator can forge if the winner has not forged one before.
  2050. example: 3
  2051. closedAuctionSlots:
  2052. type: integer
  2053. 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.
  2054. example: 2
  2055. openAuctionSlots:
  2056. type: integer
  2057. description: How many days in advance are auctions opened.
  2058. defaultSlotSetBid:
  2059. type: array
  2060. 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]`."
  2061. items:
  2062. type: integer
  2063. example: [32,0,68,21,55,99]
  2064. outbidding:
  2065. type: number
  2066. description: Minimum outbid over the previous one to consider it valid.
  2067. example: 3.64
  2068. donationAddress:
  2069. allOf:
  2070. - $ref: '#/components/schemas/EthereumAddress'
  2071. - description: Ethereum address where the donations will go to.
  2072. allocationRatio:
  2073. type: array
  2074. description: Percentage in which fees will be splitted between donations, governance and burning. The sum of the tree values should be 100.
  2075. items:
  2076. type: integer
  2077. example: [80,10,10]
  2078. withdrawalDelayer:
  2079. type: object
  2080. description: Withdrawal delayer parameters.
  2081. properties:
  2082. rollupAddress:
  2083. allOf:
  2084. - $ref: '#/components/schemas/EthereumAddress'
  2085. - description: Ethereum address of the rollup smart contract.
  2086. governanceAddress:
  2087. allOf:
  2088. - $ref: '#/components/schemas/EthereumAddress'
  2089. - description: Ethereum address of the governance mechanism.
  2090. whitheHackerGroupAddress:
  2091. allOf:
  2092. - $ref: '#/components/schemas/EthereumAddress'
  2093. - description: Ethereum Address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
  2094. keeperAddress:
  2095. allOf:
  2096. - $ref: '#/components/schemas/EthereumAddress'
  2097. - description: Ethereum Address that can enable emergency mode and modify the delay to make a withdrawal.
  2098. withdrawalDelay:
  2099. allOf:
  2100. - $ref: '#/components/schemas/EthBlockNum'
  2101. - description: The time that anyone needs to wait until a withdrawal of the funds is allowed, in Ethereum blocks.
  2102. emergencyModeStartingTime:
  2103. type: integer
  2104. description: Ethereum block in which the emergency mode will be activated.
  2105. example: 10
  2106. emergencyMode:
  2107. type: boolean
  2108. description: Indicates if emergency mode has been activated.
  2109. PaginationInfo:
  2110. type: object
  2111. description: Give pagination information
  2112. properties:
  2113. totalItems:
  2114. type: integer
  2115. description: Amount of items that the endpoint can return given the filters and the current state of the database.
  2116. example: 2048
  2117. lastReturnedItem:
  2118. type: integer
  2119. description: Index of the last returned item. Useful to query next items.
  2120. example: 439
  2121. Config:
  2122. type: object
  2123. description: Configuration parameters of the different smart contracts that power the Hermez network.
  2124. properties:
  2125. hermez:
  2126. type: object
  2127. description: Constant configuration of the Hermez smart contract.
  2128. properties:
  2129. HEZTokenAddress:
  2130. allOf:
  2131. - $ref: '#/components/schemas/EthereumAddress'
  2132. - description: Ethereum address of the HEZ token.
  2133. maxTxVerifiers:
  2134. type: integer
  2135. description: Maximum transactions of the verifiers.
  2136. example: 100
  2137. maxLoadAmount:
  2138. type: integer
  2139. description: Maximum load amount (L1 to L2) allowed.
  2140. example: 321
  2141. maxAmount:
  2142. type: integer
  2143. description: Maximum amount (L2 to L2) allowed.
  2144. example: 837
  2145. maxTokens:
  2146. type: integer
  2147. description: Maximum number of different tokens that can be registered in the network.
  2148. example: 4294967295
  2149. reservedAccountIndex:
  2150. type: integer
  2151. description: First user index. Bellow this number the indexes are reserved for the protocol.
  2152. example: 256
  2153. lastAccountIndex:
  2154. type: integer
  2155. description: Biggest account index that can be registered.
  2156. example: 4294967295
  2157. exitAccountIndex:
  2158. type: integer
  2159. description: Account index used to indicate that a transaction is an `exit` or `force exit`.
  2160. example: 1
  2161. L1CoordinatorBytes:
  2162. type: integer
  2163. description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
  2164. example: 23
  2165. L1UserBytes:
  2166. type: integer
  2167. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2168. example: 32
  2169. L2Bytes:
  2170. type: integer
  2171. description: Number of bytes that a L2 transaction has ([4 bytes] fromIdx + [4 bytes] toIdx + [2 bytes] amountFloat16 + [1 bytes] fee).
  2172. example: 33
  2173. maxL1Transactions:
  2174. type: integer
  2175. description: Maximum L1 transactions allowed to be queued in a batch.
  2176. example: 128
  2177. maxL1UserTransactions:
  2178. type: integer
  2179. description: Maximum L1 transactions allowed to be queued in a batch by users (anyone who is not a coordinator).
  2180. example: 32
  2181. RField:
  2182. allOf:
  2183. - $ref: '#/components/schemas/BigInt'
  2184. - description: Modulus zkSNARK.
  2185. withdrawManager:
  2186. type: object
  2187. description: Constant configuration of the withdraw manager smart contract.
  2188. properties:
  2189. noLimit:
  2190. type: integer
  2191. description: Reserved bucket index when the token value is 0 USD.
  2192. example: 0
  2193. amountOfBuckets:
  2194. type: integer
  2195. description: Number of buckets
  2196. maxWithdrawalDelay:
  2197. type: integer
  2198. description: Maximum delay to withdraw tokens. Time is measured in Ethereum blocks.
  2199. auction:
  2200. type: object
  2201. description: Constant configuration of the auction smart contract.
  2202. properties:
  2203. HEZTokenAddress:
  2204. allOf:
  2205. - $ref: '#/components/schemas/EthereumAddress'
  2206. - description: Ethereum address of the HEZ token.
  2207. rollupAddress:
  2208. allOf:
  2209. - $ref: '#/components/schemas/EthereumAddress'
  2210. - description: Ethereum address of the rollup smart contract.
  2211. genesisBlockNum:
  2212. allOf:
  2213. - $ref: '#/components/schemas/EthBlockNum'
  2214. - description: Ethereum block number in which the smart contract starts operating.
  2215. delayGenesis:
  2216. type: integer
  2217. description: Time delay between `genesisBlockNum` and the beginning of the first block. Time is measured in Ethereum blocks.
  2218. blocksPerSlot:
  2219. type: integer
  2220. description: Blocks per slot.
  2221. initialMinimalBidding:
  2222. type: integer
  2223. description: Minimum bid when no one has bid yet.
  2224. withdrawalDelayer:
  2225. type: object
  2226. description: Constant configuration of the withdrawal delayer smart contract.
  2227. properties:
  2228. maxWithdrawalDelay:
  2229. type: integer
  2230. description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in Ethereum blocks.
  2231. example: 200
  2232. maxEmergencyModeTime:
  2233. type: integer
  2234. description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in Ethereum blocks.
  2235. example: 2000
  2236. Error:
  2237. type: object
  2238. description: Error response.
  2239. properties:
  2240. message:
  2241. type: string
  2242. Error400:
  2243. allOf:
  2244. - $ref: '#/components/schemas/Error'
  2245. - example:
  2246. message: Invalid signature.
  2247. Error404:
  2248. allOf:
  2249. - $ref: '#/components/schemas/Error'
  2250. - example:
  2251. message: Item(s) not found.
  2252. Error500:
  2253. allOf:
  2254. - $ref: '#/components/schemas/Error'
  2255. - example:
  2256. message: Database error.