linkChains

Pre-configured chain definitions for Seismic networks

seismic-viem provides pre-configured viem Chain objects with Seismic transaction formatters. These chain definitions include the correct chain IDs, RPC endpoints, and custom formatters needed for Seismic's type 0x4A transactions.

Import

import {
  seismicTestnet,
  sanvil,
  localSeismicDevnet,
  createSeismicDevnet,
} from "seismic-viem";

Available Chains

Chain
Export
Chain ID
RPC URL
Description

Seismic Testnet

seismicTestnet

5124

https://gcp-1.seismictest.net/rpc

Public testnet

Sanvil

sanvil

31337

http://127.0.0.1:8545

Local Seismic Anvil

Local Devnet

localSeismicDevnet

5124

http://127.0.0.1:8545

Local seismic-reth --dev

Seismic Testnet

The public testnet for development and testing against a live Seismic network:

import { http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { createShieldedWalletClient, seismicTestnet } from "seismic-viem";

const client = await createShieldedWalletClient({
  chain: seismicTestnet,
  transport: http(),
  account: privateKeyToAccount("0x..."),
});

Sanvil

Local development chain using Sanvil (Seismic's fork of Anvil). Chain ID 31337 matches Anvil/Hardhat defaults:

Local Devnet

For running a local seismic-reth --dev node. Uses chain ID 5124 (same as testnet) but connects to localhost:

Choosing a Chain

SEISMIC_TX_TYPE

All chain configs use the Seismic transaction type constant:

The value 74 (0x4A) is the EIP-2718 transaction type envelope identifier for Seismic transactions. This constant is used internally by the chain formatters and encryption pipeline to identify and construct Seismic-specific transaction payloads.

Chain Formatters

Each chain config includes seismicChainFormatters -- custom viem chain formatters that handle Seismic transaction fields. These formatters are applied automatically when you use a Seismic chain definition.

The formatters extend viem's standard transaction formatting to support the additional fields required by Seismic's type 0x4A transactions, including encryption metadata and signed read parameters.

circle-info

You do not need to configure or interact with seismicChainFormatters directly. They are embedded in every pre-configured chain object and in chains created via createSeismicDevnet.

Custom Chain Factory

createSeismicDevnet

Create a custom chain definition for any Seismic-compatible node:

Parameters

Parameter
Type
Required
Description

nodeHost

string

Yes

Base URL of the Seismic node (without /rpc)

explorerUrl

string

No

Block explorer URL for the chain

The factory returns a viem Chain object with:

  • Chain ID 5124

  • RPC URL set to {nodeHost}/rpc

  • Seismic chain formatters included

  • Optional block explorer configuration

Helper Factories

Convenience factories for common Seismic infrastructure:

These generate chain configs pointing to numbered Seismic testnet instances on Azure and GCP infrastructure respectively.

SeismicTransactionRequest

Seismic chain configs use a custom transaction request type that extends viem's standard TransactionRequest with Seismic-specific fields:

circle-info

You do not need to populate these fields manually. The shielded wallet client's encryption pipeline fills them automatically when sending transactions. They are documented here for reference and debugging purposes.

Field
Type
Description

encryptionPubkey

Hex

Client's compressed secp256k1 public key

encryptionNonce

Hex

Random nonce for AES-GCM encryption of calldata

messageVersion

number

Version of the Seismic message format

recentBlockHash

Hex

Recent block hash used for transaction replay protection

expiresAtBlock

bigint

Block number after which the transaction becomes invalid

signedRead

boolean

true for signed read requests, false for standard txs

See Also

  • Installation -- Install seismic-viem and viem

  • Seismic Viem Overview -- Full SDK overview and architecture

  • Shielded Wallet Client -- Create a client using a chain config

  • Encryption -- How calldata encryption uses chain-level formatters

Last updated