User Balance
Fetch the current balance of an authenticated user.
Endpoint
GET https://api.metafide.io/v1/surge/games/user-balance
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
currency | string | Yes | The currency to fetch the balance for (e.g. USDC) |
network | string | Yes | The network to query (e.g. mainnet) |
Headers
| Header | Value |
|---|---|
Accept | */* |
x-api-key | Your Metafide API key |
Example Request
// Node 18+ has native fetch — no import needed
const url = 'https://api.metafide.io/v1/surge/games/user-balance?currency=USDC&network=mainnet';
const options = {
method: 'GET',
headers: {
'Accept': '*/*',
'x-api-key': 'metafide_11111111111111111111111111111',
},
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Response
{
"userId": 1,
"balance": "1000",
"withdrawal_req": "none"
}
Response Fields
| Field | Type | Description |
|---|---|---|
userId | number | The unique identifier of the authenticated user |
balance | string | The current available balance in the requested currency |
withdrawal_req | string | Status of any ongoing withdrawal request. Returns none if there is no active withdrawal |