💵Get Vault Balance

Base URL

All API requests should be made to the following base URL:

https://metadata.emblemvault.io

API Endpoints

Get All Known Projects

Fetches all known asset chains (for use in the verified vaults call).

Endpoint:

GET {baseURL}/vault/balance/:tokenId?live=true

Path Parameters:

  • tokenId (required): The tokenId to check balance of

Query string Parameters:

  • live (optional): get live balances (true) or recorded balance (false)

Responses:

  • 200 OK - The request was successful, and the list of asset chains is returned.

    Example successful response:

    {
      "totalValue": 0,
      "balances": [
        {
          "coin": "XCP",
          "name": "Stamp #12141",
          "balance": 1,
          "type": "nft",
          "external_url": "https://xchain.io/asset/A978855619285476200",
          "image": "https://stampchain.io/stamps/d88bac3c172d235069141de9b81e7d6c42e0b9b371aa2ff1ee4444cc096a9fd6.png",
          "project": "STAMPS",
          "traits": [
            {
              "trait_type": "STAMPS",
              "value": "STAMP #12141"
            }
          ],
          "assetName": "A978855619285476200",
          "projectLogo": null,
          "projectSite": null
        }
      ]
    }

  • 400 Bad Request - The request was unsuccessful due to incorrect input or an error in processing. Check the response body for more information.

    Example response for empty set:

    {
        "success": false,
        "error": "No items found"
    }

Examples

Here's an example using the request library in Node.js to make a request to the API with the provided tokenId:

const request = require('request');

const baseUrl = 'https://metadata.emblemvault.io';
const tokenId = '1135823521381251'; // Replace with your actual API key

const options = {
 url: `${baseUrl}/meta/${tokenId}?live=true`
};

request(options, (error, response, body) => {
 if (!error && response.statusCode === 200) {
   const parsedBody = JSON.parse(body);
   console.log(parsedBody);
 } else {
   console.log('Error:', error);
   console.log('Status Code:', response.statusCode);
   console.log('Body:', body);
 }
});

CURL

curl -X GET \
 'https://metadata.emblemvault.io/meta/1135823521381251' \
 -H 'x-api-key: your_api_key_here'

Last updated