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 forgedTransactions:
2090 type: integer
2091 description: Amount of forged transactions in this batch.
2092 example: 318
2093 additionalProperties: false
2094 required:
2095 - itemId
2096 - batchNum
2097 - ethereumBlockNum
2098 - ethereumBlockHash
2099 - timestamp
2100 - forgerAddr
2101 - collectedFees
2102 - historicTotalCollectedFeesUSD
2103 - stateRoot
2104 - numAccounts
2105 - exitRoot
2106 - forgeL1TransactionsNum
2107 - slotNum
2108 - forgedTransactions
2109 FullBatch:
2110 type: object
2111 description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
2112 properties:
2113 batch:
2114 $ref: '#/components/schemas/Batch'
2115 transactions:
2116 type: array
2117 description: List of forged transactions in the batch
2118 items:
2119 $ref: '#/components/schemas/HistoryTransaction'
2120 nullable: true
2121 additionalProperties: false
2122 required:
2123 - batch
2124 - transactions
2125 Hash:
2126 type: string
2127 description: hashed data
2128 example: "2734657026572a8708d883"
2129 SlotNum:
2130 type: integer
2131 description: Identifier of a slot.
2132 minimum: 0
2133 maximum: 4294967295
2134 example: 784
2135 Batches:
2136 type: object
2137 properties:
2138 batches:
2139 type: array
2140 description: List of batches.
2141 items:
2142 $ref: '#/components/schemas/Batch'
2143 pendingItems:
2144 $ref: '#/components/schemas/PendingItems'
2145 additionalProperties: false
2146 required:
2147 - batches
2148 - pendingItems
2149 Coordinator:
2150 type: object
2151 properties:
2152 itemId:
2153 $ref: '#/components/schemas/ItemId'
2154 forgerAddr:
2155 $ref: '#/components/schemas/EthereumAddress'
2156 bidderAddr:
2157 $ref: '#/components/schemas/EthereumAddress'
2158 URL:
2159 $ref: '#/components/schemas/URL'
2160 ethereumBlock:
2161 allOf:
2162 - $ref: '#/components/schemas/EthBlockNum'
2163 - description: Ethereum block in which the coordinator registered into the network.
2164 - example: 5735943738
2165 additionalProperties: false
2166 required:
2167 - itemId
2168 - forgerAddr
2169 - bidderAddr
2170 - URL
2171 - ethereumBlock
2172 Coordinators:
2173 type: object
2174 properties:
2175 coordinators:
2176 type: array
2177 description: List of coordinators.
2178 items:
2179 $ref: '#/components/schemas/Coordinator'
2180 pendingItems:
2181 $ref: '#/components/schemas/PendingItems'
2182 additionalProperties: false
2183 required:
2184 - coordinators
2185 - pendingItems
2186 Bid:
2187 type: object
2188 description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
2189 properties:
2190 itemId:
2191 $ref: '#/components/schemas/ItemId'
2192 bidderAddr:
2193 $ref: '#/components/schemas/EthereumAddress'
2194 forgerAddr:
2195 $ref: '#/components/schemas/EthereumAddress'
2196 slotNum:
2197 $ref: '#/components/schemas/SlotNum'
2198 URL:
2199 $ref: '#/components/schemas/URL'
2200 bidValue:
2201 $ref: '#/components/schemas/BigInt'
2202 ethereumBlockNum:
2203 $ref: '#/components/schemas/EthBlockNum'
2204 timestamp:
2205 type: string
2206 format: date-time
2207 additionalProperties: false
2208 required:
2209 - bidderAddr
2210 - forgerAddr
2211 - slotNum
2212 - URL
2213 - bidValue
2214 - ethereumBlockNum
2215 - timestamp
2216 Bids:
2217 type: object
2218 properties:
2219 bids:
2220 type: array
2221 description: List of bids.
2222 items:
2223 $ref: '#/components/schemas/Bid'
2224 pendingItems:
2225 $ref: '#/components/schemas/PendingItems'
2226 additionalProperties: false
2227 required:
2228 - bids
2229 - pendingItems
2230 RecommendedFee:
2231 type: object
2232 description: Fee that the coordinator recommends per transaction in USD.
2233 properties:
2234 existingAccount:
2235 type: number
2236 description: Recommended fee if the destination account of the transaction already exists.
2237 minimum: 0
2238 example: 0.1
2239 createAccount:
2240 type: number
2241 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.
2242 minimum: 0
2243 example: 1.3
2244 createAccountInternal:
2245 type: number
2246 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.
2247 minimum: 0
2248 example: 0.5
2249 Token:
2250 type: object
2251 description: Hermez Network compatible and registered token.
2252 properties:
2253 id:
2254 $ref: '#/components/schemas/TokenId'
2255 ethereumAddress:
2256 allOf:
2257 - $ref: '#/components/schemas/EthereumAddress'
2258 - description: Ethereum address in which the token is deployed.
2259 - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
2260 itemId:
2261 $ref: '#/components/schemas/ItemId'
2262 name:
2263 type: string
2264 description: full name of the token
2265 example: Maker Dai
2266 symbol:
2267 allOf:
2268 - $ref: '#/components/schemas/TokenSymbol'
2269 - example: DAI
2270 decimals:
2271 type: integer
2272 description: Number of decimals of the token.
2273 example: 18
2274 ethereumBlockNum:
2275 allOf:
2276 - $ref: '#/components/schemas/EthBlockNum'
2277 - description: Ethereum block number in which the token was added to the Hermez Network.
2278 - example: 539847538
2279 USD:
2280 type: number
2281 description: Value of the token in USD.
2282 example: 1.01
2283 nullable: true
2284 fiatUpdate:
2285 type: string
2286 format: date-time
2287 description: Timestamp of the moment the `USD` value was updated.
2288 nullable: true
2289 required:
2290 - id
2291 - ethereumAddress
2292 - itemId
2293 - name
2294 - symbol
2295 - decimals
2296 - ethereumBlockNum
2297 - USD
2298 - fiatUpdate
2299 additionalProperties: false
2300 Tokens:
2301 type: object
2302 properties:
2303 tokens:
2304 type: array
2305 description: List of tokens.
2306 items:
2307 $ref: '#/components/schemas/Token'
2308 pendingItems:
2309 $ref: '#/components/schemas/PendingItems'
2310 Exit:
2311 type: object
2312 description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
2313 properties:
2314 batchNum:
2315 allOf:
2316 - $ref: '#/components/schemas/BatchNum'
2317 - description: Batch in which the exit was forged.
2318 - example: 7394
2319 accountIndex:
2320 $ref: '#/components/schemas/AccountIndex'
2321 itemId:
2322 $ref: '#/components/schemas/ItemId'
2323 merkleProof:
2324 type: object
2325 description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
2326 properties:
2327 root:
2328 $ref: '#/components/schemas/BigInt'
2329 siblings:
2330 type: array
2331 items:
2332 $ref: '#/components/schemas/BigInt'
2333 oldKey:
2334 $ref: '#/components/schemas/BigInt'
2335 oldValue:
2336 $ref: '#/components/schemas/BigInt'
2337 isOld0:
2338 type: boolean
2339 key:
2340 $ref: '#/components/schemas/BigInt'
2341 value:
2342 $ref: '#/components/schemas/BigInt'
2343 fnc:
2344 type: integer
2345 maximum: 3
2346 minimum: 0
2347 required:
2348 - root
2349 - siblings
2350 - oldKey
2351 - oldValue
2352 - isOld0
2353 - key
2354 - value
2355 - fnc
2356 additionalProperties: false
2357 balance:
2358 $ref: '#/components/schemas/BigInt'
2359 instantWithdrawn:
2360 type: integer
2361 description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
2362 minimum: 0
2363 maximum: 1.84467440737096e+19
2364 example: 74747363
2365 nullable: true
2366 delayedWithdrawRequest:
2367 type: integer
2368 description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
2369 minimum: 0
2370 maximum: 1.84467440737096e+19
2371 example: null
2372 nullable: true
2373 delayedWithdrawn:
2374 type: integer
2375 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.
2376 minimum: 0
2377 maximum: 1.84467440737096e+19
2378 example: null
2379 nullable: true
2380 token:
2381 $ref: '#/components/schemas/Token'
2382 required:
2383 - batchNum
2384 - accountIndex
2385 - itemId
2386 - merkleProof
2387 - balance
2388 - instantWithdrawn
2389 - delayedWithdrawRequest
2390 - delayedWithdrawn
2391 - token
2392 additionalProperties: false
2393 Exits:
2394 type: object
2395 properties:
2396 exits:
2397 type: array
2398 description: List of exits.
2399 items:
2400 $ref: '#/components/schemas/Exit'
2401 pendingItems:
2402 $ref: '#/components/schemas/PendingItems'
2403 required:
2404 - exits
2405 - pendingItems
2406 additionalProperties: false
2407 Account:
2408 type: object
2409 description: State tree leaf. It contains balance and nonce of an account.
2410 properties:
2411 itemId:
2412 $ref: '#/components/schemas/ItemId'
2413 accountIndex:
2414 $ref: '#/components/schemas/AccountIndex'
2415 nonce:
2416 $ref: '#/components/schemas/Nonce'
2417 balance:
2418 $ref: '#/components/schemas/BigInt'
2419 bjj:
2420 $ref: '#/components/schemas/BJJ'
2421 hezEthereumAddress:
2422 $ref: '#/components/schemas/HezEthereumAddress'
2423 token:
2424 $ref: '#/components/schemas/Token'
2425 example:
2426 exits:
2427 - accountIndex: hez:ETH:259
2428 balance: '66666600000000000'
2429 batchNum: 8
2430 delayedWithdrawRequest:
2431 delayedWithdrawn:
2432 instantWithdrawn:
2433 itemId: 1
2434 merkleProof:
2435 Fnc: 0
2436 IsOld0: true
2437 Key: '256'
2438 OldKey: '256'
2439 OldValue: '256'
2440 Root: '256'
2441 Siblings:
2442 - '0'
2443 - '1'
2444 - '2'
2445 Value: '256'
2446 token:
2447 USD: 500
2448 decimals: 18
2449 ethereumAddress: '0x0000000000000000000000000000000000000000'
2450 ethereumBlockNum: 0
2451 fiatUpdate: '2020-11-26T09:57:29.110879Z'
2452 id: 0
2453 itemId: 1
2454 name: Ether
2455 symbol: ETH
2456 pendingItems: 0
2457 additionalProperties: false
2458 required:
2459 - itemId
2460 - accountIndex
2461 - nonce
2462 - balance
2463 - bjj
2464 - hezEthereumAddress
2465 - token
2466 Accounts:
2467 type: object
2468 properties:
2469 accounts:
2470 type: array
2471 description: List of accounts.
2472 items:
2473 $ref: '#/components/schemas/Account'
2474 pendingItems:
2475 $ref: '#/components/schemas/PendingItems'
2476 example:
2477 accounts:
2478 - accountIndex: hez:ETH:259
2479 balance: '2590000000000000000'
2480 bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
2481 hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
2482 itemId: 4
2483 nonce: 0
2484 token:
2485 USD: 500
2486 decimals: 18
2487 ethereumAddress: '0x0000000000000000000000000000000000000000'
2488 ethereumBlockNum: 0
2489 fiatUpdate: '2020-11-26T09:53:47.444444Z'
2490 id: 0
2491 itemId: 1
2492 name: Ether
2493 symbol: ETH
2494 - accountIndex: hez:TKN1:261
2495 balance: '2610000000'
2496 bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
2497 hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
2498 itemId: 6
2499 nonce: 0
2500 token:
2501 USD: 423
2502 decimals: 18
2503 ethereumAddress: '0x0000000000000000000000000000000000000064'
2504 ethereumBlockNum: 2
2505 fiatUpdate: '2020-11-26T09:53:47.456619Z'
2506 id: 1
2507 itemId: 2
2508 name: Test Token 1
2509 symbol: TKN1
2510 pendingItems: 0
2511 additionalProperties: false
2512 required:
2513 - accounts
2514 - pendingItems
2515 Slot:
2516 type: object
2517 description: Slot information.
2518 properties:
2519 itemId:
2520 $ref: '#/components/schemas/ItemId'
2521 slotNum:
2522 $ref: '#/components/schemas/SlotNum'
2523 firstBlock:
2524 allOf:
2525 - $ref: '#/components/schemas/EthBlockNum'
2526 - description: Block in which the slot began or will begin
2527 - example: 76238647846
2528 lastBlock:
2529 allOf:
2530 - $ref: '#/components/schemas/EthBlockNum'
2531 - description: Block in which the slot ended or will end
2532 - example: 4475934
2533 openAuction:
2534 type: boolean
2535 description: Whether the auction of the slot is open or not.
2536 bestBid:
2537 type: object
2538 description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
2539 nullable: true
2540 properties:
2541 itemId:
2542 $ref: '#/components/schemas/ItemId'
2543 bidderAddr:
2544 $ref: '#/components/schemas/EthereumAddress'
2545 forgerAddr:
2546 $ref: '#/components/schemas/EthereumAddress'
2547 slotNum:
2548 $ref: '#/components/schemas/SlotNum'
2549 URL:
2550 $ref: '#/components/schemas/URL'
2551 bidValue:
2552 type: string
2553 description: BigInt is an integer encoded as a string for numbers that are very large.
2554 example: "8708856933496328593"
2555 pattern: "^\\d+$"
2556 ethereumBlockNum:
2557 $ref: '#/components/schemas/EthBlockNum'
2558 timestamp:
2559 type: string
2560 format: date-time
2561 additionalProperties: false
2562 required:
2563 - bidderAddr
2564 - forgerAddr
2565 - slotNum
2566 - URL
2567 - bidValue
2568 - ethereumBlockNum
2569 - timestamp
2570 additionalProperties: false
2571 required:
2572 - slotNum
2573 - firstBlock
2574 - lastBlock
2575 - openAuction
2576 - bestBid
2577 Slots:
2578 type: object
2579 properties:
2580 slots:
2581 type: array
2582 description: List of slots.
2583 items:
2584 allOf:
2585 - $ref: '#/components/schemas/Slot'
2586 - description: Last synchronized Etherum block.
2587 pendingItems:
2588 $ref: '#/components/schemas/PendingItems'
2589 additionalProperties: false
2590 required:
2591 - slots
2592 - pendingItems
2593 NextForger:
2594 type: object
2595 description: Coordinator information along with the scheduled forging period
2596 properties:
2597 coordinator:
2598 $ref: '#/components/schemas/Coordinator'
2599 period:
2600 type: object
2601 description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
2602 properties:
2603 slotNum:
2604 $ref: '#/components/schemas/SlotNum'
2605 fromBlock:
2606 $ref: '#/components/schemas/EthBlockNum'
2607 toBlock:
2608 $ref: '#/components/schemas/EthBlockNum'
2609 fromTimestamp:
2610 type: string
2611 format: date-time
2612 toTimestamp:
2613 type: string
2614 format: date-time
2615 required:
2616 - slotNum
2617 - fromBlock
2618 - toBlock
2619 - fromTimestamp
2620 - toTimestamp
2621 additionalProperties: false
2622 required:
2623 - coordinator
2624 - period
2625 additionalProperties: false
2626 NextForgers:
2627 type: array
2628 description: List of next coordinators to forge.
2629 items:
2630 $ref: '#/components/schemas/NextForger'
2631 State:
2632 type: object
2633 description: Gobal variables of the network
2634 properties:
2635 network:
2636 $ref: '#/components/schemas/StateNetwork'
2637 metrics:
2638 $ref: '#/components/schemas/StateMetrics'
2639 rollup:
2640 $ref: '#/components/schemas/StateRollup'
2641 auction:
2642 $ref: '#/components/schemas/StateAuction'
2643 withdrawalDelayer:
2644 $ref: '#/components/schemas/StateWithdrawDelayer'
2645 recommendedFee:
2646 $ref: '#/components/schemas/RecommendedFee'
2647 additionalProperties: false
2648 required:
2649 - network
2650 - metrics
2651 - rollup
2652 - auction
2653 - withdrawalDelayer
2654 - recommendedFee
2655 StateNetwork:
2656 type: object
2657 description: Gobal statistics of the network
2658 properties:
2659 lastEthereumBlock:
2660 allOf:
2661 - $ref: '#/components/schemas/EthBlockNum'
2662 - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
2663 - example: 3457437
2664 lastSynchedBlock:
2665 allOf:
2666 - $ref: '#/components/schemas/EthBlockNum'
2667 - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
2668 - example: 3457437
2669 lastBatch:
2670 $ref: '#/components/schemas/Batch'
2671 currentSlot:
2672 allOf:
2673 - $ref: '#/components/schemas/SlotNum'
2674 - description: Slot where batches are currently being forged.
2675 - example: 2334
2676 nextForgers:
2677 $ref: '#/components/schemas/NextForgers'
2678 additionalProperties: false
2679 required:
2680 - lastEthereumBlock
2681 - lastSynchedBlock
2682 - lastBatch
2683 - currentSlot
2684 - nextForgers
2685 StateAuction:
2686 type: object
2687 description: Auction parameters.
2688 properties:
2689 ethereumBlockNum:
2690 $ref: '#/components/schemas/EthBlockNum'
2691 bootCoordinator:
2692 allOf:
2693 - $ref: '#/components/schemas/EthereumAddress'
2694 - description: Ethereum address of the boot coordinator.
2695 - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
2696 bootCoordinatorUrl:
2697 type: string
2698 description: Boot Coordinator URL
2699 example: "https://boot.coordinator.io"
2700 slotDeadline:
2701 type: integer
2702 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.
2703 example: 3
2704 closedAuctionSlots:
2705 type: integer
2706 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.
2707 example: 2
2708 openAuctionSlots:
2709 type: integer
2710 description: Amount of days in advance are auctions opened.
2711 defaultSlotSetBid:
2712 type: array
2713 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]`."
2714 items:
2715 type: integer
2716 example: [32,0,68,21,55,99]
2717 defaultSlotSetBidSlotNum:
2718 type: integer
2719 description: Slot in which the changes will be applied for the first time.
2720 outbidding:
2721 type: number
2722 description: Minimum outbid over the previous one to consider it valid.
2723 example: 3.64
2724 donationAddress:
2725 allOf:
2726 - $ref: '#/components/schemas/EthereumAddress'
2727 - description: Ethereum address where the donations will go to.
2728 - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
2729 allocationRatio:
2730 type: array
2731 description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
2732 items:
2733 type: integer
2734 example: [80,10,10]
2735 additionalProperties: false
2736 required:
2737 - ethereumBlockNum
2738 - bootCoordinator
2739 - bootCoordinatorUrl
2740 - slotDeadline
2741 - closedAuctionSlots
2742 - openAuctionSlots
2743 - defaultSlotSetBid
2744 - outbidding
2745 - donationAddress
2746 - allocationRatio
2747 StateRollup:
2748 type: object
2749 description: Rollup parameters
2750 properties:
2751 ethereumBlockNum:
2752 $ref: '#/components/schemas/EthBlockNum'
2753 forgeL1L2BatchTimeout:
2754 type: integer
2755 description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
2756 example: 5
2757 feeAddToken:
2758 type: integer
2759 description: Fee to pay when registering tokens into the network.
2760 example: 5698
2761 withdrawalDelay:
2762 type: integer
2763 description: Withdraw delay in seconds
2764 example: 432000
2765 buckets:
2766 type: array
2767 description: List of buckets state
2768 items:
2769 type: object
2770 properties:
2771 ceilUSD:
2772 type: integer
2773 description: Max USD value
2774 example: 1000
2775 withdrawals:
2776 type: integer
2777 description: Available withdrawals of the bucket
2778 example: 4
2779 blockWithdrawalRate:
2780 type: integer
2781 description: Every `blockWithdrawalRate` blocks add 1 withdrawal
2782 example: 8
2783 maxWithdrawals:
2784 type: integer
2785 description: Max withdrawals the bucket can hold
2786 example: 4
2787 additionalProperties: false
2788 required:
2789 - ceilUSD
2790 - withdrawals
2791 - blockWithdrawalRate
2792 - maxWithdrawals
2793 additionalProperties: false
2794 required:
2795 - ethereumBlockNum
2796 - forgeL1L2BatchTimeout
2797 - feeAddToken
2798 - withdrawalDelay
2799 - buckets
2800 StateWithdrawDelayer:
2801 type: object
2802 description: Withdrawal delayer parameters
2803 properties:
2804 ethereumBlockNum:
2805 $ref: '#/components/schemas/EthBlockNum'
2806 hermezGovernanceAddress:
2807 allOf:
2808 - $ref: '#/components/schemas/EthereumAddress'
2809 - description: Ethereum address of the governance.
2810 - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
2811 emergencyCouncilAddress:
2812 allOf:
2813 - $ref: '#/components/schemas/EthereumAddress'
2814 - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
2815 - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
2816 withdrawalDelay:
2817 allOf:
2818 - $ref: '#/components/schemas/EthBlockNum'
2819 - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
2820 - example: 539573849
2821 emergencyModeStartingBlock:
2822 type: integer
2823 description: Block number in which the emergency mode has been activated.
2824 example: 10
2825 emergencyMode:
2826 type: boolean
2827 description: Indicates if emergency mode has been activated.
2828 example: false
2829 additionalProperties: false
2830 required:
2831 - ethereumBlockNum
2832 - hermezGovernanceAddress
2833 - emergencyCouncilAddress
2834 - withdrawalDelay
2835 - emergencyModeStartingBlock
2836 - emergencyMode
2837 StateMetrics:
2838 type: object
2839 description: Metrics of the network
2840 properties:
2841 transactionsPerBatch:
2842 type: number
2843 description: Average transactions per batch in the last 24 hours.
2844 example: 2002.7
2845 batchFrequency:
2846 type: number
2847 description: Average elapsed time between batches in the last 24 hours, in seconds.
2848 example: 8.9
2849 transactionsPerSecond:
2850 type: number
2851 description: Average transactions per second in the last 24 hours.
2852 example: 302.3
2853 totalAccounts:
2854 type: integer
2855 description: Number of created accounts.
2856 example: 90473
2857 totalBJJs:
2858 type: integer
2859 description: Number of different registered BJJs.
2860 example: 23067
2861 avgTransactionFee:
2862 type: number
2863 description: Average fee percentage paid for L2 transactions in the last 24 hours.
2864 example: 1.54
2865 additionalProperties: false
2866 required:
2867 - transactionsPerBatch
2868 - batchFrequency
2869 - transactionsPerSecond
2870 - totalAccounts
2871 - totalBJJs
2872 - avgTransactionFee
2873 PendingItems:
2874 type: integer
2875 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.
2876 example: 15
2877 Config:
2878 type: object
2879 description: Configuration parameters of the different smart contracts that power the Hermez Network.
2880 properties:
2881 hermez:
2882 type: object
2883 description: Constant configuration of the Hermez smart contract.
2884 properties:
2885 publicConstants:
2886 type: object
2887 description: Public Hermez smart contract constants
2888 properties:
2889 tokenHEZ:
2890 allOf:
2891 - $ref: '#/components/schemas/EthereumAddress'
2892 - description: Ethereum address of the HEZ token.
2893 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
2894 absoluteMaxL1L2BatchTimeout:
2895 type: integer
2896 description: L1L2 Batch Timeout
2897 example: 240
2898 verifiers:
2899 type: array
2900 description: List of verifiers struct
2901 items:
2902 type: object
2903 properties:
2904 maxTx:
2905 type: integer
2906 description: Maximum rollup transactions in a batch
2907 example: 512
2908 nlevels:
2909 type: integer
2910 description: Number of levels of the circuit
2911 example: 32
2912 required:
2913 - maxTx
2914 - nlevels
2915 additionalProperties: false
2916 hermezAuctionContract:
2917 allOf:
2918 - $ref: '#/components/schemas/EthereumAddress'
2919 - description: Ethereum address of the auction smart contract.
2920 - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
2921 hermezGovernanceAddress:
2922 allOf:
2923 - $ref: '#/components/schemas/EthereumAddress'
2924 - description: Ethereum address of the governance.
2925 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
2926 withdrawDelayerContract:
2927 allOf:
2928 - $ref: '#/components/schemas/EthereumAddress'
2929 - description: Ethereum address of the withdraw delayer contracts.
2930 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
2931 required:
2932 - tokenHEZ
2933 - absoluteMaxL1L2BatchTimeout
2934 - verifiers
2935 - hermezAuctionContract
2936 - hermezGovernanceAddress
2937 - withdrawDelayerContract
2938 additionalProperties: false
2939 maxFeeIdxCoordinator:
2940 type: integer
2941 description: is the maximum number of tokens the coordinator can use to collect fees.
2942 example: 64
2943 reservedIdx:
2944 type: integer
2945 description: First 256 indexes reserved, first user index will be the 256.
2946 example: 255
2947 exitIdx:
2948 type: integer
2949 description: Account index used to indicate that a transaction is an `exit` or `force exit`.
2950 example: 1
2951 limitDepositAmount:
2952 type: integer
2953 description: Maximum deposit amount (L1 to L2) allowed.
2954 example: 321
2955 limitL2TransferAmount:
2956 type: integer
2957 description: Maximum amount (L2 to L2) allowed.
2958 example: 837
2959 limitTokens:
2960 type: integer
2961 description: Maximum number of different tokens that can be registered in the network.
2962 example: 4294967295
2963 l1CoordinatorTotalBytes:
2964 type: integer
2965 description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
2966 example: 101
2967 l1UserTotalBytes:
2968 type: integer
2969 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).
2970 example: 72
2971 maxL1UserTx:
2972 type: integer
2973 description: Maximum L1-user transactions allowed to be queued in a batch.
2974 example: 128
2975 maxL1Tx:
2976 type: integer
2977 description: Maximum L1 transactions allowed to be queued in a batch.
2978 example: 256
2979 inputSHAConstantBytes:
2980 type: integer
2981 description: Input SHA constant bytes
2982 example: 18542
2983 numBuckets:
2984 type: integer
2985 description: Number of buckets
2986 example: 5
2987 maxWithdrawalDelay:
2988 type: integer
2989 description: Maximum delay to withdraw tokens. Time is measured in seconds.
2990 example: 2 * 7 * 24 * 60 * 60
2991 exchangeMultiplier:
2992 type: integer
2993 description: exchange multiplier
2994 example: 1e14
2995 required:
2996 - publicConstants
2997 - reservedIdx
2998 - exitIdx
2999 - limitDepositAmount
3000 - limitL2TransferAmount
3001 - limitTokens
3002 - l1CoordinatorTotalBytes
3003 - l1UserTotalBytes
3004 - maxL1UserTx
3005 - maxL1Tx
3006 - inputSHAConstantBytes
3007 - numBuckets
3008 - maxWithdrawalDelay
3009 - exchangeMultiplier
3010 additionalProperties: false
3011 auction:
3012 type: object
3013 description: Constant configuration of the auction smart contract.
3014 properties:
3015 blocksPerSlot:
3016 type: integer
3017 description: Blocks per slot.
3018 initialMinimalBidding:
3019 type: integer
3020 description: Minimum bid when no one has bid yet.
3021 genesisBlockNum:
3022 allOf:
3023 - $ref: '#/components/schemas/EthBlockNum'
3024 - description: Ethereum block number in which the smart contract starts operating.
3025 tokenHEZ:
3026 allOf:
3027 - $ref: '#/components/schemas/EthereumAddress'
3028 - description: Ethereum address of the HEZ token.
3029 - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
3030 hermezRollup:
3031 allOf:
3032 - $ref: '#/components/schemas/EthereumAddress'
3033 - description: Ethereum address of the rollup smart contract.
3034 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
3035 governanceAddress:
3036 allOf:
3037 - $ref: '#/components/schemas/EthereumAddress'
3038 - description: Ethereum address of the governance.
3039 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
3040 required:
3041 - blocksPerSlot
3042 - initialMinimalBidding
3043 - genesisBlockNum
3044 - tokenHEZ
3045 - hermezRollup
3046 - governanceAddress
3047 additionalProperties: false
3048 withdrawalDelayer:
3049 type: object
3050 description: Constant configuration of the withdrawal delayer smart contract.
3051 properties:
3052 maxWithdrawalDelay:
3053 type: integer
3054 description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
3055 example: 200
3056 maxEmergencyModeTime:
3057 type: integer
3058 description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
3059 example: 2000
3060 hermezRollup:
3061 allOf:
3062 - $ref: '#/components/schemas/EthereumAddress'
3063 - description: Ethereum address of the rollup smart contract.
3064 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
3065 required:
3066 - maxWithdrawalDelay
3067 - maxEmergencyModeTime
3068 - hermezRollup
3069 additionalProperties: false
3070 required:
3071 - hermez
3072 - auction
3073 - withdrawalDelayer
3074 additionalProperties: false
3075 Error:
3076 type: object
3077 description: Error response.
3078 properties:
3079 message:
3080 type: string
3081 Error400:
3082 allOf:
3083 - $ref: '#/components/schemas/Error'
3084 - example:
3085 message: Invalid signature.
3086 Error404:
3087 allOf:
3088 - $ref: '#/components/schemas/Error'
3089 - example:
3090 message: Item(s) not found.
3091 Error500:
3092 allOf:
3093 - $ref: '#/components/schemas/Error'
3094 - example:
3095 message: Database error.