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