wallet_watchAsset
Requests that the user track the specified token in NeoLine. Returns a boolean indicating if the token was successfully added. Introduced by EIP-747.
Params
interface WatchAssetParameters {
type: string // The asset's interface, e.g. 'ERC20'
options: {
address: string // The hexadecimal Ethereum address of the token contract
symbol?: string // A ticker symbol or shorthand, up to 5 alphanumerical characters
decimals?: number // The number of asset decimals
image?: string // A string url of the token logo
}
}
Example
Request
await window.NEOLineNeoX.request({
"method": "wallet_watchAsset",
"params": {
"type": "ERC20",
"options": {
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"symbol": "USDT",
"decimals": 18,
"image": "https://cryptologos.cc/logos/tether-usdt-logo.svg?v=032"
}
}
});
Result
"null"
最后更新于
这有帮助吗?