Class: Client
@shareledgerjs/client.Client
Hierarchy
Constructors
constructor
• new Client(tmClient, options)
Parameters
| Name | Type |
|---|---|
tmClient | undefined | Tendermint34Client |
options | ClientOptions |
Inherited from
Properties
accountParser
• Protected Readonly accountParser: AccountParser
Inherited from
auth
• Readonly auth: AuthQueryExtensionMethods
Inherited from
AuthExtension.auth
chainId
• Private chainId: undefined | string
queryClient
• Protected Readonly queryClient: undefined | QueryClient
Inherited from
tmClient
• Protected Readonly tmClient: undefined | Tendermint34Client
Inherited from
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
| Name | Type | Default value |
|---|---|---|
tx | Uint8Array | undefined |
timeoutMs | number | 60_000 |
pollIntervalMs | number | 3_000 |
Returns
Promise<DeliverTxResponse>
disconnect
▸ disconnect(): void
Returns
void
forceGetQueryClient
▸ Protected forceGetQueryClient(): QueryClient
Returns
Inherited from
BaseClient.forceGetQueryClient
forceGetTmClient
▸ Protected forceGetTmClient(): Tendermint34Client
Returns
Tendermint34Client
Inherited from
getAccount
▸ getAccount(searchAddress): Promise<null | Account>
Parameters
| Name | Type |
|---|---|
searchAddress | string |
Returns
Promise<null | Account>
getBlock
▸ getBlock(height?): Promise<Block>
Parameters
| Name | Type |
|---|---|
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
| Name | Type |
|---|---|
address | string |
Returns
Promise<SequenceResponse>
getTx
▸ getTx(id): Promise<null | IndexedTx>
Parameters
| Name | Type |
|---|---|
id | string |
Returns
Promise<null | IndexedTx>
getTxHash
▸ getTxHash(tx): string
Parameters
| Name | Type |
|---|---|
tx | string | Uint8Array |
Returns
string
searchTx
▸ searchTx(query, filter?): Promise<readonly IndexedTx[]>
Parameters
| Name | Type |
|---|---|
query | SearchTxQuery |
filter | SearchTxFilter |
Returns
Promise<readonly IndexedTx[]>
txsQuery
▸ Private txsQuery(query): Promise<readonly IndexedTx[]>
Parameters
| Name | Type |
|---|---|
query | string |
Returns
Promise<readonly IndexedTx[]>