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