Skip to main content

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

NameTypeDescriptionRequired
secretPhrasestringSeller's secret passphraseYes
currencylongCurrency ID to sellYes
baseCurrencylongBase currency ID (coin) receivedYes
rateQNTPerUnitlongExchange rate (QNT per unit)Yes
unitsQNTlongNumber of units to sellYes
feeRateQNTPerFXTlongTransaction fee rateOptional
deadlineintTransaction deadline in minutesOptional

How Currency Sell Works

  1. The transaction attempts to match existing buy offers on the exchange
  2. 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
  3. A single transaction can match multiple buy offers or none
  4. Currency sell orders are NOT saved — they execute immediately (fully or partially) or not at all
  5. For each match, an exchange record is created (retrievable via GetExchanges)

Response

{
"transaction": "1234567890123456789",
"fullHash": "abc123...",
"errorCode": 0,
"errorDescription": ""
}

Error Handling

ErrorCondition
NO_COST_ORDERCalculated cost is zero
NOT_ENOUGH_CURRENCYInsufficient currency balance
UNKNOWN_CURRENCYCurrency 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"