globeShielded Public Client

Read-only client with TEE key access and precompile support

Read-only client for interacting with a Seismic node. Extends viem's PublicClient with TEE public key retrieval, precompile access, block explorer URL helpers, SRC20 event watching, and deposit contract queries. Does not require a private key.

Import

import { createShieldedPublicClient } from "seismic-viem";

Constructor

const publicClient = createShieldedPublicClient({
  chain: seismicTestnet,
  transport: http(),
});

Parameters

Parameter
Type
Required
Description

chain

Chain

Yes

Chain configuration (e.g., seismicTestnet)

transport

Transport

Yes

viem transport (e.g., http())

Return Type

ShieldedPublicClient

A viem PublicClient extended with ShieldedPublicActions, DepositContractPublicActions, and SRC20PublicActions.

Usage

Actions

Shielded Public Actions

Action
Return Type
Description

getTeePublicKey()

Promise<Hex>

Fetch the TEE's secp256k1 public key via seismic_getTeePublicKey RPC

getStorageAt()

--

Throws error (not supported on Seismic)

publicRequest()

Promise<any>

Raw RPC request to the node

explorerUrl(opts)

string | null

Generate a block explorer URL

addressExplorerUrl(address)

string | null

Explorer URL for an address

blockExplorerUrl(block)

string | null

Explorer URL for a block

txExplorerUrl(hash)

string | null

Explorer URL for a transaction

tokenExplorerUrl(address)

string | null

Explorer URL for a token

Precompile Actions

Action
Return Type
Description

rng(params)

Promise<bigint>

Generate random numbers via the RNG precompile

ecdh(params)

Promise<Hex>

ECDH key exchange via precompile

aesGcmEncryption(params)

Promise<Hex>

AES-GCM encrypt via precompile

aesGcmDecryption(params)

Promise<string>

AES-GCM decrypt via precompile

hdfk(ikm)

Promise<Hex>

HKDF key derivation via precompile

secp256k1Signature(params)

Promise<Signature>

secp256k1 signing via precompile

SRC20 Actions

Action
Return Type
Description

watchSRC20Events()

--

Watch for SRC20 token events

watchSRC20EventsWithKey()

--

Watch for SRC20 events with a decryption key

Deposit Contract Actions

Action
Return Type
Description

getDepositRoot()

Promise<Hex>

Query the deposit merkle root

getDepositCount()

Promise<bigint>

Query the deposit count

Standard viem Public Actions

All standard viem PublicActions are available directly on the client:

  • getBlockNumber(), getBlock(), getTransaction()

  • getBalance(), getCode(), call()

  • estimateGas(), waitForTransactionReceipt()

  • All other viem public client methods

getStorageAt Disabled

circle-exclamation

Examples

Fetching the TEE Public Key

Using Precompiles

Explorer URL Helpers

See Also

Last updated