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}$"
example:null
nullable:true
amount:
allOf:
- $ref:'#/components/schemas/BigInt'
@ -1308,6 +1319,7 @@ components:
- type
- tokenId
- fromAccountIndex
- toAccountIndex
- toHezAccountIndex
- toHezEthereumAddress
- toBjj
@ -1333,13 +1345,24 @@ components:
fromAccountIndex:
$ref:'#/components/schemas/AccountIndex'
toAccountIndex:
allOf:
- $ref:'#/components/schemas/AccountIndex'
- example:"hez:DAI:672"
type:string
description:>-
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`
example:"hez:DAI:309"
nullable:true
toHezEthereumAddress:
$ref:'#/components/schemas/HezEthereumAddress'
type:string
description:"Address of an Etherum account linked to the Hermez network."
pattern:"^hez:0x[a-fA-F0-9]{40}$"
example:null
nullable:true
toBjj:
$ref:'#/components/schemas/BJJ'
type:string
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}$"
example:null
nullable:true
amount:
allOf:
- $ref:'#/components/schemas/BigInt'
@ -1448,7 +1471,6 @@ components:
description:Type of transaction.
enum:
- Exit
- Withdrawn
- Transfer
- Deposit
- CreateAccountDeposit
@ -1539,7 +1561,12 @@ components:
position:
$ref:'#/components/schemas/TransactionPosition'
fromAccountIndex:
$ref:'#/components/schemas/AccountIndex'
type:string
description:>-
Identifier of an account. It references the position where the account is inside the state Merkle tree.
The identifier is built using:`hez:` + `token symbol:` + `index`
example:"hez:DAI:4444"
nullable:true
toAccountIndex:
allOf:
- $ref:'#/components/schemas/AccountIndex'
@ -1666,6 +1693,7 @@ components:
minimum:0
maximum:4294967295
example:784
nullable:true
TransactionPosition:
type:integer
description:Position that a transaction occupies in a batch.
@ -1689,8 +1717,8 @@ components:
items:
type:object
properties:
token:
$ref:'#/components/schemas/Token'
tokenId:
$ref:'#/components/schemas/TokenId'
amount:
allOf:
- $ref:'#/components/schemas/BigInt'
@ -1716,6 +1744,9 @@ components:
$ref:'#/components/schemas/EthereumAddress'
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:
type:number
description:Sum of the all the fees collected, in USD, at the moment the batch was forged.
ForgeL1TxsNumint64`meddler:"forge_l1_txs_num"`// optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
ForgeL1TxsNum*int64`meddler:"forge_l1_txs_num"`// optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
SlotNumSlotNum`meddler:"slot_num"`// Slot in which the batch is forged
ToForgeL1TxsNumint64// toForgeL1TxsNum in which the tx was forged / will be forged
ToForgeL1TxsNum*int64// toForgeL1TxsNum in which the tx was forged / will be forged
Positionint
UserOriginbool// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
FromIdxIdx// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.LoadAmount (deposit)
FromIdx*Idx// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.LoadAmount (deposit)
FromEthAddrethCommon.Address
FromBJJ*babyjub.PublicKey
ToIdxIdx// ToIdx is ignored in L1Tx/Deposit, but used in the L1Tx/DepositAndTransfer
// TxTypeExit represents L2->L1 token transfer. A leaf for this account appears in the exit tree of the block
TxTypeExitTxType="Exit"
// TxTypeWithdrawn represents the balance that was moved from L2->L1 has been widthrawn from the smart contract
TxTypeWithdrawnTxType="Withdrawn"
// TxTypeTransfer represents L2->L2 token transfer
TxTypeTransferTxType="Transfer"
// TxTypeDeposit represents L1->L2 transfer
@ -86,8 +85,8 @@ type Tx struct {
TxIDTxID`meddler:"id"`
TypeTxType`meddler:"type"`
Positionint`meddler:"position"`
FromIdxIdx`meddler:"from_idx"`
ToIdxIdx`meddler:"to_idx"`
FromIdx*Idx`meddler:"from_idx"`
ToIdx*Idx`meddler:"to_idx"`
Amount*big.Int`meddler:"amount,bigint"`
AmountFloatfloat64`meddler:"amount_f"`
TokenIDTokenID`meddler:"token_id"`
@ -95,9 +94,9 @@ type Tx struct {
BatchNum*BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
ToForgeL1TxsNumint64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOriginbool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
BatchNum*common.BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
ToForgeL1TxsNumint64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOriginbool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes