Get L2 block info

Rate limit: 5 every second

API Overview


HTTP method

GET

Path

/api/v3/block/getBlock

Summary

Get L2 block info by block id

API description


HTTP Header

Field Type Required Description Example
X-API-KEY string Y ApiKey "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ
6B6DQ6THZWbvrAGxzEdulXQvOKLrRW
ZLnN"

Request parameters

Field Type Required Description Example
id string N The block id, could be finalized, confirmed, or block_idx_num
Default : finalized
Allowable : ['finalized', 'confirmed', '{block_idx_num}']
"1234"

Request example

HTTP
CURL
GET https://api3.loopring.io/api/v3/block/getBlock?id=1234 HTTP/1.1
Host: api3.loopring.io
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh,en;q=0.9
X-API-KEY: sra1aavfa
curl -H "X-API-KEY:sra1aavfa" https://api3.loopring.io/api/v3/block/getBlock\?id\=1234

Response fields

Field Type Required Description Example
blockId integer Y The num index of the block 1235
blockSize integer Y The block size 64
exchange string Y The exchange address "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
txHash string Y The txHash of the block "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
status string Y The status of the block "pending"
createdAt integer Y The creation time of the block 1627904776000
transactions List[Transaction
Block
]
Y The txs list inside the block /

Response example

{
  "blockId" : 1235,
  "blockSize" : 64,
  "exchange" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
  "txHash" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
  "status" : "pending",
  "createdAt" : 1627904776000,
  "transactions" : [
    {
      "txType" : "transfer",
      "accountId" : 10006,
      "owner" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
      "token" : {
        "tokenId" : 6,
        "tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "amount" : "100"
      },
      "toToken" : {
        "tokenId" : 6,
        "tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "amount" : "100"
      },
      "fee" : {
        "tokenId" : 6,
        "tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "amount" : "100"
      },
      "validUntil" : 1627904776,
      "toAccountId" : 10006,
      "toAccountAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
      "storageId" : 2,
      "orderA" : {
        "storageID" : 6,
        "accountID" : 10006,
        "amountS" : "100",
        "amountB" : "600",
        "tokenS" : 6,
        "tokenB" : 32768,
        "validUntil" : 1235123512,
        "taker" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "feeBips" : 60,
        "isAmm" : true,
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "fillS" : 500
      },
      "orderB" : {
        "storageID" : 6,
        "accountID" : 10006,
        "amountS" : "100",
        "amountB" : "600",
        "tokenS" : 6,
        "tokenB" : 32768,
        "validUntil" : 1235123512,
        "taker" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "feeBips" : 60,
        "isAmm" : true,
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "fillS" : 500
      },
      "valid" : false,
      "nonce" : 65,
      "minterAccountId" : 10008,
      "minter" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
      "nftToken" : {
        "tokenId" : 6,
        "tokenAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
        "nftData" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "nftId" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
        "amount" : "100"
      },
      "nftType" : "eip1155"
    }
  ]
}

Status code

Value Description
100000 Unknown error

Model


TransactionBlock

Field Type Required Description Example
txType string Y The txType of the transaction, one in [Noop,Deposit,Withdraw,Transfer,SpotTrade,AccountUpdate,AmmUpdate,JoinAmm,ExitAmm,SignatureVerification,NftMint,NftData]
Allowable : ['Noop', 'Deposit', 'Withdraw', 'Transfer', 'SpotTrade', 'AccountUpdate', 'AmmUpdate', 'JoinAmm', 'ExitAmm', 'SignatureVerification', 'NftMint', 'NftData']
"transfer"
accountId integer N The accountId of the transaction 10006
owner string N The owner of the transaction "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
token _Token N The token info of the transaction /
toToken _Token N The toToken info of the transaction if the tx has destination tokenId /
fee _Token N The fee of the transaction /
validUntil integer N The validUntil of the transaction 1627904776
toAccountId integer N The toAccountId of the transaction if tx has a destination account 10006
toAccountAddress string N The toAccountAddress of the transaction if tx has a destination account "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
storageId integer N The storageId of the transaction 2
orderA _Order N The orderA of the transaction if tx is SpotTrade /
orderB _Order N The orderB of the transaction if tx is SpotTrade /
valid boolean N The validness of the transaction "false"
nonce integer N The nonce of the transaction if it uses nonce 65
minterAccountId integer N The minterAccountId of the transaction if its a mint tx 10008
minter string N The minter of the transaction if its a mint tx "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
nftToken _Token N The nftToken of the transaction if its a NFT related tx /
nftType string N The nftType of the transaction if its a mint tx "eip1155"

_Token

Field Type Required Description Example
tokenId Result
Info
N The tokenId of the token "6"
tokenAddress string N The token Address "0xbbbbca6a90
1c926f240b89
eacb641d8aec
7aeafd"
nftData string N The nftData of the NFT token "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
nftId string N The NFT_ID of the NFT token "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
amount string N The token amount "100"

_Order

Field Type Required Description Example
storageID integer Y The storageId of the order 6
accountID integer Y The accountID of the order 10006
amountS string Y The amountS of the order "100"
amountB string Y The amountB of the order "600"
tokenS integer Y The tokenS of the order 6
tokenB integer Y The tokenB of the order 32768
validUntil integer Y The validUntil of the order 1235123512
taker string Y The taker of the order "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
feeBips integer Y The feeBips of the order 60
isAmm boolean Y If the order isAmm "true"
nftData string Y The nftData of the order, if its NFT order "0xf7c9323511
86c3a9053f31
3eefa16209c0
18f7f1dba8aa
8ca7100400f7
c31085"
fillS integer Y The fillS of the order 500

results matching ""

    No results matching ""