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
[
  • {},
  • {
    },
  • {
    }
]

Transaction History of an address

The transactions API fetches the list of all transactions in wallet address

Our Bank statements often let us understand the financial positions of a bank account. Similarly for a Crypto wallet , the transactions gives the wallet holder a detailed analysis of the inbound and out bound transfers thereby keeping the wallet apprised of all the happenings in their wallet.

Unmarshal Transaction APIs are smart enough to differentiate the kind of operation a particular transaction was made for. It will let a user understand if the transaction was was for a send or receive or the amount was staked or un-staked , or if the transactions was for adding or removing liquidity.

Filters:

  •     Get Transactions for an address from a specified block till a specified block 
    

    Block Filtering, returns transactions within specified Block Numbers (fromBlock specifies from which block transactions should be picked, toBlock specifies till which block).

  •     Get Transactions of an address for a specified contract address
    

    Contract Filtering, returns all the transactions made by an address for the specified contract. (contract query parameter accepts any valid contract address)

  •    Get Transactions for requested chain
    

    Chain Id Filtering for kadena chain, Returns transactions available on a particular chain (0-19), All other filters will also applies for kadena chain.

unmarshal.WalletApi
    .getTransactionHistory(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
page
number >= 1
Default: 1

Page you want to query

pageSize
number
Default: 25

Number of records to be fetched per page

Example: pageSize=5
contract
string

Valid contract address

fromBlock
number
Default: 14870135

Starting block from which the transactions should be considered

Example: fromBlock=14870135
toBlock
number
Default: 14870140

End block till which the transactions should be considered

Example: toBlock=14870140
chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

Responses
200
401
get/v1/{chain}/address/{address}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/address/:address/transactions?page=1&pageSize=5&contract=string&fromBlock=14870135&toBlock=14870140&chainId=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "page": 1,
  • "total_pages": 178,
  • "items_on_page": 1,
  • "total_txs": 355,
  • "transactions": [
    ]
}

Transaction History of an address with the price at the time of transaction

The transactions API fetches the list of all transactions in wallet address along with token price at the time of transaction

Our Bank statements often let us understand the financial positions of a bank account. Similarly for a Crypto wallet, the transactions gives the wallet holder a detailed analysis of the inbound and out bound transfers thereby keeping the wallet apprised of all the happenings in their wallet.

Unmarshal Transaction APIs are smart enough to differentiate the kind of operation a particular transaction was made for. It will let a user understand if the transaction was was for a send or receive or the amount was staked or un-staked , or if the transactions was for adding or removing liquidity.

Filters:

  •     Get Transactions for an address from a specified block till a specified block 
    

    Block Filtering, returns transactions within specified Block Numbers (fromBlock specifies from which block transactions should be picked, toBlock specifies till which block).

  •     Get Transactions of an address for a specified contract address
    

    Contract Filtering, returns all the transactions made by an address for the specified contract. (contract query parameter accepts any valid contract address)

unmarshal.WalletApi
    .getTransactionHistoryWithTokenPrice(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" "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: 0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de
query Parameters
page
number >= 1
Default: 1

Page you want to query

pageSize
number
Default: 25

Number of records to be fetched per page

Example: pageSize=5
contract
string

Valid contract address

fromBlock
number
Default: 14870135

Starting block from which the transactions should be considered

Example: fromBlock=14870135
toBlock
number
Default: 14870140

End block till which the transactions should be considered

Example: toBlock=14870140
Responses
200
401
get/v2/{chain}/address/{address}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v2/:chain/address/:address/transactions?page=1&pageSize=5&contract=string&fromBlock=14870135&toBlock=14870140&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "page": 1,
  • "total_pages": 410,
  • "items_on_page": 2,
  • "total_txs": 818,
  • "transactions": [
    ]
}

Transaction History of an address without transaction count

The transactions API fetches the list of all transactions in wallet address

Our Bank statements often let us understand the financial positions of a bank account. Similarly for a Crypto wallet, the transactions gives the wallet holder a detailed analysis of the inbound and out bound transfers thereby keeping the wallet apprised of all the happenings in their wallet.

Unmarshal Transaction APIs are smart enough to differentiate the kind of operation a particular transaction was made for. It will let a user understand if the transaction was was for a send or receive or the amount was staked or un-staked , or if the transactions was for adding or removing liquidity .

This Endpoint allows contract filtering, where it returns all the transactions made by an address for that contract.

This Endpoint does not provide total transaction count for an address which inturn does not provide total pages, but instead it will returns a boolean value which specifies whether transaction are present in next page

Filters:

  •     Get Transactions for an address from a specified block till a specified block 
    

    Block Filtering, returns transactions within specified Block Numbers (fromBlock specifies from which block transactions should be picked, toBlock specifies till which block).

  •     Get Transactions of an address for a specified contract address
    

    Contract Filtering, returns all the transactions made by an address for the specified contract.

  •     Get transactions along with price at the time of transaction
    

    Get all transactions along with prices of tokens which are involved

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

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

Enum: "ethereum" "bsc" "matic" "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: 0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de
query Parameters
page
number >= 1
Default: 1

Page you want to query

pageSize
number
Default: 25

Number of records to be fetched per page

Example: pageSize=5
contract
string

Valid contract address

fromBlock
number
Default: 14870135

Starting block from which the transactions should be considered

Example: fromBlock=14870135
toBlock
number
Default: 14870140

End block till which the transactions should be considered

Example: toBlock=14870140
price
boolean

Flag to enable price of tokens at the time of transaction

Enum: "true" "false"
Example: price=false
Responses
200
401
get/v3/{chain}/address/{address}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v3/:chain/address/:address/transactions?page=1&pageSize=5&contract=string&fromBlock=14870135&toBlock=14870140&price=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "page": 1,
  • "items_on_page": 25,
  • "has_next": true,
  • "transactions": [
    ]
}

Transactions History of a token Address

This Endpoint provides all the transactions of a token address irrespective of wallet address

Our Bank statements often let us understand the financial positions of a bank account. Similarly for a Crypto wallet, the transactions gives the wallet holder a detailed analysis of the inbound and out bound transfers thereby keeping the wallet apprised of all the happenings in their wallet.

Unmarshal Transaction APIs are smart enough to differentiate the kind of operation a particular transaction was made for. It will let a user understand if the transaction was was for a send or receive or the amount was staked or un-staked , or if the transactions was for adding or removing liquidity .

Filters:

  •     Get Transactions for an address from a specified block till a specified block 
    

    Block Filtering, returns transactions within specified Block Numbers (fromBlock specifies from which block transactions should be picked, toBlock specifies till which block).

  •     Get Transactions for requested chain
    

    Chain Id Filtering for kadena chain, Returns transactions available on a particular chain (0-19), All other filters will also applies for kadena chain.

unmarshal.WalletApi
    .getTokenTransactionHistory(Chain.ethereum, "token address")
    .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: "0x2FA5dAF6Fe0708fBD63b1A7D1592577284f52256"

And valid contract address

Example: 0x2FA5dAF6Fe0708fBD63b1A7D1592577284f52256
query Parameters
page
number >= 1
Default: 1

Page you want to query

pageSize
number
Default: 25

Number of records to be fetched per page

Example: pageSize=5
fromBlock
number
Default: 14870135

Starting block from which the transactions should be considered

Example: fromBlock=14870135
toBlock
number
Default: 14870140

End block till which the transactions should be considered

Example: toBlock=14870140
chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

Responses
200
401
get/v1/{chain}/token/{address}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/token/:address/transactions?page=1&pageSize=5&fromBlock=14870135&toBlock=14870140&chainId=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "page": 1,
  • "total_pages": 178,
  • "items_on_page": 1,
  • "total_txs": 355,
  • "transactions": [
    ]
}

Transaction History of a token address without transaction count

This Endpoint provides all the transactions of a token address irrespective of wallet address.

This Endpoint does not provide total transaction count for an address which inturn does not provide total pages, but instead it will returns a boolean value which specifies whether transaction are present in next page.

Our Bank statements often let us understand the financial positions of a bank account. Similarly for a Crypto wallet, the transactions gives the wallet holder a detailed analysis of the inbound and out bound transfers thereby keeping the wallet apprised of all the happenings in their wallet.

Unmarshal Transaction APIs are smart enough to differentiate the kind of operation a particular transaction was made for. It will let a user understand if the transaction was was for a send or receive or the amount was staked or un-staked , or if the transactions was for adding or removing liquidity .

Filters:

  •     Get Transactions for an address from a specified block till a specified block 
    
    Block Filtering, returns transactions within specified Block Numbers (fromBlock specifies from which block transactions should be picked, toBlock specifies till which block).
unmarshal.WalletApi
    .getTokenTransactionHistoryWithoutTotalCount(Chain.ethereum, "token address")
    .then(({data}) => console.log(data))
Request
Security:
path Parameters
chain
required
string

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

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

And valid contract address

Example: 0x2FA5dAF6Fe0708fBD63b1A7D1592577284f52256
query Parameters
page
number >= 1
Default: 1

Page you want to query

pageSize
number
Default: 25

Number of records to be fetched per page

Example: pageSize=5
fromBlock
number
Default: 14870135

Starting block from which the transactions should be considered

Example: fromBlock=14870135
toBlock
number
Default: 14870140

End block till which the transactions should be considered

Example: toBlock=14870140
Responses
200
401
get/v2/{chain}/token/{address}/transactions
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v2/:chain/token/:address/transactions?page=1&pageSize=5&fromBlock=14870135&toBlock=14870140&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "page": 1,
  • "total_pages": 178,
  • "items_on_page": 1,
  • "total_txs": 355,
  • "transactions": [
    ]
}

Transaction Details

The transaction detail API is one such End Point which gives as much details possible for a specific transaction on a specific given chain.

All we need is the transaction hash and the entire history of the transaction is presented to anyone looking for all minor details pertaining to the particular transaction

unmarshal.WalletApi
    .getTransactionDetails(Chain.ethereum, "transaction-hash")
    .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
transactionHash
required
string
Default: "0x8e1337b81ff3c1a7e3796c74c9dc084566b6e043cd69968e9b1d2336cd3d8e64"

Any valid transaction hash

query Parameters
chainId
string
Default: "false"

Return details for requested chain id (For Kadena chain)

Responses
200
401
get/v1/{chain}/transactions/{transactionHash}
Request samples
curl -i -X GET \
  'https://api.unmarshal.com/v1/:chain/transactions/:transactionHash?chainId=false&auth_key=YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "id": "string",
  • "from": "string",
  • "to": "string",
  • "fee": "string",
  • "date": 0,
  • "status": "string",
  • "type": "string",
  • "block": 0,
  • "value": "string",
  • "nonce": 0,
  • "description": "string",
  • "sent": [],
  • "received": [],
  • "others": []
}

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

Request Body schema: application/json
object
Responses
200
401
get/v2/{chain}/address/{address}/userData
Request samples
application/json
{ }
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"
}

Total Transaction Count of an address

This endpoint allows you to retrieve the transaction count for a given address

unmarshal.WalletApi
    .getTotalTransactionCount(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" "celo" "arbitrum" "avalanche" "xinfin" "cronos" "velas" "zilliqa" "fantom" "fuse" "bsc-testnet" "matic-testnet" "rinkeby-testnet"
Example: bsc
address
required
string
Default: "demo.eth"

Any valid address or ENS

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