Skip to main content

Class: Validator

Validator provides direct access to remote Validator REST APIs.

Constructors

constructor

new Validator(config?)

Create a Validator instance with the specified connection configuration.

Parameters

NameTypeDescription
configPartial<ReadConfig>The connection configuration. This must include a baseUrl string. If passing the config from a pre-existing Database instance, it must have a non-null baseUrl key defined.

Defined in

@tableland/sdk/src/validator/index.ts:45

Properties

config

Readonly config: ReadConfig

Defined in

@tableland/sdk/src/validator/index.ts:38

Methods

getTableById

getTableById(params, opts?): Promise<Table>

Get table information

Parameters

NameTypeDescription
paramsObject-
params.chainIdnumberDescription The parent chain to target Example ts 80001
params.tableIdstringDescription Table identifier Example ts 1
optsSignal-

Returns

Promise<Table>

Description

Returns information about a single table, including schema information

Defined in

@tableland/sdk/src/validator/index.ts:83


health

health(opts?): Promise<boolean>

Get health status

Parameters

NameType
optsSignal

Returns

Promise<boolean>

Description

Returns OK if the validator considers itself healthy

Defined in

@tableland/sdk/src/validator/index.ts:67


pollForReceiptByTransactionHash

pollForReceiptByTransactionHash(params, opts?): Promise<Camelize<AssertedResponse>>

Wait for transaction status

Parameters

NameTypeDescription
paramsObject-
params.chainIdnumberDescription The parent chain to target Example ts 80001
params.transactionHashstringDescription The transaction hash to request Example ts 0x02f319429b8a7be1cbb492f0bfbf740d2472232a2edadde7df7c16c0b61aa78b
optsSignalAndInterval-

Returns

Promise<Camelize<AssertedResponse>>

Description

Polls for the status of a given transaction receipt by hash until

Defined in

@tableland/sdk/src/validator/index.ts:127


queryByStatement

queryByStatement<T>(params, opts?): Promise<ObjectsFormat<T>>

Query the network

Type parameters

NameType
Tunknown

Parameters

NameType
paramsQueryParams<undefined | "objects">
opts?Signal

Returns

Promise<ObjectsFormat<T>>

Description

Returns the results of a SQL read query against the Tabeland network

Defined in

@tableland/sdk/src/validator/index.ts:97

queryByStatement<T>(params, opts?): Promise<TableFormat<T>>

Type parameters

NameType
Tunknown

Parameters

NameType
paramsQueryParams<"table">
opts?Signal

Returns

Promise<TableFormat<T>>

Defined in

@tableland/sdk/src/validator/index.ts:101


receiptByTransactionHash

receiptByTransactionHash(params, opts?): Promise<Camelize<AssertedResponse>>

Get transaction status

Parameters

NameTypeDescription
paramsObject-
params.chainIdnumberDescription The parent chain to target Example ts 80001
params.transactionHashstringDescription The transaction hash to request Example ts 0x02f319429b8a7be1cbb492f0bfbf740d2472232a2edadde7df7c16c0b61aa78b
optsSignal-

Returns

Promise<Camelize<AssertedResponse>>

Description

Returns the status of a given transaction receipt by hash

Defined in

@tableland/sdk/src/validator/index.ts:116


version

version(opts?): Promise<Camelize<Required<{ binary_version?: string ; build_date?: string ; git_branch?: string ; git_commit?: string ; git_state?: string ; git_summary?: string ; version?: number }>>>

Get version information

Parameters

NameType
optsSignal

Returns

Promise<Camelize<Required<{ binary_version?: string ; build_date?: string ; git_branch?: string ; git_commit?: string ; git_state?: string ; git_summary?: string ; version?: number }>>>

Description

Returns version information about the validator daemon

Defined in

@tableland/sdk/src/validator/index.ts:75


forChain

Static forChain(chainNameOrId): Validator

Create a new Validator instance that uses the default baseUrl for a given chain.

Parameters

NameTypeDescription
chainNameOrIdnumber | keyof TablelandNetworkConfigThe name or id of the chain to target.

Returns

Validator

A Validator with a default baseUrl.

Defined in

@tableland/sdk/src/validator/index.ts:58