description:Get exit information form a specific exit tree and account. This information is required to perform a withdraw.
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.
operationId:getExit
operationId:getExit
parameters:
parameters:
- name:batchNum
- name:batchNum
@ -614,6 +614,12 @@ paths:
description:Include only `batchNum > maxBatchNum` batches.
description:Include only `batchNum > maxBatchNum` batches.
schema:
schema:
type:number
type:number
- name:slotNum
in:query
required:false
description:Include only batches that were forged within the specified slot.
schema:
$ref:'#/components/schemas/SlotNum'
- name:forgerAddr
- name:forgerAddr
in:query
in:query
required:false
required:false
@ -941,40 +947,12 @@ paths:
application/json:
application/json:
schema:
schema:
$ref:'#/components/schemas/Error500'
$ref:'#/components/schemas/Error500'
'/next-forgers':
get:
tags:
- Hermez status
summary:Get next coordinators to forge.
description:>-
Return a list of the coordinators that will forge in the next slots.
The response includes the coordinator that is currently forging, and the ones that have won the upcomming slots whose auctions are closed.
operationId:getNextForgers
responses:
'200':
description:Successful operation.
content:
application/json:
schema:
$ref:'#/components/schemas/NextForgers'
'400':
description:Bad request.
content:
application/json:
schema:
$ref:'#/components/schemas/Error400'
'500':
description:Internal server error.
content:
application/json:
schema:
$ref:'#/components/schemas/Error500'
'/state':
'/state':
get:
get:
tags:
tags:
- Hermez status
- Hermez status
summary:Return global statistics and metrics of the network.
description:Return global statistics and metrics of the network.
summary:Return information that represents the current state of the network.
description:Return information that represents the current state of the network. It also includes metrics and statistics.
operationId:getState
operationId:getState
responses:
responses:
'200':
'200':
@ -1133,27 +1111,6 @@ paths:
application/json:
application/json:
schema:
schema:
$ref:'#/components/schemas/Error500'
$ref:'#/components/schemas/Error500'
'/recommended-fee':
get:
tags:
- Hermez status
summary:Get recommended fee in USD.
description:>-
Get recommended fee in USD. Recommended price to pay according to the status of the destination account.
operationId:getFee
responses:
'200':
description:Successful operation
content:
application/json:
schema:
$ref:'#/components/schemas/RecommendedFee'
'500':
description:Internal server error.
content:
application/json:
schema:
$ref:'#/components/schemas/Error500'
'/coordinators':
'/coordinators':
get:
get:
tags:
tags:
@ -1251,6 +1208,7 @@ components:
description:Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
description:Position of the item in the DB. This is useful for pagination, but has nothing to do with the protocol.
PostPoolL2Transaction:
PostPoolL2Transaction:
type:object
type:object
description:L2 transaction to be posted.
properties:
properties:
id:
id:
$ref:'#/components/schemas/TransactionId'
$ref:'#/components/schemas/TransactionId'
@ -1264,18 +1222,21 @@ components:
type:string
type:string
description:>-
description:>-
Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
Identifier of the destination account. It references the position where the account is inside the state Merkle tree.
The identifier is built using:`hez:` + `token symbol:` + `index`
The identifier is built using:`hez:` + `token symbol:` + `index`. If this is provided, toHezEthereumAddress and toBjj
must be null. To perform an exit the value hez:EXIT:1 must be used.
example:null
example:null
nullable:true
nullable:true
toHezEthereumAddress:
toHezEthereumAddress:
type:string
type:string
description:"Address of an Etherum account linked to the Hermez network."
description:"Address of an Etherum account linked to the Hermez network. If this is provided, toAccountIndex and toBjj must be null."
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."
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.
If this is prvided, toAccountIndex must be null and toHezEthereumAddress must be hez:0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.
pattern:"^hez:[A-Za-z0-9_-]{44}$"
pattern:"^hez:[A-Za-z0-9_-]{44}$"
example:null
example:null
nullable:true
nullable:true
@ -1309,9 +1270,9 @@ components:
pattern:"^hez:0x[a-fA-F0-9]{40}$"
pattern:"^hez:0x[a-fA-F0-9]{40}$"
example:null
example:null
nullable:true
nullable:true
requestToBJJ:
requestToBjj:
type:string
type:string
description:References the `toBJJ` of the requested transaction.
description:References the `toBjj` of the requested transaction.
pattern:"^hez:[A-Za-z0-9_-]{44}$"
pattern:"^hez:[A-Za-z0-9_-]{44}$"
example:null
example:null
nullable:true
nullable:true
@ -1340,22 +1301,10 @@ components:
- type
- type
- tokenId
- tokenId
- fromAccountIndex
- fromAccountIndex
- toAccountIndex
- toHezAccountIndex
- toHezEthereumAddress
- toBjj
- amount
- amount
- fee
- fee
- nonce
- nonce
- signature
- signature
- requestFromAccountIndex
- requestToAccountIndex
- requestToHezEthereumAddress
- requestToBJJ
- requestTokenId
- requestAmount
- requestFee
- requestNonce
PoolL2Transaction:
PoolL2Transaction:
type:object
type:object
properties:
properties:
@ -1405,63 +1354,87 @@ components:
description:Moment in which the transaction was added to the pool.
description:Moment in which the transaction was added to the pool.
format:date-time
format:date-time
batchNum:
batchNum:
allOf:
- $ref:'#/components/schemas/BatchNum'
- nullable:true
- example:5432
type:integer
description:Identifier of a batch. Every new forged batch increments by one the batchNum, starting at 0.
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."
pattern:"^hez:[A-Za-z0-9_-]{44}$"
nullable:true
example:null
requestTokenId:
requestTokenId:
allOf:
- $ref:'#/components/schemas/TokenId'
- nullable:true
- example:4444
type:integer
description:References the `tokenId` of the requested transaction.
example:null
nullable:true
requestAmount:
requestAmount:
allOf:
- $ref:'#/components/schemas/BigInt'
- description:Amount of tokens to be sent.
- example:"700000000000000000"
- nullable:true
type:string
description:BigInt is an integer encoded as a string for numbers that are very large.
nullable:true
example:null
requestFee:
requestFee:
allOf:
- $ref:'#/components/schemas/FeeSelector'
- nullable:true
- example:8
type:integer
description:Index of the fee type to select, more info [here](https://idocs.hermez.io/#/spec/zkrollup/fee-table?id=transaction-fee-table).
minimum:0
maximum:256
nullable:true
example:null
requestNonce:
requestNonce:
allOf:
- $ref:'#/components/schemas/Nonce'
- nullable:true
- example:6
type:integer
description:Number that can only be used once per account. Increments by one with each transaction.
minimum:0
maximum:1.84467440737096e+19
nullable:true
example:null
token:
token:
$ref:'#/components/schemas/Token'
$ref:'#/components/schemas/Token'
required:
required:
- fromAccountIndex
- toHezAccountIndex
- toHezEthereumAddress
- toBjj
- tokenId
- amount
- fee
- nonce
- signature
- id
- type
- fromAccountIndex
- toAccountIndex
- toHezEthereumAddress
- toBjj
- amount
- fee
- nonce
- state
- signature
- timestamp
- batchNum
- requestFromAccountIndex
- requestToAccountIndex
- requestToHezEthereumAddress
- requestToBJJ
- requestTokenId
- requestAmount
- requestFee
- requestNonce
- token
TransactionId:
TransactionId:
type:string
type:string
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)
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)
@ -1514,7 +1487,7 @@ components:
description:Identifier of a token registered in the network.
description:Identifier of a token registered in the network.
minimum:0
minimum:0
maximum:4294967295
maximum:4294967295
example:4444
example:98765
BigInt:
BigInt:
type:string
type:string
description:BigInt is an integer encoded as a string for numbers that are very large.
description:BigInt is an integer encoded as a string for numbers that are very large.
@ -1776,9 +1749,6 @@ components:
$ref:'#/components/schemas/EthereumAddress'
$ref:'#/components/schemas/EthereumAddress'
collectedFees:
collectedFees:
$ref:'#/components/schemas/CollectedFees'
$ref:'#/components/schemas/CollectedFees'
totalCollectedFeesUSD:
type:number
description:Value in USD of the collected tokens by the forger in concept of fees. This is calculated at the moment the batch is forged, with the conversion rates at that time.
historicTotalCollectedFeesUSD:
historicTotalCollectedFeesUSD:
type:number
type:number
description:Sum of the all the fees collected, in USD, at the moment the batch was forged.
description:Sum of the all the fees collected, in USD, at the moment the batch was forged.
@ -2124,11 +2094,6 @@ components:
- description:Coordinator who won the auction. Only applicable if the auction is closed.
- description:Coordinator who won the auction. Only applicable if the auction is closed.
- nullable:true
- nullable:true
- example:null
- example:null
batchNums:
type:array
description:List of batch numbers that were forged during the slot
items:
$ref:'#/components/schemas/BatchNum'
Slots:
Slots:
type:object
type:object
properties:
properties:
@ -2212,6 +2177,10 @@ components:
type:number
type:number
description:Average fee percentage paid for L2 transactions in the last 24 hours.
description:Average fee percentage paid for L2 transactions in the last 24 hours.
example:1.54
example:1.54
nextForgers:
$ref:'#/components/schemas/NextForgers'
recommendedFee:
$ref:'#/components/schemas/RecommendedFee'
governance:
governance:
type:object
type:object
description:Network setings that are updatable by the governance.
description:Network setings that are updatable by the governance.
AuxToIdxIdx`meddler:"-"`// AuxToIdx is only used internally at the StateDB to avoid repeated computation when processing transactions (from Synchronizer, TxSelector, BatchBuilder)
ToEthAddrethCommon.Address`meddler:"to_eth_addr"`
ToBJJ*babyjub.PublicKey`meddler:"to_bjj"`
TokenIDTokenID`meddler:"token_id"`
Amount*big.Int`meddler:"amount,bigint"`// TODO: change to float16
FeeFeeSelector`meddler:"fee"`
NonceNonce`meddler:"nonce"`// effective 40 bits used
Timestamptime.Time`meddler:"timestamp,utctime"`// time when added to the tx pool
TxIDTxID`meddler:"tx_id"`
FromIdxIdx`meddler:"from_idx"`
ToIdxIdx`meddler:"to_idx,zeroisnull"`
AuxToIdxIdx`meddler:"-"`// AuxToIdx is only used internally at the StateDB to avoid repeated computation when processing transactions (from Synchronizer, TxSelector, BatchBuilder)
ToEthAddrethCommon.Address`meddler:"to_eth_addr"`
ToBJJ*babyjub.PublicKey`meddler:"to_bjj"`
TokenIDTokenID`meddler:"token_id"`
Amount*big.Int`meddler:"amount,bigint"`// TODO: change to float16
FeeFeeSelector`meddler:"fee"`
NonceNonce`meddler:"nonce"`// effective 40 bits used