Optional
chainId: number{number} the chainId number. defaults to getCurrentChain()
return verified configurations
get supported chain map
get supported chain id list
get supported chain/network short name list
Protected
extractProtected
{string}
const url = "https://tokens.1inch.io/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png";
const token = extractTokenFromURL(url);
console.log(token); // "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
fetch token custom info
{string} contract address
fetch token map/list
get token item info
{string} contract address
//
// switch chain/network to BNB Smart Chain Mainnet
//
const currentChainId = 56;
const contractAddress : string = new OneInchTokenService( currentChainId ).nativeTokenAddress;
const item = await new OneInchTokenService( currentChainId ).getTokenItemInfo( contractAddress );
// should return:
{
chainId: 56,
symbol: 'BNB',
name: 'BNB',
address: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
decimals: 18,
logoURI: 'https://tokens.1inch.io/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c.png',
providers: [ '1inch', 'Curve Token List' ],
eip2612: false,
tags: [ 'native' ]
}
Static
isStatic
isProtected
cloneProtected
deep clone configuration from the input
{NetworkModels}
Protected
setProtected
setset supported chain map
{RpcSupportedChainMap}
Protected
setProtected
set
OneInchTokenService
Remark
https://portal.1inch.dev/documentation/authentication