import { StdTx } from "@cosmjs/amino"; import { WrappedStdTx } from "../tx"; import { BlockResponse, BroadcastMode, BroadcastTxsResponse, EncodeTxResponse, NodeInfoResponse, SearchTxsResponse, TxsResponse } from "./base"; /** Unfortunately, Cosmos SDK encodes empty arrays as null */ export declare type LcdApiArray = readonly T[] | null; export declare function normalizeLcdApiArray(backend: LcdApiArray): readonly T[]; declare type LcdExtensionSetup

= (base: LcdClient) => P; export interface LcdClientBaseOptions { readonly apiUrl: string; readonly broadcastMode?: BroadcastMode; } /** * A client to the LCD's (light client daemon) API. * This light client connects to Tendermint (i.e. the chain), encodes/decodes Amino data for us and provides a convenient JSON interface. * * This _JSON over HTTP_ API is sometimes referred to as "REST" or "RPC", which are both misleading terms * for the same thing. * * Please note that the client to the LCD can not verify light client proofs. When using this, * you need to trust the API provider as well as the network connection between client and API. * * @see https://cosmos.network/rpc */ export declare class LcdClient { /** Constructs an LCD client with 0 extensions */ static withExtensions(options: LcdClientBaseOptions): LcdClient; /** Constructs an LCD client with 1 extension */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup): LcdClient & A; /** Constructs an LCD client with 2 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup): LcdClient & A & B; /** Constructs an LCD client with 3 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup): LcdClient & A & B & C; /** Constructs an LCD client with 4 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup, setupExtensionD: LcdExtensionSetup): LcdClient & A & B & C & D; /** Constructs an LCD client with 5 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup, setupExtensionD: LcdExtensionSetup, setupExtensionE: LcdExtensionSetup): LcdClient & A & B & C & D & E; /** Constructs an LCD client with 6 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup, setupExtensionD: LcdExtensionSetup, setupExtensionE: LcdExtensionSetup, setupExtensionF: LcdExtensionSetup): LcdClient & A & B & C & D & E & F; /** Constructs an LCD client with 7 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup, setupExtensionD: LcdExtensionSetup, setupExtensionE: LcdExtensionSetup, setupExtensionF: LcdExtensionSetup, setupExtensionG: LcdExtensionSetup): LcdClient & A & B & C & D & E & F & G; /** Constructs an LCD client with 8 extensions */ static withExtensions(options: LcdClientBaseOptions, setupExtensionA: LcdExtensionSetup, setupExtensionB: LcdExtensionSetup, setupExtensionC: LcdExtensionSetup, setupExtensionD: LcdExtensionSetup, setupExtensionE: LcdExtensionSetup, setupExtensionF: LcdExtensionSetup, setupExtensionG: LcdExtensionSetup, setupExtensionH: LcdExtensionSetup): LcdClient & A & B & C & D & E & F & G & H; private readonly client; private readonly broadcastMode; /** * Creates a new client to interact with a Cosmos SDK light client daemon. * This class tries to be a direct mapping onto the API. Some basic decoding and normalizatin is done * but things like caching are done at a higher level. * * When building apps, you should not need to use this class directly. If you do, this indicates a missing feature * in higher level components. Feel free to raise an issue in this case. * * @param apiUrl The URL of a Cosmos SDK light client daemon API (sometimes called REST server or REST API) * @param broadcastMode Defines at which point of the transaction processing the broadcastTx method returns */ constructor(apiUrl: string, broadcastMode?: BroadcastMode); get(path: string, params?: Record): Promise; post(path: string, params: any): Promise; blocksLatest(): Promise; blocks(height: number): Promise; nodeInfo(): Promise; txById(id: string): Promise; txsQuery(query: string): Promise; /** returns the amino-encoding of the transaction performed by the server */ encodeTx(tx: WrappedStdTx): Promise; /** * Broadcasts a signed transaction to the transaction pool. * Depending on the client's broadcast mode, this might or might * wait for checkTx or deliverTx to be executed before returning. * * @param tx a signed transaction as StdTx (i.e. not wrapped in type/value container) */ broadcastTx(tx: StdTx): Promise; } export {};