You can retrieve a Quote
object before committing for an exchange transaction. The object tells what price you can expect if you exchange your digital asset for another.
You can create, accept, and retrieve exchange quotes with Gluwa API.
Get Quote for currency exchange
Attribute | Type | Description |
Amount |
| The amount in source currency you want to exchange. |
Conversion |
| Conversion symbol for the exchange. See conversion. |
SendingAddress |
| The address that will fund the source amount. |
SendingAddressSignature |
| The signature of the sending address. Generated the same way as X-REQUEST-SIGNATURE. |
ReceivingAddress |
| The address that the exchanged currency will be received. ​ For example, if the conversion is |
ReceivingAddressSignature |
| The signature of the receiving address. Generated the same way as X-REQUEST-SIGNATURE. |
BtcPublicKey |
| Optional. Required if the source currency is |
HTTP Status | Return Object |
200 | ​Quote. |
Attribute | Type | Description |
Conversion |
| The conversion of the exchange. |
TotalSourceAmount |
| The total amount in source currency that will be exchanged. |
TotalFee |
| The exchange fee. |
TotalEstimatedExchangedAmount |
| The total estimated exchanged amount in exchanged currency. |
AveragePrice |
| The average of all the prices in the list of matched orders. The unit is |
BestPrice |
| The best price available in the list of matched orders. The unit is |
WorstPrice |
| The best price available in the list of matched orders. The unit is |
MatchedOrders |
| The list of matched orders available to fulfill the requested source amount. |
CreatedDateTime |
| The time when the quote is created. |
TimeToLive |
| The duration in seconds that the quote is valid. |
Checksum |
| Checksum. Used when you accept the quote. |
Attribute | Type | Description |
OrderID |
| Order ID |
DestinationAddress |
| The address where the source amount must be sent to. |
SourceAmount |
| The amount in source currency that this order will exchange. |
Fee |
| The fee amount that must be used to create |
ExchangedAmount |
| The amount in exchanged currency that this order will fulfill. |
Price |
| The price this order is offering for the exchange. The unit is |
ExpiryBlockNumber |
| Optional. Required if the source currency is Gluwacoin currency (ex> ​ After this block number, the exchange will not execute, and you may call reclaim function on the blockchain to release your reserved funds. |
Executor |
| Optional. Required if the source currency is Gluwacoin currency (ex> |
ReservedFundsAddress |
| Optional. Required if the source currency is |
ReservedFundsRedeemScript |
| Optional. Required if the source currency is |
HTTP Status | Error Code | Description |
400 |
| Invalid URL parameters |
400 |
| Request body is missing. |
400 |
| Request validation errors. See InnerErrors. |
400 |
| Request validation errors. See InnerErrors. |
404 |
| No orders are matched. |
500 |
| Server error. |
Accept quote received from POST /v1/Quote
endpoint.
Attribute | Type | Description |
MatchedOrders | array of MatchedOrder​ | All orders that will fulfill this quote. |
Checksum |
| Checksum that was received when quote was created. |
Attribute | Type | Description |
OrderID |
| ID of the order that was matched |
ReserveTxnSignature |
| Reserve transaction signature used to reserve funds for the exchange. |
Nonce |
| Optional. Required if the source currency is Gluwacoin currency (ex> |
ExecuteTxnSignature |
| Optional. Required if the source currency |
ReclaimTxnSignature |
| Optional. Required if the source currency |
HTTP Status | Return Object |
202 | ​AcceptedQuoteID. |
Attribute | Type | Description |
ID |
| The ID of the accepted quote. |
HTTP Status | Error Code | Description |
400 |
| Invalid URL parameters |
400 |
| Request body is missing. |
400 |
| Request validation errors. See InnerErrors. |
400 |
| Request validation errors. See InnerErrors. |
403 |
| Invalid checksum. Checksum may be wrong or expired. |
404 |
| One of the matched orders are no longer available. |
500 |
| Server error. |
Get a list of accepted quotes.
Header | Type | Description |
X-REQUEST-SIGNATURE |
| Address Signature of the sending address. See X-REQUEST-SIGNATURE. |
Attribute | Type | Description |
currency |
| The source currency of the quote. |
address |
| The sending address of the quote. |
Attribute | Type | Description |
startDateTime |
| ISO 8601 format datetime. If defined, only quotes created after this datetime are included in the response. |
endDateTime |
| ISO 8601 format datetime. If defined, only quotes created before this datetime are included in the response. |
status |
|
|
offset |
| Number of quotes to skip the beginning of list. Defaults to 0. |
limit |
| Number of quotes to include in the result. Defaults to 25, maximum of 100. |
HTTP Status | Return Object |
200 | array of Quotes. |
Attribute | Type | Description |
ID |
| Accepted quote ID. |
SendingAddress |
| The address that funded the source amount. |
SourceAmount |
| The total amount |
Fee |
| The total fee of the exchange |
EstimatedExchangedAmount |
| The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. |
AveragePrice |
| The average of all the prices in the list of matched orders. The unit is |
BestPrice |
| The best price available in the list of matched orders. The unit is |
WorstPrice |
| The best price available in the list of matched orders. The unit is |
ReceivingAddress |
| The address that the exchanged currency is received. |
Status |
|
|
Conversion |
| The conversion of the quote. See conversion. |
HTTP Status | Error Code | Description |
400 |
| Invalid URL parameters |
403 |
|
|
403 |
|
|
403 |
| Invalid |
500 |
| Server error. |
Get an accepted quote with ID.
Header | Type | Description |
X-REQUEST-SIGNATURE |
| Address Signature of the sending address of this quote. See X-REQUEST-SIGNATURE. |
Attribute | Type | Description |
ID |
| ID of the accepted quote. |
HTTP Status | Return Object |
200 | ​Quote. |
Attribute | Type | Description |
ID |
| Accepted quote ID. |
SendingAddress |
| The address that funded the source amount. |
SourceAmount |
| The total source amount. |
Fee |
| The total fee of the exchange. |
EstimatedExchangedAmount |
| The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. |
ReceivingAddress |
| The address that the exchanged currency is received. |
Status |
|
|
Conversion |
| The conversion of the quote. See conversion. |
MatchedOrders |
| The list of matched orders that fulfilled the source amount. |
Attribute | Type | Description |
SourceAmount |
| The amount in source currency that this order will exchange. |
Fee |
| The fee amount used to create |
Status |
|
|
Price |
| The price this order is offering for the exchange. The unit is |
HTTP Status | Error Code | Description |
400 |
| Invalid URL parameters |
403 |
|
|
403 |
|
|
403 |
| Invalid |
404 |
| Quote not found. |
500 |
| Server error. |