Wagmi
Wagmi Core is a VanillaJS library for Ethereum. You can use Wagmi and Viem to connect to Cyber Testnet and Mainnet.
Install
npm install @wagmi/core @wagmi/connectors viem@2.x
Setup
Create chain using viemimport { type Chain } from "viem";
export const cyberTestnet = {
id: 111557560,
name: "Cyber Testnet",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
default: { http: ["https://cyber-testnet.alt.technology/"] },
},
blockExplorers: {
default: {
name: "Cyber Testnet Explorer",
url: "https://testnet.cyberscan.co/",
},
},
} as const satisfies Chain;
import { http, createConfig } from "@wagmi/core";
import { mainnet, sepolia } from "@wagmi/core/chains";
export const config = createConfig({
chains: [cyberTestnet],
transports: {
[cyberTestnet.id]: http(),
},
});
Read data from Cyber
import { getBlockNumber } from "@wagmi/core";
import { config } from "./config";
const blockNumber = await getBlockNumber(config);