From e3903ab6cb3545f6c075af35685c0d189946d066 Mon Sep 17 00:00:00 2001 From: Assaf Morami Date: Mon, 22 Jul 2024 11:49:38 +0300 Subject: [PATCH] update jsdoc --- src/stride_client.ts | 22 ++++++++++++++++++---- types/stride_client.d.ts | 24 +++++++++++++++++++----- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/stride_client.ts b/src/stride_client.ts index 6ad5c0a..02c93e0 100644 --- a/src/stride_client.ts +++ b/src/stride_client.ts @@ -20,7 +20,20 @@ import { import { getTxIbcResponses, IbcResponse } from "./utils"; export type StrideClientOptions = SigningStargateClientOptions & { + /** + * How much time (in milliseconds) to wait for IBC response txs (acknowledge/timeout). + * + * Defaults to `180_000` (3 minutes). + * + */ resolveIbcResponsesTimeoutMs?: number; + /** + * When waiting for the IBC response txs (acknowledge/timeout) to commit on-chain, how much time (in milliseconds) to wait between checks. + * + * Smaller intervals will cause more load on your node provider. Keep in mind that blocks on Stride take about 6 seconds to finalize. + * + * Defaults to `12_000` (12 seconds). + */ resolveIbcResponsesCheckIntervalMs?: number; }; @@ -29,7 +42,7 @@ export class StrideClient { public readonly rpcEndpoint: string, public readonly signer: OfflineSigner, public readonly address: string, - private readonly signingStargateClient: Awaited< + public readonly signingStargateClient: Awaited< ReturnType >, public readonly query: Awaited< @@ -39,15 +52,16 @@ export class StrideClient { public readonly types: { stride: typeof stride } & { cosmos: typeof cosmos; } & { ibc: typeof ibc }, - private readonly options?: StrideClientOptions, + public readonly options?: StrideClientOptions, ) {} /** + * Creates a new StrideClient object. * * @param {string} rpcUrl - A URL to the CometBFT RPC endpoint, also known as Tendermint RPC, by default on port 26657. * @param {OfflineSigner} signer - A signer for signing transactions. - * @param {string} address - walletAddress is the specific account address in the wallet that is permitted to sign transactions. - * @param {StrideClientOptions} [options] - Optional. Configuration options for the signing client, including gas price, gas limit, and other parameters. + * @param {string} address - The account address inside the `signer` that is permitted to sign transactions. + * @param {StrideClientOptions} [options] - Optional. Configurations for the signing client, including gas price, gas limit, and other parameters. */ public static async create( rpcUrl: string, diff --git a/types/stride_client.d.ts b/types/stride_client.d.ts index 1e55bc9..bb65db7 100644 --- a/types/stride_client.d.ts +++ b/types/stride_client.d.ts @@ -1,16 +1,29 @@ import { EncodeObject, OfflineSigner } from "@cosmjs/proto-signing"; -import { DeliverTxResponse, SigningStargateClientOptions, StdFee } from "@cosmjs/stargate"; +import { DeliverTxResponse, SigningStargateClient, SigningStargateClientOptions, StdFee } from "@cosmjs/stargate"; import { cosmos, ibc, stride } from "./codegen"; import { IbcResponse } from "./utils"; export declare type StrideClientOptions = SigningStargateClientOptions & { + /** + * How much time (in milliseconds) to wait for IBC response txs (acknowledge/timeout). + * + * Defaults to `180_000` (3 minutes). + * + */ resolveIbcResponsesTimeoutMs?: number; + /** + * When waiting for the IBC response txs (acknowledge/timeout) to commit on-chain, how much time (in milliseconds) to wait between checks. + * + * Smaller intervals will cause more load on your node provider. Keep in mind that blocks on Stride take about 6 seconds to finalize. + * + * Defaults to `12_000` (12 seconds). + */ resolveIbcResponsesCheckIntervalMs?: number; }; export declare class StrideClient { readonly rpcEndpoint: string; readonly signer: OfflineSigner; readonly address: string; - private readonly signingStargateClient; + readonly signingStargateClient: Awaited>; readonly query: Awaited> & Awaited>; readonly types: { stride: typeof stride; @@ -19,14 +32,15 @@ export declare class StrideClient { } & { ibc: typeof ibc; }; - private readonly options?; + readonly options?: StrideClientOptions; private constructor(); /** + * Creates a new StrideClient object. * * @param {string} rpcUrl - A URL to the CometBFT RPC endpoint, also known as Tendermint RPC, by default on port 26657. * @param {OfflineSigner} signer - A signer for signing transactions. - * @param {string} address - walletAddress is the specific account address in the wallet that is permitted to sign transactions. - * @param {StrideClientOptions} [options] - Optional. Configuration options for the signing client, including gas price, gas limit, and other parameters. + * @param {string} address - The account address inside the `signer` that is permitted to sign transactions. + * @param {StrideClientOptions} [options] - Optional. Configurations for the signing client, including gas price, gas limit, and other parameters. */ static create(rpcUrl: string, signer: OfflineSigner, address: string, options?: StrideClientOptions): Promise; /**