[Internal] Tokenlist pairs update: Only manual update; use exclude/include config; no tokenlist_base (#5451)

* Force include and exclude implementation.

* Rename update to updateAuto

* UpdateManual hooks

* UpdateManual hook fix

* Update existing tokenlist.json file, use exclude/include config.

* Force include only pairs against the main currency.

* PS config adjustment

* Remove tokenlist_base files

* Lint fix

* Remove all pairs first.

Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
Adam R 2021-02-01 16:45:55 +01:00 committed by GitHub
parent de0ea4b7d9
commit bf24ea2d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 189 additions and 962 deletions

View File

@ -5,7 +5,7 @@ on:
- cron: '0 7,19 * * *'
workflow_dispatch:
jobs:
periodic-update:
periodic-auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@ -18,7 +18,7 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run scripts
run: npm run update
run: npm run updateAuto
- name: Show update result (diff)
if: success()
run: |

View File

@ -1,655 +0,0 @@
{
"name": "Trust Wallet: Ethereum",
"logoURI": "https://trustwallet.com/assets/images/favicon.png",
"keywords": [],
"timestamp": "2020-10-03T12:37:57.000+00:00",
"tokens": [
{
"chainId": 1,
"asset": "c60_t0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"type": "ERC20",
"address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"name": "Wrapped Ethereum",
"symbol": "WETH",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
"pairs": [
{
"base": "c60_t0x0000000000085d4780B73119b644AE5ecd22b376"
},
{
"base": "c60_t0x0Ae055097C6d159879521C384F1D2123D1f195e6"
},
{
"base": "c60_t0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e"
},
{
"base": "c60_t0x0D8775F648430679A709E98d2b0Cb6250d2887EF"
},
{
"base": "c60_t0x0F5D2fB29fb7d3CFeE444a200298f468908cC942"
},
{
"base": "c60_t0x111111111117dC0aa78b770fA6A738034120C302"
},
{
"base": "c60_t0x1985365e9f78359a9B6AD760e32412f4a445E862"
},
{
"base": "c60_t0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44"
},
{
"base": "c60_t0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
},
{
"base": "c60_t0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
},
{
"base": "c60_t0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39"
},
{
"base": "c60_t0x2ba592F78dB6436527729929AAf6c908497cB200"
},
{
"base": "c60_t0x37236CD05b34Cc79d3715AF2383E96dd7443dCF1"
},
{
"base": "c60_t0x408e41876cCCDC0F92210600ef50372656052a38"
},
{
"base": "c60_t0x40FD72257597aA14C7231A7B1aaa29Fce868F677"
},
{
"base": "c60_t0x4Fabb145d64652a948d72533023f6E7A623C7C53"
},
{
"base": "c60_t0x514910771AF9Ca656af840dff83E8264EcF986CA"
},
{
"base": "c60_t0x57Ab1ec28D129707052df4dF418D58a2D46d5f51"
},
{
"base": "c60_t0x584bC13c7D411c00c01A62e8019472dE68768430"
},
{
"base": "c60_t0x607F4C5BB672230e8672085532f7e901544a7375"
},
{
"base": "c60_t0x6B175474E89094C44Da98b954EedeAC495271d0F"
},
{
"base": "c60_t0x6B3595068778DD592e39A122f4f5a5cF09C90fE2"
},
{
"base": "c60_t0x6BFf2fE249601ed0Db3a87424a2E923118BB0312"
},
{
"base": "c60_t0x740623d2c797b7D8D1EcB98e9b4Afcf99Ec31E14"
},
{
"base": "c60_t0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9"
},
{
"base": "c60_t0x80fB784B7eD66730e8b1DBd9820aFD29931aab03"
},
{
"base": "c60_t0x8400D94A5cb0fa0D041a3788e395285d61c9ee5e"
},
{
"base": "c60_t0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419"
},
{
"base": "c60_t0x8762db106B2c2A0bccB3A80d1Ed41273552616E8"
},
{
"base": "c60_t0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9"
},
{
"base": "c60_t0x967da4048cD07aB37855c090aAF366e4ce1b9F48"
},
{
"base": "c60_t0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2"
},
{
"base": "c60_t0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
{
"base": "c60_t0xaaAEBE6Fe48E54f431b0C390CfaF0b017d09D42d"
},
{
"base": "c60_t0xba100000625a3754423978a60c9317c58a424e3D"
},
{
"base": "c60_t0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55"
},
{
"base": "c60_t0xc00e94Cb662C3520282E6f5717214004A7f26888"
},
{
"base": "c60_t0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F"
},
{
"base": "c60_t0xd26114cd6EE289AccF82350c8d8487fedB8A0C07"
},
{
"base": "c60_t0xD46bA6D942050d489DBd938a2C909A5d5039A161"
},
{
"base": "c60_t0xdAC17F958D2ee523a2206206994597C13D831ec7"
},
{
"base": "c60_t0xdd974D5C2e2928deA5F71b9825b8b646686BD200"
},
{
"base": "c60_t0xE41d2489571d322189246DaFA5ebDe1F4699F498"
},
{
"base": "c60_t0xF5D669627376EBd411E34b98F19C868c8ABA5ADA"
},
{
"base": "c60_t0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c"
}
]
},
{
"chainId": 1,
"asset": "c60_t0x0000000000085d4780B73119b644AE5ecd22b376",
"type": "ERC20",
"address": "0x0000000000085d4780B73119b644AE5ecd22b376",
"name": "TrueUSD",
"symbol": "TUSD",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0000000000085d4780B73119b644AE5ecd22b376/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x0Ae055097C6d159879521C384F1D2123D1f195e6",
"type": "ERC20",
"address": "0x0Ae055097C6d159879521C384F1D2123D1f195e6",
"name": "xDai",
"symbol": "STAKE",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0Ae055097C6d159879521C384F1D2123D1f195e6/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",
"type": "ERC20",
"address": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",
"name": "Yearn.Finance",
"symbol": "YFI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x0D8775F648430679A709E98d2b0Cb6250d2887EF",
"type": "ERC20",
"address": "0x0D8775F648430679A709E98d2b0Cb6250d2887EF",
"name": "Basic Attention Token",
"symbol": "BAT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0D8775F648430679A709E98d2b0Cb6250d2887EF/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x0F5D2fB29fb7d3CFeE444a200298f468908cC942",
"type": "ERC20",
"address": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942",
"name": "Decentraland MANA",
"symbol": "MANA",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0F5D2fB29fb7d3CFeE444a200298f468908cC942/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x111111111117dC0aa78b770fA6A738034120C302",
"type": "ERC20",
"address": "0x111111111117dC0aa78b770fA6A738034120C302",
"name": "1INCH Token",
"symbol": "1INCH",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x111111111117dC0aa78b770fA6A738034120C302/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x1985365e9f78359a9B6AD760e32412f4a445E862",
"type": "ERC20",
"address": "0x1985365e9f78359a9B6AD760e32412f4a445E862",
"name": "Reputation",
"symbol": "REP",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1985365e9f78359a9B6AD760e32412f4a445E862/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44",
"type": "ERC20",
"address": "0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44",
"name": "Keep3rV1",
"symbol": "KP3R",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
"type": "ERC20",
"address": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",
"name": "Uniswap",
"symbol": "UNI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"type": "ERC20",
"address": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"name": "Wrapped BTC",
"symbol": "WBTC",
"decimals": 8,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39",
"type": "ERC20",
"address": "0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39",
"name": "HEX",
"symbol": "HEX",
"decimals": 8,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x2ba592F78dB6436527729929AAf6c908497cB200",
"type": "ERC20",
"address": "0x2ba592F78dB6436527729929AAf6c908497cB200",
"name": "Cream",
"symbol": "CREAM",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2ba592F78dB6436527729929AAf6c908497cB200/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x37236CD05b34Cc79d3715AF2383E96dd7443dCF1",
"type": "ERC20",
"address": "0x37236CD05b34Cc79d3715AF2383E96dd7443dCF1",
"name": "Small Love Potion",
"symbol": "SLP",
"decimals": 0,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x37236CD05b34Cc79d3715AF2383E96dd7443dCF1/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x408e41876cCCDC0F92210600ef50372656052a38",
"type": "ERC20",
"address": "0x408e41876cCCDC0F92210600ef50372656052a38",
"name": "Republic Token",
"symbol": "REN",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x408e41876cCCDC0F92210600ef50372656052a38/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x40FD72257597aA14C7231A7B1aaa29Fce868F677",
"type": "ERC20",
"address": "0x40FD72257597aA14C7231A7B1aaa29Fce868F677",
"name": "Sora",
"symbol": "XOR",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x40FD72257597aA14C7231A7B1aaa29Fce868F677/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x4Fabb145d64652a948d72533023f6E7A623C7C53",
"type": "ERC20",
"address": "0x4Fabb145d64652a948d72533023f6E7A623C7C53",
"name": "Binance USD",
"symbol": "BUSD",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x4Fabb145d64652a948d72533023f6E7A623C7C53/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x514910771AF9Ca656af840dff83E8264EcF986CA",
"type": "ERC20",
"address": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
"name": "ChainLink",
"symbol": "Link",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x514910771AF9Ca656af840dff83E8264EcF986CA/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x57Ab1ec28D129707052df4dF418D58a2D46d5f51",
"type": "ERC20",
"address": "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51",
"name": "Synth sUSD",
"symbol": "sUSD",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x57Ab1ec28D129707052df4dF418D58a2D46d5f51/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x584bC13c7D411c00c01A62e8019472dE68768430",
"type": "ERC20",
"address": "0x584bC13c7D411c00c01A62e8019472dE68768430",
"name": "Hegic",
"symbol": "HEGIC",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x584bC13c7D411c00c01A62e8019472dE68768430/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x607F4C5BB672230e8672085532f7e901544a7375",
"type": "ERC20",
"address": "0x607F4C5BB672230e8672085532f7e901544a7375",
"name": "iExec RLC",
"symbol": "RLC",
"decimals": 9,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x607F4C5BB672230e8672085532f7e901544a7375/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x6B175474E89094C44Da98b954EedeAC495271d0F",
"type": "ERC20",
"address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",
"type": "ERC20",
"address": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",
"name": "SushiSwap",
"symbol": "SUSHI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B3595068778DD592e39A122f4f5a5cF09C90fE2/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x6BFf2fE249601ed0Db3a87424a2E923118BB0312",
"type": "ERC20",
"address": "0x6BFf2fE249601ed0Db3a87424a2E923118BB0312",
"name": "Fyooz",
"symbol": "FYZ",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6BFf2fE249601ed0Db3a87424a2E923118BB0312/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x740623d2c797b7D8D1EcB98e9b4Afcf99Ec31E14",
"type": "ERC20",
"address": "0x740623d2c797b7D8D1EcB98e9b4Afcf99Ec31E14",
"name": "DoYourTip",
"symbol": "DYT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x740623d2c797b7D8D1EcB98e9b4Afcf99Ec31E14/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
"type": "ERC20",
"address": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",
"name": "Aave Token",
"symbol": "AAVE",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x80fB784B7eD66730e8b1DBd9820aFD29931aab03",
"type": "ERC20",
"address": "0x80fB784B7eD66730e8b1DBd9820aFD29931aab03",
"name": "Lend",
"symbol": "LEND",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x80fB784B7eD66730e8b1DBd9820aFD29931aab03/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x8400D94A5cb0fa0D041a3788e395285d61c9ee5e",
"type": "ERC20",
"address": "0x8400D94A5cb0fa0D041a3788e395285d61c9ee5e",
"name": "Unibright",
"symbol": "UBT",
"decimals": 8,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x8400D94A5cb0fa0D041a3788e395285d61c9ee5e/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419",
"type": "ERC20",
"address": "0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419",
"name": "DIA",
"symbol": "DIA",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x8762db106B2c2A0bccB3A80d1Ed41273552616E8",
"type": "ERC20",
"address": "0x8762db106B2c2A0bccB3A80d1Ed41273552616E8",
"name": "Reserve Rights",
"symbol": "RSR",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x8762db106B2c2A0bccB3A80d1Ed41273552616E8/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9",
"type": "ERC20",
"address": "0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9",
"name": "Swipe",
"symbol": "SXP",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x8CE9137d39326AD0cD6491fb5CC0CbA0e089b6A9/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x967da4048cD07aB37855c090aAF366e4ce1b9F48",
"type": "ERC20",
"address": "0x967da4048cD07aB37855c090aAF366e4ce1b9F48",
"name": "Ocean Protocol",
"symbol": "OCEAN",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x967da4048cD07aB37855c090aAF366e4ce1b9F48/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
"type": "ERC20",
"address": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",
"name": "MakerDAO",
"symbol": "MKR",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"type": "ERC20",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"name": "USDC",
"symbol": "USDC",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xaaAEBE6Fe48E54f431b0C390CfaF0b017d09D42d",
"type": "ERC20",
"address": "0xaaAEBE6Fe48E54f431b0C390CfaF0b017d09D42d",
"name": "Celsius",
"symbol": "CEL",
"decimals": 4,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xaaAEBE6Fe48E54f431b0C390CfaF0b017d09D42d/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xba100000625a3754423978a60c9317c58a424e3D",
"type": "ERC20",
"address": "0xba100000625a3754423978a60c9317c58a424e3D",
"name": "Balancer",
"symbol": "BAL",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xba100000625a3754423978a60c9317c58a424e3D/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55",
"type": "ERC20",
"address": "0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55",
"name": "BandToken",
"symbol": "BAND",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xBA11D00c5f74255f56a5E366F4F77f5A186d7f55/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xc00e94Cb662C3520282E6f5717214004A7f26888",
"type": "ERC20",
"address": "0xc00e94Cb662C3520282E6f5717214004A7f26888",
"name": "Compound",
"symbol": "COMP",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xc00e94Cb662C3520282E6f5717214004A7f26888/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
"type": "ERC20",
"address": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
"name": "Synthetix Network Token",
"symbol": "SNX",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets//logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xd26114cd6EE289AccF82350c8d8487fedB8A0C07",
"type": "ERC20",
"address": "0xd26114cd6EE289AccF82350c8d8487fedB8A0C07",
"name": "OMG Network",
"symbol": "OMG",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets//logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xD46bA6D942050d489DBd938a2C909A5d5039A161",
"type": "ERC20",
"address": "0xD46bA6D942050d489DBd938a2C909A5d5039A161",
"name": "Ampleforth",
"symbol": "AMPL",
"decimals": 9,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets//logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xdAC17F958D2ee523a2206206994597C13D831ec7",
"type": "ERC20",
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"name": "Tether USD",
"symbol": "USDT",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xdd974D5C2e2928deA5F71b9825b8b646686BD200",
"type": "ERC20",
"address": "0xdd974D5C2e2928deA5F71b9825b8b646686BD200",
"name": "Kyber Network Crystal",
"symbol": "KNC",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdd974D5C2e2928deA5F71b9825b8b646686BD200/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xE41d2489571d322189246DaFA5ebDe1F4699F498",
"type": "ERC20",
"address": "0xE41d2489571d322189246DaFA5ebDe1F4699F498",
"name": "0x Protocol Token",
"symbol": "ZRX",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xE41d2489571d322189246DaFA5ebDe1F4699F498/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xF5D669627376EBd411E34b98F19C868c8ABA5ADA",
"type": "ERC20",
"address": "0xF5D669627376EBd411E34b98F19C868c8ABA5ADA",
"name": "Axie Infinity",
"symbol": "AXS",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xF5D669627376EBd411E34b98F19C868c8ABA5ADA/logo.png",
"pairs": []
},
{
"chainId": 1,
"asset": "c60_t0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c",
"type": "ERC20",
"address": "0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c",
"name": "Enjin Coin",
"symbol": "ENJ",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c/logo.png",
"pairs": []
}
],
"version": {
"major": 0,
"minor": 2,
"patch": 0
}
}

View File

@ -1,259 +0,0 @@
{
"name": "Trust Wallet: Smart Chain",
"logoURI": "https://trustwallet.com/assets/images/favicon.png",
"keywords": [],
"timestamp": "2020-10-03T12:37:57.000+00:00",
"tokens": [
{
"chainId": 56,
"asset": "c20000714_t0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"type": "BEP20",
"address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
"name": "Wrapped BNB",
"symbol": "WBNB",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/logo.png",
"pairs": [
{
"base": "c20000714_t0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82"
},
{
"base": "c20000714_t0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3"
},
{
"base": "c20000714_t0x2170Ed0880ac9A755fd29B2688956BD959F933F8"
},
{
"base": "c20000714_t0x4B0F1812e5Df2A09796481Ff14017e6005508003"
},
{
"base": "c20000714_t0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7"
},
{
"base": "c20000714_t0x55d398326f99059fF775485246999027B3197955"
},
{
"base": "c20000714_t0x63870A18B6e42b01Ef1Ad8A2302ef50B7132054F"
},
{
"base": "c20000714_t0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c"
},
{
"base": "c20000714_t0xa1faa113cbE53436Df28FF0aEe54275c13B40975"
},
{
"base": "c20000714_t0xa2B726B1145A4773F68593CF171187d8EBe4d495"
},
{
"base": "c20000714_t0xBf5140A22578168FD562DCcF235E5D43A02ce9B1"
},
{
"base": "c20000714_t0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63"
},
{
"base": "c20000714_t0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56"
},
{
"base": "c20000714_t0xf79037F6f6bE66832DE4E7516be52826BC3cBcc4"
},
{
"base": "c20000714_t0xCa3F508B8e4Dd382eE878A314789373D80A5190A"
},
{
"base": "c20000714_t0x928e55daB735aa8260AF3cEDadA18B5f70C72f1b"
}
]
},
{
"chainId": 56,
"asset": "c20000714_t0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"type": "BEP20",
"address": "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82",
"name": "PancakeSwap Token",
"symbol": "Cake",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
"type": "BEP20",
"address": "0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",
"name": "Binance-Peg Dai Token",
"symbol": "DAI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
"type": "BEP20",
"address": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
"name": "Ethereum Token",
"symbol": "ETH",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x2170Ed0880ac9A755fd29B2688956BD959F933F8/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x4B0F1812e5Df2A09796481Ff14017e6005508003",
"type": "BEP20",
"address": "0x4B0F1812e5Df2A09796481Ff14017e6005508003",
"name": "Trust Wallet",
"symbol": "TWT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x4B0F1812e5Df2A09796481Ff14017e6005508003/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7",
"type": "BEP20",
"address": "0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7",
"name": "VAI Stablecoin",
"symbol": "VAI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x4BD17003473389A42DAF6a0a729f6Fdb328BbBd7/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x55d398326f99059fF775485246999027B3197955",
"type": "BEP20",
"address": "0x55d398326f99059fF775485246999027B3197955",
"name": "Binance-Peg Tether USD",
"symbol": "USDT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x55d398326f99059fF775485246999027B3197955/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x63870A18B6e42b01Ef1Ad8A2302ef50B7132054F",
"type": "BEP20",
"address": "0x63870A18B6e42b01Ef1Ad8A2302ef50B7132054F",
"name": "BLink Token",
"symbol": "BLINK",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x63870A18B6e42b01Ef1Ad8A2302ef50B7132054F/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",
"type": "BEP20",
"address": "0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c",
"name": "Binance-Peg BTCB Token",
"symbol": "BTCB",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xa1faa113cbE53436Df28FF0aEe54275c13B40975",
"type": "BEP20",
"address": "0xa1faa113cbE53436Df28FF0aEe54275c13B40975",
"name": "Alpha Token",
"symbol": "ALPHA",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xa1faa113cbE53436Df28FF0aEe54275c13B40975/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xa2B726B1145A4773F68593CF171187d8EBe4d495",
"type": "BEP20",
"address": "0xa2B726B1145A4773F68593CF171187d8EBe4d495",
"name": "Injective Protocol",
"symbol": "INJ",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xa2B726B1145A4773F68593CF171187d8EBe4d495/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xA8c2B8eec3d368C0253ad3dae65a5F2BBB89c929",
"type": "BEP20",
"address": "0xA8c2B8eec3d368C0253ad3dae65a5F2BBB89c929",
"name": "CertiK Token",
"symbol": "CTK",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xA8c2B8eec3d368C0253ad3dae65a5F2BBB89c929/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xBf5140A22578168FD562DCcF235E5D43A02ce9B1",
"type": "BEP20",
"address": "0xBf5140A22578168FD562DCcF235E5D43A02ce9B1",
"name": "Binance-Peg Uniswap",
"symbol": "UNI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xBf5140A22578168FD562DCcF235E5D43A02ce9B1/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63",
"type": "BEP20",
"address": "0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63",
"name": "Venus",
"symbol": "XVS",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xcF6BB5389c92Bdda8a3747Ddb454cB7a64626C63/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"type": "BEP20",
"address": "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",
"name": "BUSD",
"symbol": "BUSD",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xf79037F6f6bE66832DE4E7516be52826BC3cBcc4",
"type": "BEP20",
"address": "0xf79037F6f6bE66832DE4E7516be52826BC3cBcc4",
"name": "Hard Protocol",
"symbol": "HARD",
"decimals": 6,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xf79037F6f6bE66832DE4E7516be52826BC3cBcc4/logo.png",
"pairs": []
},
{
"chainId": 56,
"asset": "c20000714_t0xCa3F508B8e4Dd382eE878A314789373D80A5190A",
"type": "BEP20",
"address": "0xCa3F508B8e4Dd382eE878A314789373D80A5190A",
"name": "beefy.finance",
"symbol": "BIFI",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0xCa3F508B8e4Dd382eE878A314789373D80A5190A/logo.png",
"pairs": []
},
{
"asset": "c20000714_t0x928e55daB735aa8260AF3cEDadA18B5f70C72f1b",
"type": "BEP20",
"address": "0x928e55daB735aa8260AF3cEDadA18B5f70C72f1b",
"name": "Frontier Token",
"symbol": "FRONT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/smartchain/assets/0x928e55daB735aa8260AF3cEDadA18B5f70C72f1b/logo.png",
"pairs": []
}
],
"version": {
"major": 0,
"minor": 1,
"patch": 0
}
}

View File

@ -9,7 +9,8 @@
"check-sanity": "ts-node ./script/entrypoint/check-sanity",
"fix": "ts-node ./script/entrypoint/fix",
"fix-sanity": "ts-node ./script/entrypoint/fix-sanity",
"update": "ts-node ./script/entrypoint/update",
"updateAuto": "ts-node ./script/entrypoint/updateAuto",
"update": "ts-node ./script/entrypoint/updateManual",
"lint": "npx eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "npx eslint . --ext .js,.jsx,.ts,.tsx --fix"
},

View File

@ -125,7 +125,7 @@ export class BinanceAction implements ActionInterface {
];
}
async update(): Promise<void> {
async updateAuto(): Promise<void> {
// retrieve missing token images; BEP2 (bep8 not supported)
const bep2InfoList = await retrieveBep2AssetList();
const denylist: string[] = readJsonFile(getChainDenylistPath(binanceChain)) as string[];

View File

@ -8,6 +8,7 @@ import {
} from "../generic/subgraph";
import { Ethereum } from "../generic/blockchains";
import {
parseForceList,
rebuildTokenlist,
TokenItem
} from "../generic/tokenlists";
@ -21,6 +22,9 @@ const PrimaryTokens: string[] = ["WETH", "ETH"];
async function retrieveUniswapPairs(): Promise<PairInfo[]> {
console.log(`Retrieving pairs from Uniswap, limit liquidity USD ${config.Uniswap_MinLiquidity} volume ${config.Uniswap_MinVol24} txcount ${config.Uniswap_MinTxCount24}`);
console.log(` forceIncludeList: ${config.Uniswap_ForceInclude}`);
const includeList = parseForceList(config.Uniswap_ForceInclude);
const pairs = await getTradingPairs(config.Uniswap_TradingPairsUrl, config.Uniswap_TradingPairsQuery);
const filtered: PairInfo[] = [];
pairs.forEach(x => {
@ -28,7 +32,7 @@ async function retrieveUniswapPairs(): Promise<PairInfo[]> {
if (typeof(x) === "object") {
const pairInfo = x as PairInfo;
if (pairInfo) {
if (checkTradingPair(pairInfo, config.Uniswap_MinLiquidity, config.Uniswap_MinVol24, config.Uniswap_MinTxCount24, PrimaryTokens)) {
if (checkTradingPair(pairInfo, config.Uniswap_MinLiquidity, config.Uniswap_MinVol24, config.Uniswap_MinTxCount24, PrimaryTokens, includeList)) {
filtered.push(pairInfo);
}
}
@ -71,7 +75,7 @@ async function generateTokenlist(): Promise<void> {
}
pairs2.push([tokenItem0, tokenItem1]);
});
await rebuildTokenlist(Ethereum, pairs2, "Ethereum");
await rebuildTokenlist(Ethereum, pairs2, "Ethereum", config.Uniswap_ForceExclude);
}
export class EthereumAction implements ActionInterface {
@ -79,7 +83,7 @@ export class EthereumAction implements ActionInterface {
getSanityChecks(): CheckStepInterface[] { return []; }
async update(): Promise<void> {
//await generateTokenlist();
async updateManual(): Promise<void> {
await generateTokenlist();
}
}

View File

@ -8,6 +8,7 @@ import {
} from "../generic/subgraph";
import { SmartChain } from "../generic/blockchains";
import {
parseForceList,
rebuildTokenlist,
TokenItem
} from "../generic/tokenlists";
@ -20,6 +21,9 @@ const PrimaryTokens: string[] = ["WBNB", "BNB"];
async function retrievePancakeSwapPairs(): Promise<PairInfo[]> {
console.log(`Retrieving pairs from PancakeSwap, limit liquidity USD ${config.PancakeSwap_MinLiquidity} volume ${config.PancakeSwap_MinVol24} txcount ${config.PancakeSwap_MinTxCount24}`);
console.log(` forceIncludeList: ${config.PancakeSwap_ForceInclude}`);
const includeList = parseForceList(config.PancakeSwap_ForceInclude);
const pairs = await getTradingPairs(config.PancakeSwap_TradingPairsUrl, config.PancakeSwap_TradingPairsQuery);
const filtered: PairInfo[] = [];
pairs.forEach(x => {
@ -27,7 +31,7 @@ async function retrievePancakeSwapPairs(): Promise<PairInfo[]> {
if (typeof(x) === "object") {
const pairInfo = x as PairInfo;
if (pairInfo) {
if (checkTradingPair(pairInfo, config.PancakeSwap_MinLiquidity, config.PancakeSwap_MinVol24, config.PancakeSwap_MinTxCount24, PrimaryTokens)) {
if (checkTradingPair(pairInfo, config.PancakeSwap_MinLiquidity, config.PancakeSwap_MinVol24, config.PancakeSwap_MinTxCount24, PrimaryTokens, includeList)) {
filtered.push(pairInfo);
}
}
@ -70,7 +74,7 @@ async function generateTokenlist(): Promise<void> {
}
pairs2.push([tokenItem0, tokenItem1]);
});
await rebuildTokenlist(SmartChain, pairs2, "Smart Chain");
await rebuildTokenlist(SmartChain, pairs2, "Smart Chain", config.PancakeSwap_ForceExclude);
}
export class SmartchainAction implements ActionInterface {
@ -78,7 +82,7 @@ export class SmartchainAction implements ActionInterface {
getSanityChecks(): CheckStepInterface[] { return []; }
async update(): Promise<void> {
//await generateTokenlist();
async updateManual(): Promise<void> {
await generateTokenlist();
}
}

View File

@ -96,7 +96,7 @@ export class TezosAction implements ActionInterface {
];
}
async update(): Promise<void> {
async updateAuto(): Promise<void> {
await gen_validators_tezos();
}
}

View File

@ -8,11 +8,14 @@ export const binanceUrlTokenAssets = "https://explorer.binance.org/api/v1/asset
export const binanceDexURL = 'https://dex-atlantic.binance.org/api'
export const assetsURL = 'https://raw.githubusercontent.com/trustwallet/assets/master'
// Force include & exclude config: list of token symbols, or symbol pairs (e.g. ["Cake", "DAI-WBNB"]).
export const PancakeSwap_ForceInclude: string[] = ["Cake", "DAI", "ETH", "TWT", "VAI", "USDT", "BLINK", "BTCB", "ALPHA", "INJ", "CTK", "UNI", "XVS", "BUSD", "HARD", "BIFI", "FRONT"];
export const PancakeSwap_ForceExclude: string[] = [];
export const PancakeSwap_TradingPairsUrl = "https://api.bscgraph.org/subgraphs/name/wowswap";
export const PancakeSwap_TradingPairsQuery = `
query pairs {
pairs(first: 200, orderBy: reserveUSD, orderDirection: desc) {
id reserveUSD trackedReserveETH volumeUSD txCount __typename
pairs(first: 150, orderBy: reserveUSD, orderDirection: desc) {
id reserveUSD volumeUSD txCount __typename
token0 {
id symbol name decimals __typename
}
@ -25,6 +28,10 @@ export const PancakeSwap_TradingPairsQuery = `
export const PancakeSwap_MinLiquidity = 1000000;
export const PancakeSwap_MinVol24 = 500000;
export const PancakeSwap_MinTxCount24 = 288;
// Force include & exclude config: list of token symbols, or symbol pairs (e.g. ["BAT", "YFI-WETH"]).
export const Uniswap_ForceInclude: string[] = ["TUSD", "STAKE", "YFI", "BAT", "MANA", "1INCH", "REP", "KP3R", "UNI", "WBTC", "HEX", "CREAM", "SLP", "REN", "XOR", "BUSD", "Link", "sUSD", "HEGIC", "RLC", "DAI", "SUSHI", "FYZ", "DYT", "AAVE", "LEND", "UBT", "DIA", "RSR", "SXP", "OCEAN", "MKR", "USDC", "CEL", "BAL", "BAND", "COMP", "SNX", "OMG", "AMPL", "USDT", "KNC", "ZRX", "AXS", "ENJ"];
export const Uniswap_ForceExclude: string[] = [];
export const Uniswap_TradingPairsUrl = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2"; // see https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2
export const Uniswap_TradingPairsQuery = `
query pairs {
@ -42,3 +49,4 @@ export const Uniswap_TradingPairsQuery = `
export const Uniswap_MinLiquidity = 2000000;
export const Uniswap_MinVol24 = 1000000;
export const Uniswap_MinTxCount24 = 480;

View File

@ -1,8 +1,8 @@
import { updateAll } from "../generic/update-all";
import { updateAutoAll } from "../generic/update-all";
export async function main(): Promise<void> {
try {
await updateAll();
await updateAutoAll();
} catch(err) {
console.error(err);
process.exit(1);

View File

@ -0,0 +1,12 @@
import { updateManualAll } from "../generic/update-all";
export async function main(): Promise<void> {
try {
await updateManualAll();
} catch(err) {
console.error(err);
process.exit(1);
}
}
main();

View File

@ -14,7 +14,8 @@ export interface ActionInterface {
getConsistencyChecks?(): CheckStepInterface[];
sanityFix?(): Promise<void>;
consistencyFix?(): Promise<void>;
update?(): Promise<void>;
updateAuto?(): Promise<void>; // For regular automatic updates
updateManual?(): Promise<void>; // For occasional manual updates
}
export enum FixCheckMode {

View File

@ -15,7 +15,6 @@ export const infoFullName = `${infoName}.${jsonExtension}`;
const allowList = `allowlist.${jsonExtension}`;
const denyList = `denylist.${jsonExtension}`;
const tokenList = `tokenlist.${jsonExtension}`;
const tokenListBase = `tokenlist_base.${jsonExtension}`;
export const validatorsList = `${listName}.${jsonExtension}`
export const assetFolderAllowedFiles = [logoFullName, infoFullName];
@ -24,7 +23,6 @@ export const chainFolderAllowedFiles = [
allowList,
denyList,
tokenList,
tokenListBase,
"validators",
infoName
]
@ -39,7 +37,6 @@ export const getChainAssetInfoPath = (chain: string, asset: string): string => `
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 getChainTokenlistBasePath = (chain: string): string => `${getChainPath(chain)}/${tokenListBase}`;
export const pricingFolderPath = path.join(process.cwd(), '/pricing');
export const getChainValidatorsPath = (chain: string): string => `${getChainPath(chain)}/validators`;

View File

@ -1,6 +1,7 @@
// Interfacing with TheGraph subgraph APIs
import axios from "axios";
import { ForceListPair, matchPairToForceList, TokenItem } from "./tokenlists";
export interface TokenInfo {
id: string;
@ -53,12 +54,25 @@ export function primaryTokenIndex(pair: PairInfo, primaryTokens: string[]): numb
return 0;
}
function tokenItemFromInfo(tokenInfo: TokenInfo): TokenItem {
return new TokenItem(tokenInfo.id, '', tokenInfo.id, tokenInfo.name, tokenInfo.symbol, tokenInfo.decimals, '', []);
}
// Verify a trading pair, whether we support the tokens, has enough liquidity, etc.
export function checkTradingPair(pair: PairInfo, minLiquidity: number, minVol24: number, minTxCount24: number, primaryTokens: string[]
): boolean {
export function checkTradingPair(pair: PairInfo, minLiquidity: number, minVol24: number, minTxCount24: number, primaryTokens: string[], forceIncludeList: ForceListPair[]): boolean {
if (!pair.id || !pair.reserveUSD || !pair.volumeUSD || !pair.txCount || !pair.token0 || !pair.token1) {
return false;
}
if (primaryTokenIndex(pair, primaryTokens) == 0) {
console.log("pair with no primary coin:", pair.token0.symbol, "--", pair.token1.symbol);
return false;
}
if (matchPairToForceList(tokenItemFromInfo(pair.token0), tokenItemFromInfo(pair.token1), forceIncludeList)) {
console.log("pair included due to FORCE INCLUDE:", pair.token0.symbol, "--", pair.token1.symbol, " ", Math.round(pair.reserveUSD));
return true;
}
if (pair.reserveUSD < minLiquidity) {
console.log("pair with low liquidity:", pair.token0.symbol, "--", pair.token1.symbol, " ", Math.round(pair.reserveUSD));
return false;
@ -71,10 +85,6 @@ export function checkTradingPair(pair: PairInfo, minLiquidity: number, minVol24:
console.log("pair with low tx count:", pair.token0.symbol, "--", pair.token1.symbol, " ", pair.txCount);
return false;
}
if (primaryTokenIndex(pair, primaryTokens) == 0) {
console.log("pair with no primary coin:", pair.token0.symbol, "--", pair.token1.symbol);
return false;
}
//console.log("pair:", pair.token0.symbol, "--", pair.token1.symbol, " ", pair.reserveUSD);
return true;
}

View File

@ -1,4 +1,4 @@
// Tokenlist.json handling
// Handling of tokenlist.json files, tokens and trading pairs.
import { readJsonFile, writeJsonFile } from "../generic/json";
import { diff } from "jsondiffpatch";
@ -6,7 +6,6 @@ import { tokenInfoFromTwApi, TokenTwInfo } from "../generic/asset";
import {
getChainAssetLogoPath,
getChainAllowlistPath,
getChainTokenlistBasePath,
getChainTokenlistPath,
} from "../generic/repo-structure";
import * as bluebird from "bluebird";
@ -75,6 +74,87 @@ export class Pair {
}
}
///// Exclude/Include list token/pair matching
// A token or pair in the force exclude/include list
export class ForceListPair {
token1: string;
// second is optional, if empty --> token only, if set --> pair
token2: string;
}
export function parseForceListEntry(rawForceListEntry: string): ForceListPair {
const pair: ForceListPair = new ForceListPair();
const tokens: string[] = rawForceListEntry.split("-");
pair.token1 = tokens[0];
pair.token2 = "";
if (tokens.length >= 2) {
pair.token2 = tokens[1];
}
return pair;
}
export function parseForceList(rawForceList: string[]): ForceListPair[] {
return rawForceList.map(e => parseForceListEntry(e));
}
export function matchTokenToForceListEntry(token: TokenItem, forceListEntry: string): boolean {
if (forceListEntry.toLowerCase() === token.symbol.toLowerCase() ||
forceListEntry.toLowerCase() === token.asset.toLowerCase() ||
forceListEntry.toLowerCase() === token.name.toLowerCase()) {
return true;
}
return false;
}
export function matchPairToForceListEntry(token1: TokenItem, token2: TokenItem, forceListEntry: ForceListPair): boolean {
if (!forceListEntry.token2) {
// entry is token only
if (matchTokenToForceListEntry(token1, forceListEntry.token1) ||
(token2 && matchTokenToForceListEntry(token2, forceListEntry.token1))) {
return true;
}
return false;
}
// entry is pair
if (!token2) {
return false;
}
if (matchTokenToForceListEntry(token1, forceListEntry.token1) && matchTokenToForceListEntry(token2, forceListEntry.token2)) {
return true;
}
// reverse
if (matchTokenToForceListEntry(token1, forceListEntry.token2) && matchTokenToForceListEntry(token2, forceListEntry.token1)) {
return true;
}
return false;
}
export function matchTokenToForceList(token: TokenItem, forceList: ForceListPair[]): boolean {
let matched = false;
forceList.forEach(e => {
if (matchTokenToForceListEntry(token, e.token1)) {
matched = true;
}
if (matchTokenToForceListEntry(token, e.token2)) {
matched = true;
}
});
return matched;
}
export function matchPairToForceList(token1: TokenItem, token2: TokenItem, forceList: ForceListPair[]): boolean {
let matched = false;
forceList.forEach(p => {
if (matchPairToForceListEntry(token1, token2, p)) {
matched = true;
}
});
return matched;
}
/////
export function createTokensList(titleCoin: string, tokens: TokenItem[], time: string, versionMajor: number, versionMinor = 1, versionPatch = 0): List {
if (!time) {
time = (new Date()).toISOString();
@ -197,6 +277,12 @@ function sort(list: List) {
});
}
function removeAllPairs(list: List) {
// remove all pairs
list.pairs = [];
list.tokens.forEach(t => t.pairs = []);
}
function clearUnimportantFields(list: List) {
list.timestamp = "";
list.version = new Version(0, 0, 0);
@ -215,14 +301,15 @@ export function diffTokenlist(listOrig1: List, listOrig2: List): unknown {
return diffs;
}
export async function rebuildTokenlist(chainName: string, pairs: [TokenItem, TokenItem][], listName: string): Promise<void> {
export async function rebuildTokenlist(chainName: string, pairs: [TokenItem, TokenItem][], listName: string, forceExcludeList: string[]): Promise<void> {
// sanity check, prevent deletion of many pairs
if (!pairs || pairs.length < 5) {
console.log(`Warning: Only ${pairs.length} pairs returned, ignoring`);
return;
}
// filter out missing tokens
const excludeList = parseForceList(forceExcludeList);
// filter out pairs with missing and excluded tokens
// prepare phase, read allowlist
const allowlist: string[] = readJsonFile(getChainAllowlistPath(chainName)) as string[];
const pairs2: [TokenItem, TokenItem][] = [];
@ -235,22 +322,20 @@ export async function rebuildTokenlist(chainName: string, pairs: [TokenItem, Tok
console.log("pair with unsupported 2nd coin:", p[0].symbol, "--", p[1].symbol);
return;
}
if (matchPairToForceList(p[0], p[1], excludeList)) {
console.log("pair excluded due to FORCE EXCLUDE:", p[0].symbol, "--", p[1].symbol);
return;
}
pairs2.push(p);
});
const filteredCount: number = pairs.length - pairs2.length;
console.log(`${filteredCount} unsupported tokens filtered out, ${pairs2.length} pairs`);
const tokenlistFile = getChainTokenlistPath(chainName);
{
// show current size
const json = readJsonFile(tokenlistFile);
const list: List = json as List;
console.log(`Tokenlist original: ${list.tokens.length} tokens`);
}
const tokenlistBaseFile = getChainTokenlistBasePath(chainName);
const json = readJsonFile(tokenlistBaseFile);
const json = readJsonFile(tokenlistFile);
const list: List = json as List;
console.log(`Tokenlist base: ${list.tokens.length} tokens`);
console.log(`Tokenlist original: ${list.tokens.length} tokens`);
removeAllPairs(list);
await bluebird.each(pairs2, async (p) => {
await addPairIfNeeded(p[0], p[1], list);

View File

@ -176,19 +176,34 @@ async function consistencyFixByList(actions: ActionInterface[]) {
console.log("All consistency fixes done.");
}
async function updateByList(actions: ActionInterface[]) {
console.log("Running updates (using external data sources) ...");
async function updateAutoByList(actions: ActionInterface[]) {
console.log("Running auto updates (using external data sources) ...");
await bluebird.each(actions, async (action) => {
try {
if (action.update) {
console.log(`Update '${action.getName()}':`);
await action.update();
if (action.updateAuto) {
console.log(`Auto update '${action.getName()}':`);
await action.updateAuto();
}
} catch (error) {
console.log(`Caught error: ${error.message}`);
}
});
console.log("All updates done.");
console.log("All auto updates done.");
}
async function updateManualByList(actions: ActionInterface[]) {
console.log("Running manual updates (using external data sources) ...");
await bluebird.each(actions, async (action) => {
try {
if (action.updateManual) {
console.log(`Manual update '${action.getName()}':`);
await action.updateManual();
}
} catch (error) {
console.log(`Caught error: ${error.message}`);
}
});
console.log("All manual updates done.");
}
export async function sanityCheckAll(): Promise<[string[], string[]]> {
@ -207,6 +222,10 @@ export async function consistencyFixAll(): Promise<void> {
await consistencyFixByList(actionList);
}
export async function updateAll(): Promise<void> {
await updateByList(actionList);
export async function updateAutoAll(): Promise<void> {
await updateAutoByList(actionList);
}
export async function updateManualAll(): Promise<void> {
await updateManualByList(actionList);
}