Skip to content

Commit 6090bfa

Browse files
update api docs
1 parent 246265b commit 6090bfa

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

Developers/api/transaction-add.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
# POST /transaction/add
22
Send transactions as JSON object. This endpoint is for all transaction types.
3+
34
#### Supported Transactions
45
The structure depends on the `type` parameter.
56
==- Wart Transfer
67
Transfer `WART`.
78

9+
<!-- PinHeightEl, NonceIdEl, NonceReservedEl, CompactFeeEl, Ts..., SignatureEl -->
10+
811
PARAMETER | TYPE | DETAILS
912
----------|------|--------
1013
`type`| string | Set to `wartTransfer`.
1114
`feeE8` (optional) | unsigned 64 bit integer | Amount of `WART` to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 `WART` this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
12-
`fee` (optional) | string | Amount of `WART` to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
15+
`feeStr` (optional) | string | Amount of `WART` to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
1316
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values.
1417
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
1518
`signature65`| string of length 130 | hex-encoded 65 byte compact recoverable ECDSA signature in custom format, see below.
1619
`toAddr` | string of length 48| The address that `WART` shall be transferred to.
17-
`wartE8` (optional) | unsigned 64 bit integer | Amount of `WART` to send multiplied by 10^8. For example to send one coin this value must be 100000000.
18-
`wartStr` (optional) | string | Amount of `WART` to send. Format must be string, non-scientific notation with at most 8 digits after comma. "`1`" or "`1.00000000`" are valid.
20+
`wartE8` (optional) | unsigned 64 bit integer | Nonzero amount of `WART` to send multiplied by 10^8. For example to send one coin this value must be 100000000.
21+
`wartStr` (optional) | string | Nonzero amount of `WART` to send. Format must be string, non-scientific notation with at most 8 digits after comma. "`1`" or "`1.00000000`" are valid.
1922

2023
**NOTE**:
2124

22-
- The `WART` amount must be specified either via `wart` or via `wartE8`.
23-
- The transaction fee must be specified either via `fee` or via `feeE8`.
25+
- The `WART` amount must be specified either via `wartE8` or via `wartStr`.
26+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
2427
- Miner fee must be exactly representable in a 16 bit encoding.
2528

2629
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -43,20 +46,19 @@ BYTES | DESCRIPTION
4346
`amountU64` | unsigned 64 bit integer | Number of smallest representable units of the token to be sent. See the warning below.
4447
`assetHash` | string of length 64 | The asset hash specifies the asset for this transfer.
4548
`feeE8` (optional) | unsigned 64 bit integer | Amount of `WART` to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 `WART` this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
46-
`fee` (optional) | string | Amount of `WART` to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
49+
`feeStr` (optional) | string | Amount of `WART` to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
4750
`isLiquidity` | boolean | Specify whether you want to send the asset itself (`false`) or its pool liquidity (`true`).
4851
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values.
4952
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
5053
`signature65`| string of length 130 | hex-encoded 65 byte compact recoverable ECDSA signature in custom format, see below.
5154
`toAddr` | string of length 48| The address that tokens shall be transferred to.
5255

5356
!!!warning Warning
54-
The `amountU64` parameter specifies the number of smallest units of the specified token type. The actual conversion to token units depends on the token type's precision `p` (one token unit corresponds to `10^p` smallest representable units). Note that every asset has **its own precision** fixed during asset creation whereas any asset pool's liquidity **always has precision 8** (like the WART token type).
57+
The `amountU64` parameter specifies the number of smallest units of the specified token type. The actual conversion to token units depends on the token type's precision `p` (one token unit corresponds to `10^p` smallest representable units). Note that every asset has **its own precision** fixed during asset creation whereas any asset pool's liquidity **always has precision 8** (like the WART token itself).
5558
!!!
5659
**NOTE**:
5760

58-
- The transaction fee must be specified either via `fee` or via `feeE8`.
59-
- The transaction fee must be specified either via `fee` or via `feeE8`.
61+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
6062
- Miner fee must be exactly representable in a 16 bit encoding.
6163

6264
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -82,7 +84,7 @@ Create a new buy or sell limit swap order for a specific asset.
8284
`amountU64` | unsigned 64 bit integer | Number of smallest representable units of the token to be spent on the swap.
8385
`assetHash` | string of length 64 | The asset hash specifies the asset for this transfer.
8486
`feeE8` (optional) | unsigned 64 bit integer | Amount of coins to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 coins this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
85-
`fee` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
87+
`feeStr` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
8688
`isBuy` | boolean | Specify whether this order is a buy (`true`) or a sell (`false`) order.
8789
`limit` | string of length 6| Hexadecimal of of 3 byte encoded limit price. Use the `/tools/parse_price` endpoint to request this encoding.
8890
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values
@@ -94,7 +96,7 @@ The `amountU64` parameter specifies the number of smallest units of the token th
9496
!!!
9597
**NOTE**:
9698

97-
- The transaction fee must be specified either via `fee` or via `feeE8`.
99+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
98100
- Miner fee must be exactly representable in a 16 bit encoding.
99101

100102
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -121,7 +123,7 @@ Deposit liquidity into an asset's `WART` pool.
121123
`amountU64` | unsigned 64 bit integer | Number of smallest representable units of the asset to spend into the pool. See the warning below.
122124
`assetHash` | string of length 64 | The asset hash specifies the asset for this transfer.
123125
`feeE8` (optional) | unsigned 64 bit integer | Amount of coins to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 coins this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
124-
`fee` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
126+
`feeStr` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
125127
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values
126128
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
127129
`signature65`| string of length 130 | hex-encoded 65 byte compact recoverable ECDSA signature in custom format, see below.
@@ -133,8 +135,8 @@ The `amountU64` parameter specifies the number of smallest units of the specifie
133135
!!!
134136
**NOTE**:
135137

136-
- The `WART` amount must be specified either via `wart` or via `wartE8`.
137-
- The transaction fee must be specified either via `fee` or via `feeE8`.
138+
- The `WART` amount must be specified either via `wartE8` or via `wartStr`.
139+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
138140
- Miner fee must be exactly representable in a 16 bit encoding.
139141

140142
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -155,11 +157,11 @@ Withdraw liquidity from an asset's `WART` pool by redeeming liquidity tokens.
155157

156158
PARAMETER | TYPE | DETAILS
157159
----------|------|--------
158-
`type`| string | Set to `liquidityDeposit`.
160+
`type`| string | Set to `liquidityWithdrawal`.
159161
`amountE8` | unsigned 64 bit integer | Number of smallest representable units of the liquidity tokens to spend into the pool. Since liquidity tokens always have precision 8, this is the number of liquidity tokens multiplied by `10^8`.
160162
`assetHash` | string of length 64 | The asset hash specifies the asset for this transfer.
161163
`feeE8` (optional) | unsigned 64 bit integer | Amount of coins to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 coins this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
162-
`fee` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
164+
`feeStr` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
163165
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values
164166
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
165167
`signature65`| string of length 130 | hex-encoded 65 byte compact recoverable ECDSA signature in custom format, see below.
@@ -169,7 +171,7 @@ The `amountU64` parameter specifies the number of smallest units of the specifie
169171
!!!
170172
**NOTE**:
171173

172-
- The transaction fee must be specified either via `fee` or via `feeE8`.
174+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
173175
- Miner fee must be exactly representable in a 16 bit encoding.
174176

175177
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -189,18 +191,18 @@ Cancel a pending transaction or an existing order.
189191

190192
PARAMETER | TYPE | DETAILS
191193
----------|------|--------
192-
`type`| string | Set to `liquidityDeposit`.
194+
`type`| string | Set to `cancelation`.
193195
`cancelHeight` | unsigned 32 bit integer | The canceled transaction's `pinHeight`.
194196
`cancelNonceId` | unsinged 32 bit integer | The canceled transaction's `nonceId`.
195197
`feeE8` (optional) | unsigned 64 bit integer | Amount of coins to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 coins this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
196-
`fee` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
198+
`feeStr` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
197199
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values
198200
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
199201
`signature65`| string of length 130 | hex-encoded 65 byte compact recoverable ECDSA signature in custom format, see below.
200202

201203
**NOTE**:
202204

203-
- The transaction fee must be specified either via `fee` or via `feeE8`.
205+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
204206
- Miner fee must be exactly representable in a 16 bit encoding.
205207

206208
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:
@@ -222,7 +224,7 @@ Create a new asset.
222224
----------|------|--------
223225
`type`| string | Set to `assetCreation`.
224226
`feeE8` (optional) | unsigned 64 bit integer | Amount of coins to spend on transaction fees multiplied by 10^8. For example to send one 0.00000001 coins this value must be 1. This value must be exactly representable value in a 16 bit encoding, see below.
225-
`fee` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
227+
`feeStr` (optional) | string | Amount of coins to spend on transaction fees. This value must be exactly representable value in a 16 bit encoding, see below.
226228
`name` | string of length 1 to 5 | The name of asset to be created.
227229
`nonceId` | unsigned 32 bit integer | To avoid double spend, there can only be one transaction with a specific (pinHeight,nonceId) pair. The same nonceId can be used for different pinHeight values
228230
`pinHeight` | unsigned 32 bit integer | Signature includes block hash at this height
@@ -232,7 +234,7 @@ Create a new asset.
232234

233235
**NOTE**:
234236

235-
- The transaction fee must be specified either via `fee` or via `feeE8`.
237+
- The transaction fee must be specified either via `feeE8` or via `feeStr`.
236238
- Miner fee must be exactly representable in a 16 bit encoding.
237239

238240
The transaction hash needed for signature generation is the SHA256 hash of the following bytes:

0 commit comments

Comments
 (0)