Skip to main content

Class: Client

@shareledgerjs/client.Client

Hierarchy

Constructors

constructor

new Client(tmClient, options)

Parameters

NameType
tmClientundefined | Tendermint34Client
optionsClientOptions

Inherited from

BaseClient.constructor

Properties

accountParser

Protected Readonly accountParser: AccountParser

Inherited from

BaseClient.accountParser


auth

Readonly auth: AuthQueryExtensionMethods

Inherited from

AuthExtension.auth


chainId

Private chainId: undefined | string


queryClient

Protected Readonly queryClient: undefined | QueryClient

Inherited from

BaseClient.queryClient


tmClient

Protected Readonly tmClient: undefined | Tendermint34Client

Inherited from

BaseClient.tmClient


tx

Readonly tx: TxQueryExtensionMethods

Inherited from

TxExtension.tx

Methods

broadcastTx

broadcastTx(tx, timeoutMs?, pollIntervalMs?): Promise<DeliverTxResponse>

Broadcasts a signed transaction to the network and monitors its inclusion in a block.

If broadcasting is rejected by the node for some reason (e.g. because of a CheckTx failure), an error is thrown.

If the transaction is not included in a block before the provided timeout, this errors with a TimeoutError.

If the transaction is included in a block, a DeliverTxResponse is returned. The caller then usually needs to check for execution success or failure.

Parameters

NameTypeDefault value
txUint8Arrayundefined
timeoutMsnumber60_000
pollIntervalMsnumber3_000

Returns

Promise<DeliverTxResponse>


disconnect

disconnect(): void

Returns

void


forceGetQueryClient

Protected forceGetQueryClient(): QueryClient

Returns

QueryClient

Inherited from

BaseClient.forceGetQueryClient


forceGetTmClient

Protected forceGetTmClient(): Tendermint34Client

Returns

Tendermint34Client

Inherited from

BaseClient.forceGetTmClient


getAccount

getAccount(searchAddress): Promise<null | Account>

Parameters

NameType
searchAddressstring

Returns

Promise<null | Account>


getBlock

getBlock(height?): Promise<Block>

Parameters

NameType
height?number

Returns

Promise<Block>


getChainId

getChainId(): Promise<string>

Returns

Promise<string>


getHeight

getHeight(): Promise<number>

Returns

Promise<number>


getSequence

getSequence(address): Promise<SequenceResponse>

Parameters

NameType
addressstring

Returns

Promise<SequenceResponse>


getTx

getTx(id): Promise<null | IndexedTx>

Parameters

NameType
idstring

Returns

Promise<null | IndexedTx>


getTxHash

getTxHash(tx): string

Parameters

NameType
txstring | Uint8Array

Returns

string


searchTx

searchTx(query, filter?): Promise<readonly IndexedTx[]>

Parameters

NameType
querySearchTxQuery
filterSearchTxFilter

Returns

Promise<readonly IndexedTx[]>


txsQuery

Private txsQuery(query): Promise<readonly IndexedTx[]>

Parameters

NameType
querystring

Returns

Promise<readonly IndexedTx[]>