Skip to main content

Class: ChronicleContractClient

Represents a client for interacting with the Chronicle contract.

Constructors​

constructor​

• new ChronicleContractClient(«destructured»)

Constructs an instance of ChronicleContractClient.

Parameters​

NameType
«destructured»ContractClientParams

Defined in​

packages/client/src/ChronicleContractClient.ts:63

Methods​

checkProof​

▸ checkProof(«destructured»): Promise<boolean>

Verifies the proof against the Chronicle contract.

Parameters​

NameType
«destructured»CheckProofParams

Returns​

Promise<boolean>

The result of the proof verification.

Defined in​

packages/client/src/ChronicleContractClient.ts:120


getCurrentTreeState​

â–¸ getCurrentTreeState(): Promise<{ currentHash: `0x${string}` ; currentSize: bigint }>

Retrieves the current state of the tree from the Chronicle contract.

Returns​

Promise<{ currentHash: `0x${string}` ; currentSize: bigint }>

An object containing the chain's current root & tree size..

Defined in​

packages/client/src/ChronicleContractClient.ts:77


waitForTreeSize​

â–¸ waitForTreeSize(size, pollingInterval?, timeout?): Promise<void>

Waits until the tree reaches a specified size or times out.

Throws

Will throw an error if the waiting times out.

Parameters​

NameTypeDefault valueDescription
sizebigintundefinedThe target tree size.
pollingInterval?number10000The interval at which to poll for tree size.
timeout?number0Time to wait before timing out. 0 means no timeout.

Returns​

Promise<void>

Defined in​

packages/client/src/ChronicleContractClient.ts:91


fromRpc​

â–¸ Static fromRpc(rpc): Promise<ChronicleContractClient>

Creates a ChronicleContractClient instance from an RPC endpoint.

Parameters​

NameTypeDescription
rpcstringThe RPC endpoint.

Returns​

Promise<ChronicleContractClient>

An instance of ChronicleContractClient.

Defined in​

packages/client/src/ChronicleContractClient.ts:142