Block Actions
Every block affects the chain state via actions. These actions are returned from various API methods such as the /chain/block/:id and /transaction/latest methods.
The JSON structure of these actions is explained below.
Reward
Block reward paid to miners.
{
"txHash": "e849a0fe...",
"historyId": 46,
"toAddress": "00000000...de47c9b2",
"amount": { "E8": 300019985, "str": "3.00019985" }
}
Wart Transfer
Wart coin transfer between accounts. Token transfers are returned as a differnt action type, see below.
{
"txHash": "897b3cc7...",
"historyId": 42,
"fromAddress": "3661579d...",
"fee": { "E8": 9992, "str": "0.00009992" },
"nonceId": 0,
"pinHeight": 0,
"toAddress": "00000000...de47c9b2",
"amount": { "E8": 100000000, "str": "1.00000000" }
}
Token Transfers
Token transfers between accounts. Wart transfers are separated from token transfers because the latter
require additional fields to be returned such as different amount specification (assets don't always have
8 decimals) and isLiquidity flag.
{
"txHash": "edb03806...",
"historyId": 48,
"fromAddress": "2de77d5e...",
"fee": { "E8": 1, "str": "0.00000001" },
"nonceId": 100,
"pinHeight": 0,
"toAddress": "00000000...de47c9b2",
"amount": { "str": "100.0000", "u64": 1000000, "decimals": 4 },
"asset": { "id": 2, "name": "TOK2", "decimals": 4, "hash": "f45b1131..." },
"isLiquidity": false,
"tokenSpec": "asset:f45b1131..."
}
New Orders
Represents a new limit order placed on the DEX including orders that were included in the same block and were immediately matched.
{
"txHash": "c6fbade2...",
"historyId": 37,
"address": "2de77d5e...",
"fee": { "E8": 1, "str": "0.00000001" },
"nonceId": 99,
"pinHeight": 0,
"baseAsset": { "id": 7, "name": "TOK2", "decimals": 4, "hash": "0e4825ef..." },
"amount": { "str": "100.0000", "u64": 1000000, "decimals": 4 },
"limit": { "precExponent10": 4, "exponent2": -6, "mantissa": 64000, "hex": "fa0049", "doubleAdjusted": 0.1, "doubleRaw": 1000.0 },
"buy": false
}
Match
In each block, markets with new orders are order-matched. Order matching is based on CoinFuMasterShifu's paper on Fair Batch Matching. This algorithm batch-matches discrete with continuous liquidity in a fair way such that no intrinsic ordering exists among the matched orders, which means that the the algorithm is MEV-proof, in particular no sandwich attacks are possible.
The returned JSON object contains the pool before and after the matching, and all swaps executed. Each swaps also includes the history id which can be used for further lookup on the referenced order. To check remaining order quantity, use the historyId in the /market/:market/order/:historyId API endpoint.
{
"txHash": "2ecefa2f...",
"historyId": 38,
"baseAsset": { "id": 7, "name": "TOK2", "decimals": 4, "hash": "0e4825ef..." },
"poolBefore": {
"base": { "str": "0", "u64": 0, "decimals": 4 },
"quote": { "str": "0", "E8": 0 }
},
"poolAfter": {
"base": { "str": "0", "u64": 0, "decimals": 4 },
"quote": { "str": "0", "E8": 0 }
},
"buySwaps": [
{ "base": { "str": "10.0000", "u64": 100000, "decimals": 4 }, "quote": { "str": "1.00000000", "E8": 100000000 }, "historyId": 26 }
],
"sellSwaps": [
{ "base": { "str": "20.0010", "u64": 200010, "decimals": 4 }, "quote": { "str": "2.00010000", "E8": 200010000 }, "historyId": 25 }
]
}
Liquidity Deposit
Represents liquidity deposits into a liquidity pool.
{
"txHash": "576da5fd...",
"historyId": 11,
"address": "3661579d...",
"fee": { "E8": 9992, "str": "0.00009992" },
"nonceId": 0,
"pinHeight": 0,
"baseAsset": { "id": 7, "name": "TOK2", "decimals": 4, "hash": "0e4825ef..." },
"baseDeposited": { "str": "100.0000", "u64": 1000000, "decimals": 4 },
"quoteDeposited": { "str": "1.00000000", "E8": 100000000 },
"sharesReceived": { "str": "10.0000", "u64": 100000, "decimals": 4 }
}
Liquidity Withdrawals
Liquidity provider withdrawals from a liquidity pool.
{
"txHash": "576da5fd...",
"historyId": 11,
"address": "3661579d...",
"fee": { "E8": 9992, "str": "0.00009992" },
"nonceId": 0,
"pinHeight": 0,
"baseAsset": { "id": 7, "name": "TOK2", "decimals": 4, "hash": "0e4825ef..." },
"sharesRedeemed": { "str": "10.0000", "u64": 100000, "decimals": 4 },
"baseReceived": { "str": "100.0000", "u64": 1000000, "decimals": 4 },
"quoteReceived": { "str": "1.00000000", "E8": 100000000 }
}
Asset Creations
Represents new asset creations.
{
"txHash": "0e4825ef...",
"historyId": 10,
"creatorAddress": "3661579d...",
"fee": { "E8": 9992, "str": "0.00009992" },
"nonceId": 13,
"pinHeight": 0,
"supply": "100000000.0000",
"name": "TOK2",
"assetId": 7
}
Cancelations
Represents Transaction cancelation, i.e. special transactions which block other transactions. Each cancel transaction contains a cancelTxid field referencing the cancelled transaction. No transaction with the referenced transaction id can be mined in the same or a future block.
{
"txHash": "a3aadbaa...",
"historyId": 47,
"address": "3661579d...",
"fee": { "E8": 9992, "str": "0.00009992" },
"nonceId": 5,
"pinHeight": 0,
"cancelTxid": { "accountId": 2, "nonceId": 3, "pinHeight": 10 }
}
Order Cancelation
Represents previously active limit orders which were canceled from a specific asset's the order Wart/Asset book.
{
"txHash": "a3aadbaa...",
"historyId": 47,
"cancelTxid": { "accountId": 2, "nonceId": 3, "pinHeight": 10 },
"buy": true,
"baseAsset": { "id": 7, "name": "TOK2", "decimals": 4, "hash": "0e4825ef..." },
"remaining": { "E8": 100000000, "str": "1.00000000" }
}