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.
Typescript (SDK) Node.js (Axios) Bash (cURL)
Copy const tokenResponse = await rango .getCustomToken ({
"blockchain" : "SOLANA" ,
"address" : "3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA"
})
Copy const response = await axios .get ( 'https://api.rango.exchange/meta/custom-token' , {
params : {
'blockchain' : 'SOLANA' ,
'address' : '3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA' ,
'apiKey' : 'c6381a79-2817-4602-83bf-6a641a409e32'
}
});
Copy curl --request GET \
--url 'https://api.rango.exchange/meta/custom-token?blockchain=SOLANA&address=3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'
API Definition SDK Models (Typescript)
blockchain
* String
Description: The blockchain which the token belongs to.
address
* String
Description: Smart contract address of the token.
Example: 3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA
Copy export type CustomTokenRequest = {
blockchain : string
address : string
}
API Definition SDK Models (Typescript) Sample Response
token
Description: The token's metadata
error
Description: Error message if there was any problem
errorCode
Description: Error code if there was any problem
traceId
Description: Trace id help Rango support to resolve the issue
Copy export type CustomTokenResponse = {
token : Token
error : string | null
errorCode : number | null
traceId : number | null
}
export type Token = {
blockchain : string
address : string | null
symbol : string
name : string | null
decimals : number
image : string
usdPrice : number | null
isSecondaryCoin : boolean
coinSource : string | null
coinSourceUrl : string | null
isPopular : boolean
supportedSwappers ?: string []
}
Copy {
"token" : {
"blockchain" : "SOLANA" ,
"symbol" : "Brett" ,
"image" : "https://bafkreifi5rkzrqyze3cqoqt5xm6ullqpyh5g52ut46pmwva6cju2yyy3ay.ipfs.nftstorage.link" ,
"address" : "3yoMkf3X6bDxjks6YaWwNk4SAbuaysLg1a4BjQKToQAA" ,
"usdPrice" : null ,
"decimals" : 9 ,
"name" : "Brett" ,
"isPopular" : false ,
"isSecondaryCoin" : true ,
"coinSource" : null ,
"coinSourceUrl" : null ,
"supportedSwappers" : []
} ,
"error" : null ,
"errorCode" : null ,
"traceId" : null
}