Skip to main content

Class: EquitoClient

Methods

getApiAt()

getApiAt(blockNumber?): Promise<ApiDecoration<"promise">>

Returns the API instance at a specific block number, if specified. Otherwise, returns the API instance at the latest finalized block.

Parameters

blockNumber?: number

If provided, the API instance will be created at the block number.

Returns

Promise<ApiDecoration<"promise">>

The API instance at the block number.

Defined in

client/equito-client.ts:66


getBlockTimestamp()

getBlockTimestamp(blockNumber): Promise<number>

Returns the timestamp in milliseconds of a specific block number.

Parameters

blockNumber: number

The block number for which to get the timestamp.

Returns

Promise<number>

The timestamp in milliseconds of the block.

Defined in

client/equito-client.ts:174


getConfirmationTime()

getConfirmationTime(args): Promise<GetConfirmationTimeReturnType>

Returns the timestamp in milliseconds of a proof for a specific message hash, chain selector, and block number.

Parameters

args: GetConfirmationTimeArgs

GetConfirmationTimeArgs

Returns

Promise<GetConfirmationTimeReturnType>

Defined in

client/equito-client.ts:192


getNextValidators()

getNextValidators(): Promise<`0x${string}`[]>

Returns the list of validators for the next session.

Returns

Promise<`0x${string}`[]>

The list of validators.

Defined in

client/equito-client.ts:97


getProof()

getProof(messageHash, chainSelector, blockNumber?): Promise<undefined | `0x${string}`>

Returns the proof for a specific message hash, chain selector, and block number.

Parameters

messageHash: `0x${string}`

The message hash for which to get the proof.

chainSelector: number

The chain selector for which to get the proof.

blockNumber?: number

The block number at which to get the proof.

Returns

Promise<undefined | `0x${string}`>

If exists, the proof for the message in Hex format.

Defined in

client/equito-client.ts:148


getRouter()

getRouter(chainSelector): Promise<`0x${string}`>

Returns the router contract address for a given chain selector.

Parameters

chainSelector: number

The chain selector for which to get the router contract address.

Returns

Promise<`0x${string}`>

The router contract address.

Defined in

client/equito-client.ts:81


getSignatures()

getSignatures(messageHash, chainSelector, blockNumber?): Promise<`0x${string}`[]>

Returns the list of signatures for a specific message hash, chain selector, and block number.

Parameters

messageHash: `0x${string}`

The message hash for which to get the signatures.

chainSelector: number

The chain selector for which to get the signatures.

blockNumber?: number

The block number at which to get the signatures.

Returns

Promise<`0x${string}`[]>

The list of signatures.

Defined in

client/equito-client.ts:127


getValidators()

getValidators(chainSelector, blockNumber?): Promise<`0x${string}`[]>

Returns the list of validators for a specific chain and block number.

Parameters

chainSelector: number

The chain selector for which to get the validators.

blockNumber?: number

The block number at which to get the validators.

Returns

Promise<`0x${string}`[]>

The list of validators.

Defined in

client/equito-client.ts:110


listenForSignatures()

listenForSignatures(args): Promise<void>

Listens for signatures for a specific message hash, chain selector, and block number in a specific time frame.

Parameters

args: ListenForSignaturesArgs

ListenForSignaturesArgs

Returns

Promise<void>

Defined in

client/equito-client.ts:242


create()

static create(config): Promise<EquitoClient>

Create a new instance of EquitoClient.

An EquitoClient instance is a wrapper around the Substrate API that provides methods to interact with the Equito node.

Parameters

config: EquitoClientCreateConfig

The configuration for creating an EquitoClient.

Returns

Promise<EquitoClient>

A new instance of EquitoClient.

Defined in

client/equito-client.ts:32