Get Token Balance
Allows users to fetch current token price in TRX and USD for a specific token (un-bonded) on SunPump.
Endpoint
URL:
/sunpump/getTokenBalance
Method:
GET
Content-Type:
application/json
API Key Header:
api-key: your-api-key
Parameters
publicKey
string
Yes
Sender Public Tron Address
tokenAddress
string
Yes
Token Contract Address
tokenDecimals
number
No
The number of decimals used by the token. Defaults to 18
rpc
string
No
Optional custom Tron RPC URL
Example Request
Example Response JSON
Error Responses
Invalid Public Key
Invalid Token Address
Balance Retrieval Error
Notes
Balance Format: The API returns the balance in Sun (
balanceInSun
), and a human-readable format (convertedBalance
) based on the provided decimals.Rate Limiting: This endpoint is rate-limited according to your plan's API key limits. Ensure that you handle these limits in your application.
Last updated
Was this helpful?