Skip to content

docs: add 'Add Network to Your Wallet' page under About Injective#178

Open
ChuhanJin wants to merge 8 commits into
InjectiveLabs:mainfrom
ChuhanJin:docs/add-network-to-wallet
Open

docs: add 'Add Network to Your Wallet' page under About Injective#178
ChuhanJin wants to merge 8 commits into
InjectiveLabs:mainfrom
ChuhanJin:docs/add-network-to-wallet

Conversation

@ChuhanJin

@ChuhanJin ChuhanJin commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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.

Summary by CodeRabbit

  • Documentation
    • Added a new guide explaining how to add Injective EVM and native (CosmWasm) networks to browser wallets.
    • Included mainnet/testnet setup steps, chain ID mappings, and manual configuration tables.
    • Added interactive wallet cards to streamline EVM network add/switch and native chain enablement.
    • Published the guide in the Injective documentation navigation.

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.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2947e6fe-8ff0-401b-9445-a93cdd4c4d72

📥 Commits

Reviewing files that changed from the base of the PR and between 83c155e and cb99674.

📒 Files selected for processing (1)
  • .gitbook/add-network-to-wallet.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • .gitbook/add-network-to-wallet.mdx

📝 Walkthrough

Walkthrough

Adds a GitBook page documenting Injective EVM and native network parameters, interactive wallet connection flows, and manual configuration references. Registers the page in the English INJECTIVE navigation.

Changes

Wallet network documentation

Layer / File(s) Summary
Page structure and network reference
.gitbook/add-network-to-wallet.mdx
Adds page metadata, network context, wallet assets, chain configuration data, and manual EVM/native mainnet and testnet tables.
Interactive wallet connection controls
.gitbook/add-network-to-wallet.mdx
Adds EVM chain switching/addition, Cosmos wallet enabling, and status-driven controls.
Documented wallet flows and navigation
.gitbook/add-network-to-wallet.mdx, .gitbook/docs.json
Adds EVM and native wallet sections with interactive cards and registers the page in English navigation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: bangjelkoski

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: adding the Add Network to Your Wallet docs page under Injective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dea727e and 5843cd4.

📒 Files selected for processing (2)
  • .gitbook/add-network-to-wallet.mdx
  • .gitbook/docs.json

Comment thread .gitbook/add-network-to-wallet.mdx Outdated
Star Assistant added 3 commits July 13, 2026 21:34
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5843cd4 and b29a107.

📒 Files selected for processing (1)
  • .gitbook/add-network-to-wallet.mdx

Comment thread .gitbook/add-network-to-wallet.mdx Outdated
Comment thread .gitbook/add-network-to-wallet.mdx
Star Assistant added 4 commits July 13, 2026 22:46
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants