vega-frontend-monorepo/libs/emblem
2024-03-19 11:10:21 +00:00
..
src feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
.eslintrc.json feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
.swcrc feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
jest.config.ts feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
project.json feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
README.md feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
tsconfig.json feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
tsconfig.lib.json feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00
tsconfig.spec.json feat(emblem): create example emblem component (#6013) 2024-03-19 11:10:21 +00:00

Emblem

Uses https://icon.vega.xyz to source an image for icons, either by asset & vega chain ID or contract & source chain ID

Components

All of the components ultimately render an img tag, and all properties can be overriden.

Emblem

Wrapper component for EmblemByAsset and EmblemByContract. Depending on the props, it returns an icon for an asset by one of the below subcomponents

Property Name Required or Optional Description
asset Optional The ID of the Vega Asset.
chainId Optional The ID of the Vega Chain.
vegaChainId Optional The ID of the Vega Chain (e.g. vega-fairground-2020305051805).
contractAddress Optional The address of the smart contract on its origin chain.

EmblemByAsset

Renders an icon for a given Vega Asset ID.

Property Name Required or Optional Description
asset Required The ID of the Vega Asset.
vegaChainId Required The ID of the Vega Chain (e.g. vega-fairground-2020305051805).

EmblemByContract

Renders an icon for a given smart contract address on its origin chain.

Property Name Required or Optional Description
contract Required The address of the contract representing the asset.
chainId Required The ID of the origin chain (e.g. 1 for Ethereum Mainnet).

Building

Run nx build emblem to build the library.