Skip to main content

PublishExchangeOffer

Publishes an exchange offer for an exchangeable currency, creating linked buy and sell offers.

Request

POST /nxt?requestType=publishExchangeOffer

Parameters

NameTypeDescriptionRequired
currencylongCurrency ID of an active currencyYes
baseCurrencylongBase currency IDYes
buyRateQNTPerUnitlongCoin amount for buying a currency unit (in QNT)Yes
sellRateQNTPerUnitlongCoin amount for selling a currency unit (in QNT)Yes
initialBuySupplyQNTlongInitial number of currency units offered to buyYes
initialSellSupplyQNTlongInitial number of currency units offered for sellYes
totalBuyLimitQNTlongTotal number of currency units which can be boughtYes
totalSellLimitQNTlongTotal number of currency units which can be soldYes
expirationHeightintBlockchain height at which the offer expiresYes

Response

{
"transaction": "123456789",
"fullHash": "abc123def456...",
"transactionJSON": {
"type": 6,
"subtype": 6,
"timestamp": 123456789,
"deadline": 14400,
"senderPublicKey": "abc123...",
"amountNQT": "0",
"feeNQT": "100000000",
"signature": "def456...",
"attachment": {
"version.ExchangeOffer": 1,
"currency": "987654321",
"baseCurrency": "555555555",
"buyRateQNTPerUnit": "500",
"sellRateQNTPerUnit": "550",
"initialBuySupplyQNT": "1000000000",
"initialSellSupplyQNT": "1000000000",
"totalBuyLimitQNT": "100000000000",
"totalSellLimitQNT": "100000000000",
"expirationHeight": 300000
}
}
}

Example

curl -X POST "http://localhost:22024/nxt?requestType=publishExchangeOffer" \
-d "currency=987654321" \
-d "baseCurrency=555555555" \
-d "buyRateQNTPerUnit=500" \
-d "sellRateQNTPerUnit=550" \
-d "initialBuySupplyQNT=1000000000" \
-d "initialSellSupplyQNT=1000000000" \
-d "totalBuyLimitQNT=100000000000" \
-d "totalSellLimitQNT=100000000000" \
-d "expirationHeight=300000" \
-d "secretPhrase=YOUR_SECRET_PHRASE"