Wallet APIs

Token Balances

This endpoint allows you to retrieve balance tied to a particular address on a specific chain.The response of this API will let you understand in details about all your assets.

Filters:

  •     Get All Assets Without dust tokens
    

    Dust filtering, where if verified is specified as true it returns only verified tokens removing all dust tokens. (verified query parameter accepts true or false)

  •    Get Assets in requested chain
    

    Chain Id Filtering for kadena chain, Returns assets available on a particular chain (0-19)

  •    Get a particular token balance across all chains
    

    Token Filtering for kadena chain, Returns token balance across all chains (0-19). Combination of both token and chainID can be passed which return the balance of a requested token in a requested chain, If address does not start with k: or w: then both chainId and token should be passed

  •    Get aggregated balance across all chains
    

    Aggregated balance for kadena Returns the aggregated balance across all chains

import Unmarshal, {Chain} from "@unmarshal/sdk";

const unmarshal = new Unmarshal({apiKey: "YOUR_API_KEY_GOES_HERE"});

unmarshal.WalletApi
    .getTokenBalances(Chain.ethereum, "demo.eth")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "kadena" "celo" "klaytn" "cronos" "velas" "arbitrum" "avalanche" "xinfin" "zilliqa" "solana" "fantom" "fuse" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
address
required
string
Default: "demo.eth"

Any valid address or ENS

Example: demo.eth
query Parameters
verified
boolean
Default: "false"

Set true for only verified tokens

chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

token
string
Default: "false"

Return balances of the requested token (For Kadena chain)

Responses
200
401
get/v1/{chain}/address/{address}/assets
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/address/:address/assets?verified=false&chainId=false&token=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {},
  • {
    },
  • {
    }
]

Assets with offset based pagination

This endpoint allows you to retrieve assets tied to a particular address on a specific chain.The response of this API is returned in a paginated format with an offset value.

Note:

  • To fetch items on the next page, pass next_offset value of current page as the offset.

  • For Kadena and Solana, all assets will be returned in a single response.

Filters:

  •     Get All Assets Without dust tokens
    

    Dust filtering, where if verified is specified as true it returns only verified tokens removing all dust tokens. (verified query parameter accepts true or false)

  •    Get Assets in requested chain
    

    Chain Id Filtering for kadena chain, Returns assets available on a particular chain (0-19)

  •    Get a particular token balance across all chains
    

    Token Filtering for kadena chain, Returns token balance across all chains (0-19). Combination of both token and chainID can be passed which return the balance of a requested token in a requested chain, If address does not start with k: or w: then both chainId and token should be passed

  •    Get aggregated balance across all chains
    

    Aggregated balance for kadena Returns the aggregated balance across all chains

import Unmarshal, {Chain} from "@unmarshal/sdk";

const unmarshal = new Unmarshal({apiKey: "YOUR_API_KEY_GOES_HERE"});

unmarshal.WalletApi
    .getTokenBalances(Chain.ethereum, "demo.eth")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic" "kadena" "celo" "klaytn" "cronos" "velas" "arbitrum" "avalanche" "xinfin" "zilliqa" "solana" "fantom" "fuse" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
address
required
string
Default: "demo.eth"

Any valid address or ENS

Example: demo.eth
query Parameters
verified
boolean
Default: "false"

Set true for only verified tokens

chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

token
string
Default: "false"

Return balances of the requested token (For Kadena chain)

pageSize
number
Default: 50

Number of records to be fetched per page

Example: pageSize=5
offset
string
Default: "0"

The offset to start with, this is returned in the previous response.

Responses
200
401
get/v2/{chain}/address/{address}/assets
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v2/:chain/address/:address/assets?verified=false&chainId=false&token=false&pageSize=5&offset=0&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "items_on_page": 5,
  • "next_offset": 5,
  • "assets": [
    ]
}

Profit and Loss

The profit loss endpoint provide the profit or loss made by an address for a given token.

unmarshal.WalletApi
    .getProfitAndLoss(Chain.ethereum, "demo.eth", "token-address")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
address
required
string
Default: "demo.eth"

Any valid address or ENS

Example: demo.eth
chain
required
string

Chain name (example: bsc, ethereum, matic...)

Enum: "ethereum" "bsc" "matic"
Example: bsc
query Parameters
contract
required
string

Valid contract address

Responses
200
401
get/v2/{chain}/address/{address}/userData
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v2/:chain/address/:address/userData?contract=string&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "quote_rate": 1.88,
  • "total_fees_paid": 0.00408196,
  • "total_fees_paid_usd": 12.35876252184,
  • "average_token_price": 0.6777538233562116,
  • "overall_profit_loss": 1390.998826376863,
  • "current_holding_quantity": 1157,
  • "percentage_change_24H": 3.87773,
  • "price_change_24H": 81.37875199999999
}

Token Holders Count

This endpoint allows you to retrieve the total token holders for a given token contract address.

unmarshal.WalletApi
    .getTokenHoldersCount(Chain.ethereum, "token address")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string
Enum: "ethereum" "bsc" "matic" "celo"
Example: ethereum
address
required
string

Any valid Erc20 token address

Example: 0x5a666c7d92E5fA7Edcb6390E4efD6d0CDd69cF37
Responses
200
401
get/v1/{chain}/token-address/{address}/holders-count
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/token-address/:address/holders-count?auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "token_holders_count": "3367"
}

Top Token Holders

This endpoint returns the Top Holders of a token. This is supported on the ethereum and polygon chains currently.

Request
Security:
path Parameters
chain
required
string
Enum: "ethereum" "matic"
Example: ethereum
contract
required
string

Any valid Erc20 token address

Example: 0x5a666c7d92E5fA7Edcb6390E4efD6d0CDd69cF37
Responses
200

Example response

401
get/v1/{chain}/contract/{contract}/top-holders
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/contract/:contract/top-holders?auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "token_address": "0x5a666c7d92e5fa7edcb6390e4efd6d0cdd69cf37",
  • "top_holders": [
    ],
  • "holders_count": 4070
}