## Local support --- ## Current ENV - **NEXT_PUBLIC_SELECTED_CHAIN eg. osmosis / terra / mitosis** - NEXT_PUBLIC_DUMMY_MNEMONIC - NEXT_PUBLIC_AMPLITUDE_API_KEY - NEXT_PUBLIC_FAUCET_URL - NEXT_PUBLIC_SENTRY_DSN ## Properties by chain - Navbar mode - Overview mode - GraphQL url - API path - eg. https://celatone-api.alleslabs.dev/txs/osmosis/osmosis-1/F53E6EC97214C6C947F33B698BF8A78E553FED2ACBA057F09871AFE11D41B532 - Faucet - LCD - Suggest - Fallback (Optional) - RPC - Suggest - Fallback (Optional) - Placeholder contract address - constants - gasprice - gas adjustment - max file size (store code msg) - gas limit by messages ## Properties for Celatone - max list name length - max contract name length - max code name length - max contract description length ### Spec ```jsonld= { supportedChain: { [chainId]: { chainName: string, // osmosis, sei, terra lcd: string, rpc: string, indexer: string, api: string, // we should generate all paths via util function apiPaths: { txs: 'txs/[chainName]/[chainId]', balances: 'balances/[chainName]/[chainId]', assets: 'assets/[chainName]/[chainId]', projects: '', contracts: '', codes: '', }, feature: { faucet: { enable: boolean, url: string, }, wasm: { enable: boolean, storeCodeMaxFileSize: number, }, pool: { enable: boolean, }, }, // this should be available on chain-registry. gas: { gasPrice: string, // '0.015' gasAdjustment: number, // 1.6 clearAdmin: number, }, // so, we'll use this for `addressLengthMap` addresses: { userAddress: string, validatorAddress: string, contractAddress: string, }, explorerLink: { validator: string, proposal: string, }, }, }, // global constant constant: { maxListNameLength: 50, maxContractNameLength: 50, maxContractDescriptionLength: 250, maxCodeNameLength: 50, maxProposalTitleLength: 255, }, } ``` ```bash= # order is significant NEXT_PUBLIC_SUPPORTED_CHAIN_IDS=osmosis-1,osmo-test-4,osmo-test-5 ``` ### Rules - There is no default route, if user route to `/` then it will redirect to some default chain id - If there is some chain Id can't retrieve config, just "can't find chain config by chain id" - If it cannot look up all chainIds, then throw error. - `formatUserKey` use currentChainName as previously. ### Main Tasks - Patch App.tsx - read supported chainId list from env on App.tsx - Look up on `chainConfigs` by chainId - save current chainConfig to context - Replace `/mainnet` and `/testnet` route by `/[chainId]` - update `useNetworkChange` and `useSelectChain` to look up `chainName` by `chainId` from route - create util functions for lcd - create utll functions for rpc - create util function for graphql and apply code - create api url by getting chainId and path ('/txs', '/assets') as arguments - enable and disable faucet by chain config - enable and disable wasm by chain config - enable and disable pool by chain config - use gas, gas price from config - use example addresses from config - patch validate address length by using example address's length - use explorer link from config - use project constants from config ### Side Tasks - Remove `terra2testnet` from `_app.tsx` - open PR to update `seitestnet2` asset