Files
status-mobile/doc/adding-new-chains.md
Lungu Cristian 10ea95f323 Simplify adding new chains (#22353)
* 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
2025-03-28 11:21:08 +02:00

1.6 KiB

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)

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