CurrencySell
Sells currency units for Shamwari coin (FXT). The transaction attempts to match existing buy offers at the best available price.
Request
POST /nxt?requestType=currencySell
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
secretPhrase | string | Seller's secret passphrase | Yes |
currency | long | Currency ID to sell | Yes |
baseCurrency | long | Base currency ID (coin) received | Yes |
rateQNTPerUnit | long | Exchange rate (QNT per unit) | Yes |
unitsQNT | long | Number of units to sell | Yes |
feeRateQNTPerFXT | long | Transaction fee rate | Optional |
deadline | int | Transaction deadline in minutes | Optional |
How Currency Sell Works
- The transaction attempts to match existing buy offers on the exchange
- When a match is found, the minimum units between the buy offer and the sell order are exchanged at the rate matching the highest buy offer
- A single transaction can match multiple buy offers or none
- Currency sell orders are NOT saved — they execute immediately (fully or partially) or not at all
- For each match, an exchange record is created (retrievable via GetExchanges)
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}
Error Handling
| Error | Condition |
|---|---|
NO_COST_ORDER | Calculated cost is zero |
NOT_ENOUGH_CURRENCY | Insufficient currency balance |
UNKNOWN_CURRENCY | Currency does not exist |
Example
curl -X POST http://localhost:22024/nxt \
-d "requestType=currencySell" \
-d "secretPhrase=your_phrase" \
-d "currency=987654321" \
-d "baseCurrency=1" \
-d "rateQNTPerUnit=500" \
-d "unitsQNT=1000000000"