@tokelia/react-token-image
v6.0.0-tokelia.1
Published
React component to display token images with fallbacks and unknown state.
Maintainers
Readme
Fork MIT de @depay/react-token-image mantenido por
Tokelia para tokelia-pay. Publica un único bundle genérico (sin
variantes -evm/-svm) sobre @tokelia/web3-blockchains, @tokelia/web3-client y
@tokelia/web3-tokens, y elimina el escalón de fallback a https://integrate.depay.com/tokens:
en cadenas EVM, tras fallar la imagen de trustwallet/assets se pasa directo a la búsqueda de meta
datos NFT (uri/tokenURI) antes de mostrar el placeholder "unknown". Ver NOTICE para
el detalle completo de cambios respecto a upstream.
Quickstart
npm install --save @tokelia/react-token-imageimport { TokenImage } from '@tokelia/react-token-image'
render() {
return(
<TokenImage
className="custom-img-class-name"
blockchain={'ethereum'}
address={'0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb'}
/>
)
}Support
This library supports the following blockchains:
Functionalities
TokenImage
The TokenImage component tries to display a token image for a given blockchain and address by:
Trying to fetch the image from https://github.com/trustwallet/assets, or https://github.com/wagyuswapapp/assets (Velas)
On EVM chains, trying to fetch an image through NFT token meta data
NFT Images
Pass an additional id if token address contains multiple NFTs:
<TokenImage
blockchain={'ethereum'}
address={'0x495f947276749ce646f68ac8c248420045cb7b5e'}
id={'42745998150656004690816543961586238000273307462307754421658803578179357246440'}
/>Development
Get started
npm install --include=dev
npm run devRelease
Publicado por el controlador de tokelia-pay (npm publish --access public).
