mirror of
https://github.com/status-im/status-mobile.git
synced 2026-08-31 00:51:15 +00:00
* ref: isolate chain definitions * moved networks to wallet context * ref: removed redundant block explorer url definitions * fix: removed more network mentions * ref: removed remaining network dependencies * test: fixed tests * ref: restructured networks * fix: removed unused network utils * ref: removed unused network-preferences sheet * ref: simplified the network api * ref: removed networks dependencies (more) * ref: simplified chain definition to use status-go values * test: fixed unit tests * fix: removed most usages of utils.ethereum.chain ns in status-im * ref: removed utils.network ns and deprecated utils.ethereum.chain ns * ref: profile/testnet? and networks fns instead of manual extraction * feat: added doc for adding new chains * test: added tests for networks.core * fix: removed network names from translations * feat: added schema for network rpc data-store * fix: default networks not defined correctly * doc: adjusted the add new chains doc * fix: bridge network subscription * ref: moved db functions (networks/profile) to respective db ns * fix: make sure block explorer url ends with "/" * fix: wallet connect sessions not showing up * fix: lint
19 lines
1.6 KiB
Markdown
19 lines
1.6 KiB
Markdown
# Adding new chains
|
|
|
|
This doc only describes how to add new chains on the client side, so make sure the chain is added on `status-go` first (see [eth-rpc-proxy:ADD_NEW_CHAINS.md](https://github.com/status-im/eth-rpc-proxy/blob/master/ADD_NEW_CHAINS.md))
|
|
|
|
## Steps
|
|
1. Add the chain image (.png) to `resources/images/networks/`
|
|
2. Add the chain name (keyword) and the path to the chain image to `quo.foundations.resources/networks`
|
|
3. Add the mainnet (and/or testnet) `chain-id` constant(s) to `status-im.contexts.wallet.networks.config`
|
|
4. Add additional chain information in the same namespace, under `mainnets` and `testnets` respectively, including the chain name keyword added for the image.
|
|
5. In case the network should be highlighted as _new_ in the UI, add the chain id to `status-im.contexts.wallet.networks.config/new-networks`
|
|
|
|
## Future steps to improve addition of new chains and facilitate the addition of custom chains by the user
|
|
1. Remove reliance on the `network-name` and refer to a chain solely by its `chain-id`
|
|
2. Remove the definition of the network images from `quo.foundations.resources/networks` by relying on the images provided by `status-go`
|
|
3. `quo` components that should render a network image should get the image source as a prop
|
|
4. The chain data added in `status-im.contexts.wallet.networks.config` should be received from `status-go` or derived on the client, instead of being added manually.
|
|
5. Ideally, when adding a new chain, we shouln't bring new changes on the client. All the changes should happen on the `status-go` side
|
|
6. Remove deprecated namespaces dealing with chains e.g. `utils.ethereum.chains`
|