Home

Trade tokens on an exchange

POST
https://trx.nownodes.io/wallet/exchangetransaction

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Trade tokens on a decentralized exchange. This operation exchanges one token for another.

Body

application/json

Request value.

owner_addressstringrequired

The owner address that trades tokens, in hex string format

exchange_idintegerrequired

The id of the exchange

token_idstringrequired

The id of the token sold, if it's TRX, should be "_"

quantintegerrequired

The amount of tokens to sell

expectedintegerrequired

The expected amount of tokens to buy (minimum acceptable amount)

visibleboolean

Whether the address is in base58 format

Response

200OK

HTTP 200 response for exchangetransaction. The body contains either a successful result or a node-level error.

400Bad Request

Bad Request. The request is malformed or contains invalid parameters.

401Unauthorized

Unauthorized: API key is present but rejected by the NOWNodes gateway.

405Method Not Allowed

Method Not Allowed. Returned by the NOWNodes gateway for malformed or unsupported gateway-level requests.

422Unprocessable Entity

Missing API key. The NOWNodes gateway returns plain text for this error.

500Internal Server Error

Internal Server Error. The gateway or node failed while processing the request.