-
Notifications
You must be signed in to change notification settings - Fork 36
Config
Gnosis Protocol Web has some built-in configuration parameters, that allow, among other things to use your own token list, rebrand it, add new pages or modify the existing ones.
The web has some default configuration. This configuration can be
- Default app configs can be found on the default config file
- We recommend against editing this file directly, though.
- If you wish to replace any default config, create a file named
configinside thecustomfolder. - Both
JSONandYAMLformats are supported.
Simply replace any config found on config-default.
⚠️ NOTE: If you are forking the project, you might want to delete the custom/.gitignore file so you can commit a config file and components inside the custom directory.
Below we provide details for each config.
A single string that controls the page title and favicon metadata.
Identify the app. The IDs range from 1 until 256 Every transaction sent to the blockchain will include the ID and some basic analytic info.
appId can also be passed as an environment variable, e.g. APP_ID=2 yarn start. In which case it overrides the appId from config file.
More info about this parameter can be found here.
Path to favicon logo.
Path to the template html file.
Tokens are dynamically loaded from the contract, but it might not be desirable to display everything in the interface.
Gnosis Protocol is a fully permissionless trading protocol for ERC-20, as such, anyone can enable a token for trading. Tokens of dubious value or nature or those not compatible with the ERC-20 standard may also be added. Accordingly, it is the responsibility of the Site operator to determine which tokens listed on the permissionless Gnosis Protocol are displayed on their Site.
To dynamically control which tokens are displayed without the need of a redeployment, it's possible to use a Token Curated Registry (TCR) contract per network.
The only requirement is that this contract implements the following method:
function getTokens(uint256 _listId) public view returns (address[] memory)For a sample implementation, refer to dxDAO's TCR.
Config format:
tcr:
type: 'multi-tcr'
config:
lists:
- networkId: number
listId: number
contractAddress: string
# OR, for no filtering
tcr:
type: 'none'Where:
-
typecurrently is eithermulti-tcrornonefor no filter. -
networkIdis a number, such as1for Mainnet,4for Rinkeby and so on. -
listIdis optional and defaults to0 -
contractAddressthe address of the contract deployed in networknetworkId
Note: For networks where a TCR contract is not provided, the tokens will not be filtered.
Endpoints for service that provides price estimation and data for the orderbook graph.
Config format:
dexPriceEstimator:
type: 'dex-price-estimator'
config:
- networkId: number
url_production: string
url_develop: stringWhere:
-
typecan only bedex-price-estimator. -
networkIdis a number, such as1for Mainnet,4for Rinkeby and so on. -
url_productionthe endpoint for givennetworkIdto use in production -
url_developthe endpoint for givennetworkIdto use in development (optional)
Endpoints for Gnosis Protocol Subgraph.
Config format:
theGraphApi:
type: 'the-graph'
config:
- networkId: number
url: stringWhere:
-
typecan only bethe-graph. -
networkIdis a number, such as1for Mainnet,4for Rinkeby and so on. -
urlthe endpoint for givennetworkId
Endpoint for default Ethereum network provider.
Used when a wallet is not connected and for read operations when connected through Wallet Connect.
Config format:
defaultProviderConfig:
type: 'infura'
config:
infuraId: 607a7dfcb1ad4a0b83152e30ce20cfc5
infuraEndpoint: wss://mainnet.infura.io/ws/v3/OR
defaultProviderConfig:
type: 'url'
config:
ethNodeUrl: http://localhost:8383Where:
-
infuraIdis your Infura id. Appended toinfuraEndpoint. -
infuraEndpointis the base url to Infura endpoint -- without theinfuraId. -
ethNodeUrlis the url to an Ethereum node.
Note: Both values can be provided as environment variables. Respectively, INFURA_ID and ETH_NODE_URL.
Exchange contract config. Used for narrowing down event queries.
Config format:
exchangeContractConfig:
type: 'contractBlock'
config:
- networkId: number
blockNumber: numberWhere:
-
typecan only becontractBlock. -
networkIdis a number, such as1for Mainnet,4for Rinkeby and so on. -
blockNumberis the block where contract was deployed to given network
Config for wallet connect. Allows to set a different bridge.
Config format:
walletConnect:
bridge: 'wss://safe-walletconnect.gnosis.io/'Alternatively you can set the bridge by declaring the env var WALLET_CONNECT_BRIDGE that would take precedence over the config.