StaticTokens is an off-chain list of manually maintained token metadata (symbol, name, decimals, logo for the particular denom, etc). These static tokens are generated via data from a few different files in the data folder.
Follow the steps below to add/update token-metadata on the injective-list repo.
The symbolMeta.ts file contains the symbolMeta details unique to each symbol with the following interface:
export interface TokenSymbolMeta {
name: string;
logo: string;
symbol: string;
decimals: number;
coinGeckoId: string;
}
Add the symbolMeta entry to the bottom of the list - only if it doesn't exist on the list:
export const symbolMeta: Record<string, TokenSymbolMeta> = {
...,
EXAMPLE: {
decimals: 18,
name: 'example',
logo: 'imageFileName.png',
symbol: 'EXAMPLE',
coinGeckoId: 'example-coinGeckoId',
}
}
In the CI/CD workflow, the uploadImages script will automatically upload images in the images folder that doesn't already exist on the tokenImagePaths.json file to cloudflare.
Follow the steps below to add a new image:
- Copy the token image to the images folder
- Make sure the image fileName is unique in the folder - image fileName is used as the unique identifier mapping cloudflare URL to the token image.
- Copy and override the token image with file you want to replace in the images folder
- Delete the object key-pair that has the same imageFileName, this ensures that the uploadImages script uploads the new logo to cloudflare.
The image name should match the symbolMeta entry logo field for example imageFileName.png
.
Note that: we only support the following formats ['png', 'jpg', 'jpeg', 'svg', 'webp']
.
There are a few different token types, namely Cw20, TokenFactory, Erc20 (Peggy) and IBC.
Using EXAMPLE
symbol meta above, here are how to add token metadata for the different token types:
In the erc20.ts file file, add an entry to the end of mainnetTokens
array:
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
address: "0x...",
},
];
We can also override SymbolMeta data here
export const mainnetTokens = [
{
// we can also override SymbolMeta data here
...symbolMeta.EXAMPLE,
decimals: 6,
coinGeckoId: "example-coinGeckoId-override",
name: "example-override",
logo: "imageFileName-override.png",
symbol: "symbol-override",
address: "0x...",
},
];
In the ibc.ts file file, add an entry to the end of mainnetTokens
array:
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
channelId: "channel-example",
source: TokenSource.Cosmos,
path: "transfer/channel-example",
hash: "...",
baseDenom: "uexample",
},
];
We can also override SymbolMeta data here
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
channelId: "channel-example",
source: TokenSource.Cosmos,
path: "transfer/channel-example",
hash: "...",
baseDenom: "uexample",
decimals: 6,
coinGeckoId: "example-coinGeckoId-override",
name: "example-override",
logo: "imageFileName-override.png",
symbol: "symbol-override",
},
];
In the cw20.ts file file, add an entry to the end of mainnetTokens
array:
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
address: "inj...",
},
];
We can also override SymbolMeta data here
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
decimals: 6,
coinGeckoId: "example-coinGeckoId-override",
name: "example-override",
logo: "imageFileName-override.png",
symbol: "symbol-override",
address: "inj...",
},
];
In the tokenFactory.ts file file, add an entry to the end of mainnetTokens
array:
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
creator: "inj...",
},
];
We can also override SymbolMeta data here
export const mainnetTokens = [
{
...symbolMeta.EXAMPLE,
creator: "inj...",
decimals: 6,
coinGeckoId: "example-coinGeckoId-override",
name: "example-override",
logo: "imageFileName-override.png",
symbol: "symbol-override",
},
];