Get Custom Token
Get metadata of a custom token
Custom Token API
Provides token details for a user-specified token that is not included in Rango's official list. Currently supports blockchains based on Solana and EVM.
const tokenResponse = await rango.token({
"blockchain": "SOLANA",
"address": "3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA"
})const response = await axios.get('https://api.rango.exchange/basic/meta/custom-token', {
params: {
'blockchain': 'SOLANA',
'address': '3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA',
'apiKey': 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});curl --request GET \
--url 'https://api.rango.exchange/basic/meta/custom-token?blockchain=SOLANA&address=3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'Custom Token Request
blockchain* StringDescription: The blockchain which the token belongs to.
Example:
SOLANA
address* StringDescription: Smart contract address of the token.
Example:
3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA
export type CustomTokenRequest = {
blockchain: string
address: string
}Custom Token Response
tokenDescription: The token's metadata
errorDescription: Error message if there was any problem
errorCodeDescription: Error code if there was any problem
traceIdDescription: Trace id help Rango support to resolve the issue
export type CustomTokenResponse = {
token: Token
error: string | null
errorCode: number | null
traceId: number | null
}
export type Token = {
blockchain: string
chainId: string | null
address: string | null
symbol: string
name: string | null
decimals: number
image: string
blockchainImage: string
usdPrice: number | null
isPopular: boolean
supportedSwappers: string[]
}{
"token": {
"blockchain": "SOLANA",
"symbol": "Brett",
"name": "Brett",
"isPopular": false,
"chainId": "mainnet-beta",
"address": "3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA",
"decimals": 9,
"image": "https://bafkreifi5rkzrqyze3cqoqt5xm6ullqpyh5g52ut46pmwva6cju2yyy3ay.ipfs.nftstorage.link",
"blockchainImage": "https://raw.githubusercontent.com/rango-exchange/assets/main/blockchains/SOLANA/icon.svg",
"usdPrice": 0.09683140474717515,
"supportedSwappers": []
},
"error": null,
"errorCode": null,
"traceId": null
}Last updated
Was this helpful?