Get Balance

Get the balance of any address in MINA protocol.

Description

This endpoint retrieves the current balance of a specified wallet address in both native currency (MINA) and fiat currency (USD).

URL

https://api.zelf.world/api/mina/balance/:address

Method

GET

Parameters

Parameter
Type
Description

address

string

The wallet address for which to retrieve the balance.

Headers

Key
Value
Required
Description

Authorization

Bearer <token>

Yes

The authorization token for access.

Example Request

curl --location --request GET 'https://api.zelf.world/api/mina/balance/B62qjuW4rj2hjC6Q5HV5QWADF...MK2Pnj7J7TEwH' \
--header 'Authorization: Bearer <token>'

Example Response

{
  "data": {
    "balance": 812.8946,
    "fiatBalance": 337.8585052304,
    "currency": "usd"
  }
}

Response Details

  • balance: The balance of the specified wallet address in MINA.

  • fiatBalance: The equivalent value of the balance in USD.

  • currency: The fiat currency used for conversion (in this case, USD).

Error Responses

Status Code
Description

401

Unauthorized. Invalid or missing token.

404

Not Found. The wallet address does not exist.

500

Internal Server Error. An error occurred on the server.

Node.js - Axios Example

const axios = require('axios');

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.zelf.world/api/mina/balance/B62qjuW4rj2hjC6Q5HV5QWADF...MK2Pnj7J7TEwH',
  headers: {
    'Authorization': 'Bearer <token>'
  }
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });

Status Codes

Code
Description

200

Success. The balance data is returned.

400

Bad Request. Invalid address format.

401

Unauthorized. Invalid authorization token.

500

Internal Server Error.

Notes

  • Ensure that the address provided is valid and in the correct format.

  • The API requires an Authorization token for access.


Last updated