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/
auto_conversions = uniwire_api_request('/v1/automatic-conversions/')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:
{
"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
| Parameter | Description |
|---|---|
| ID | The ID of the automatic conversion to retrieve |
auto_conversions = uniwire_api_request('/v1/automatic-conversions/<id>/')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:
{
"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
| Parameter | Description | Required |
|---|---|---|
| is_enabled | Enable / Disable automatic conversion execution | No |
| from_wallet | Wallet ID | Yes |
| from_kind | Available Values | Yes |
| to_wallet | Wallet ID | Yes |
| to_kind | Available Values | Yes |
| min_amount | Minimal amount to execute automatic conversion | Yes |
| max_amount | Maximum amount to execute automatic conversion | Yes |
| keep_amount | Amount to keep in wallet | Yes |
| exchange | Exchange ID | No |
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))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:
{
"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
| Parameter | Description |
|---|---|
| ID | The ID of the automatic conversion to retrieve |
Payload Parameters
| Parameter | Description |
|---|---|
| is_enabled | Enable / Disable automatic conversion execution |
| to_wallet | Wallet ID |
| to_kind | Available Values |
| exchange | Exchange ID |
| min_amount | Minimal amount to execute automatic conversion |
| max_amount | Maximum amount to execute automatic conversion |
| keep_amount | Amount to keep in wallet |
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))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:
{
"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
| Parameter | Description |
|---|---|
| ID | The ID of the automatic conversion to delete |
import json
payload = None
auto_conversion = uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'DELETE')
print(json.dumps(auto_conversion, indent=2))var payload = null
uniwire_api_request('/v1/automatic-conversions/<id>', payload, 'DELETE').then(function(response) {
//
}).catch(function(error) {
console.log(error);
});