Wallet API
This endpoints discuss on how to query the wallet endpoint.
Endpoint Overview
The Wallet Balance Endpoint allows users to retrieve the balance of a specified wallet for a given token on a specified blockchain network. This functionality is crucial for users who need to monitor token balances across different networks.
Endpoint
POST /wallet/:chain/:address/:toknAddress/balance
Request Parameters
Body Parameters
address:
Type: String
Description: The address of the wallet whose balance is to be retrieved. This parameter is required.
tokenAddress:
Type: String
Description: The address of the token contract. This parameter is required.
chain:
Type: Number (optional)
Description: The blockchain network on which the token exists. Defaults to
1
(Ethereum) if not provided. Use900
for Solana.
Request Example
Here is an example of how to structure the request:
Response
The response from the endpoint will vary depending on the success or failure of the request.
Success Response
Status Code:
200 OK
Response Body:
Error Responses
Missing Parameters
Status Code:
400 Bad Request
Response Body:
Internal Server Error
Status Code:
500 Internal Server Error
Response Body:
Additional Information
Ensure the
address
andtokenAddress
provided are valid and correctly formatted.The
chain
parameter is optional, and if not provided, the default network used will be Ethereum (chain = 1
). Use900 or 800
for Solana devent or mainnet.
Wallet Stats Endpoint Documentation
Overview
This endpoint allows you to retrieve the statistics of a user's wallet across different blockchain networks. It provides detailed information about the assets in the wallet, including tokens and NFTs, along with their net worth.
Endpoint
GET /wallet/:chain/:address/stats
Request Parameters
URL Parameters
chain:
Type: Number
Description: The network chain to query. The endpoint supports multiple chains:
1
: Ethereum Mainnet (default)56
: Binance Smart Chain97
: Binance Smart Chain Testnet800
: Solana Mainnet900
: Solana Devnet137
: Polygon Mainnet8453
: Base Mainnet42161
: Arbitrum Mainnet
address:
Type: String
Description: The address of the user's wallet.
Response
The response will contain the assets in the wallet categorized by type (e.g., tokens, NFTs), the net worth of the wallet in USD, and the total number of assets.
Success Response
Status Code:
200 OK
Response Body:
Error Responses
Missing Parameters
Status Code:
400 Bad Request
Response Body:
Internal Server Error
Status Code:
500 Internal Server Error
Response Body:
Example Request
Example Response
Notes
The endpoint supports multiple chains, and the data retrieved will depend on the chain specified.
The
networth
field provides the total USD value of assets within the wallet.The
total_assets
field counts the number of different types of assets (tokens and NFTs) in the wallet.
By utilizing the Wallet Endpoint, users can efficiently retrieve wallet balance and stats across different blockchain networks, enabling better management and monitoring of their assets within the TokenInfo.AI platform.
Last updated