SPCXDEVELOPERS
Documentation / Build
SPCX DEVELOPER NETWORK

App integration

Use familiar EVM libraries and user-approved wallets.

Viem chain definition

Configure Viem as a custom network; no SPCX proprietary SDK is required.

TypeScript
import { defineChain, createPublicClient, http } from "viem";
export const spcxTestnet = defineChain({
  id: 46630021,
  name: "SPCX Chain Testnet",
  nativeCurrency: { name: "Test SPCX", symbol: "tSPCX", decimals: 18 },
  rpcUrls: { default: { http: ["https://rpc-testnet.spcxchain.network"] } },
  blockExplorers: { default: { name: "SPCX Explorer", url: "https://explorer.spcxchain.network" } },
  testnet: true,
});
const client = createPublicClient({ chain: spcxTestnet, transport: http() });
console.log(await client.getBlockNumber());

Add wallet network

Invoke after an explicit user action. Never request a seed phrase or private key.

JavaScript
await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [{ chainId: "0x2c78485", chainName: "SPCX Chain Testnet",
    nativeCurrency: { name: "Test SPCX", symbol: "tSPCX", decimals: 18 },
    rpcUrls: ["https://rpc-testnet.spcxchain.network"],
    blockExplorerUrls: ["https://explorer.spcxchain.network"] }]
});

Hardhat / ethers

Set the RPC URL and numeric chain ID in your existing tooling. Use dedicated test credentials outside the repository; verify returned chain ID before writing.