Conversions
View and manage cryptocurrency conversion operations within your account.
List Conversions
This endpoint retrieves all conversions.
HTTP Request
GET /v1/conversions/
auto_conversions = uniwire_api_request('/v1/conversions/')uniwire_api_request('/v1/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",
"amount": "50",
"to_amount": "49.5",
"exchange": {
"id": "<exchange_id>",
"title": "Binance"
},
"status": "draft",
"is_approved": false,
"approved_by": null
},
{
"id": "a667298e-ff10-4e16-bb06-4394552264ca",
"created_at": "2024-09-19T16:18:22.057617+00:00",
"created_by": "<user_email>",
"from_wallet": {
"id": "fce22564-bf58-481f-a66d-9bcb4dc764e1",
"name": "Ethereum"
},
"from_kind": "ETH",
"to_wallet": {
"id": "fce22564-bf58-481f-a66d-9bcb4dc764e1",
"name": "Ethereum"
},
"to_kind": "ETH_USDT",
"amount": "0.01809803",
"to_amount": "42.48",
"exchange": {
"id": "9994a4fe-1367-4143-a696-b236f34c653a",
"title": null
},
"status": "draft",
"is_approved": false,
"approved_by": "<user_email>"
}
]
}Get Conversion
This endpoint retrieves a specific conversion.
HTTP Request
GET /v1/conversions/<ID>/
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the conversion to retrieve |
auto_conversions = uniwire_api_request('/v1/conversions/<id>/')uniwire_api_request('/v1/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",
"amount": "50",
"to_amount": "49.5",
"exchange": {
"id": "<exchange_id>",
"title": "Binance"
},
"status": "draft",
"is_approved": false,
"approved_by": null,
"transaction": null,
"payout": null
}
}Create Conversion
This endpoint allows creating conversion. Only one conversion per wallet per kind is allowed. Editable fields: from_wallet,from_kind,to_wallet,to_kind,amount,exchange,is_approved.
HTTP Request
POST /v1/conversions/
Payload Parameters
| Parameter | Description | Required |
|---|---|---|
| is_approved | Approve conversion | No |
| from_wallet | Wallet ID | Yes |
| from_kind | Available Values | Yes |
| to_wallet | Wallet ID | Yes |
| to_kind | Available Values | Yes |
| exchange | Exchange ID | No |
| amount | Amount to convert | Yes |
import json
payload = {
'is_approved': False,
'from_wallet': '<wallet_id>',
'from_kind': 'USDT-TRX',
'to_wallet': '<wallet_id>',
'to_kind': 'USDC-TRX',
'amount': 50,
'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/conversions/', payload, 'POST')
print(json.dumps(auto_conversion, indent=2))var payload = {
'is_approved': false,
'from_wallet': '<wallet_id>',
'from_kind': 'USDT-TRX',
'to_wallet': '<wallet_id>',
'to_kind': 'USDC-TRX',
'amount': 50,
'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/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",
"amount": "50",
"to_amount": "49.5",
"exchange": {
"id": "<exchange_id>",
"title": "Binance"
},
"is_approved": false
}
}Update Conversion
This endpoint allows updating conversion. Editable fields: to_wallet,to_kind,amount,exchange,is_approved.
HTTP Request
PUT https://api.uniwire.com/v1/conversions/<ID>/
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the conversion to retrieve |
Payload Parameters
| Parameter | Description |
|---|---|
| is_approved | Enable / Disable conversion execution |
| to_wallet | Wallet ID |
| to_kind | Available Values |
| exchange | Exchange ID |
| amount | Amount to convert |
import json
payload = {
'is_approved': False,
'to_wallet': '<wallet_id>',
'to_kind': 'USDC-TRX',
'amount': 50,
'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/conversions/<id>', payload, 'PUT')
print(json.dumps(auto_conversion, indent=2))var payload = {
'is_approved': False,
'to_wallet': '<wallet_id>',
'to_kind': 'USDC-TRX',
'amount': 50,
'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/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",
"amount": "50",
"to_amount": "49.5",
"exchange": {
"id": "<exchange_id>",
"title": "Binance"
},
"is_approved": false
}
}Delete Conversion
This endpoint allows delete conversion.
HTTP Request
DELETE https://api.uniwire.com/v1/conversions/<ID>/
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the conversion to delete |
import json
payload = None
auto_conversion = uniwire_api_request('/v1/conversions/<id>', payload, 'DELETE')
print(json.dumps(auto_conversion, indent=2))var payload = null
uniwire_api_request('/v1/conversions/<id>', payload, 'DELETE').then(function(response) {
//
}).catch(function(error) {
console.log(error);
});