The feature request includes removing the "one chain only" rule currently set in wallet-config.ts and using a "multi chain" rule instead.
Describe Preferred Solution
Preferred solution includes:
[x] Updating wagmiConfig.chains array values from isTestnet ? sepolia : mainnet to sepolia, mainnet
[x] Removing isTestnet condition from alchemyApiKey and alchemyApiTestnetKey validations, so both are needed independently of isTestnet value
[x] Updating chain definition in wallet-config.ts so both chains are included
[ ] Creating one new const for ENS_SUBGRAPH_ENDPOINT so both mainnet and testnet ones are accessible by the codebase
[ ] Updating isTestnet definition so it is not anymore set based on a .env var but, instead, based on the current network the user is connected to
[ ] Updating awaitBlockchainTxReceiptpublicClient definition. In the near future we will need multi chain support on public clients creation so suggest a currentChain constant is created and reused in this place and in other clients instantiations
[ ] Update clients instances of blockchain-txs.tschain definition
[ ] Update network definition inside setDomainAsPrimaryName so it has an intelligent way of defining the network to be used (I think a new mapping will be needed in here, it depends on the new currentChain definition...)
[ ] Update RequestToRegisterComponentuseBalance approach for getting current chain ID
[ ] Update TransactionRequestConfirmedCTA so it gets the etherscan URL from a mapping that defines etherscan URLs for supported chains
[ ] Replace chain && chain?.id !== DEFAULT_CHAIN_ID conditional from sendBlockchainTx by one conditional that tests if the user is in one supported chain or not
Related Code
All the different files mentioned!
Additional Context
By doing this, we are not only prepared for a Sepolia + Mainnet support but we prepare the ground for receiving multiple L2s.
Feature Request
Describe the Feature Request
The feature request includes removing the "one chain only" rule currently set in
wallet-config.ts
and using a "multi chain" rule instead.Describe Preferred Solution
Preferred solution includes:
wagmiConfig.chains
array values fromisTestnet ? sepolia : mainnet
tosepolia, mainnet
isTestnet
condition fromalchemyApiKey
andalchemyApiTestnetKey
validations, so both are needed independently ofisTestnet
valuechain
definition inwallet-config.ts
so both chains are includedconst
forENS_SUBGRAPH_ENDPOINT
so both mainnet and testnet ones are accessible by the codebaseisTestnet
definition so it is not anymore set based on a .env var but, instead, based on the current network the user is connected toawaitBlockchainTxReceipt
publicClient
definition. In the near future we will need multi chain support on public clients creation so suggest acurrentChain
constant is created and reused in this place and in other clients instantiationsblockchain-txs.ts
chain
definitionsetDomainAsPrimaryName
so it has an intelligent way of defining the network to be used (I think a new mapping will be needed in here, it depends on the newcurrentChain
definition...)RequestToRegisterComponent
useBalance
approach for getting current chain IDTransactionRequestConfirmedCTA
so it gets the etherscan URL from a mapping that defines etherscan URLs for supported chainschain && chain?.id !== DEFAULT_CHAIN_ID
conditional fromsendBlockchainTx
by one conditional that tests if the user is in one supported chain or notRelated Code
All the different files mentioned!
Additional Context
By doing this, we are not only prepared for a Sepolia + Mainnet support but we prepare the ground for receiving multiple L2s.