Skip to content

Commit 2200cab

Browse files
rename to block actions
1 parent 4538369 commit 2200cab

3 files changed

Lines changed: 30 additions & 20 deletions

File tree

developers/api/rest.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ Example output of `/transaction/latest`:
192192
}
193193
```
194194
195-
[!ref Transaction Details](rest/transaction-details.md)
195+
For detailed JSON strucutre of block actions, see
196+
[!ref Block Actions](rest/block-actions.md)
196197
### `GET /transaction/minfee`
197198
198199
Show the minimum fee required by this node. Transactions with a lower fee will not be accepted or requested by the node.

developers/api/rest/transaction-details.md renamed to developers/api/rest/block-actions.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Transaction Details
1+
# Block Actions
22

3-
All block body arrays share the same entry structures described below. See [GET /transaction/latest](#get-transactionlatest) for context on where these fields appear.
3+
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.
4+
The JSON structure of these actions is explained below.
45

5-
## Rewards
6+
## Reward
67

7-
Block rewards paid to miners.
8+
Block reward paid to miners.
89

910
```json
1011
{
@@ -23,9 +24,9 @@ Block rewards paid to miners.
2324
| `amount.E8` | integer | Amount in raw E8 units |
2425
| `amount.str` | string | Amount as decimal string |
2526

26-
## Wart Transfers
27+
## Wart Transfer
2728

28-
WART coin transfers between accounts.
29+
Wart coin transfer between accounts. Token transfers are returned as a differnt action type, see below.
2930

3031
```json
3132
{
@@ -55,7 +56,9 @@ WART coin transfers between accounts.
5556

5657
## Token Transfers
5758

58-
Token transfers between accounts.
59+
Token transfers between accounts. Wart transfers are separated from token transfers because the latter
60+
require additional fields to be returned such as different amount specification (assets don't always have
61+
8 decimals) and `isLiquidity` flag.
5962

6063
```json
6164
{
@@ -90,12 +93,12 @@ Token transfers between accounts.
9093
| `asset.name` | string | Asset name |
9194
| `asset.decimals` | integer | Asset decimals |
9295
| `asset.hash` | string | Asset hash |
93-
| `isLiquidity` | boolean | Whether transfer is liquidity-related |
96+
| `isLiquidity` | boolean | Whether transfer is the asset itself (false) or liquidity of the corresponding pool |
9497
| `tokenSpec` | string | Token specification string |
9598

9699
## New Orders
97100

98-
New limit orders placed on the DEX.
101+
Represents a new limit order placed on the DEX including orders that were included in the same block and were immediately matched.
99102

100103
```json
101104
{
@@ -136,9 +139,11 @@ New limit orders placed on the DEX.
136139
| `limit.doubleRaw` | number | Price as double (raw) |
137140
| `buy` | boolean | True if buy order, false if sell |
138141

139-
## Matches
142+
## Match
140143

141-
DEX trade matches (swaps between liquidity providers).
144+
In each block, markets with new orders are order-matched. Order matching is based on CoinFuMasterShifu's paper on [Fair Batch Matching](https://github.com/CoinFuMasterShifu/FairBatchMatching/blob/main/FairBatchMatching.pdf). 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.
145+
146+
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.
142147

143148
```json
144149
{
@@ -185,9 +190,9 @@ DEX trade matches (swaps between liquidity providers).
185190
| `buySwaps[].historyId` | integer | Referenced history ID |
186191
| `sellSwaps[]` | array | Sell-side swap entries (same fields as `buySwaps`) |
187192

188-
## Liquidity Deposits
193+
## Liquidity Deposit
189194

190-
Liquidity provider deposits into a trading pool.
195+
Represents liquidity deposits into a liquidity pool.
191196

192197
```json
193198
{
@@ -223,7 +228,7 @@ Liquidity provider deposits into a trading pool.
223228

224229
## Liquidity Withdrawals
225230

226-
Liquidity provider withdrawals from a trading pool.
231+
Liquidity provider withdrawals from a liquidity pool.
227232

228233
```json
229234
{
@@ -258,7 +263,7 @@ Liquidity provider withdrawals from a trading pool.
258263

259264
## Asset Creations
260265

261-
New token/asset creation transactions.
266+
Represents new asset creations.
262267

263268
```json
264269
{
@@ -289,7 +294,7 @@ New token/asset creation transactions.
289294

290295
## Cancelations
291296

292-
Transaction cancelations (revert pending transactions).
297+
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.
293298

294299
```json
295300
{
@@ -298,7 +303,8 @@ Transaction cancelations (revert pending transactions).
298303
"address": "3661579d...",
299304
"fee": { "E8": 9992, "str": "0.00009992" },
300305
"nonceId": 5,
301-
"pinHeight": 0
306+
"pinHeight": 0,
307+
"cancelTxid": { "accountId": 2, "nonceId": 3, "pinHeight": 10 }
302308
}
303309
```
304310

@@ -311,10 +317,13 @@ Transaction cancelations (revert pending transactions).
311317
| `fee.str` | string | Fee as decimal string |
312318
| `nonceId` | integer | Nonce ID of cancelled tx |
313319
| `pinHeight` | integer | Pin block height |
320+
| `cancelTxid.accountId` | integer | Account ID of cancelled transaction |
321+
| `cancelTxid.nonceId` | integer | Nonce ID of cancelled transaction |
322+
| `cancelTxid.pinHeight` | integer | Pin height of cancelled transaction |
314323

315-
## Order Cancelations
324+
## Order Cancelation
316325

317-
Order cancelations (cancel limit orders on the DEX).
326+
Represents previously active limit orders which were canceled from a specific asset's the order Wart/Asset book.
318327

319328
```json
320329
{

developers/api/rest/mempool-transactions.md

Whitespace-only changes.

0 commit comments

Comments
 (0)