book-open-readeruseShieldedRead

Execute authenticated read calls on shielded contracts

circle-info

This hook wraps useSignedReadContract from seismic-react. The actual export name is useSignedReadContract.

Hook for performing signed reads -- authenticated eth_call requests where the caller proves their identity. This allows contracts to return caller-specific shielded data (for example, a balance that depends on msg.sender).

import { useSignedReadContract } from "seismic-react";

Config

Parameter
Type
Required
Description

address

`0x${string}`

Yes

Contract address

abi

Abi

Yes

Contract ABI

functionName

string

Yes

Name of the view/pure function to call

args

array

No

Arguments to pass to the function

Return Type

Property
Type
Description

signedRead

() => Promise<any>

Function to execute the signed read

read

() => Promise<any>

Alias for signedRead

isLoading

boolean

Whether a read is in progress

error

Error | null

Error from the most recent read


Usage

Reading a shielded balance

Loading state handling

Error handling

circle-info

Unlike wagmi's useReadContract which auto-fetches on mount, useSignedReadContract returns a function you call imperatively. This is because signed reads require wallet interaction to prove caller identity.

See Also

Last updated