config#BASE_URL TypeScript Examples
The following examples show how to use
config#BASE_URL.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: wallet.ts From glide-frontend with GNU General Public License v3.0 | 6 votes |
registerToken = async (tokenAddress: string, tokenSymbol: string, tokenDecimals: number) => {
const tokenAdded = await window.ethereum.request({
method: 'wallet_watchAsset',
params: {
type: 'ERC20',
options: {
address: tokenAddress,
symbol: tokenSymbol,
decimals: tokenDecimals,
image: `${BASE_URL}/images/tokens/${tokenAddress}.png`,
},
},
})
return tokenAdded
}
Example #2
Source File: index.tsx From glide-frontend with GNU General Public License v3.0 | 6 votes |
CurrencyLogo: React.FC<{
address?: string
size?: string
}> = ({ address, size = '24px', ...rest }) => {
const src = useMemo(() => {
const checksummedAddress = isAddress(address)
if (checksummedAddress) {
// return `https://assets.trustwalletapp.com/blockchains/smartchain/assets/${checksummedAddress}/logo.png`
return `${BASE_URL}/images/tokens/${checksummedAddress}.png`
}
return null
}, [address])
return <StyledLogo size={size} src={src} alt="token logo" {...rest} />
}
Example #3
Source File: wallet.ts From vvs-ui with GNU General Public License v3.0 | 6 votes |
registerToken = async (tokenAddress: string, tokenSymbol: string, tokenDecimals: number) => {
const tokenAdded = await window.ethereum.request({
method: 'wallet_watchAsset',
params: {
type: 'ERC20',
options: {
address: tokenAddress,
symbol: tokenSymbol,
decimals: tokenDecimals,
image: `${BASE_URL}/images/tokens/${tokenAddress}.png`,
},
},
})
return tokenAdded
}