Skip to content
Available on private testnetTestnet: example only (not executed)Mainnet: Not availableSoftware: Core bad4a06ea · protocol pqwerai-v8-testnet/1Updated

viem 2

Not executed for this release

chain.ts
import { defineChain, createPublicClient, createWalletClient, http, parseEther } from "viem";
import { privateKeyToAccount } from "viem/accounts";

export const pqwerai = defineChain({
  id: 77240,
  name: "PQWERAI Testnet",
  nativeCurrency: { name: "PQAI", symbol: "PQAI", decimals: 18 },
  rpcUrls: { default: { http: [process.env.PQWERAI_RPC ?? "http://127.0.0.1:8545"] } },
  testnet: true,
});

const client = createPublicClient({ chain: pqwerai, transport: http() });
console.log(await client.getBlockNumber());

// PQWERAI finality comes from g4_status, not blockTag "finalized"
const status = await client.request({ method: "g4_status" as any, params: [] as any });

const wallet = createWalletClient({ chain: pqwerai, transport: http(), account: privateKeyToAccount(process.env.KEY as `0x${string}`) });
const hash = await wallet.sendTransaction({ to: "0x000000000000000000000000000000000000dEaD", value: parseEther("0.01") });
await client.waitForTransactionReceipt({ hash });

Do not pass blockTag: "finalized" or "safe"; PQWERAI Core returns finalized block not found.


Sources at 72057fe3ec: testnet/release/network/network.json

Found a problem? Report a documentation issue · Build testnet-rc1+72057fe3ec