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