Get L2 block info
流量控制: 每 秒
摘要
HTTP 方法
GET
访问路径
/api/v3/block/getBlock
功能
Get L2 block info by block id
API 描述
HTTP头
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
X-API-KEY | string | 是 | ApiKey | "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ 6B6DQ6THZWbvrAGxzEdulXQvOKLrRW ZLnN" |
请求参数
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
id | string | 否 | The block id, could be finalized, confirmed, or block_idx_num 默认值 : finalized 取值范围 : ['finalized', 'confirmed', '{block_idx_num}'] |
"1234" |
请求示例
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
响应字段
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
blockId | integer | 是 | The num index of the block | 1235 |
blockSize | integer | 是 | The block size | 64 |
exchange | string | 是 | The exchange address | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
txHash | string | 是 | The txHash of the block | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
status | string | 是 | The status of the block | "pending" |
createdAt | integer | 是 | The creation time of the block | 1627904776000 |
transactions | List[Transaction Block] |
是 | The txs list inside the block | / |
响应示例
{
"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",
"fromAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
"toAddress" : "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd"
}
]
}
状态码
状态码 | 描述 |
---|---|
100000 | Unknown error |
模型
TransactionBlock
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
txType | string | 是 | The txType of the transaction, one in [Noop,Deposit,Withdraw,Transfer,SpotTrade,AccountUpdate,AmmUpdate,JoinAmm,ExitAmm,SignatureVerification,NftMint,NftData] 取值范围 : ['Noop', 'Deposit', 'Withdraw', 'Transfer', 'SpotTrade', 'AccountUpdate', 'AmmUpdate', 'JoinAmm', 'ExitAmm', 'SignatureVerification', 'NftMint', 'NftData'] |
"transfer" |
accountId | integer | 否 | The accountId of the transaction | 10006 |
owner | string | 否 | The owner of the transaction | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
token | _Token | 否 | The token info of the transaction | / |
toToken | _Token | 否 | The toToken info of the transaction if the tx has destination tokenId | / |
fee | _Token | 否 | The fee of the transaction | / |
validUntil | integer | 否 | The validUntil of the transaction | 1627904776 |
toAccountId | integer | 否 | The toAccountId of the transaction if tx has a destination account | 10006 |
toAccountAddress | string | 否 | The toAccountAddress of the transaction if tx has a destination account | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
storageId | integer | 否 | The storageId of the transaction | 2 |
orderA | _Order | 否 | The orderA of the transaction if tx is SpotTrade | / |
orderB | _Order | 否 | The orderB of the transaction if tx is SpotTrade | / |
valid | boolean | 否 | The validness of the transaction | "false" |
nonce | integer | 否 | The nonce of the transaction if it uses nonce | 65 |
minterAccountId | integer | 否 | The minterAccountId of the transaction if its a mint tx | 10008 |
minter | string | 否 | The minter of the transaction if its a mint tx | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftToken | _Token | 否 | The nftToken of the transaction if its a NFT related tx | / |
nftType | string | 否 | The nftType of the transaction if its a mint tx | "eip1155" |
fromAddress | string | 否 | field.TransactionBlock.fromAddress | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
toAddress | string | 否 | field.TransactionBlock.toAddress | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
_Token
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
tokenId | Result Info |
否 | The tokenId of the token | "6" |
tokenAddress | string | 否 | The token Address | "0xbbbbca6a90 1c926f240b89 eacb641d8aec 7aeafd" |
nftData | string | 否 | The nftData of the NFT token | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
nftId | string | 否 | The NFT_ID of the NFT token | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
amount | string | 否 | The token amount | "100" |
_Order
字段 | 类型 | 必须 | 说明 | 举例 |
---|---|---|---|---|
storageID | integer | 是 | The storageId of the order | 6 |
accountID | integer | 是 | The accountID of the order | 10006 |
amountS | string | 是 | The amountS of the order | "100" |
amountB | string | 是 | The amountB of the order | "600" |
tokenS | integer | 是 | The tokenS of the order | 6 |
tokenB | integer | 是 | The tokenB of the order | 32768 |
validUntil | integer | 是 | The validUntil of the order | 1235123512 |
taker | string | 是 | The taker of the order | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
feeBips | integer | 是 | The feeBips of the order | 60 |
isAmm | boolean | 是 | If the order isAmm | "true" |
nftData | string | 是 | The nftData of the order, if its NFT order | "0xf7c9323511 86c3a9053f31 3eefa16209c0 18f7f1dba8aa 8ca7100400f7 c31085" |
fillS | integer | 是 | The fillS of the order | 500 |