Class: ChronicleContractClient
Represents a client for interacting with the Chronicle contract.
Constructors​
constructor​
• new ChronicleContractClient(«destructured»)
Constructs an instance of ChronicleContractClient.
Parameters​
| Name | Type |
|---|---|
«destructured» | ContractClientParams |
Defined in​
packages/client/src/ChronicleContractClient.ts:63
Methods​
checkProof​
▸ checkProof(«destructured»): Promise<boolean>
Verifies the proof against the Chronicle contract.
Parameters​
| Name | Type |
|---|---|
«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​
| Name | Type | Default value | Description |
|---|---|---|---|
size | bigint | undefined | The target tree size. |
pollingInterval? | number | 10000 | The interval at which to poll for tree size. |
timeout? | number | 0 | Time 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​
| Name | Type | Description |
|---|---|---|
rpc | string | The RPC endpoint. |
Returns​
Promise<ChronicleContractClient>
An instance of ChronicleContractClient.