> ## Documentation Index
> Fetch the complete documentation index at: https://injectivelabs-mintlify-6abb8c3a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 添加网络到钱包

> 一键将 Injective 网络添加到浏览器钱包。为 Injective EVM（MetaMask 和 Trust Wallet）和 Injective 原生链（Keplr）提供交互式钱包选项，涵盖主网与测试网。

一键将 Injective 添加到浏览器钱包，或使用下方的手动配置。Injective 提供两个可互操作的接口：

* **Injective EVM** 是兼容以太坊的 JSON-RPC 层。可与 MetaMask、Trust Wallet 等 EVM 钱包配合使用。
* **Injective（原生）** 是原生 Cosmos SDK 链。可与 Keplr 配合使用。

<Info>
  Injective EVM 与 Injective 原生链映射到同一个网络。它们使用不同的 chain ID，但共享底层状态。完整参考请参见
  [Network Information](/cn/developers/network-information) 与
  [EVM Network Information](/cn/developers-evm/network-information)。
</Info>

## Injective EVM

Injective EVM 可与 MetaMask、Trust Wallet 等 EVM 钱包配合使用。选择一个网络，然后选择一个钱包选项来添加或切换到 Injective。

<div style={{ border: "1px solid rgba(77,61,255,0.22)", borderRadius: "16px", padding: "16px 18px", background: "rgba(128,128,128,0.06)", marginBottom: "14px" }}>
  <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginBottom: "12px" }}>
    <span style={{ fontWeight: 700, fontSize: "15px" }}>Injective EVM 主网</span>
    <span style={{ fontSize: "12.5px", opacity: 0.6, fontFamily: "monospace" }}>Chain ID 1776</span>
  </div>

  <div style={{ display: "flex", flexWrap: "wrap", gap: "10px" }}>
    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const injected = typeof window !== "undefined" ? window.ethereum : null;
    const list = injected && injected.providers && injected.providers.length ? injected.providers : (injected ? [injected] : []);
    const legacyProvider = list.find((p) => p && p.isMetaMask) || null;
    const getErrorCode = (error) => {
      if (!error) return NaN;
      if (error.data && error.data.originalError && error.data.originalError.code !== undefined) return Number(error.data.originalError.code);
      if (error.data && error.data.code !== undefined) return Number(error.data.code);
      if (error.code !== undefined) return Number(error.code);
      return NaN;
    };
    const providerPromise = typeof window === "undefined"
      ? Promise.resolve(legacyProvider)
      : new Promise((resolve) => {
          let settled = false;
          let timer = null;
          const settle = (provider) => {
            if (settled) return;
            settled = true;
            if (timer) window.clearTimeout(timer);
            window.removeEventListener("eip6963:announceProvider", onAnnounceProvider);
            resolve(provider || null);
          };
          const onAnnounceProvider = (event) => {
            const detail = event && event.detail;
            if (detail && detail.info && detail.info.rdns === "io.metamask" && detail.provider) {
              settle(detail.provider);
            }
          };
          window.addEventListener("eip6963:announceProvider", onAnnounceProvider);
          timer = window.setTimeout(() => settle(legacyProvider), 500);
          window.dispatchEvent(new Event("eip6963:requestProvider"));
        });
    providerPromise.then((provider) => {
      if (!provider) { finish("未找到钱包", false); alert("请安装 MetaMask。"); return false; }
      return provider.request({ method: "eth_requestAccounts" })
      .then(() => provider.request({
        method: "wallet_switchEthereumChain",
        params: [{ chainId: "0x6f0" }]
      }).catch((error) => {
        if (getErrorCode(error) === 4902) {
          return provider.request({
            method: "wallet_addEthereumChain",
            params: [{
              chainId: "0x6f0",
              chainName: "Injective",
              rpcUrls: ["https://sentry.evm-rpc.injective.network/"],
              nativeCurrency: { name: "Injective", symbol: "INJ", decimals: 18 },
              blockExplorerUrls: ["https://blockscout.injective.network/"]
            }]
          });
        }
        throw error;
      }))
      .then(() => true);
    })
      .then((connected) => {
        if (!connected) return;
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Add or switch network failed:", error);
        label.textContent = getErrorCode(error) === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/metamask.svg?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=6277f4b4be685a84c742296ff886758e')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 MetaMask</span>
    </button>

    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const injected = typeof window !== "undefined" ? window.ethereum : null;
    const list = injected && injected.providers && injected.providers.length ? injected.providers : (injected ? [injected] : []);
    const legacyProvider = typeof window !== "undefined"
      ? ((window.trustwallet && (window.trustwallet.ethereum || window.trustwallet)) || list.find((p) => p && (p.isTrust || p.isTrustWallet)) || null)
      : null;
    const getErrorCode = (error) => {
      if (!error) return NaN;
      if (error.data && error.data.originalError && error.data.originalError.code !== undefined) return Number(error.data.originalError.code);
      if (error.data && error.data.code !== undefined) return Number(error.data.code);
      if (error.code !== undefined) return Number(error.code);
      return NaN;
    };
    const providerPromise = typeof window === "undefined"
      ? Promise.resolve(legacyProvider)
      : new Promise((resolve) => {
          let settled = false;
          let timer = null;
          const settle = (provider) => {
            if (settled) return;
            settled = true;
            if (timer) window.clearTimeout(timer);
            window.removeEventListener("eip6963:announceProvider", onAnnounceProvider);
            resolve(provider || null);
          };
          const onAnnounceProvider = (event) => {
            const detail = event && event.detail;
            if (detail && detail.info && detail.info.rdns === "com.trustwallet.app" && detail.provider) {
              settle(detail.provider);
            }
          };
          window.addEventListener("eip6963:announceProvider", onAnnounceProvider);
          timer = window.setTimeout(() => settle(legacyProvider), 500);
          window.dispatchEvent(new Event("eip6963:requestProvider"));
        });
    providerPromise.then((provider) => {
      if (!provider) { finish("未找到钱包", false); alert("请安装 Trust Wallet。"); return false; }
      return provider.request({ method: "eth_requestAccounts" })
      .then(() => provider.request({
        method: "wallet_switchEthereumChain",
        params: [{ chainId: "0x6f0" }]
      }).catch((error) => {
        if (getErrorCode(error) === 4902) {
          return provider.request({
            method: "wallet_addEthereumChain",
            params: [{
              chainId: "0x6f0",
              chainName: "Injective",
              rpcUrls: ["https://sentry.evm-rpc.injective.network/"],
              nativeCurrency: { name: "Injective", symbol: "INJ", decimals: 18 },
              blockExplorerUrls: ["https://blockscout.injective.network/"]
            }]
          });
        }
        throw error;
      }))
      .then(() => true);
    })
      .then((connected) => {
        if (!connected) return;
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Add or switch network failed:", error);
        label.textContent = getErrorCode(error) === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/trust-wallet.svg?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=5153c2ca2f14987c64da89a3acba03d6')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 Trust Wallet</span>
    </button>
  </div>
</div>

<div style={{ border: "1px solid rgba(77,61,255,0.22)", borderRadius: "16px", padding: "16px 18px", background: "rgba(128,128,128,0.06)", marginBottom: "14px" }}>
  <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginBottom: "12px" }}>
    <span style={{ fontWeight: 700, fontSize: "15px" }}>Injective EVM 测试网</span>
    <span style={{ fontSize: "12.5px", opacity: 0.6, fontFamily: "monospace" }}>Chain ID 1439</span>
  </div>

  <div style={{ display: "flex", flexWrap: "wrap", gap: "10px" }}>
    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const injected = typeof window !== "undefined" ? window.ethereum : null;
    const list = injected && injected.providers && injected.providers.length ? injected.providers : (injected ? [injected] : []);
    const legacyProvider = list.find((p) => p && p.isMetaMask) || null;
    const getErrorCode = (error) => {
      if (!error) return NaN;
      if (error.data && error.data.originalError && error.data.originalError.code !== undefined) return Number(error.data.originalError.code);
      if (error.data && error.data.code !== undefined) return Number(error.data.code);
      if (error.code !== undefined) return Number(error.code);
      return NaN;
    };
    const providerPromise = typeof window === "undefined"
      ? Promise.resolve(legacyProvider)
      : new Promise((resolve) => {
          let settled = false;
          let timer = null;
          const settle = (provider) => {
            if (settled) return;
            settled = true;
            if (timer) window.clearTimeout(timer);
            window.removeEventListener("eip6963:announceProvider", onAnnounceProvider);
            resolve(provider || null);
          };
          const onAnnounceProvider = (event) => {
            const detail = event && event.detail;
            if (detail && detail.info && detail.info.rdns === "io.metamask" && detail.provider) {
              settle(detail.provider);
            }
          };
          window.addEventListener("eip6963:announceProvider", onAnnounceProvider);
          timer = window.setTimeout(() => settle(legacyProvider), 500);
          window.dispatchEvent(new Event("eip6963:requestProvider"));
        });
    providerPromise.then((provider) => {
      if (!provider) { finish("未找到钱包", false); alert("请安装 MetaMask。"); return false; }
      return provider.request({ method: "eth_requestAccounts" })
      .then(() => provider.request({
        method: "wallet_switchEthereumChain",
        params: [{ chainId: "0x59f" }]
      }).catch((error) => {
        if (getErrorCode(error) === 4902) {
          return provider.request({
            method: "wallet_addEthereumChain",
            params: [{
              chainId: "0x59f",
              chainName: "Injective Testnet",
              rpcUrls: ["https://k8s.testnet.json-rpc.injective.network/"],
              nativeCurrency: { name: "Injective", symbol: "INJ", decimals: 18 },
              blockExplorerUrls: ["https://testnet.blockscout.injective.network/"]
            }]
          });
        }
        throw error;
      }))
      .then(() => true);
    })
      .then((connected) => {
        if (!connected) return;
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Add or switch network failed:", error);
        label.textContent = getErrorCode(error) === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/metamask.svg?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=6277f4b4be685a84c742296ff886758e')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 MetaMask</span>
    </button>

    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const injected = typeof window !== "undefined" ? window.ethereum : null;
    const list = injected && injected.providers && injected.providers.length ? injected.providers : (injected ? [injected] : []);
    const legacyProvider = typeof window !== "undefined"
      ? ((window.trustwallet && (window.trustwallet.ethereum || window.trustwallet)) || list.find((p) => p && (p.isTrust || p.isTrustWallet)) || null)
      : null;
    const getErrorCode = (error) => {
      if (!error) return NaN;
      if (error.data && error.data.originalError && error.data.originalError.code !== undefined) return Number(error.data.originalError.code);
      if (error.data && error.data.code !== undefined) return Number(error.data.code);
      if (error.code !== undefined) return Number(error.code);
      return NaN;
    };
    const providerPromise = typeof window === "undefined"
      ? Promise.resolve(legacyProvider)
      : new Promise((resolve) => {
          let settled = false;
          let timer = null;
          const settle = (provider) => {
            if (settled) return;
            settled = true;
            if (timer) window.clearTimeout(timer);
            window.removeEventListener("eip6963:announceProvider", onAnnounceProvider);
            resolve(provider || null);
          };
          const onAnnounceProvider = (event) => {
            const detail = event && event.detail;
            if (detail && detail.info && detail.info.rdns === "com.trustwallet.app" && detail.provider) {
              settle(detail.provider);
            }
          };
          window.addEventListener("eip6963:announceProvider", onAnnounceProvider);
          timer = window.setTimeout(() => settle(legacyProvider), 500);
          window.dispatchEvent(new Event("eip6963:requestProvider"));
        });
    providerPromise.then((provider) => {
      if (!provider) { finish("未找到钱包", false); alert("请安装 Trust Wallet。"); return false; }
      return provider.request({ method: "eth_requestAccounts" })
      .then(() => provider.request({
        method: "wallet_switchEthereumChain",
        params: [{ chainId: "0x59f" }]
      }).catch((error) => {
        if (getErrorCode(error) === 4902) {
          return provider.request({
            method: "wallet_addEthereumChain",
            params: [{
              chainId: "0x59f",
              chainName: "Injective Testnet",
              rpcUrls: ["https://k8s.testnet.json-rpc.injective.network/"],
              nativeCurrency: { name: "Injective", symbol: "INJ", decimals: 18 },
              blockExplorerUrls: ["https://testnet.blockscout.injective.network/"]
            }]
          });
        }
        throw error;
      }))
      .then(() => true);
    })
      .then((connected) => {
        if (!connected) return;
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Add or switch network failed:", error);
        label.textContent = getErrorCode(error) === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/trust-wallet.svg?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=5153c2ca2f14987c64da89a3acba03d6')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 Trust Wallet</span>
    </button>
  </div>
</div>

<Info>
  MetaMask 和 Trust Wallet 按钮使用标准的 `wallet_addEthereumChain` 请求。如果网络已添加，钱包会显示切换提示。如果注入式钱包没有反应，请使用下方的值手动添加网络。
</Info>

### 手动配置

<Tabs>
  <Tab title="Injective EVM 主网" icon="server">
    | 属性 | 值 |
    | - | - |
    | 网络名称 | Injective |
    | Chain ID | `1776` |
    | RPC URL | `https://sentry.evm-rpc.injective.network/` |
    | WS 端点 | `wss://sentry.evm-ws.injective.network` |
    | 货币符号 | `INJ` |
    | 精度 | `18` |
    | 区块浏览器 | `https://blockscout.injective.network/` |
  </Tab>

  <Tab title="Injective EVM 测试网" icon="flask-vial">
    | 属性 | 值 |
    | - | - |
    | 网络名称 | Injective Testnet |
    | Chain ID | `1439` |
    | RPC URL | `https://k8s.testnet.json-rpc.injective.network/` |
    | WS 端点 | `wss://k8s.testnet.ws.injective.network/` |
    | 货币符号 | `INJ` |
    | 精度 | `18` |
    | 区块浏览器 | `https://testnet.blockscout.injective.network/` |
    | 水龙头 | [`testnet.faucet.injective.network`](https://testnet.faucet.injective.network/) |
  </Tab>
</Tabs>

## Injective（原生）

Injective 原生链可与 Keplr 配合使用。Keplr 内置 Injective，开箱即可使用。选择下方的网络以在 Keplr 中解锁。

<div style={{ border: "1px solid rgba(77,61,255,0.22)", borderRadius: "16px", padding: "16px 18px", background: "rgba(128,128,128,0.06)", marginBottom: "14px" }}>
  <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginBottom: "12px" }}>
    <span style={{ fontWeight: 700, fontSize: "15px" }}>Injective 主网</span>
    <span style={{ fontSize: "12.5px", opacity: 0.6, fontFamily: "monospace" }}>Chain ID injective-1</span>
  </div>

  <div style={{ display: "flex", flexWrap: "wrap", gap: "10px" }}>
    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const p = typeof window !== "undefined" ? window.keplr : null;
    if (!p) { finish("未找到钱包", false); alert("请安装 Keplr 钱包。"); return; }
    p.enable("injective-1")
      .then(() => {
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Keplr enable failed:", error);
        label.textContent = error && error.code === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", borderRadius: "5px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/keplr.png?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=0ce25376bf78b46eca9b6c5bb2f00d5a')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 Keplr</span>
    </button>
  </div>
</div>

<div style={{ border: "1px solid rgba(77,61,255,0.22)", borderRadius: "16px", padding: "16px 18px", background: "rgba(128,128,128,0.06)", marginBottom: "14px" }}>
  <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", marginBottom: "12px" }}>
    <span style={{ fontWeight: 700, fontSize: "15px" }}>Injective 测试网</span>
    <span style={{ fontSize: "12.5px", opacity: 0.6, fontFamily: "monospace" }}>Chain ID injective-888</span>
  </div>

  <div style={{ display: "flex", flexWrap: "wrap", gap: "10px" }}>
    <button
      type="button"
      onClick={(event) => {
    const button = event.currentTarget;
    const label = button.querySelector("[data-wallet-label]");
    const originalLabel = label.textContent;
    const originalBorder = button.style.borderColor;
    const originalBackground = button.style.background;
    const originalOpacity = button.style.opacity;
    const finish = (message, success) => {
      label.textContent = message;
      button.style.borderColor = success ? "#22c55e" : "#ef4444";
      button.style.background = success ? "rgba(34,197,94,0.12)" : "rgba(239,68,68,0.10)";
      button.style.opacity = "1";
      window.setTimeout(() => {
        label.textContent = originalLabel;
        button.style.borderColor = originalBorder;
        button.style.background = originalBackground;
        button.style.opacity = originalOpacity;
        button.disabled = false;
      }, 2500);
    };
    label.textContent = "连接中...";
    button.disabled = true;
    button.style.opacity = "0.72";
    const p = typeof window !== "undefined" ? window.keplr : null;
    if (!p) { finish("未找到钱包", false); alert("请安装 Keplr 钱包。"); return; }
    p.enable("injective-888")
      .then(() => {
        label.textContent = "已连接 ✓";
        finish(label.textContent, true);
      })
      .catch((error) => {
        console.error("Keplr enable failed:", error);
        label.textContent = error && error.code === 4001 ? "请求已取消" : "请重试";
        finish(label.textContent, false);
      });
  }}
      style={{ display: "inline-flex", alignItems: "center", gap: "7px", padding: "6px 12px", borderRadius: "9px", border: "1px solid rgba(128,128,128,0.28)", background: "transparent", color: "inherit", fontWeight: 600, fontSize: "14px", cursor: "pointer", minWidth: "145px", transition: "all 160ms ease" }}
    >
      <span aria-hidden="true" style={{ width: "20px", height: "20px", borderRadius: "5px", backgroundImage: "url('https://mintcdn.com/injectivelabs-mintlify-6abb8c3a/DU0krLtlJ5bBKhNu/img/wallets/keplr.png?fit=max&auto=format&n=DU0krLtlJ5bBKhNu&q=85&s=0ce25376bf78b46eca9b6c5bb2f00d5a')", backgroundSize: "contain", backgroundRepeat: "no-repeat", backgroundPosition: "center", flexShrink: 0 }} />

      <span data-wallet-label aria-live="polite">添加到 Keplr</span>
    </button>
  </div>
</div>

<Info>
  Keplr 默认包含 Injective，因此按钮只是解锁钱包中的该链。完整的钱包接入指南请参见
  [钱包](/cn/defi/wallet/index)。
</Info>

### 手动配置

<Tabs>
  <Tab title="Injective 主网" icon="server">
    | 属性 | 值 |
    | - | - |
    | Chain ID | `injective-1` |
    | RPC / 节点 | `https://sentry.tm.injective.network:443` |
    | 货币符号 | `INJ` |
    | 精度 | `18` |
    | 浏览器 | [`injscan.com`](https://injscan.com/) |

    <Info>
      Injective 原生链使用 chain ID `injective-1`。它的 EVM 接口使用数字型 chain ID `1776`。两者映射到同一个主网。
    </Info>
  </Tab>

  <Tab title="Injective 测试网" icon="flask-vial">
    | 属性 | 值 |
    | - | - |
    | Chain ID | `injective-888` |
    | RPC / 节点 | `https://testnet.sentry.tm.injective.network:443` |
    | 货币符号 | `INJ` |
    | 精度 | `18` |
    | 浏览器 | [`testnet.explorer.injective.network`](https://testnet.explorer.injective.network/) |
    | 水龙头 | [`testnet.faucet.injective.network`](https://testnet.faucet.injective.network/) |

    <Info>
      Injective 原生链在测试网上使用 chain ID `injective-888`。它的 EVM 接口使用数字型 chain ID `1439`。两者映射到同一个测试网。
    </Info>
  </Tab>
</Tabs>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.