MPC-TSS
Portfolios
Get Assets on Portfolio

API Documentation: Get Listing Asset (Coin/Token)

Overview

This endpoint allow user to view all assets on particular wallet, including the balance on-chain of asset.

  • HTTP Method: GET
  • Endpoint: /api/v1/portfolios/{walletId}

Request Path Parameters

  • walletId (required): wallet identifier.

Request Query Parameters

  • page (optional): The page number to retrieve. Type: number.
  • limit (optional): The maximum number of results to return. Type: number.
  • search (optional): Filters assets based on the asset's name. Type: string.
  • force (optional): When force is set to true, the balance will be fetched directly from the RPC. If false, the balance will be retrieved from the cache. Note that the force option is rate-limited to 5 requests within a 3-minute window. Type: boolean.

Example Request Query

/api/v1/portfolios/7a813f6b-5639-49b2-a39c-8159fefaa6ae?page=1&limit=10&force=true'
 

Request

Request Headers

  • X-CLIENT-ID: (required): Client ID which was generated when register in Xellar TSS API Service Dashboard.
  • X-SIGNATURE: (required): Calculated signature, please refer to Authorization section.
  • X-TIMESTAMP: (required): Request timestamp in RFC3339 format.

Example Request Syntax

curl -X GET -H "Content-Type: application/json" -H "x-client-id: $YOUR_CLIENT_ID" -H "x-client-secret: $YOUR_CLIENT_SECRET" <BASE_URL>/api/v1/portfolios/{walletId}

Response

The response will include a JSON object with the following properties:

  • status (number): The HTTP status code of the response (e.g., 200 for success).
  • message (string): A message providing additional information about the operation.
  • data (object): An object containing the request information.
  • data.page (number): Indicate the current page.
  • data.limit (number): Indicate max data shown.
  • data.totalResults (number): Indicate total existing data based on query.
  • data.totalPages (number): Indicate total page.
  • data.data (array): List of assets.
  • data.data.key (string): Asset unique identifier.
  • data.data.id (string): Asset id.
  • data.data.symbol (string): Asset symbol.
  • data.data.name (string): Asset name.
  • data.data.network (string): Asset netwwork.
  • data.data.wrapped (boolean): If true, asset is native-wrapped asset.
  • data.data.isNative (boolean): If true, asset is native coin on particular network.
  • data.data.logo (string): Asset logo.
  • data.data.contractAddress (string): Token Contract address, value exist only on non-native asset.
  • data.data.decimalPlace (string): Decimal of asset, value exist only on non-native asset.
  • data.data.balance (string): Balance asset

Example Response

{
    "status": 200,
    "message": "success get assets on portfolio",
    "data": {
        "page": 1,
        "limit": 10,
        "totalResults": 2,
        "totalPages": 1,
        "data": [
            {
                "key": "b3d56d59-c60a-441f-9a95-a035ab032128",
                "id": "usd-coin",
                "symbol": "usdc",
                "name": "USDC",
                "network": "ethereum",
                "wrapped": false,
                "isNative": false,
                "logo": "https://raw.githubusercontent.com/Xellar-Protocol/xellar-assets/master/assets/usd-coin/logo.png",
                "contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
                "decimalPlace": 6,
                "isCustom": false,
                "balance": "0"                
            },
            {
                "key": "ae272e78-99b0-4fd3-9759-314637df711e",
                "id": "6fff3dac-28f4-4b86-9110-44540ff7c3f8",
                "symbol": "myt2",
                "name": "My Token2",
                "network": "ethereum",
                "wrapped": false,
                "isNative": false,
                "logo": "",
                "contractAddress": "0xfd957f21bd95e723645c07c48a2d8acb8ffb3796",
                "decimalPlace": 18,
                "isCustom": true,
                "balance": "0"                
            }
        ]
    }
}