Class: SigningClient
@shareledgerjs/client.SigningClient
Hierarchy
↳
SigningClient
Constructors
constructor
• new SigningClient(tmClient, signer?, options?)
Parameters
| Name | Type |
|---|---|
tmClient | undefined | Tendermint34Client |
signer? | OfflineSigner |
options | SigningOptions |
Overrides
Properties
accountParser
• Protected Readonly accountParser: AccountParser
Inherited from
aminoTypes
• Private Readonly aminoTypes: AminoTypes
auth
• Readonly auth: AuthQueryExtensionMethods
Inherited from
broadcastPollIntervalMs
• Optional Readonly broadcastPollIntervalMs: number
broadcastTimeoutMs
• Optional Readonly broadcastTimeoutMs: number
gasPrice
• Protected Optional Readonly gasPrice: GasPrice
queryClient
• Protected Readonly queryClient: undefined | QueryClient
Inherited from
registry
• Readonly registry: Registry
signer
• Private Optional signer: OfflineSigner
tmClient
• Protected Readonly tmClient: undefined | Tendermint34Client
Inherited from
tx
• Readonly tx: TxQueryExtensionMethods
Inherited from
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>
Inherited from
disconnect
▸ disconnect(): void
Returns
void
Inherited from
forceGetQueryClient
▸ Protected forceGetQueryClient(): QueryClient
Returns
Inherited from
forceGetSigner
▸ Protected forceGetSigner(): OfflineSigner
Returns
OfflineSigner
forceGetTmClient
▸ Protected forceGetTmClient(): Tendermint34Client
Returns
Tendermint34Client
Inherited from
getAccount
▸ getAccount(searchAddress): Promise<null | Account>
Parameters
| Name | Type |
|---|---|
searchAddress | string |
Returns
Promise<null | Account>
Inherited from
getBlock
▸ getBlock(height?): Promise<Block>
Parameters
| Name | Type |
|---|---|
height? | number |
Returns
Promise<Block>
Inherited from
getChainId
▸ getChainId(): Promise<string>
Returns
Promise<string>
Inherited from
getHeight
▸ getHeight(): Promise<number>
Returns
Promise<number>
Inherited from
getSequence
▸ getSequence(address): Promise<SequenceResponse>
Parameters
| Name | Type |
|---|---|
address | string |
Returns
Promise<SequenceResponse>
Inherited from
getSignerAccount
▸ getSignerAccount(): Promise<AccountData>
Returns
Promise<AccountData>
getSignerAccounts
▸ getSignerAccounts(): Promise<readonly AccountData[]>
Returns
Promise<readonly AccountData[]>
getTx
▸ getTx(id): Promise<null | IndexedTx>
Parameters
| Name | Type |
|---|---|
id | string |
Returns
Promise<null | IndexedTx>
Inherited from
getTxHash
▸ getTxHash(tx): string
Parameters
| Name | Type |
|---|---|
tx | string | Uint8Array |
Returns
string
Inherited from
searchTx
▸ searchTx(query, filter?): Promise<readonly IndexedTx[]>
Parameters
| Name | Type |
|---|---|
query | SearchTxQuery |
filter | SearchTxFilter |
Returns
Promise<readonly IndexedTx[]>
Inherited from
sign
▸ sign(signerAddress, messages, fee?, memo?, explicitSignerData?): Promise<Uint8Array>
Gets account number and sequence from the API, creates a sign doc, creates a single signature and assembles the signed transaction.
The sign mode (SIGN_MODE_DIRECT or SIGN_MODE_LEGACY_AMINO_JSON) is determined by this client's signer.
You can pass signer data (account number, sequence and chain ID) explicitly instead of querying them from the chain. This is needed when signing for a multisig account, but it also allows for offline signing (See the SigningStargateClient.offline constructor).
Parameters
| Name | Type |
|---|---|
signerAddress | string |
messages | readonly EncodeObject[] |
fee? | StdFee |
memo? | string |
explicitSignerData? | SignerData |
Returns
Promise<Uint8Array>
signAmino
▸ Private signAmino(signerAddress, messages, fee, memo, __namedParameters): Promise<Uint8Array>
Parameters
| Name | Type |
|---|---|
signerAddress | string |
messages | readonly EncodeObject[] |
fee | StdFee |
memo | string |
__namedParameters | SignerData |
Returns
Promise<Uint8Array>
signAndBroadcast
▸ signAndBroadcast(signerAddress, messages, fee?, memo?, explicitSignerData?): Promise<DeliverTxResponse>
Parameters
| Name | Type |
|---|---|
signerAddress | string |
messages | readonly EncodeObject[] |
fee? | StdFee |
memo? | string |
explicitSignerData? | SignerData |
Returns
Promise<DeliverTxResponse>
signDirect
▸ Private signDirect(signerAddress, messages, fee, memo, __namedParameters): Promise<Uint8Array>
Parameters
| Name | Type |
|---|---|
signerAddress | string |
messages | readonly EncodeObject[] |
fee | StdFee |
memo | string |
__namedParameters | SignerData |
Returns
Promise<Uint8Array>
simulate
▸ simulate(signerAddress, messages, memo?, fee?): Promise<number>
Parameters
| Name | Type |
|---|---|
signerAddress | string |
messages | readonly EncodeObject[] |
memo? | string |
fee? | StdFee |
Returns
Promise<number>
withSigner
▸ withSigner(signer): Promise<SigningClient>
Parameters
| Name | Type |
|---|---|
signer | OfflineSigner |
Returns
Promise<SigningClient>
withoutSigner
▸ withoutSigner(): SigningClient