PublishExchangeOffer
Publishes an exchange offer for an exchangeable currency, creating linked buy and sell offers.
Request
POST /nxt?requestType=publishExchangeOffer
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
currency | long | Currency ID of an active currency | Yes |
baseCurrency | long | Base currency ID | Yes |
buyRateQNTPerUnit | long | Coin amount for buying a currency unit (in QNT) | Yes |
sellRateQNTPerUnit | long | Coin amount for selling a currency unit (in QNT) | Yes |
initialBuySupplyQNT | long | Initial number of currency units offered to buy | Yes |
initialSellSupplyQNT | long | Initial number of currency units offered for sell | Yes |
totalBuyLimitQNT | long | Total number of currency units which can be bought | Yes |
totalSellLimitQNT | long | Total number of currency units which can be sold | Yes |
expirationHeight | int | Blockchain height at which the offer expires | Yes |
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"