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: fromItem
1148 in: query
1149 required: false
1150 description: Indicates the desired first item (using the itemId property) to be included in the response.
1151 schema:
1152 type: number
1153 - name: order
1154 in: query
1155 required: false
1156 description: Order of the returned items. Coordinators will be ordered by increasing (ethereumBlock, forgerAddr).
1157 schema:
1158 type: string
1159 default: ASC
1160 enum:
1161 - ASC
1162 - DESC
1163 - name: limit
1164 in: query
1165 required: false
1166 description: Maximum number of items to be returned.
1167 schema:
1168 type: integer
1169 minimum: 1
1170 maximum: 2049
1171 responses:
1172 '200':
1173 description: Successful operation.
1174 content:
1175 application/json:
1176 schema:
1177 $ref: '#/components/schemas/Coordinators'
1178 '400':
1179 description: Bad request.
1180 content:
1181 application/json:
1182 schema:
1183 $ref: '#/components/schemas/Error400'
1184 '500':
1185 description: Internal server error.
1186 content:
1187 application/json:
1188 schema:
1189 $ref: '#/components/schemas/Error500'
1190 '/coordinators/{bidderAddr}':
1191 get:
1192 tags:
1193 - Hermez status
1194 summary: Get the information of a coordinator.
1195 description: Get the information of a coordinator.
1196 operationId: getCoordinator
1197 parameters:
1198 - name: bidderAddr
1199 in: path
1200 description: Coordinator identifier
1201 required: true
1202 schema:
1203 $ref: '#/components/schemas/EthereumAddress'
1204 responses:
1205 '200':
1206 description: Successful operation.
1207 content:
1208 application/json:
1209 schema:
1210 $ref: '#/components/schemas/Coordinator'
1211 '400':
1212 description: Bad request.
1213 content:
1214 application/json:
1215 schema:
1216 $ref: '#/components/schemas/Error400'
1217 '404':
1218 description: Not found.
1219 content:
1220 application/json:
1221 schema:
1222 $ref: '#/components/schemas/Error404'
1223 '500':
1224 description: Internal server error.
1225 content:
1226 application/json:
1227 schema:
1228 $ref: '#/components/schemas/Error500'
1229components:
1230 schemas:
1231 ItemId:
1232 type: integer
1233 description: Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
1234 PostPoolL2Transaction:
1235 type: object
1236 description: L2 transaction to be posted.
1237 properties:
1238 id:
1239 $ref: '#/components/schemas/TransactionId'
1240 type:
1241 $ref: '#/components/schemas/TransactionTypeL2'
1242 tokenId:
1243 $ref: '#/components/schemas/TokenId'
1244 fromAccountIndex:
1245 $ref: '#/components/schemas/AccountIndex'
1246 toAccountIndex:
1247 type: string
1248 description: >-
1249 Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
1250 The identifier is built using: `hez:` + `token symbol:` + `index`. If this is provided, toHezEthereumAddress and toBjj
1251 must be null. To perform an exit the value hez:EXIT:1 must be used.
1252 example: null
1253 nullable: true
1254 toHezEthereumAddress:
1255 type: string
1256 description: "Address of an Etherum account linked to the Hermez Network. If this is provided, toAccountIndex and toBjj must be null."
1257 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1258 example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1259 nullable: true
1260 toBjj:
1261 type: string
1262 description: >-
1263 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.
1264 If this is provided, toAccountIndex must be null and toHezEthereumAddress must be hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.
1265 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1266 example: null
1267 nullable: true
1268 amount:
1269 allOf:
1270 - $ref: '#/components/schemas/BigInt'
1271 - description: Amount of tokens to be sent.
1272 example: "6300000000000000000"
1273 fee:
1274 $ref: '#/components/schemas/FeeSelector'
1275 nonce:
1276 $ref: '#/components/schemas/Nonce'
1277 signature:
1278 allOf:
1279 - $ref: '#/components/schemas/BJJSignature'
1280 - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
1281 - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
1282 requestFromAccountIndex:
1283 type: string
1284 description: References the `fromAccountIndex` of the requested transaction.
1285 example: null
1286 nullable: true
1287 requestToAccountIndex:
1288 type: string
1289 description: References the `toAccountIndex` of the requested transaction.
1290 example: null
1291 nullable: true
1292 requestToHezEthereumAddress:
1293 type: string
1294 description: References the `toHezEthereumAddress` of the requested transaction.
1295 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1296 example: null
1297 nullable: true
1298 requestToBjj:
1299 type: string
1300 description: References the `toBjj` of the requested transaction.
1301 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1302 example: null
1303 nullable: true
1304 requestTokenId:
1305 type: integer
1306 description: References the `tokenId` of the requested transaction.
1307 example: null
1308 nullable: true
1309 requestAmount:
1310 type: string
1311 description: References the `amount` of the requested transaction.
1312 example: null
1313 nullable: true
1314 requestFee:
1315 type: integer
1316 description: References the `fee` of the requested transaction.
1317 example: null
1318 nullable: true
1319 requestNonce:
1320 type: integer
1321 description: References the `nonce` of the requested transaction.
1322 example: null
1323 nullable: true
1324 example:
1325 id: '0x020000000001000000000006'
1326 type: Transfer
1327 tokenId: 6
1328 fromAccountIndex: hez:DAI:256
1329 toAccountIndex: hez:DAI:257
1330 toHezEthereumAddress:
1331 toBjj:
1332 amount: '100000000000000'
1333 fee: 0
1334 nonce: 6
1335 signature: 1a79dd5e661d58266901a0de8afb046b466c4c1af937100f627a421771f2911fa3fde8ea2e272b4802a8b1f1229689292acd6f7e8ab4cadc4ab37b6b9e13a101
1336 additionalProperties: false
1337 required:
1338 - id
1339 - type
1340 - tokenId
1341 - fromAccountIndex
1342 - amount
1343 - fee
1344 - nonce
1345 - signature
1346 PoolL2Transaction:
1347 type: object
1348 properties:
1349 id:
1350 $ref: '#/components/schemas/TransactionId'
1351 type:
1352 $ref: '#/components/schemas/TransactionTypeL2'
1353 fromAccountIndex:
1354 $ref: '#/components/schemas/AccountIndex'
1355 fromHezEthereumAddress:
1356 type: string
1357 description: "Address of an Etherum account linked to the Hermez Network."
1358 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1359 example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1360 nullable: true
1361 fromBJJ:
1362 type: string
1363 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."
1364 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1365 example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
1366 nullable: true
1367 toAccountIndex:
1368 type: string
1369 description: >-
1370 Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
1371 The identifier is built using: `hez:` + `token symbol:` + `index`
1372 example: "hez:DAI:309"
1373 nullable: true
1374 toHezEthereumAddress:
1375 type: string
1376 description: "Address of an Etherum account linked to the Hermez Network."
1377 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1378 example: null
1379 nullable: true
1380 toBjj:
1381 type: string
1382 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."
1383 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1384 example: null
1385 nullable: true
1386 amount:
1387 allOf:
1388 - $ref: '#/components/schemas/BigInt'
1389 - description: Amount of tokens to be sent.
1390 example: "6303020000000000000"
1391 fee:
1392 $ref: '#/components/schemas/FeeSelector'
1393 nonce:
1394 $ref: '#/components/schemas/Nonce'
1395 state:
1396 $ref: '#/components/schemas/PoolL2TransactionState'
1397 signature:
1398 allOf:
1399 - $ref: '#/components/schemas/BJJSignature'
1400 - description: Signature of the transaction. More info [here](https://idocs.hermez.io/#/spec/zkrollup/README?id=l2a-idl2).
1401 - example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
1402 timestamp:
1403 type: string
1404 description: Moment in which the transaction was added to the pool.
1405 format: date-time
1406 batchNum:
1407 type: integer
1408 description: Identifier of a batch. Every new forged batch increases by one the batchNum, starting at 0.
1409 minimum: 0
1410 maximum: 4294967295
1411 nullable: true
1412 example: null
1413 requestFromAccountIndex:
1414 type: string
1415 description: >-
1416 Identifier of an account. It references the position where the account is inside the state Merkle tree.
1417 The identifier is built using: `hez:` + `token symbol:` + `index`
1418 nullable: true
1419 example: null
1420 requestToAccountIndex:
1421 type: string
1422 description: >-
1423 Identifier of an account. It references the position where the account is inside the state Merkle tree.
1424 The identifier is built using: `hez:` + `token symbol:` + `index`
1425 nullable: true
1426 example: null
1427 requestToHezEthereumAddress:
1428 type: string
1429 description: "Address of an Etherum account linked to the Hermez Network."
1430 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1431 nullable: true
1432 example: null
1433 requestToBJJ:
1434 type: string
1435 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."
1436 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1437 nullable: true
1438 example: null
1439 requestTokenId:
1440 type: integer
1441 description: References the `tokenId` of the requested transaction.
1442 example: null
1443 nullable: true
1444 requestAmount:
1445 type: string
1446 description: BigInt is an integer encoded as a string for numbers that are very large.
1447 nullable: true
1448 example: null
1449 requestFee:
1450 type: integer
1451 description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
1452 minimum: 0
1453 maximum: 256
1454 nullable: true
1455 example: null
1456 requestNonce:
1457 type: integer
1458 description: Number that can only be used once per account. Increments by one with each transaction.
1459 minimum: 0
1460 maximum: 1.84467440737096e+19
1461 nullable: true
1462 example: null
1463 token:
1464 $ref: '#/components/schemas/Token'
1465 example:
1466 amount: '100000000000000'
1467 batchNum:
1468 fee: 0
1469 fromAccountIndex: hez:SCC:256
1470 fromBJJ: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
1471 fromHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
1472 id: '0x020000000001000000000006'
1473 nonce: 6
1474 requestAmount:
1475 requestFee: 0
1476 requestFromAccountIndex:
1477 requestNonce: 0
1478 requestToAccountIndex:
1479 requestToBJJ:
1480 requestToHezEthereumAddress:
1481 requestTokenId:
1482 signature: 5ee9c7b5baa243ba282d18596a55cc357b01513eaed75165365f802102cce4a7a1dd35e3ab31cf9039e2b8a9f570d935115be9379a3dd47813dfc014031ab201
1483 state: pend
1484 timestamp: '2020-11-17T13:58:54.422232Z'
1485 toAccountIndex: hez:SCC:257
1486 toBjj: hez:r_trOasVEk0zNaalOoS9aLedu6mO7jI5XTIPu_zGXoyn
1487 toHezEthereumAddress: hez:0x00000000000000000000000000000000004Ab84F
1488 token:
1489 USD: 23.74
1490 decimals: 7
1491 ethereumAddress: '0x0000000000000000000000000000000000000006'
1492 ethereumBlockNum: 2
1493 fiatUpdate:
1494 id: 6
1495 itemId: 7
1496 name: Some Cool Coin
1497 symbol: 'SCC'
1498 type: Transfer
1499 required:
1500 - id
1501 - type
1502 - fromAccountIndex
1503 - fromHezEthereumAddress
1504 - fromBJJ
1505 - toAccountIndex
1506 - toHezEthereumAddress
1507 - toBjj
1508 - amount
1509 - fee
1510 - nonce
1511 - state
1512 - signature
1513 - timestamp
1514 - batchNum
1515 - requestFromAccountIndex
1516 - requestToAccountIndex
1517 - requestToHezEthereumAddress
1518 - requestToBJJ
1519 - requestTokenId
1520 - requestAmount
1521 - requestFee
1522 - requestNonce
1523 - token
1524 TransactionId:
1525 type: string
1526 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)
1527 example: "0x00000000000001e240004700"
1528 EthereumAddress:
1529 type: string
1530 description: "Address of an Etherum account."
1531 pattern: "^0x[a-fA-F0-9]{40}$"
1532 example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1533 HezEthereumAddress:
1534 type: string
1535 description: "Address of an Etherum account linked to the Hermez Network."
1536 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1537 example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1538 BJJ:
1539 type: string
1540 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."
1541 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1542 example: "hez:rR7LXKal-av7I56Y0dEBCVmwc9zpoLY5ERhy5w7G-xwe"
1543 AccountIndex:
1544 type: string
1545 description: >-
1546 Identifier of an account. It references the position where the account is inside the state Merkle tree.
1547 The identifier is built using: `hez:` + `token symbol:` + `index`
1548 example: "hez:DAI:4444"
1549 TransactionType:
1550 type: string
1551 description: Type of transaction.
1552 enum:
1553 - Exit
1554 - Transfer
1555 - Deposit
1556 - CreateAccountDeposit
1557 - CreateAccountDepositTransfer
1558 - DepositTransfer
1559 - ForceTransfer
1560 - ForceExit
1561 - TransferToEthAddr
1562 - TransferToBJJ
1563 TransactionTypeL2:
1564 type: string
1565 description: Type of transaction.
1566 enum:
1567 - Exit
1568 - Transfer
1569 - TransferToEthAddr
1570 - TransferToBJJ
1571 TokenId:
1572 type: integer
1573 description: Identifier of a token registered in the network.
1574 minimum: 0
1575 maximum: 4294967295
1576 example: 98765
1577 BigInt:
1578 type: string
1579 description: BigInt is an integer encoded as a string for numbers that are very large.
1580 example: "8708856933496328593"
1581 pattern: "^\\d+$"
1582 FeeSelector:
1583 type: integer
1584 description: Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
1585 minimum: 0
1586 maximum: 256
1587 example: 36
1588 Nonce:
1589 type: integer
1590 description: Number that can only be used once per account, increments by one at each transaction.
1591 minimum: 0
1592 maximum: 1.84467440737096e+19
1593 example: 121
1594 PoolL2TransactionState:
1595 type: string
1596 description: >
1597 State of a L2 transaction from the coordinator pool.
1598 * pend: Pending
1599 * fing: Forging
1600 * fged: Forged
1601 * invl: Invalid
1602 enum:
1603 - pend
1604 - fing
1605 - fged
1606 - invl
1607 ETHSignature:
1608 type: string
1609 description: Ethereum signature.
1610 pattern: "^0x[a-fA-F0-9]{130}$"
1611 example: "0xf9161cd688394772d93aa3e7b3f8f9553ca4f94f65b7cece93ed4a239d5c0b4677dca6d1d459e3a5c271a34de735d4664a43e5a8960a9a6e027d12c562dd448e1c"
1612 BJJSignature:
1613 type: string
1614 description: BabyJubJub compressed signature.
1615 pattern: "^[a-fA-F0-9]{128}$"
1616 example: "72024a43f546b0e1d9d5d7c4c30c259102a9726363adcc4ec7b6aea686bcb5116f485c5542d27c4092ae0ceaf38e3bb44417639bd2070a58ba1aa1aab9d92c03"
1617 BatchNum:
1618 type: integer
1619 description: Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
1620 minimum: 0
1621 maximum: 4294967295
1622 example: 5432
1623 AccountCreationAuthorizationPost:
1624 type: object
1625 properties:
1626 hezEthereumAddress:
1627 $ref: '#/components/schemas/HezEthereumAddress'
1628 bjj:
1629 $ref: '#/components/schemas/BJJ'
1630 signature:
1631 $ref: '#/components/schemas/ETHSignature'
1632 example:
1633 hezEthereumAddress: hez:0xb5270eB4ae11c6fAAff6F5fa0A5202B8d963634C
1634 bjj: hez:hg2Ydsb8O66H-steBR3cnHl944ua7E-PkTJ_SbPBBg5r
1635 signature: '0xb7cf237c4a2ff3d4df57752e7b9deb236fa384f03a79d39acf17ec5f8d12a3cf00b017c2466611310cb2bacac68460e96778278646842c6d2bcb79979271c28501'
1636 required:
1637 - hezEthereumAddress
1638 - bjj
1639 - signature
1640 AccountCreationAuthorization:
1641 type: object
1642 properties:
1643 timestamp:
1644 type: string
1645 format: date-time
1646 hezEthereumAddress:
1647 $ref: '#/components/schemas/HezEthereumAddress'
1648 bjj:
1649 $ref: '#/components/schemas/BJJ'
1650 signature:
1651 $ref: '#/components/schemas/ETHSignature'
1652 example:
1653 hezEthereumAddress: hez:0x74a549b410d01d9eC56346aE52b8550515B283b2
1654 bjj: hez:dEZ-Tj7d5h0TAqbnRTTYURYDEo5KZzB87_2WknUU8gCN
1655 signature: '0x8db6db2ad6cbe21297fb8ee01c59b01b52d4df7ea92a0f0dee0be0075a8f224a06b367407c8f402cfe0490c142a1c92da3fc29b51162ae160d35e1577d3071bb01'
1656 timestamp: '2020-11-17T13:25:36.784295Z'
1657 additionalProperties: false
1658 required:
1659 - timestamp
1660 - hezEthereumAddress
1661 - bjj
1662 - signature
1663 HistoryTransaction:
1664 type: object
1665 description: Transaction of the Hermez Network
1666 properties:
1667 L1orL2:
1668 type: string
1669 enum:
1670 - L1
1671 - L2
1672 id:
1673 $ref: '#/components/schemas/TransactionId'
1674 itemId:
1675 $ref: '#/components/schemas/ItemId'
1676 type:
1677 $ref: '#/components/schemas/TransactionType'
1678 position:
1679 $ref: '#/components/schemas/TransactionPosition'
1680 fromAccountIndex:
1681 type: string
1682 description: >-
1683 Identifier of an account. It references the position where the account is inside the state Merkle tree.
1684 The identifier is built using: `hez:` + `token symbol:` + `index`
1685 example: "hez:DAI:4444"
1686 nullable: true
1687 fromHezEthereumAddress:
1688 type: string
1689 description: "Address of an Etherum account linked to the Hermez Network."
1690 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1691 example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1692 nullable: true
1693 fromBJJ:
1694 type: string
1695 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."
1696 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1697 example: "hez:9CK9fjQdMUTGm8KDvGLy3MB-vnP0NCcGX7Uh7OO6KRJm"
1698 nullable: true
1699 toAccountIndex:
1700 allOf:
1701 - $ref: '#/components/schemas/AccountIndex'
1702 - example: "hez:DAI:672"
1703 toHezEthereumAddress:
1704 type: string
1705 description: "Address of an Etherum account linked to the Hermez Network."
1706 pattern: "^hez:0x[a-fA-F0-9]{40}$"
1707 example: "hez:0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
1708 nullable: true
1709 toBJJ:
1710 type: string
1711 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."
1712 pattern: "^hez:[A-Za-z0-9_-]{44}$"
1713 example: "hez:f1J78_6uqTyjX6jrVCqN4RFeRBnWQAGl477ZFtOnH6Sm"
1714 nullable: true
1715 amount:
1716 allOf:
1717 - $ref: '#/components/schemas/BigInt'
1718 - description: Amount of tokens to be sent.
1719 - example: "4903020000000000000"
1720 batchNum:
1721 type: integer
1722 description: Batch in which the transaction was forged. Null indicates not forged yet.
1723 minimum: 0
1724 maximum: 4294967295
1725 example: 5432
1726 nullable: true
1727 historicUSD:
1728 type: number
1729 description: Value in USD at the moment the transaction was forged.
1730 example: 49.7
1731 nullable: true
1732 timestamp:
1733 type: string
1734 format: date-time
1735 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.
1736 token:
1737 $ref: '#/components/schemas/Token'
1738 L1Info:
1739 type: object
1740 description: Additional information that only applies to L1 transactions.
1741 nullable: true
1742 properties:
1743 toForgeL1TransactionsNum:
1744 $ref: '#/components/schemas/ToForgeL1TransactionsNum'
1745 userOrigin:
1746 type: boolean
1747 description: True if the transaction was sent by a user. False if it was sent by a coordinator.
1748 depositAmount:
1749 allOf:
1750 - $ref: '#/components/schemas/BigInt'
1751 - description: Tokens transfered from L1 to L2.
1752 - example: "4900000000000000000"
1753 amountSuccess:
1754 type: boolean
1755 description: >-
1756 Indicates if the amount specified by the user has been sent propperly. If false, the amount that actualy has been sent is 0.
1757 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.
1758 An example were this value could be false: a user send a `DepositTransfer` transaction, but when the tx is forged there are not
1759 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.
1760 example: true
1761 depositAmountSuccess:
1762 type: boolean
1763 description: >-
1764 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.
1765 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.
1766 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.
1767 In this case transaction won't be effective making the deposit amount have a real value of 0.
1768 example: true
1769 historicDepositAmountUSD:
1770 type: number
1771 description: Deposit amount in USD, at the moment the transaction was made.
1772 example: 3.897
1773 nullable: true
1774 ethereumBlockNum:
1775 allOf:
1776 - $ref: '#/components/schemas/EthBlockNum'
1777 - description: Ethereum block in which the transaction was added to the smart contract forge queue.
1778 - example: 258723049
1779 required:
1780 - toForgeL1TransactionsNum
1781 - userOrigin
1782 - depositAmount
1783 - amountSuccess
1784 - depositAmountSuccess
1785 - historicDepositAmountUSD
1786 - ethereumBlockNum
1787 additionalProperties: false
1788 L2Info:
1789 type: object
1790 description: Additional information that only applies to L2 transactions.
1791 nullable: true
1792 properties:
1793 fee:
1794 $ref: '#/components/schemas/FeeSelector'
1795 historicFeeUSD:
1796 type: number
1797 description: Fee in USD, at the moment the transaction was forged.
1798 example: 263.89
1799 nullable: true
1800 nonce:
1801 $ref: '#/components/schemas/Nonce'
1802 example: null
1803 required:
1804 - fee
1805 - historicFeeUSD
1806 - nonce
1807 additionalProperties: false
1808 example:
1809 L1Info:
1810 ethereumBlockNum: 1
1811 historicDepositAmountUSD: 232.47
1812 depositAmount: '261'
1813 toForgeL1TransactionsNum: 10
1814 userOrigin: true
1815 L1orL2: L1
1816 L2Info:
1817 amount: '261'
1818 batchNum: 1
1819 fromAccountIndex: hez:ETH:276
1820 fromBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
1821 fromHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
1822 historicUSD: 3784.19
1823 id: '0x00000000000000000a000400'
1824 itemId: 2
1825 position: 4
1826 timestamp: '2020-11-17T14:08:12.197554Z'
1827 toAccountIndex: hez:ETH:276
1828 toBJJ: hez:p_OohTzjzZnD3Sw93HQlK13DSxfD6lyvbfhh2kBsV6Z4
1829 toHezEthereumAddress: hez:0x0000000000000000000000000000000000000114
1830 token:
1831 USD: 234.56
1832 decimals: 18
1833 ethereumAddress: '0x0000000000000000000000000000000000000000'
1834 ethereumBlockNum: 0
1835 fiatUpdate:
1836 id: 0
1837 itemId: 1
1838 name: Ether
1839 symbol: ETH
1840 type: CreateAccountDeposit
1841 required:
1842 - L1orL2
1843 - id
1844 - itemId
1845 - type
1846 - position
1847 - fromAccountIndex
1848 - fromHezEthereumAddress
1849 - fromBJJ
1850 - toAccountIndex
1851 - toHezEthereumAddress
1852 - toBJJ
1853 - amount
1854 - batchNum
1855 - historicUSD
1856 - timestamp
1857 - token
1858 - L1Info
1859 - L2Info
1860 additionalProperties: false
1861 HistoryTransactions:
1862 type: object
1863 properties:
1864 transactions:
1865 type: array
1866 description: List of history transactions.
1867 items:
1868 $ref: '#/components/schemas/HistoryTransaction'
1869 pendingItems:
1870 $ref: '#/components/schemas/PendingItems'
1871 example:
1872 transactions:
1873 - L1Info:
1874 ethereumBlockNum: 3
1875 historicDepositAmountUSD:
1876 depositAmount: '0'
1877 toForgeL1TransactionsNum: 7
1878 userOrigin: true
1879 L1orL2: L1
1880 L2Info:
1881 amount: '88888800000000000'
1882 batchNum: 9
1883 fromAccountIndex: hez:ETH:262
1884 fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
1885 fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
1886 historicUSD: 44.4444
1887 id: '0x000000000000000007000300'
1888 itemId: 28
1889 position: 3
1890 timestamp: '2020-11-26T09:18:40.004749Z'
1891 toAccountIndex: hez:EXIT:1
1892 toBJJ:
1893 toHezEthereumAddress:
1894 token:
1895 USD: 500
1896 decimals: 18
1897 ethereumAddress: '0x0000000000000000000000000000000000000000'
1898 ethereumBlockNum: 0
1899 fiatUpdate: '2020-11-26T09:18:27.034866Z'
1900 id: 0
1901 itemId: 1
1902 name: Ether
1903 symbol: ETH
1904 type: ForceExit
1905 - L1Info:
1906 L1orL2: L2
1907 L2Info:
1908 fee: 123
1909 historicFeeUSD: 2.15037380962404
1910 nonce: 1
1911 amount: '55555500000000000'
1912 batchNum: 8
1913 fromAccountIndex: hez:TKN1:264
1914 fromBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
1915 fromHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
1916 historicUSD: 23.4999765
1917 id: '0x020000000001080000000001'
1918 itemId: 19
1919 position: 2
1920 timestamp: '2020-11-26T09:18:40.004749Z'
1921 toAccountIndex: hez:TKN1:260
1922 toBJJ: hez:81h61cx0FKR1RXcLbHW8cZMPY8SR6yKU3ei4pmcLjpaQ
1923 toHezEthereumAddress: hez:0x6813Eb9362372EEF6200f3b1dbC3f819671cBA69
1924 token:
1925 USD: 423
1926 decimals: 18
1927 ethereumAddress: '0x0000000000000000000000000000000000000064'
1928 ethereumBlockNum: 2
1929 fiatUpdate: '2020-11-26T09:18:27.04357Z'
1930 id: 1
1931 itemId: 2
1932 name: Test Token 1
1933 symbol: TKN1
1934 type: Transfer
1935 - L1Info:
1936 L1orL2: L2
1937 L2Info:
1938 fee: 44
1939 historicFeeUSD: 0.1973587359744
1940 nonce: 2
1941 amount: '66666600000000000'
1942 batchNum: 8
1943 fromAccountIndex: hez:ETH:259
1944 fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
1945 fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
1946 historicUSD: 33.3333
1947 id: '0x020000000001030000000002'
1948 itemId: 20
1949 position: 3
1950 timestamp: '2020-11-26T09:18:40.004749Z'
1951 toAccountIndex: hez:EXIT:1
1952 toBJJ:
1953 toHezEthereumAddress:
1954 token:
1955 USD: 500
1956 decimals: 18
1957 ethereumAddress: '0x0000000000000000000000000000000000000000'
1958 ethereumBlockNum: 0
1959 fiatUpdate: '2020-11-26T09:18:27.034866Z'
1960 id: 0
1961 itemId: 1
1962 name: Ether
1963 symbol: ETH
1964 type: Exit
1965 - L1Info:
1966 ethereumBlockNum: 3
1967 historicDepositAmountUSD: 14099.9999859
1968 depositAmount: '33333333300000000000'
1969 toForgeL1TransactionsNum: 2
1970 userOrigin: true
1971 L1orL2: L1
1972 L2Info:
1973 amount: '0'
1974 batchNum: 4
1975 fromAccountIndex: hez:TKN1:0
1976 fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
1977 fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
1978 historicUSD:
1979 id: '0x000000000000000002000000'
1980 itemId: 9
1981 position: 0
1982 timestamp: '2020-11-26T09:18:40.004749Z'
1983 toAccountIndex: hez:TKN1:0
1984 toBJJ:
1985 toHezEthereumAddress:
1986 token:
1987 USD: 423
1988 decimals: 18
1989 ethereumAddress: '0x0000000000000000000000000000000000000064'
1990 ethereumBlockNum: 2
1991 fiatUpdate: '2020-11-26T09:18:27.04357Z'
1992 id: 1
1993 itemId: 2
1994 name: Test Token 1
1995 symbol: TKN1
1996 type: CreateAccountDeposit
1997 - L1Info:
1998 L1orL2: L2
1999 L2Info:
2000 fee: 2
2001 historicFeeUSD: 3.87833366166246e-17
2002 nonce: 1
2003 amount: '11111100000000000'
2004 batchNum: 7
2005 fromAccountIndex: hez:TKN1:261
2006 fromBJJ: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
2007 fromHezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
2008 historicUSD: 4.6999953
2009 id: '0x020000000001050000000001'
2010 itemId: 15
2011 position: 2
2012 timestamp: '2020-11-26T09:18:40.004749Z'
2013 toAccountIndex: hez:TKN1:264
2014 toBJJ: hez:Mj_xDCjfN-y3h_4hbhEdtkqnz6LFF1Cf4AV_8IoQswwh
2015 toHezEthereumAddress: hez:0x2B5AD5c4795c026514f8317c7a215E218DcCD6cF
2016 token:
2017 USD: 423
2018 decimals: 18
2019 ethereumAddress: '0x0000000000000000000000000000000000000064'
2020 ethereumBlockNum: 2
2021 fiatUpdate: '2020-11-26T09:18:27.04357Z'
2022 id: 1
2023 itemId: 2
2024 name: Test Token 1
2025 symbol: TKN1
2026 type: Transfer
2027 pendingItems: 23
2028 required:
2029 - transactions
2030 - pendingItems
2031 additionalProperties: false
2032 EthBlockNum:
2033 type: integer
2034 description: Ethereum block number
2035 minimum: 0
2036 maximum: 1.84467440737096e+19
2037 example: 762375478
2038 ToForgeL1TransactionsNum:
2039 type: integer
2040 description: Reference to know in which batch a L1 transaction was forged / will be forged.
2041 minimum: 0
2042 maximum: 4294967295
2043 example: 784
2044 nullable: true
2045 TransactionPosition:
2046 type: integer
2047 description: Position that a transaction occupies in a batch.
2048 minimum: 0
2049 example: 5
2050 URL:
2051 type: string
2052 description: HTTP URL
2053 example: "https://hermez.io"
2054 TokenSymbol:
2055 type: string
2056 description: Abreviation of the token name.
2057 example: "DAI"
2058 TokenName:
2059 type: string
2060 description: Token name.
2061 example: "Dai"
2062 CollectedFees:
2063 type: object
2064 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.
2065 additionalProperties:
2066 type: string
2067 example:
2068 1234: "425632785672345647"
2069 4321: "86538967235465432654352"
2070 Batch:
2071 type: object
2072 description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
2073 properties:
2074 itemId:
2075 $ref: '#/components/schemas/ItemId'
2076 batchNum:
2077 $ref: '#/components/schemas/BatchNum'
2078 ethereumBlockNum:
2079 $ref: '#/components/schemas/EthBlockNum'
2080 ethereumBlockHash:
2081 type: string
2082 description: hash of the Ethereum block in which the batch was forged
2083 example: "0xfe88c94d860f01a17f961bf4bdfb6e0c6cd10d3fda5cc861e805ca1240c58553"
2084 timestamp:
2085 type: string
2086 format: date-time
2087 description: Time in which the batch was forged.
2088 forgerAddr:
2089 $ref: '#/components/schemas/EthereumAddress'
2090 collectedFees:
2091 $ref: '#/components/schemas/CollectedFees'
2092 historicTotalCollectedFeesUSD:
2093 type: number
2094 description: Sum of the all the fees collected, in USD, at the moment the batch was forged.
2095 example: 23.3
2096 stateRoot:
2097 allOf:
2098 - $ref: '#/components/schemas/Hash'
2099 - description: Root of the accounts Merkle Tree.
2100 - example: "2734657026572a8708d883"
2101 numAccounts:
2102 type: integer
2103 description: Number of registered accounts in this batch.
2104 exitRoot:
2105 allOf:
2106 - $ref: '#/components/schemas/Hash'
2107 - description: Root of the exit Merkle Tree associated to this batch.
2108 - example: "2734657026572a8708d883"
2109 forgeL1TransactionsNum:
2110 type: integer
2111 description: Identifier that corresponds to the group of L1 transactions forged in the current batch.
2112 example: 5
2113 nullable: true
2114 slotNum:
2115 $ref: '#/components/schemas/SlotNum'
2116 additionalProperties: false
2117 required:
2118 - itemId
2119 - batchNum
2120 - ethereumBlockNum
2121 - ethereumBlockHash
2122 - timestamp
2123 - forgerAddr
2124 - collectedFees
2125 - historicTotalCollectedFeesUSD
2126 - stateRoot
2127 - numAccounts
2128 - exitRoot
2129 - forgeL1TransactionsNum
2130 - slotNum
2131 FullBatch:
2132 type: object
2133 description: Group of transactions forged in a coordinator and sent and validated in Ethereum.
2134 properties:
2135 batch:
2136 $ref: '#/components/schemas/Batch'
2137 transactions:
2138 type: array
2139 description: List of forged transactions in the batch
2140 items:
2141 $ref: '#/components/schemas/HistoryTransaction'
2142 nullable: true
2143 additionalProperties: false
2144 required:
2145 - batch
2146 - transactions
2147 Hash:
2148 type: string
2149 description: hashed data
2150 example: "2734657026572a8708d883"
2151 SlotNum:
2152 type: integer
2153 description: Identifier of a slot.
2154 minimum: 0
2155 maximum: 4294967295
2156 example: 784
2157 Batches:
2158 type: object
2159 properties:
2160 batches:
2161 type: array
2162 description: List of batches.
2163 items:
2164 $ref: '#/components/schemas/Batch'
2165 pendingItems:
2166 $ref: '#/components/schemas/PendingItems'
2167 additionalProperties: false
2168 required:
2169 - batches
2170 - pendingItems
2171 Coordinator:
2172 type: object
2173 properties:
2174 itemId:
2175 $ref: '#/components/schemas/ItemId'
2176 forgerAddr:
2177 $ref: '#/components/schemas/EthereumAddress'
2178 bidderAddr:
2179 $ref: '#/components/schemas/EthereumAddress'
2180 URL:
2181 $ref: '#/components/schemas/URL'
2182 ethereumBlock:
2183 allOf:
2184 - $ref: '#/components/schemas/EthBlockNum'
2185 - description: Ethereum block in which the coordinator registered into the network.
2186 - example: 5735943738
2187 additionalProperties: false
2188 required:
2189 - itemId
2190 - forgerAddr
2191 - bidderAddr
2192 - URL
2193 - ethereumBlock
2194 Coordinators:
2195 type: object
2196 properties:
2197 coordinators:
2198 type: array
2199 description: List of coordinators.
2200 items:
2201 $ref: '#/components/schemas/Coordinator'
2202 pendingItems:
2203 $ref: '#/components/schemas/PendingItems'
2204 additionalProperties: false
2205 required:
2206 - coordinators
2207 - pendingItems
2208 Bid:
2209 type: object
2210 description: Tokens placed in an auction by a coordinator to gain the right to forge batches during a specific slot.
2211 properties:
2212 itemId:
2213 $ref: '#/components/schemas/ItemId'
2214 bidderAddr:
2215 $ref: '#/components/schemas/EthereumAddress'
2216 forgerAddr:
2217 $ref: '#/components/schemas/EthereumAddress'
2218 slotNum:
2219 $ref: '#/components/schemas/SlotNum'
2220 URL:
2221 $ref: '#/components/schemas/URL'
2222 bidValue:
2223 $ref: '#/components/schemas/BigInt'
2224 ethereumBlockNum:
2225 $ref: '#/components/schemas/EthBlockNum'
2226 timestamp:
2227 type: string
2228 format: date-time
2229 additionalProperties: false
2230 required:
2231 - bidderAddr
2232 - forgerAddr
2233 - slotNum
2234 - URL
2235 - bidValue
2236 - ethereumBlockNum
2237 - timestamp
2238 Bids:
2239 type: object
2240 properties:
2241 bids:
2242 type: array
2243 description: List of bids.
2244 items:
2245 $ref: '#/components/schemas/Bid'
2246 pendingItems:
2247 $ref: '#/components/schemas/PendingItems'
2248 additionalProperties: false
2249 required:
2250 - bids
2251 - pendingItems
2252 RecommendedFee:
2253 type: object
2254 description: Fee that the coordinator recommends per transaction in USD.
2255 properties:
2256 existingAccount:
2257 type: number
2258 description: Recommended fee if the destination account of the transaction already exists.
2259 minimum: 0
2260 example: 0.1
2261 createAccount:
2262 type: number
2263 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.
2264 minimum: 0
2265 example: 1.3
2266 createAccountInternal:
2267 type: number
2268 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.
2269 minimum: 0
2270 example: 0.5
2271 Token:
2272 type: object
2273 description: Hermez Network compatible and registered token.
2274 properties:
2275 id:
2276 $ref: '#/components/schemas/TokenId'
2277 ethereumAddress:
2278 allOf:
2279 - $ref: '#/components/schemas/EthereumAddress'
2280 - description: Ethereum address in which the token is deployed.
2281 - example: "0xaa942cfcd25ad4d90a62358b0dd84f33b398262a"
2282 itemId:
2283 $ref: '#/components/schemas/ItemId'
2284 name:
2285 type: string
2286 description: full name of the token
2287 example: Maker Dai
2288 symbol:
2289 allOf:
2290 - $ref: '#/components/schemas/TokenSymbol'
2291 - example: DAI
2292 decimals:
2293 type: integer
2294 description: Number of decimals of the token.
2295 example: 18
2296 ethereumBlockNum:
2297 allOf:
2298 - $ref: '#/components/schemas/EthBlockNum'
2299 - description: Ethereum block number in which the token was added to the Hermez Network.
2300 - example: 539847538
2301 USD:
2302 type: number
2303 description: Value of the token in USD.
2304 example: 1.01
2305 nullable: true
2306 fiatUpdate:
2307 type: string
2308 format: date-time
2309 description: Timestamp of the moment the `USD` value was updated.
2310 nullable: true
2311 required:
2312 - id
2313 - ethereumAddress
2314 - itemId
2315 - name
2316 - symbol
2317 - decimals
2318 - ethereumBlockNum
2319 - USD
2320 - fiatUpdate
2321 additionalProperties: false
2322 Tokens:
2323 type: object
2324 properties:
2325 tokens:
2326 type: array
2327 description: List of tokens.
2328 items:
2329 $ref: '#/components/schemas/Token'
2330 pendingItems:
2331 $ref: '#/components/schemas/PendingItems'
2332 Exit:
2333 type: object
2334 description: Exit tree leaf. It Contains the necessary information to perform a withdrawal.
2335 properties:
2336 batchNum:
2337 allOf:
2338 - $ref: '#/components/schemas/BatchNum'
2339 - description: Batch in which the exit was forged.
2340 - example: 7394
2341 accountIndex:
2342 $ref: '#/components/schemas/AccountIndex'
2343 itemId:
2344 $ref: '#/components/schemas/ItemId'
2345 merkleProof:
2346 type: object
2347 description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
2348 properties:
2349 Root:
2350 $ref: '#/components/schemas/BigInt'
2351 Siblings:
2352 type: array
2353 items:
2354 $ref: '#/components/schemas/BigInt'
2355 OldKey:
2356 $ref: '#/components/schemas/BigInt'
2357 OldValue:
2358 $ref: '#/components/schemas/BigInt'
2359 IsOld0:
2360 type: boolean
2361 Key:
2362 $ref: '#/components/schemas/BigInt'
2363 Value:
2364 $ref: '#/components/schemas/BigInt'
2365 Fnc:
2366 type: integer
2367 maximum: 3
2368 minimum: 0
2369 required:
2370 - Root
2371 - Siblings
2372 - OldKey
2373 - OldValue
2374 - IsOld0
2375 - Key
2376 - Value
2377 - Fnc
2378 additionalProperties: false
2379 balance:
2380 $ref: '#/components/schemas/BigInt'
2381 instantWithdrawn:
2382 type: integer
2383 description: Block in which the exit balance was instantly withdrawn. Null indicates that an instant withdrawn hasn't been performed.
2384 minimum: 0
2385 maximum: 1.84467440737096e+19
2386 example: 74747363
2387 nullable: true
2388 delayedWithdrawRequest:
2389 type: integer
2390 description: Block in which the exit balance was requested to delay withdraw. Null indicates that a delay withdraw hasn't been performed.
2391 minimum: 0
2392 maximum: 1.84467440737096e+19
2393 example: null
2394 nullable: true
2395 delayedWithdrawn:
2396 type: integer
2397 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.
2398 minimum: 0
2399 maximum: 1.84467440737096e+19
2400 example: null
2401 nullable: true
2402 token:
2403 $ref: '#/components/schemas/Token'
2404 required:
2405 - batchNum
2406 - accountIndex
2407 - itemId
2408 - merkleProof
2409 - balance
2410 - instantWithdrawn
2411 - delayedWithdrawRequest
2412 - delayedWithdrawn
2413 - token
2414 additionalProperties: false
2415 Exits:
2416 type: object
2417 properties:
2418 exits:
2419 type: array
2420 description: List of exits.
2421 items:
2422 $ref: '#/components/schemas/Exit'
2423 pendingItems:
2424 $ref: '#/components/schemas/PendingItems'
2425 required:
2426 - exits
2427 - pendingItems
2428 additionalProperties: false
2429 Account:
2430 type: object
2431 description: State tree leaf. It contains balance and nonce of an account.
2432 properties:
2433 itemId:
2434 $ref: '#/components/schemas/ItemId'
2435 accountIndex:
2436 $ref: '#/components/schemas/AccountIndex'
2437 nonce:
2438 $ref: '#/components/schemas/Nonce'
2439 balance:
2440 $ref: '#/components/schemas/BigInt'
2441 bjj:
2442 $ref: '#/components/schemas/BJJ'
2443 hezEthereumAddress:
2444 $ref: '#/components/schemas/HezEthereumAddress'
2445 token:
2446 $ref: '#/components/schemas/Token'
2447 example:
2448 exits:
2449 - accountIndex: hez:ETH:259
2450 balance: '66666600000000000'
2451 batchNum: 8
2452 delayedWithdrawRequest:
2453 delayedWithdrawn:
2454 instantWithdrawn:
2455 itemId: 1
2456 merkleProof:
2457 Fnc: 0
2458 IsOld0: true
2459 Key: '256'
2460 OldKey: '256'
2461 OldValue: '256'
2462 Root: '256'
2463 Siblings:
2464 - '0'
2465 - '1'
2466 - '2'
2467 Value: '256'
2468 token:
2469 USD: 500
2470 decimals: 18
2471 ethereumAddress: '0x0000000000000000000000000000000000000000'
2472 ethereumBlockNum: 0
2473 fiatUpdate: '2020-11-26T09:57:29.110879Z'
2474 id: 0
2475 itemId: 1
2476 name: Ether
2477 symbol: ETH
2478 pendingItems: 0
2479 additionalProperties: false
2480 required:
2481 - itemId
2482 - accountIndex
2483 - nonce
2484 - balance
2485 - bjj
2486 - hezEthereumAddress
2487 - token
2488 Accounts:
2489 type: object
2490 properties:
2491 accounts:
2492 type: array
2493 description: List of accounts.
2494 items:
2495 $ref: '#/components/schemas/Account'
2496 pendingItems:
2497 $ref: '#/components/schemas/PendingItems'
2498 example:
2499 accounts:
2500 - accountIndex: hez:ETH:259
2501 balance: '2590000000000000000'
2502 bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
2503 hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
2504 itemId: 4
2505 nonce: 0
2506 token:
2507 USD: 500
2508 decimals: 18
2509 ethereumAddress: '0x0000000000000000000000000000000000000000'
2510 ethereumBlockNum: 0
2511 fiatUpdate: '2020-11-26T09:53:47.444444Z'
2512 id: 0
2513 itemId: 1
2514 name: Ether
2515 symbol: ETH
2516 - accountIndex: hez:TKN1:261
2517 balance: '2610000000'
2518 bjj: hez:W6x4TZOAZ9mAqdOb3Xm_hKDLspaXfEfMMN4tXOkinS-W
2519 hezEthereumAddress: hez:0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf
2520 itemId: 6
2521 nonce: 0
2522 token:
2523 USD: 423
2524 decimals: 18
2525 ethereumAddress: '0x0000000000000000000000000000000000000064'
2526 ethereumBlockNum: 2
2527 fiatUpdate: '2020-11-26T09:53:47.456619Z'
2528 id: 1
2529 itemId: 2
2530 name: Test Token 1
2531 symbol: TKN1
2532 pendingItems: 0
2533 additionalProperties: false
2534 required:
2535 - accounts
2536 - pendingItems
2537 Slot:
2538 type: object
2539 description: Slot information.
2540 properties:
2541 itemId:
2542 $ref: '#/components/schemas/ItemId'
2543 slotNum:
2544 $ref: '#/components/schemas/SlotNum'
2545 firstBlock:
2546 allOf:
2547 - $ref: '#/components/schemas/EthBlockNum'
2548 - description: Block in which the slot began or will begin
2549 - example: 76238647846
2550 lastBlock:
2551 allOf:
2552 - $ref: '#/components/schemas/EthBlockNum'
2553 - description: Block in which the slot ended or will end
2554 - example: 4475934
2555 openAuction:
2556 type: boolean
2557 description: Whether the auction of the slot is open or not.
2558 bestBid:
2559 type: object
2560 description: The best bid of the auction. If the bestBid is null, it is because no coordinator has bid for that slot.
2561 nullable: true
2562 properties:
2563 itemId:
2564 $ref: '#/components/schemas/ItemId'
2565 bidderAddr:
2566 $ref: '#/components/schemas/EthereumAddress'
2567 forgerAddr:
2568 $ref: '#/components/schemas/EthereumAddress'
2569 slotNum:
2570 $ref: '#/components/schemas/SlotNum'
2571 URL:
2572 $ref: '#/components/schemas/URL'
2573 bidValue:
2574 type: string
2575 description: BigInt is an integer encoded as a string for numbers that are very large.
2576 example: "8708856933496328593"
2577 pattern: "^\\d+$"
2578 ethereumBlockNum:
2579 $ref: '#/components/schemas/EthBlockNum'
2580 timestamp:
2581 type: string
2582 format: date-time
2583 additionalProperties: false
2584 required:
2585 - bidderAddr
2586 - forgerAddr
2587 - slotNum
2588 - URL
2589 - bidValue
2590 - ethereumBlockNum
2591 - timestamp
2592 additionalProperties: false
2593 required:
2594 - slotNum
2595 - firstBlock
2596 - lastBlock
2597 - openAuction
2598 - bestBid
2599 Slots:
2600 type: object
2601 properties:
2602 slots:
2603 type: array
2604 description: List of slots.
2605 items:
2606 allOf:
2607 - $ref: '#/components/schemas/Slot'
2608 - description: Last synchronized Etherum block.
2609 pendingItems:
2610 $ref: '#/components/schemas/PendingItems'
2611 additionalProperties: false
2612 required:
2613 - slots
2614 - pendingItems
2615 NextForger:
2616 type: object
2617 description: Coordinator information along with the scheduled forging period
2618 properties:
2619 coordinator:
2620 $ref: '#/components/schemas/Coordinator'
2621 period:
2622 type: object
2623 description: Time period in which the coordinator will have the ability to forge. Specified both in Ethereum blocks and timestamp
2624 properties:
2625 slotNum:
2626 $ref: '#/components/schemas/SlotNum'
2627 fromBlock:
2628 $ref: '#/components/schemas/EthBlockNum'
2629 toBlock:
2630 $ref: '#/components/schemas/EthBlockNum'
2631 fromTimestamp:
2632 type: string
2633 format: date-time
2634 toTimestamp:
2635 type: string
2636 format: date-time
2637 required:
2638 - slotNum
2639 - fromBlock
2640 - toBlock
2641 - fromTimestamp
2642 - toTimestamp
2643 additionalProperties: false
2644 required:
2645 - coordinator
2646 - period
2647 additionalProperties: false
2648 NextForgers:
2649 type: array
2650 description: List of next coordinators to forge.
2651 items:
2652 $ref: '#/components/schemas/NextForger'
2653 State:
2654 type: object
2655 description: Gobal variables of the network
2656 properties:
2657 network:
2658 $ref: '#/components/schemas/StateNetwork'
2659 metrics:
2660 $ref: '#/components/schemas/StateMetrics'
2661 rollup:
2662 $ref: '#/components/schemas/StateRollup'
2663 auction:
2664 $ref: '#/components/schemas/StateAuction'
2665 withdrawalDelayer:
2666 $ref: '#/components/schemas/StateWithdrawDelayer'
2667 recommendedFee:
2668 $ref: '#/components/schemas/RecommendedFee'
2669 additionalProperties: false
2670 required:
2671 - network
2672 - metrics
2673 - rollup
2674 - auction
2675 - withdrawalDelayer
2676 - recommendedFee
2677 StateNetwork:
2678 type: object
2679 description: Gobal statistics of the network
2680 properties:
2681 lastEthereumBlock:
2682 allOf:
2683 - $ref: '#/components/schemas/EthBlockNum'
2684 - description: Current Etherum block. Note that this is the actual last block of Ethereum, not the last synchronized block by the node.
2685 - example: 3457437
2686 lastSynchedBlock:
2687 allOf:
2688 - $ref: '#/components/schemas/EthBlockNum'
2689 - description: Last synchronized Etherum block. Compare with lastEthereumBlock to check the synchronization status of the node.
2690 - example: 3457437
2691 lastBatch:
2692 $ref: '#/components/schemas/Batch'
2693 currentSlot:
2694 allOf:
2695 - $ref: '#/components/schemas/SlotNum'
2696 - description: Slot where batches are currently being forged.
2697 - example: 2334
2698 nextForgers:
2699 $ref: '#/components/schemas/NextForgers'
2700 additionalProperties: false
2701 required:
2702 - lastEthereumBlock
2703 - lastSynchedBlock
2704 - lastBatch
2705 - currentSlot
2706 - nextForgers
2707 StateAuction:
2708 type: object
2709 description: Auction parameters.
2710 properties:
2711 ethereumBlockNum:
2712 $ref: '#/components/schemas/EthBlockNum'
2713 bootCoordinator:
2714 allOf:
2715 - $ref: '#/components/schemas/EthereumAddress'
2716 - description: Ethereum address of the boot coordinator.
2717 - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
2718 bootCoordinatorUrl:
2719 type: string
2720 description: Boot Coordinator URL
2721 example: "https://boot.coordinator.io"
2722 slotDeadline:
2723 type: integer
2724 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.
2725 example: 3
2726 closedAuctionSlots:
2727 type: integer
2728 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.
2729 example: 2
2730 openAuctionSlots:
2731 type: integer
2732 description: Amount of days in advance are auctions opened.
2733 defaultSlotSetBid:
2734 type: array
2735 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]`."
2736 items:
2737 type: integer
2738 example: [32,0,68,21,55,99]
2739 outbidding:
2740 type: number
2741 description: Minimum outbid over the previous one to consider it valid.
2742 example: 3.64
2743 donationAddress:
2744 allOf:
2745 - $ref: '#/components/schemas/EthereumAddress'
2746 - description: Ethereum address where the donations will go to.
2747 - example: "0x887dc4262BCDbf85190C01c996b4C06a461d2430"
2748 allocationRatio:
2749 type: array
2750 description: Percentage in which fees will be split between donations, governance, and burning. The sum of the tree values should be 100.
2751 items:
2752 type: integer
2753 example: [80,10,10]
2754 additionalProperties: false
2755 required:
2756 - ethereumBlockNum
2757 - bootCoordinator
2758 - bootCoordinatorUrl
2759 - slotDeadline
2760 - closedAuctionSlots
2761 - openAuctionSlots
2762 - defaultSlotSetBid
2763 - outbidding
2764 - donationAddress
2765 - allocationRatio
2766 StateRollup:
2767 type: object
2768 description: Rollup parameters
2769 properties:
2770 ethereumBlockNum:
2771 $ref: '#/components/schemas/EthBlockNum'
2772 forgeL1L2BatchTimeout:
2773 type: integer
2774 description: Max Ethereum blocks after the last L1-L2-batch, when exceeds the timeout only L1-L2-batch are allowed.
2775 example: 5
2776 feeAddToken:
2777 type: integer
2778 description: Fee to pay when registering tokens into the network.
2779 example: 5698
2780 withdrawalDelay:
2781 type: integer
2782 description: Withdraw delay in seconds
2783 example: 432000
2784 buckets:
2785 type: array
2786 description: List of buckets state
2787 items:
2788 type: object
2789 properties:
2790 ceilUSD:
2791 type: integer
2792 description: Max USD value
2793 example: 1000
2794 withdrawals:
2795 type: integer
2796 description: Available withdrawals of the bucket
2797 example: 4
2798 blockWithdrawalRate:
2799 type: integer
2800 description: Every `blockWithdrawalRate` blocks add 1 withdrawal
2801 example: 8
2802 maxWithdrawals:
2803 type: integer
2804 description: Max withdrawals the bucket can hold
2805 example: 4
2806 additionalProperties: false
2807 required:
2808 - ceilUSD
2809 - withdrawals
2810 - blockWithdrawalRate
2811 - maxWithdrawals
2812 additionalProperties: false
2813 required:
2814 - ethereumBlockNum
2815 - forgeL1L2BatchTimeout
2816 - feeAddToken
2817 - withdrawalDelay
2818 - buckets
2819 StateWithdrawDelayer:
2820 type: object
2821 description: Withdrawal delayer parameters
2822 properties:
2823 ethereumBlockNum:
2824 $ref: '#/components/schemas/EthBlockNum'
2825 hermezGovernanceAddress:
2826 allOf:
2827 - $ref: '#/components/schemas/EthereumAddress'
2828 - description: Ethereum address of the governance.
2829 - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
2830 emergencyCouncilAddress:
2831 allOf:
2832 - $ref: '#/components/schemas/EthereumAddress'
2833 - description: Ethereum address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
2834 - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
2835 withdrawalDelay:
2836 allOf:
2837 - $ref: '#/components/schemas/EthBlockNum'
2838 - description: The time that everyone needs to wait until a withdrawal of the funds is allowed, in seconds.
2839 - example: 539573849
2840 emergencyModeStartingBlock:
2841 type: integer
2842 description: Block number in which the emergency mode has been activated.
2843 example: 10
2844 emergencyMode:
2845 type: boolean
2846 description: Indicates if emergency mode has been activated.
2847 example: false
2848 additionalProperties: false
2849 required:
2850 - ethereumBlockNum
2851 - hermezGovernanceAddress
2852 - emergencyCouncilAddress
2853 - withdrawalDelay
2854 - emergencyModeStartingBlock
2855 - emergencyMode
2856 StateMetrics:
2857 type: object
2858 description: Metrics of the network
2859 properties:
2860 transactionsPerBatch:
2861 type: number
2862 description: Average transactions per batch in the last 24 hours.
2863 example: 2002.7
2864 batchFrequency:
2865 type: number
2866 description: Average elapsed time between batches in the last 24 hours, in seconds.
2867 example: 8.9
2868 transactionsPerSecond:
2869 type: number
2870 description: Average transactions per second in the last 24 hours.
2871 example: 302.3
2872 totalAccounts:
2873 type: integer
2874 description: Number of created accounts.
2875 example: 90473
2876 totalBJJs:
2877 type: integer
2878 description: Number of different registered BJJs.
2879 example: 23067
2880 avgTransactionFee:
2881 type: number
2882 description: Average fee percentage paid for L2 transactions in the last 24 hours.
2883 example: 1.54
2884 additionalProperties: false
2885 required:
2886 - transactionsPerBatch
2887 - batchFrequency
2888 - transactionsPerSecond
2889 - totalAccounts
2890 - totalBJJs
2891 - avgTransactionFee
2892 PendingItems:
2893 type: integer
2894 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.
2895 example: 15
2896 Config:
2897 type: object
2898 description: Configuration parameters of the different smart contracts that power the Hermez Network.
2899 properties:
2900 hermez:
2901 type: object
2902 description: Constant configuration of the Hermez smart contract.
2903 properties:
2904 publicConstants:
2905 type: object
2906 description: Public Hermez smart contract constants
2907 properties:
2908 tokenHEZ:
2909 allOf:
2910 - $ref: '#/components/schemas/EthereumAddress'
2911 - description: Ethereum address of the HEZ token.
2912 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
2913 absoluteMaxL1L2BatchTimeout:
2914 type: integer
2915 description: L1L2 Batch Timeout
2916 example: 240
2917 verifiers:
2918 type: array
2919 description: List of verifiers struct
2920 items:
2921 type: object
2922 properties:
2923 maxTx:
2924 type: integer
2925 description: Maximum rollup transactions in a batch
2926 example: 512
2927 nlevels:
2928 type: integer
2929 description: Number of levels of the circuit
2930 example: 32
2931 required:
2932 - maxTx
2933 - nlevels
2934 additionalProperties: false
2935 hermezAuctionContract:
2936 allOf:
2937 - $ref: '#/components/schemas/EthereumAddress'
2938 - description: Ethereum address of the auction smart contract.
2939 - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
2940 hermezGovernanceAddress:
2941 allOf:
2942 - $ref: '#/components/schemas/EthereumAddress'
2943 - description: Ethereum address of the governance.
2944 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
2945 withdrawDelayerContract:
2946 allOf:
2947 - $ref: '#/components/schemas/EthereumAddress'
2948 - description: Ethereum address of the withdraw delayer contracts.
2949 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
2950 required:
2951 - tokenHEZ
2952 - absoluteMaxL1L2BatchTimeout
2953 - verifiers
2954 - hermezAuctionContract
2955 - hermezGovernanceAddress
2956 - withdrawDelayerContract
2957 additionalProperties: false
2958 maxFeeIdxCoordinator:
2959 type: integer
2960 description: is the maximum number of tokens the coordinator can use to collect fees.
2961 example: 64
2962 reservedIdx:
2963 type: integer
2964 description: First 256 indexes reserved, first user index will be the 256.
2965 example: 255
2966 exitIdx:
2967 type: integer
2968 description: Account index used to indicate that a transaction is an `exit` or `force exit`.
2969 example: 1
2970 limitDepositAmount:
2971 type: integer
2972 description: Maximum deposit amount (L1 to L2) allowed.
2973 example: 321
2974 limitL2TransferAmount:
2975 type: integer
2976 description: Maximum amount (L2 to L2) allowed.
2977 example: 837
2978 limitTokens:
2979 type: integer
2980 description: Maximum number of different tokens that can be registered in the network.
2981 example: 4294967295
2982 l1CoordinatorTotalBytes:
2983 type: integer
2984 description: Number of bytes that a L1 coordinator transaction has ([4 bytes] token + [32 bytes] babyjub + [65 bytes] compressedSignature).
2985 example: 101
2986 l1UserTotalBytes:
2987 type: integer
2988 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).
2989 example: 72
2990 maxL1UserTx:
2991 type: integer
2992 description: Maximum L1-user transactions allowed to be queued in a batch.
2993 example: 128
2994 maxL1Tx:
2995 type: integer
2996 description: Maximum L1 transactions allowed to be queued in a batch.
2997 example: 256
2998 inputSHAConstantBytes:
2999 type: integer
3000 description: Input SHA constant bytes
3001 example: 18542
3002 numBuckets:
3003 type: integer
3004 description: Number of buckets
3005 example: 5
3006 maxWithdrawalDelay:
3007 type: integer
3008 description: Maximum delay to withdraw tokens. Time is measured in seconds.
3009 example: 2 * 7 * 24 * 60 * 60
3010 exchangeMultiplier:
3011 type: integer
3012 description: exchange multiplier
3013 example: 1e14
3014 required:
3015 - publicConstants
3016 - reservedIdx
3017 - exitIdx
3018 - limitDepositAmount
3019 - limitL2TransferAmount
3020 - limitTokens
3021 - l1CoordinatorTotalBytes
3022 - l1UserTotalBytes
3023 - maxL1UserTx
3024 - maxL1Tx
3025 - inputSHAConstantBytes
3026 - numBuckets
3027 - maxWithdrawalDelay
3028 - exchangeMultiplier
3029 additionalProperties: false
3030 auction:
3031 type: object
3032 description: Constant configuration of the auction smart contract.
3033 properties:
3034 blocksPerSlot:
3035 type: integer
3036 description: Blocks per slot.
3037 initialMinimalBidding:
3038 type: integer
3039 description: Minimum bid when no one has bid yet.
3040 genesisBlockNum:
3041 allOf:
3042 - $ref: '#/components/schemas/EthBlockNum'
3043 - description: Ethereum block number in which the smart contract starts operating.
3044 tokenHEZ:
3045 allOf:
3046 - $ref: '#/components/schemas/EthereumAddress'
3047 - description: Ethereum address of the HEZ token.
3048 - example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
3049 hermezRollup:
3050 allOf:
3051 - $ref: '#/components/schemas/EthereumAddress'
3052 - description: Ethereum address of the rollup smart contract.
3053 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
3054 governanceAddress:
3055 allOf:
3056 - $ref: '#/components/schemas/EthereumAddress'
3057 - description: Ethereum address of the governance.
3058 - example: "0x444dc4262BCDbf85190C01c996b4C06a461d2430"
3059 required:
3060 - blocksPerSlot
3061 - initialMinimalBidding
3062 - genesisBlockNum
3063 - tokenHEZ
3064 - hermezRollup
3065 - governanceAddress
3066 additionalProperties: false
3067 withdrawalDelayer:
3068 type: object
3069 description: Constant configuration of the withdrawal delayer smart contract.
3070 properties:
3071 maxWithdrawalDelay:
3072 type: integer
3073 description: Maximum time delay in which the tokens can be locked in the contract. Time is measured in seconds.
3074 example: 200
3075 maxEmergencyModeTime:
3076 type: integer
3077 description: Maximum amount of time in which the contract can be in emergency mode. Time is measured in seconds.
3078 example: 2000
3079 hermezRollup:
3080 allOf:
3081 - $ref: '#/components/schemas/EthereumAddress'
3082 - description: Ethereum address of the rollup smart contract.
3083 - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
3084 required:
3085 - maxWithdrawalDelay
3086 - maxEmergencyModeTime
3087 - hermezRollup
3088 additionalProperties: false
3089 required:
3090 - hermez
3091 - auction
3092 - withdrawalDelayer
3093 additionalProperties: false
3094 Error:
3095 type: object
3096 description: Error response.
3097 properties:
3098 message:
3099 type: string
3100 Error400:
3101 allOf:
3102 - $ref: '#/components/schemas/Error'
3103 - example:
3104 message: Invalid signature.
3105 Error404:
3106 allOf:
3107 - $ref: '#/components/schemas/Error'
3108 - example:
3109 message: Item(s) not found.
3110 Error500:
3111 allOf:
3112 - $ref: '#/components/schemas/Error'
3113 - example:
3114 message: Database error.