Skip to content

Auto Conversions

Multiple times a day wallets balances will be checked and if balance exceeds amount specified in "Keep Amount" by at least "Minimum Amount" it will be automatically converted into desirable currency. "Maximum Amount" limits what is the maximum amount per one conversion.

List Auto Conversions

This endpoint retrieves all automatic conversions.

HTTP Request

GET /v1/automatic-conversions/

python
auto_conversions = uniwire_api_request('/v1/automatic-conversions/')
javascript
uniwire_api_request('/v1/automatic-conversions/').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

The above command returns JSON structured like this:

json
{
  "result": [
    {
      "id": "<id>",
      "created_at": "2024-09-19T16:18:22.057617+00:00",
      "created_by": "<user_email>",
      "from_wallet": {
        "id": "<wallet_id>",
        "name": "Tron"
      },
      "from_kind": "USDT-TRX",
      "to_wallet": {
        "id": "<wallet_id>",
        "name": "Tron"
      },
      "to_kind": "USDC-TRX",
      "keep_amount": "50",
      "min_amount": "50",
      "max_amount": "50",
      "exchange": {
        "id": "<exchange_id>",
        "title": "Binance"
      },
      "is_enabled": true
    }
  ]
}

Get Auto Conversion

This endpoint retrieves a specific automatic conversion.

HTTP Request

GET /v1/automatic-conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the automatic conversion to retrieve
python
auto_conversions = uniwire_api_request('/v1/automatic-conversions/<id>/')
javascript
uniwire_api_request('/v1/automatic-conversions/<id>/').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

The above command returns JSON structured like this:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "keep_amount": "50",
    "min_amount": "50",
    "max_amount": "50",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "is_enabled": true
  }
}

Create Auto Conversion

This endpoint allows creating automatic conversion. Only one automatic conversion per wallet per kind is allowed. Editable fields: to_wallet,to_kind,keep_amount,min_amount,exchange,is_enabled.

HTTP Request

POST /v1/automatic-conversions/

Payload Parameters

ParameterDescriptionRequired
is_enabledEnable / Disable automatic conversion executionNo
from_walletWallet IDYes
from_kindAvailable ValuesYes
to_walletWallet IDYes
to_kindAvailable ValuesYes
min_amountMinimal amount to execute automatic conversionYes
max_amountMaximum amount to execute automatic conversionYes
keep_amountAmount to keep in walletYes
exchangeExchange IDNo
python
import json

payload = {
    'is_enabled': True,
    'from_wallet': '<wallet_id>',
    'from_kind': 'USDT-TRX',
    'to_wallet': '<wallet_id>',
    'to_kind': 'USDC-TRX',
    'min_amount': 50,
    'max_amount': 50,
    'keep_amount': 50,
    'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/automatic-conversions/', payload, 'POST')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = {
  'is_enabled': True,
  'from_wallet': '<wallet_id>',
  'from_kind': 'USDT-TRX',
  'to_wallet': '<wallet_id>',
  'to_kind': 'USDC-TRX',
  'min_amount': 50,
  'max_amount': 50,
  'keep_amount': 50,
  'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/automatic-conversions/', payload, 'POST').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

JSON response for Create Automatic Conversion endpoint:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "keep_amount": "50",
    "min_amount": "50",
    "max_amount": "50",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "is_enabled": true
  }
}

Update Auto Conversion

This endpoint allows updating automatic conversion. Editable fields: is_enabled,to_wallet,to_kind,keep_amount,min_amount,max_amount,exchange.

HTTP Request

PUT https://api.uniwire.com/v1/automatic-conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the automatic conversion to retrieve

Payload Parameters

ParameterDescription
is_enabledEnable / Disable automatic conversion execution
to_walletWallet ID
to_kindAvailable Values
exchangeExchange ID
min_amountMinimal amount to execute automatic conversion
max_amountMaximum amount to execute automatic conversion
keep_amountAmount to keep in wallet
python
import json

payload = {
    'is_enabled': True,
    'to_wallet': '<wallet_id>',
    'to_kind': 'USDC-TRX',
    'min_amount': 50,
    'max_amount': 50,
    'keep_amount': 50,
    'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'PUT')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = {
  'is_enabled': True,
  'to_wallet': '<wallet_id>',
  'to_kind': 'USDC-TRX',
  'min_amount': 50,
  'max_amount': 50,
  'keep_amount': 50,
  'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'PUT').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

JSON response for Create Automatic Conversion endpoint:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "keep_amount": "50",
    "min_amount": "50",
    "max_amount": "50",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "is_enabled": true
  }
}

Delete Auto Conversion

This endpoint allows delete automatic conversion.

HTTP Request

DELETE https://api.uniwire.com/v1/automatic-conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the automatic conversion to delete
python
import json

payload = None
auto_conversion = uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'DELETE')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = null
uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'DELETE').then(function(response) {
  //
}).catch(function(error) {
  console.log(error);
});