### Install Gluwa Node.js SDK Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-javascript-nodejs.md Installs the Gluwa JavaScript SDK for Node.js using npm. This is the first step to integrate Gluwa's services into your application. Ensure you have Node.js and npm installed. ```bash $ npm install @gluwa/gluwa-js ``` -------------------------------- ### Install Gluwa PHP SDK via Composer Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-php.md Installs the Gluwa PHP SDK using Composer, a dependency manager for PHP. This command adds the SDK to your project's dependencies. ```bash $ composer require gluwa/gluwa-php ``` -------------------------------- ### Initialize QRCodeClient in .NET Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-.net.md Shows how to instantiate a QRCodeClient for generating QR codes. It includes examples for both standard and sandbox environments. ```csharp QRCodeClient qrCodeClient = new QRCodeClient(); // If you want to use the SandBox mode QRCodeClient qrCodeClient = new QRCodeClient(true); ``` -------------------------------- ### Retrieve Gluwa Transaction Details by Hash Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-java.md This Java example demonstrates how to fetch specific transaction details using its transaction hash and currency. It utilizes the Gluwa API SDK to query the transaction information. ```java public void getListTransactionDetail_test() { Configuration conf = new ConfigurationForTest(); GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(conf); GluwaTransaction transaction = new GluwaTransaction(); transaction.setCurrency("{Currency}"); transaction.setTxnHash("{Txn Hash}"); GluwaResponse result = wrapper.getListTransactionDetail(transaction); } ``` -------------------------------- ### Create Gluwacoin Transaction with .NET SDK Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-.net.md An example of creating a new Gluwacoin transaction using the GluwaClient. It specifies required parameters like currency, addresses, private key, amount, and optional parameters for transaction details and idempotency. Handles success and error responses. ```csharp ECurrency currency = "{USDG or KRWG or NGNG or BTC}"; string address = "{Your Gluwacoin public Address}"; string privateKey = "{Your Gluwacoin Private Key}"; string amount = "{Transaction amount, not including the fee}"; string target = "{The address that the transaction will be sent to}"; string merchantOrderID = "{Identifier for the transaction that was provided by the merchant user}"; // default to null. Optional string note = "{Additional information about the transaction that a user can provide}"; // default to null. Optional string nonce = "{Nonce for the transaction. For Gluwacoin currencies only}"; // default to null. Optional string idem = "{Idempotent key for the transaction to prevent duplicate transactions}"; // default to null. Optional string paymentID = "{ID for the QR code payment}"; // default to null. Optional string paymentSig = "{Signature of the QR code payment. Required if PaymentID is not null}"; // default to null. Optional Result result = await gluwaClient.CreateTransactionAsync( currency, address, privateKey, amount, target, merchantOrderID, // optional, default = null note, // optional, default = null nonce, // optional, default = null idem, // optional, default = null paymentID, // optional, default = null paymentSig // optional, default = null ); if (result.IsFailure) { switch (result.Error.Code) { case "ErrorCode1": // handle error 1 break; case "ErrorCode2": // handle error 2 break; default: // handle error break; } } else { // successful response. See result.Data for the response } ``` -------------------------------- ### GET v1/Orders Source: https://github.com/gluwa/gluwadocs/blob/master/order.md Retrieve a list of all orders, with options to filter by date, status, and pagination. ```APIDOC ## GET v1/Orders ### Description Retrieve all orders. Supports filtering by date, status, and pagination. ### Method GET ### Endpoint /v1/Orders ### Parameters #### Query Parameters - **startDateTime** (datetime) - Optional - ISO 8601 format datetime. Filters orders created after this date. - **endDateTime** (datetime) - Optional - ISO 8601 format datetime. Filters orders created before this date. - **status** (string) - Optional - Filters by order status (`Active`, `Complete`, `Canceled`). - **offset** (int) - Optional - Number of orders to skip. Defaults to 0. - **limit** (int) - Optional - Number of orders to return. Defaults to 25, maximum is 100. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Response Body**: An array of `Order` objects. #### Order Object - **ID** (string) - The order ID. - **Conversion** (string) - Conversion symbol for the order. - **SendingAddress** (string) - The address where the source amount is sent from. - **SourceAmount** (string) - The amount available for exchange in source currency. - **Price** (string) - The price for the exchange. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **Status** (string) - The current status of the order (`Active`, `Complete`, `Canceled`). #### Response Example ```json [ { "ID": "f8c3a2b1-4e5d-4a7b-8c9d-0e1f2a3b4c5d", "Conversion": "BTC/USD", "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "SourceAmount": "1.0", "Price": "0.00005", "ReceivingAddress": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzz4x73w0", "Status": "Active" } ] ``` #### Error Responses - **400** - `InvalidUrlParameters`: Invalid URL parameters. - **403** - `Forbidden`: Not authorized to use this endpoint. Check your Authorization header. - **500** - `InternalServerError`: Server error. ``` -------------------------------- ### List Transaction History with .NET SDK Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-.net.md An example of retrieving a list of Gluwacoin transactions for a given address using the GluwaClient. Allows filtering by currency, address, private key, limit, status, and offset. Handles success and error responses. ```csharp ECurrency currency = "{USDG or KRWG or NGNG or BTC}"; string address = "{Your Gluwacoin public Address}"; string privateKey = "{Your Gluwacoin Private Key}"; uint limit = "{Number of transactions to include in the result}"; // defaults to 100. Optional ETransactionStatusFilter status = "{Incomplete or Confirmed}"; // defaults to Confirmed. Optional uint offset = "{Number of transactions to skip}"; // default to 0. Optional” Result, ErrorResponse> result = await gluwaClient.GetTransactionListAsync( currency, address, privateKey, limit, // optional, default = 100 status, // optional, default = Confirmed, offset // optional, default = 0 ); if (result.IsFailure) { switch (result.Error.Code) { case "ErrorCode1": // handle error 1 break; case "ErrorCode2": // handle error 2 break; default: // handle error break; } } else { // successful response. See result.Data for the response } ``` -------------------------------- ### GET /v1/OrderBook/:conversion Source: https://github.com/gluwa/gluwadocs/blob/master/order-book.md Retrieves the current order book for a specified conversion symbol. The response includes an array of orders, each detailing the amount and price. ```APIDOC ## GET v1/OrderBook/:conversion ### Description Get the current order book for a given conversion symbol. ### Method GET ### Endpoint `/v1/OrderBook/:conversion` ### Parameters #### Path Parameters - **conversion** (string) - Required - Conversion symbol. See [conversion](api/currency-and-conversion-symbols.md#conversion-symbols). ### Response #### Success Response (200) - **Orders** (array of Order objects) - An array of orders, each containing: - **Amount** (string) - Amount of available in the order. - **Price** (string) - Price. The unit is `/`. #### Response Example ```json [ { "Amount": "10.5", "Price": "0.0001 BTC/USD" }, { "Amount": "5.2", "Price": "0.00015 BTC/USD" } ] ``` ### Errors #### Error Response (400) - **ErrorCode** (string) - `InvalidUrlParameters` - Description: Invalid URL parameters. ``` -------------------------------- ### Generate Gluwa Payment QR Code Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-java.md This example shows how to obtain a Base64 encoded QR code string for Gluwa payments. The resulting string can be used in an HTML `` tag to display the QR code directly on a webpage. ```markup Gluwa Payment QR Code ``` -------------------------------- ### Universal Link Example (HTML) Source: https://github.com/gluwa/gluwadocs/blob/master/development/sending-address.md An HTML anchor tag demonstrating the structure of a universal link designed to open the Gluwa app and initiate a 'scan' action. The link includes a JSON payload as a URL-encoded parameter, specifying the currency and target for the address request. ```markup Connect to Gluwa app ``` -------------------------------- ### Initialize Gluwa SDK Configuration Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-java.md This Java code demonstrates how to create and initialize the `Configuration` class for the Gluwa SDK. It requires API keys, secrets, and Ethereum wallet details. Set `__DEV__` to true for sandbox environment and false for live. ```java public class Configuration extends Configuration { public ConfigurationForTest() { super(); set__DEV__(true); // sandbox: true, live: false setApiKey("{Your API Key}"); setApiSecret("{Your API Secret}"); setWebhookSecret("{Your Webhook Secret}"); setMasterEthereumAddress("{Your Ethereum Address}"); setMasterEthereumPrivateKey("{Your Ethereum Private Key}"); } } ``` -------------------------------- ### GET /V1/Quotes/:ID Source: https://github.com/gluwa/gluwadocs/blob/master/api/quote.md Retrieves a specific accepted quote by its ID. ```APIDOC ## GET /V1/Quotes/:ID ### Description Get an accepted quote with ID. ### Method GET ### Endpoint `/V1/Quotes/:ID` ### Parameters #### Path Parameters - **ID** (UUID) - Required - ID of the accepted quote. #### Headers - **X-REQUEST-SIGNATURE** (string) - Required - Address Signature of the sending address of this quote. See [X-REQUEST-SIGNATURE](authentication.md#x-request-signature). ### Response #### Success Response (200) - **ID** (UUID) - Accepted quote ID. - **SendingAddress** (string) - The address that funded the source amount. - **SourceAmount** (string) - The total amount - **Fee** (string) - The total fee of the exchange - **EstimatedExchangedAmount** (string) - The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. - **AveragePrice** (string) - The average of all the prices in the list of matched orders. The unit is `/`. - **BestPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **WorstPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **ReceivingAddress** (string) - The address that the exchanged currency is received. - **Status** (string) - `Pending` or `Processed`. - **Conversion** (string) - The conversion of the quote. See [conversion](currency-and-conversion-symbols.md#conversion-symbols). ### Response Example ```json { "ID": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "SendingAddress": "gluwa_address_1", "SourceAmount": "100.00", "Fee": "0.50", "EstimatedExchangedAmount": "99.50", "AveragePrice": "0.995", "BestPrice": "0.998", "WorstPrice": "0.992", "ReceivingAddress": "gluwa_address_2", "Status": "Pending", "Conversion": "USD-BTC" } ``` ``` -------------------------------- ### Initialize GluwaClient in .NET Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-.net.md Demonstrates how to create and initialize a GluwaClient object for managing funds and transactions. Supports both default and sandbox modes. ```csharp GluwaClient gluwaClient = new GluwaClient(); // If you want to use the SandBox mode GluwaClient gluwaClient = new GluwaClient(true); ``` -------------------------------- ### Initialize Gluwa PHP SDK Configuration Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-php.md Initializes the Gluwa object with necessary API credentials and wallet information. Supports both sandbox and production environments. Requires PHP 5.6+ and may need bcmath and gmp extensions. ```php $Configuration_DEV, 'APIKey' => $Configuration_APIKey, 'APISecret' => $Configuration_APISecret, 'WebhookSecret' => $Configuration_WebhookSecret, 'MasterEthereumPrivateKey' => $Configuration_MasterEthereumPrivateKey, 'MasterEthereumAddress' => $Configuration_MasterEthereumAddress, ]); ``` -------------------------------- ### GET v1/Orders/:ID Source: https://github.com/gluwa/gluwadocs/blob/master/api/order.md Retrieve a specific order using its unique ID. ```APIDOC ## GET v1/Orders/:ID ### Description Retrieve an order with the specified ID. ### Method GET ### Endpoint /v1/Orders/:ID ### Parameters #### Path Parameters - **ID** (UUID) - Required - The order ID. #### Headers - **Authorization** (string) - Required - Auth token using `Basic` scheme. ### Response #### Success Response (200) - **Order** (Order object) - The details of the requested order. #### Order Object - **ID** (string) - The order ID. - **Conversion** (string) - Conversion symbol for the order. - **SendingAddress** (string) - The address where the source amount is sent from. - **SourceAmount** (string) - The amount available for exchange in source currency. - **Price** (string) - The price the order will use for the exchange. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **Status** (string) - `Active`, `Complete` or `Canceled`. - **Exchanges** (array of Exchange objects) - The list of past and pending exchanges. #### Exchange Object - **SendingAddress** (string) - The address where the source amount is sent from. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **SourceAmount** (string) - The amount in source currency to be exchanged. - **Fee** (string) - The total fee paid for the exchange. - **ExchangedAmount** (string) - The amount in exchanged currency received. - **Price** (string) - The price used for this exchange. - **Status** (string) - `Pending`, `Success` or `Failed`. ### Response Example ```json { "ID": "d290f1ee-6c54-4b01-90e6-d701748f0851", "Conversion": "BTC/USD", "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "SourceAmount": "0.1", "Price": "10000.0", "ReceivingAddress": "1B9zP1eP5QGefi2DMPTfTL5SLmv7DivfNb", "Status": "Active", "Exchanges": [ { "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "ReceivingAddress": "1B9zP1eP5QGefi2DMPTfTL5SLmv7DivfNb", "SourceAmount": "0.1", "Fee": "0.0001", "ExchangedAmount": "999.9", "Price": "10000.0", "Status": "Success" } ] } ``` ### Errors - **400** `InvalidUrlParameters`: Invalid URL parameters. - **403** `Forbidden`: Access is denied for this resource. - **404** `NotFound`: Order not found. - **500** `InternalServerError`: Server error. ``` -------------------------------- ### GET v1/Orders Source: https://github.com/gluwa/gluwadocs/blob/master/api/order.md Retrieve all orders with optional filtering by date, status, and pagination. ```APIDOC ## GET v1/Orders ### Description Retrieve all orders. Supports filtering by date range, status, and pagination. ### Method GET ### Endpoint /v1/Orders ### Parameters #### Query Parameters - **startDateTime** (datetime) - Optional - ISO 8601 format datetime. If defined, only orders created after this datetime are included. - **endDateTime** (datetime) - Optional - ISO 8601 format datetime. If defined, only orders created before this datetime are included. - **status** (string) - Optional - `Active`, `Complete` or `Canceled`. If specified, only orders with the specified status will be included. - **offset** (int) - Optional - Number of orders to skip. Defaults to 0. - **limit** (int) - Optional - Number of orders to include. Defaults to 25, maximum of 100. #### Headers - **Authorization** (string) - Required - Auth token using `Basic` scheme. ### Response #### Success Response (200) - **Orders** (array of Order objects) - An array of order objects. #### Order Object - **ID** (string) - The order ID. - **Conversion** (string) - Conversion symbol for the order. - **SendingAddress** (string) - The address where the source amount is sent from. - **SourceAmount** (string) - The amount available for exchange in source currency. - **Price** (string) - The price the order will use for the exchange. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **Status** (string) - `Active`, `Complete` or `Canceled`. ### Response Example ```json [ { "ID": "d290f1ee-6c54-4b01-90e6-d701748f0851", "Conversion": "BTC/USD", "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "SourceAmount": "0.1", "Price": "10000.0", "ReceivingAddress": "1B9zP1eP5QGefi2DMPTfTL5SLmv7DivfNb", "Status": "Active" } ] ``` ### Errors - **400** `InvalidUrlParameters`: Invalid URL parameters. - **403** `Forbidden`: Not authorized to use this endpoint. - **500** `InternalServerError`: Server error. ``` -------------------------------- ### GET v1/Orders/:ID Source: https://github.com/gluwa/gluwadocs/blob/master/order.md Retrieve the details of a specific order using its unique ID. ```APIDOC ## GET v1/Orders/:ID ### Description Retrieve an order with a specified ID. ### Method GET ### Endpoint /v1/Orders/:ID ### Parameters #### Path Parameters - **ID** (UUID) - Required - The unique identifier of the order. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Response Body**: An `Order` object, including a list of `Exchanges`. #### Order Object - **ID** (string) - The order ID. - **Conversion** (string) - Conversion symbol for the order. - **SendingAddress** (string) - The address where the source amount is sent from. - **SourceAmount** (string) - The amount available for exchange in source currency. - **Price** (string) - The price for the exchange. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **Status** (string) - The current status of the order (`Active`, `Complete`, `Canceled`). - **Exchanges** (array of `Exchange`) - A list of past and pending exchanges for this order. #### Exchange Object - **SendingAddress** (string) - The address where the source amount is sent from. - **ReceivingAddress** (string) - The address where the exchanged amount is received. - **SourceAmount** (string) - The amount in source currency to be exchanged. - **Fee** (string) - The total fee paid for the exchange. - **ExchangedAmount** (string) - The amount in exchanged currency received. - **Price** (string) - The price used for this exchange. - **Status** (string) - The status of the exchange (`Pending`, `Success`, `Failed`). #### Response Example ```json { "ID": "f8c3a2b1-4e5d-4a7b-8c9d-0e1f2a3b4c5d", "Conversion": "BTC/USD", "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "SourceAmount": "1.0", "Price": "0.00005", "ReceivingAddress": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzz4x73w0", "Status": "Active", "Exchanges": [ { "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "ReceivingAddress": "1B1zP1eP5QGefi2DMPTfTL5SLmv7DivfNb", "SourceAmount": "0.5", "Fee": "0.00001", "ExchangedAmount": "25000.0", "Price": "0.00005", "Status": "Success" } ] } ``` #### Error Responses - **400** - `InvalidUrlParameters`: Invalid URL parameters. - **403** - `Forbidden`: Access is denied. Check your Authorization header. - **404** - `NotFound`: Order not found. - **500** - `InternalServerError`: Server error. ``` -------------------------------- ### Initialize Gluwa Node.js SDK Source: https://github.com/gluwa/gluwadocs/blob/master/development/gluwa-sdk-for-javascript-nodejs.md Initializes the Gluwa SDK with configuration details for either production or sandbox environments. It requires API keys, secrets, webhook secrets, and master wallet credentials. Never expose private keys. ```javascript const GluwaJS = require('@gluwa/gluwa-js'); const GluwaConfig = { production: { APIKey: '{Your production API Key}', APISecret: '{Your production API Secret}', WebhookSecret: '{Your production Webhhok Secret}', MasterEthereumAddress: '{Your Ethereum Address for production}', MasterEthereumPrivateKey: '{Your Ethereum Private Key for production}', isDev: false, }, sandbox: { APIKey: '{Your sandbox API Key}', APISecret: '{Your sandbox API Secret}', WebhookSecret: '{Your sandbox Webhhok Secret}', MasterEthereumAddress: '{Your Ethereum Address for sandbox}', MasterEthereumPrivateKey: '{Your Ethereum Private Key for sandbox}', isDev: true, }, } const Gluwa = new GluwaJS(GluwaConfig.production); ``` -------------------------------- ### Core Resources Source: https://github.com/gluwa/gluwadocs/blob/master/api/api.md This section provides links to documentation for core API resources, including balance, fee, transaction, QR code, wrap/unwrap, quote, order, and order book. ```APIDOC ## Core Resources - [balance.md](balance.md) - [fee.md](fee.md) - [transaction.md](transaction.md) - [qr-code.md](qr-code.md) - [wrap-unwrap.md](wrap-unwrap.md) - [quote.md](../quote.md) - [order.md](../order.md) - [order-book.md](../order-book.md) ``` -------------------------------- ### GET /v1/OrderBook/:conversion Source: https://github.com/gluwa/gluwadocs/blob/master/api/order-book.md Retrieves the current order book for a specified conversion symbol. ```APIDOC ## GET /v1/OrderBook/:conversion ### Description Get current order book for a specific conversion symbol. ### Method GET ### Endpoint /v1/OrderBook/:conversion ### Parameters #### Path Parameters - **conversion** (string) - Required - Conversion symbol. See [conversion](currency-and-conversion-symbols.md#conversion-symbols). ### Response #### Success Response (200) - An array of Orders. #### Order - **Amount** (string) - Amount of available in the order. - **Price** (string) - Price. The unit is `/`. #### Response Example [ { "Amount": "100.50", "Price": "0.000025 BTC/LTC" } ] ### Errors #### Error Response (400) - **InvalidUrlParameters**: Invalid URL parameters ``` -------------------------------- ### POST v1/Orders Source: https://github.com/gluwa/gluwadocs/blob/master/api/order.md Create a new order. ```APIDOC ## POST v1/Orders ### Description Create a new order. ### Method POST ### Endpoint /v1/Orders ### Parameters #### Headers - **Authorization** (string) - Required - Auth token using `Basic` scheme. #### Request Body *(Details for request body are not provided in the input text.)* ### Response *(Details for response are not provided in the input text.)* ### Errors *(Details for errors are not provided in the input text.)* ``` -------------------------------- ### GET /v1/:currency/Addresses/:address Source: https://github.com/gluwa/gluwadocs/blob/master/api/balance.md Retrieve the current balance of a given cryptocurrency address. ```APIDOC ## GET /v1/:currency/Addresses/:address ### Description Retrieve the current balance of an address. ### Method GET ### Endpoint /v1/:currency/Addresses/:address ### Parameters #### Path Parameters - **currency** (string) - Required - The currency unit of the balance. - **address** (string) - Required - The public address associated with the transactions. #### Query Parameters - **includeUnspentOutputs** (boolean) - Optional - Unspent transaction outputs of the address. Available only for BTC addresses and if `includeUnspentOutputs` is set to `true`. ### Response #### Success Response (200) - **Balance** (string) - A string representing how much balance in the currency unit (e.g., "1.23" for 1.23 USD-G). - **Currency** (string) - The currency unit of the balance. - **UnspentOutputs** (array of UnspentOutput) - Unspent transaction outputs of the address. Available only for BTC addresses and if `includeUnspentOutputs` is set to `true`. #### Response Example ```json { "Balance": "1.2345", "Currency": "USD-G", "UnspentOutputs": [ { "Amount": "0.1", "TxHash": "0123456789abcdef", "Index": 0, "Confirmations": 5 } ] } ``` ### Errors - **400** - `BadRequest`: Invalid address format. - **400** - `InvalidUrlParameters`: Invalid URL parameters. - **500** - `InternalServerError`: Server error. - **503** - `ServiceUnavailable`: Service unavailable for the specified currency. ``` -------------------------------- ### Get an accepted quote with ID Source: https://github.com/gluwa/gluwadocs/blob/master/quote.md Retrieves a specific accepted quote using its unique identifier. ```APIDOC ## GET /V1/Quotes/:ID ### Description Get an accepted quote with ID. ### Method GET ### Endpoint `/V1/Quotes/:ID` ### Parameters #### Path Parameters - **ID** (UUID) - Required - ID of the accepted quote. #### Headers - **X-REQUEST-SIGNATURE** (string) - Required - Address Signature of the sending address of this quote. See [X-REQUEST-SIGNATURE](api/authentication.md#x-request-signature). ### Response #### Success Response (200) - **Quote** (object) - The accepted quote object. #### Quote Object - **ID** (UUID) - Accepted quote ID. - **SendingAddress** (string) - The address that funded the source amount. - **SourceAmount** (string) - The total amount. - **Fee** (string) - The total fee of the exchange. - **EstimatedExchangedAmount** (string) - The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. - **AveragePrice** (string) - The average of all the prices in the list of matched orders. The unit is `/`. - **BestPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **WorstPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **ReceivingAddress** (string) - The address that the exchanged currency is received. - **Status** (string) - `Pending` or `Processed`. - **Conversion** (string) - The conversion of the quote. See [conversion](api/currency-and-conversion-symbols.md#conversion-symbols). ### Response Example ```json { "ID": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "SendingAddress": "sender_address_123", "SourceAmount": "100.00", "Fee": "0.50", "EstimatedExchangedAmount": "99.50", "AveragePrice": "0.995", "BestPrice": "0.998", "WorstPrice": "0.990", "ReceivingAddress": "receiver_address_456", "Status": "Pending", "Conversion": "USD/BTC" } ``` ### Errors - **400** `InvalidUrlParameters` - Invalid URL parameters. - **400** `MissingBody` - Request body is missing. - **400** `InvalidBody` - Request validation errors. See InnerErrors. - **400** `ValidationError` - Request validation errors. See InnerErrors. - **403** `Forbidden` - Invalid checksum. Checksum may be wrong or expired. - **404** `NotFound` - One of the matched orders are no longer available. - **500** `InternalServerError` - Server error. ``` -------------------------------- ### Create Order Source: https://github.com/gluwa/gluwadocs/blob/master/api/order.md Creates a new order for currency exchange. This endpoint requires detailed information about the conversion, addresses, amounts, and price. ```APIDOC ## POST /v1/Orders ### Description Creates a new order for currency exchange. ### Method POST ### Endpoint /v1/Orders ### Parameters #### Request Body - **Conversion** (string) - Required - Conversion symbol for the order. See [conversion](currency-and-conversion-symbols.md#conversion-symbols). - **SendingAddress** (string) - Required - The address that funds the source amount. - **SendingAddressSignature** (string) - Required - Address Signature of the `SendingAddress` , generate in the same way as [X-REQUEST-SIGNATURE](authentication.md#x-request-signature). - **ReceivingAddress** (string) - Required - The address that the exchanged amount will be received. - **ReceivingAddressSignature** (string) - Required - Address Signature of the `ReceivingAddress` , generate in the same way as [X-REQUEST-SIGNATURE](authentication.md#x-request-signature). - **SourceAmount** (string) - Required - The amount in source currency to be exchanged. - **Price** (string) - Required - The price you want to use. Any exchange that this order will fulfill will use this price. The unit is `/`. - **BtcPublicKey** (string) - Optional - Required if the source currency is `BTC`. The public key for the sending address. Note that this is different from the public address. ### Request Example ```json { "Conversion": "BTC_USD", "SendingAddress": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "SendingAddressSignature": "signature_for_sending_address", "ReceivingAddress": "0xAb5801c7D398351b8bE11C439e05C5B3259aeC9B", "ReceivingAddressSignature": "signature_for_receiving_address", "SourceAmount": "0.1", "Price": "50000", "BtcPublicKey": "0321a3c736a7359863461f0d3726d51198435f55e30855482055802c5d1c9f9a46" } ``` ### Response #### Success Response (201) - **ID** (UUID) - The order ID. #### Response Example ```json { "ID": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ### Errors - **400** `InvalidUrlParameters`: Invalid URL parameters - **400** `MissingBody`: Request body is missing. - **400** `InvalidBody`: Request validation errors. See InnerErrors. - **400** `ValidationError`: Request validation errors. See InnerErrors. - **403** `Forbidden`: Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. - **403** `WebhookNotFound`: Webhook URL to send exchange request is unavailable. - **500** `InternalServerError`: Server error. - **503** `ServiceUnavailable`: Service unavailable for the specified conversion. ``` -------------------------------- ### GET /v1/:currency/Addresses/:address/Quotes Source: https://github.com/gluwa/gluwadocs/blob/master/api/quote.md Retrieves a list of accepted quotes for a given currency and address. ```APIDOC ## GET /v1/:currency/Addresses/:address/Quotes ### Description Get a list of accepted quotes. ### Method GET ### Endpoint `/v1/:currency/Addresses/:address/Quotes` ### Parameters #### Path Parameters - **currency** (string) - Required - The source [currency](currency-and-conversion-symbols.md#conversion-symbols) of the quote. - **address** (string) - Required - The sending address of the quote. #### Query Parameters - **startDateTime** (datetime) - Optional - ISO 8601 format datetime. If defined, only quotes created after this datetime are included in the response. - **endDateTime** (datetime) - Optional - ISO 8601 format datetime. If defined, only quotes created before this datetime are included in the response. - **status** (string) - Optional - `Pending` or `Processed`. - **offset** (int) - Optional - Number of quotes to skip the beginning of list. Defaults to 0. - **limit** (int) - Optional - Number of quotes to include in the result. Defaults to 25, maximum of 100. #### Headers - **X-REQUEST-SIGNATURE** (string) - Required - Address Signature of the sending address. See [X-REQUEST-SIGNATURE](authentication.md#x-request-signature). ### Response #### Success Response (200) - **ID** (UUID) - Accepted quote ID. - **SendingAddress** (string) - The address that funded the source amount. - **SourceAmount** (string) - The total amount - **Fee** (string) - The total fee of the exchange - **EstimatedExchangedAmount** (string) - The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. - **AveragePrice** (string) - The average of all the prices in the list of matched orders. The unit is `/`. - **BestPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **WorstPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **ReceivingAddress** (string) - The address that the exchanged currency is received. - **Status** (string) - `Pending` or `Processed`. - **Conversion** (string) - The conversion of the quote. See [conversion](currency-and-conversion-symbols.md#conversion-symbols). ### Response Example ```json [ { "ID": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "SendingAddress": "gluwa_address_1", "SourceAmount": "100.00", "Fee": "0.50", "EstimatedExchangedAmount": "99.50", "AveragePrice": "0.995", "BestPrice": "0.998", "WorstPrice": "0.992", "ReceivingAddress": "gluwa_address_2", "Status": "Pending", "Conversion": "USD-BTC" } ] ``` ``` -------------------------------- ### Get Transaction by Hash Source: https://github.com/gluwa/gluwadocs/blob/master/api/transaction.md Retrieves details for a specific transaction using its blockchain hash and currency. ```APIDOC ## GET /v1/:currency/Transactions/:txnhash ### Description Retrieves details for a specific transaction using its blockchain hash and currency. ### Method GET ### Endpoint `/v1/:currency/Transactions/:txnhash` ### Parameters #### Path Parameters - **currency** (string) - Required - The currency of the transaction. - **txnhash** (string) - Required - Blockchain transaction hash. #### Headers - **X-REQUEST-SIGNATURE** (string) - Required - Address Signature of an address involved with txnhash. See [X-REQUEST-SIGNATURE](authentication.md#x-request-signature). ### Response #### Success Response (200) - **Transaction** (object) - Details of the transaction. #### Response Example ```json { "Note": "string", "Fee": "string", "ID": "UUID" } ``` ### Errors - **400** - `InvalidUrlParameters` - Invalid URL parameters - **400** - `BadRequest` - Invalid `txnhash` value. - **403** - `SignatureMissing` - `X-REQUEST-SIGNATURE` header is missing. - **403** - `SignatureExpired` - `X-REQUEST-SIGNATURE` has expired. - **403** - `InvalidSignature` - Invalid `X-REQUEST-SIGNATURE`. - **404** - `NotFound` - Transaction not found. - **500** - `InternalServerError` - Server error. - **503** - `ServiceUnavailable` - Service unavailable for the specified currency. ``` -------------------------------- ### Introduction Source: https://github.com/gluwa/gluwadocs/blob/master/api/api.md The Gluwa API follows REST design guidelines, uses JSON-encoded responses, and standard HTTP methods. It supports separate environments for testing and live usage. ```APIDOC ## Introduction The Gluwa API follows [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) design guideline. The API has predictable resource-oriented URL's and returns [JSON-encoded](http://www.json.org) responses, and uses standard HTTP response codes, authentication, and verbs. We support a separate environment for testing purposes. When testing, use the sandbox credentials and URL. When you are ready to go live, use the production credentials and URL. ### Base URL **Live:** `https://api.gluwa.com` **Sandbox:** `https://sandbox.api.gluwa.com` ### HTTPS Over HTTP All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). Calls made over plain HTTP will fail. ### Client SDK's By default, the Gluwa API Docs demonstrate using curl to interact with the API over HTTP. You could also use one of our official Software Development Kits (SDK) to see interact with our API. ``` -------------------------------- ### Get a list of accepted quotes Source: https://github.com/gluwa/gluwadocs/blob/master/quote.md Retrieves a list of accepted quotes based on specified currency, address, and optional filters. ```APIDOC ## GET /v1/:currency/Addresses/:address/Quotes ### Description Get a list of accepted quotes. ### Method GET ### Endpoint `/v1/:currency/Addresses/:address/Quotes` ### Parameters #### Path Parameters - **currency** (string) - Required - The source currency of the quote. - **address** (string) - Required - The sending address of the quote. #### Query Parameters - **startDateTime** (datetime) - Optional - If defined, only quotes created after this datetime are included in the response. - **endDateTime** (datetime) - Optional - If defined, only quotes created before this datetime are included in the response. - **status** (string) - Optional - `Pending` or `Processed`. - **offset** (int) - Optional - Number of quotes to skip the beginning of list. Defaults to 0. - **limit** (int) - Optional - Number of quotes to include in the result. Defaults to 25, maximum of 100. #### Headers - **X-REQUEST-SIGNATURE** (string) - Required - Address Signature of the sending address. See [X-REQUEST-SIGNATURE](api/authentication.md#x-request-signature). ### Response #### Success Response (200) - **Quotes** (array) - An array of Quote objects. #### Quote Object - **ID** (UUID) - Accepted quote ID. - **SendingAddress** (string) - The address that funded the source amount. - **SourceAmount** (string) - The total amount. - **Fee** (string) - The total fee of the exchange. - **EstimatedExchangedAmount** (string) - The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. - **AveragePrice** (string) - The average of all the prices in the list of matched orders. The unit is `/`. - **BestPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **WorstPrice** (string) - The best price available in the list of matched orders. The unit is `/`. - **ReceivingAddress** (string) - The address that the exchanged currency is received. - **Status** (string) - `Pending` or `Processed`. - **Conversion** (string) - The conversion of the quote. See [conversion](api/currency-and-conversion-symbols.md#conversion-symbols). ### Response Example ```json [ { "ID": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "SendingAddress": "sender_address_123", "SourceAmount": "100.00", "Fee": "0.50", "EstimatedExchangedAmount": "99.50", "AveragePrice": "0.995", "BestPrice": "0.998", "WorstPrice": "0.990", "ReceivingAddress": "receiver_address_456", "Status": "Pending", "Conversion": "USD/BTC" } ] ``` ### Errors - **400** `InvalidUrlParameters` - Invalid URL parameters. - **403** `SignatureMissing` - `X-REQUEST-SIGNATURE` header is missing. - **403** `SignatureExpired` - `X-REQUEST-SIGNATURE` has expired. - **403** `InvalidSignature` - Invalid `X-REQUEST-SIGNATURE`. - **500** `InternalServerError` - Server error. ```