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