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