duality-labs / duality-web-app

2 stars 2 forks source link

feat: add token pair whitelist controls for token pairs #559

Closed dib542 closed 3 months ago

dib542 commented 3 months ago

As not all Dex pairs/pools are of the same importance, we want to be able to guide the user to viewing only specific token pairs.

This PR achieves a filtered "Recommended Dex Pools" filter using a whitelist from an optional ENV var REACT_APP__CHAIN_REGISTRY_ASSET_PAIR_LIST a string with example JSON structure here:

[
    {
        "asset_1": {
            "chain_name": "neutrontestnet",
            "asset_base": "factory/neutron19glux3jzdfyyz6ylmuksgxfj5phdaxfr2uhy86/factoryATOM"
        },
        "asset_2": {
            "chain_name": "neutrontestnet",
            "asset_base": "factory/neutron19glux3jzdfyyz6ylmuksgxfj5phdaxfr2uhy86/factoryNTRN"
        }
    }
]

Which is the demo pair of the testnet as seen in the deploy preview: https://c8dfa25d-7351573e--duality-xyz-testnet.netlify.app/orderbook/demoUSDC/demoNTRN

Before: app testnet duality xyz_pools(FullHD) app testnet duality xyz_pools(FullHD) (1)

After: c8dfa25d-7351573e--duality-xyz-testnet netlify app_pools(FullHD) (3) c8dfa25d-7351573e--duality-xyz-testnet netlify app_pools(FullHD) (5)

The "My Pools" sections of both the tables and TokerPair picker dialog remain unchanged: c8dfa25d-7351573e--duality-xyz-testnet netlify app_pools(FullHD) (4) c8dfa25d-7351573e--duality-xyz-testnet netlify app_pools(FullHD) (6)

github-actions[bot] commented 3 months ago

Deploy Previews

Testnet

Preview URL: https://c8dfa25d-7351573e--duality-xyz-testnet.netlify.app Logs: https://app.netlify.com/sites/duality-xyz-testnet/deploys/6644b7ac232fe4097ef37605

Beta

Preview URL: https://c8dfa25d-7351573e--duality-xyz-beta.netlify.app Logs: https://app.netlify.com/sites/duality-xyz-beta/deploys/6644b7f85152d315a82f4829

dib542 commented 3 months ago

:tada: This PR is included in version 2.10.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: