docs: add 'Add Network to Your Wallet' page under About Injective#178
docs: add 'Add Network to Your Wallet' page under About Injective#178ChuhanJin wants to merge 8 commits into
Conversation
Add a guide for adding Injective networks to a browser wallet, modeled on Robinhood Chain's add-network page. - New page .gitbook/add-network-to-wallet.mdx, registered in docs.json under the INJECTIVE (About Injective) group, right after the index page. - Covers Injective EVM (mainnet 1776, testnet 1439) with manual config tables and a copy-paste wallet_addEthereumChain / wallet_switchEthereumChain snippet. - Covers Injective CosmWasm/native (injective-1, injective-888) with manual config tables and a Keplr enable() snippet. - All values sourced from existing network-information.mdx pages.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a GitBook page documenting Injective EVM and native network parameters, interactive wallet connection flows, and manual configuration references. Registers the page in the English ChangesWallet network documentation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant User
participant AddNetworkCard
participant EVMWallet
participant CosmosWallet
User->>AddNetworkCard: Select a network wallet button
AddNetworkCard->>EVMWallet: Request accounts and add or switch EVM chain
AddNetworkCard->>CosmosWallet: Enable native chain
EVMWallet-->>AddNetworkCard: Return connection result
CosmosWallet-->>AddNetworkCard: Return connection result
AddNetworkCard-->>User: Display connection status
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.gitbook/add-network-to-wallet.mdx:
- Around line 104-114: Wrap the wallet_addEthereumChain request inside the 4902
branch of the switchError handler with a nested try-catch, and handle rejection
with user-facing feedback consistent with the existing
add-injective-to-your-dapp.mdx example. Preserve the current switch-error
logging for failures outside the 4902 case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 09d1d3b1-6625-4b0e-8c48-915abb4b1bf7
📒 Files selected for processing (2)
.gitbook/add-network-to-wallet.mdx.gitbook/docs.json
Replace the copy-paste code snippet with live, clickable wallet buttons using Mintlify inline React components: - Injective EVM mainnet/testnet buttons call wallet_addEthereumChain / wallet_switchEthereumChain to add or switch the network in MetaMask and other injected EVM wallets, with per-button pending/done/error state. - Injective native mainnet/testnet buttons call window.keplr.enable() to unlock the chain in Keplr. - Manual configuration tables retained as a fallback for all four networks.
…omponent The previous version used curried arrow exports and multiple top-level exports interleaved with markdown, which Mintlify's MDX parser rejected with a parsing error. Consolidate into one <AddNetworkButtons kind=evm|cosmos /> component with all handlers and configs inline. Verified with a local mintlify dev build.
…et logos) - Group each network's wallets into a single card (Robinhood-style layout), with the network name and chain ID in the card header and wallet buttons laid out in a row. - Replace the generic + icon with each wallet's real logo (MetaMask fox, Keplr, Leap) via inline SVG data URIs, so no external assets are required. - Cosmos card offers both Keplr and Leap; EVM card uses MetaMask (and any injected EVM wallet via the same handler). - Clean up prose: remove the heavy em-dash phrasing.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.gitbook/add-network-to-wallet.mdx:
- Around line 58-64: Update enableCosmos to accept a wallet-type identifier and
select window.keplr or window.leap accordingly instead of always preferring
Keplr. Update the wallet definitions and all referenced call sites, including
the Leap button paths around the affected entries, to pass the corresponding
wallet type while preserving the existing missing-provider handling.
- Around line 137-189: Update the inline styles in the network card and wallet
buttons to remove hardcoded light-mode colors: use inherited text colors and
theme-aware or transparent backgrounds for the card, default buttons, error
state, and completed state. Preserve the existing status-based styling and
behavior in the config.networks rendering and wallet button map.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 41c4ede6-c4ae-45ec-bfbd-d89fcc644abc
📒 Files selected for processing (1)
.gitbook/add-network-to-wallet.mdx
…viders
- Add SubWallet to both the EVM and Cosmos cards.
- Use each wallet's real logo: MetaMask fox, Keplr, Leap (frog), SubWallet.
- Target the specific wallet provider instead of a generic one:
- EVM: pick the injected provider by flag (isMetaMask / isSubWallet),
checking window.ethereum.providers for multi-wallet setups.
- Cosmos: use each wallet's own namespace (window.keplr, window.leap,
window.SubWallet.cosmos), so each button connects the intended extension
and points to that wallet's install page when missing.
- Keep the handlers as flat multi-arg functions (Mintlify's MDX parser rejects
curried arrow-returning-arrow expressions). Verified with mintlify dev.
…llet cosmos button, add addEthereumChain error handling, dark-mode-safe colors
Add a guide for adding Injective networks to a browser wallet, modeled on Robinhood Chain's add-network page.
Summary by CodeRabbit