Add support for Ethereum and Binance Chain (#4316)

* Add support for Ethereum and Binance Chain

* Add tokenlist.json to assetFolderAllowedFiles

* Rename token list name

* Create tokenlist.json

* Add list logoURI
This commit is contained in:
Viktor Radchenko 2020-10-05 17:20:16 -07:00 committed by GitHub
parent 97e3d767e3
commit 0742768421
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,23 @@
{
"name":"Trust Wallet: BNB",
"logoURI":"https://trustwallet.com/assets/images/favicon.png",
"keywords":[
],
"timestamp":"2020-10-03T12:37:57.000+00:00",
"tokens":[
{
"blockchain":"binance",
"address":"TWT-8C2",
"name":"Trust Wallet",
"symbol":"TWT",
"decimals":8,
"logoURI":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/binance/assets/TWT-8C2/logo.png"
}
],
"version":{
"major":0,
"minor":1,
"patch":0
}
}

View File

@ -0,0 +1,24 @@
{
"name":"Trust Wallet: Ethereum",
"logoURI":"https://trustwallet.com/assets/images/favicon.png",
"keywords":[
],
"timestamp":"2020-10-03T12:37:57.000+00:00",
"tokens":[
{
"blockchain":"ethereum",
"chainId":1,
"address":"0x6B175474E89094C44Da98b954EedeAC495271d0F",
"name":"Dai Stablecoin",
"symbol":"DAI",
"decimals":18,
"logoURI":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png"
}
],
"version":{
"major":0,
"minor":1,
"patch":0
}
}

View File

@ -0,0 +1,24 @@
{
"name":"Trust Wallet: Smart Chain",
"logoURI":"https://trustwallet.com/assets/images/favicon.png",
"keywords":[
],
"timestamp":"2020-10-03T12:37:57.000+00:00",
"tokens":[
{
"blockchain":"smartchain",
"chainId":56,
"address":"0x4B0F1812e5Df2A09796481Ff14017e6005508003",
"name":"Trust Wallet",
"symbol":"TWT",
"decimals":18,
"logoURI":"https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x4B0F1812e5Df2A09796481Ff14017e6005508003/logo.png"
}
],
"version":{
"major":0,
"minor":1,
"patch":0
}
}

View File

@ -14,6 +14,7 @@ export const logoFullName = `${logoName}.${logoExtension}`;
export const infoFullName = `${infoName}.${jsonExtension}`;
const allowList = `allowlist.${jsonExtension}`;
const denyList = `denylist.${jsonExtension}`;
const tokenList = `tokenlist.${jsonExtension}`;
export const validatorsList = `${listName}.${jsonExtension}`
export const assetFolderAllowedFiles = [logoFullName, infoFullName];
@ -21,6 +22,7 @@ export const chainFolderAllowedFiles = [
"assets",
allowList,
denyList,
tokenList,
"validators",
infoName
]
@ -33,6 +35,7 @@ export const getChainAssetLogoPath = (chain: string, asset: string): string => `
export const getChainAssetInfoPath = (chain: string, asset: string): string => `${getChainAssetPath(chain, asset)}/${infoFullName}`;
export const getChainAllowlistPath = (chain: string): string => `${getChainPath(chain)}/${allowList}`;
export const getChainDenylistPath = (chain: string): string => `${getChainPath(chain)}/${denyList}`;
export const getChainTokenlistPath = (chain: string): string => `${getChainPath(chain)}/${tokenList}`;
export const pricingFolderPath = path.join(process.cwd(), '/pricing');
export const getChainValidatorsPath = (chain: string): string => `${getChainPath(chain)}/validators`;