Wallets
Manage wallet balances and currency conversions
Wallets API
Manage wallet balances and convert currencies to DRAKMA.
Get Wallet Balances {#get-balances}
Retrieve current balances for all supported currencies.
Endpoint
GET /api/v1/wallet/balances
Authentication
Required
Response
{
"usd": "1250.50",
"usdt": "500.00",
"usdc": "0",
"eth": "0.5",
"drgn": "1000.00",
"drakma": "5000.00"
}Response Fields
| Field | Type | Description |
|---|---|---|
usd | string | USD balance |
usdt | string | USDT (Tether) balance |
usdc | string | USDC balance |
eth | string | Ethereum balance |
drgn | string | DRGN balance |
drakma | string | DRAKMA balance |
Notes
- Returns "0" for currencies with no wallet or zero balance
- All balances returned as decimal strings for precision
Convert to DRAKMA {#convert-to-drakma}
Convert currency to DRAKMA with bonus.
Endpoint
POST /api/v1/wallet/convert-to-drakma
Authentication
Required - Must have sufficient balance
Request Body
{
"currency": "USD",
"amount": "100.00"
}Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | Source currency (USD, USDT, USDC, ETH, DRGN) |
amount | string | Yes | Amount to convert |
Valid Currencies
USD- US DollarUSDT- TetherUSDC- USD CoinETH- EthereumDRGN- Dragonchain Token
Note: Cannot convert DRAKMA to DRAKMA
Response
{
"status": "success"
}Error Responses
| Status | Message | Reason |
|---|---|---|
| 400 | Invalid currency: DRAKMA | Cannot convert DRAKMA |
| 400 | Insufficient funds: 1000.00 | Balance too low |
| 500 | failed to post transaction | Blockchain error |
Conversion Process
- Validates currency (cannot be DRAKMA)
- Verifies sufficient wallet balance
- Calculates conversion rate with bonus
- Posts transaction to Dragonchain
- Burns source currency (user → zero wallet)
- Mints DRAKMA (zero wallet → user)
Transaction Details
Burn Transaction (Source Currency):
- From: User wallet
- To: Zero wallet (burn address)
- Amount: Requested conversion amount
- Metadata:
{conversionBurn: true}
Mint Transaction (DRAKMA):
- From: Zero wallet (mint address)
- To: User wallet
- Amount: Total with bonus
- Metadata:
{conversionMint: true}
Notes
- Conversion includes bonus DRAKMA
- Operations are atomic (both succeed or both fail)
- Transaction ID stored for audit trail
- Uses database transaction for consistency
Supported Currencies
| Code | Name | Type |
|---|---|---|
| USD | US Dollar | Fiat |
| USDT | Tether | Stablecoin |
| USDC | USD Coin | Stablecoin |
| ETH | Ethereum | Cryptocurrency |
| DRGN | Dragonchain Token | Platform Token |
| DRAKMA | Drakma | Platform Token |
Currency Restrictions
- DRAKMA: Can receive through conversions, cannot convert from
- All other currencies can convert to DRAKMA