import { EncodeObject, OfflineSigner } from "@cosmjs/proto-signing"; import { AuthExtension, BankExtension, Coin, Event, GasPrice, QueryClient, SigningStargateClient, SigningStargateClientOptions, StakingExtension } from "@cosmjs/stargate"; import { comet38, CometClient, ReadonlyDateWithNanoseconds, tendermint34, tendermint37 } from "@cosmjs/tendermint-rpc"; import { Any } from "cosmjs-types/google/protobuf/any"; import { Order, Packet } from "cosmjs-types/ibc/core/channel/v1/channel"; import { Height } from "cosmjs-types/ibc/core/client/v1/client"; import { ClientState as TendermintClientState, ConsensusState as TendermintConsensusState, Header as TendermintHeader } from "cosmjs-types/ibc/lightclients/tendermint/v1/tendermint"; import { SignedHeader } from "cosmjs-types/tendermint/types/types"; import { ValidatorSet } from "cosmjs-types/tendermint/types/validator"; import { Logger } from "./logger"; import { IbcExtension } from "./queries/ibc"; import { Ack } from "./utils"; declare type CometHeader = tendermint34.Header | tendermint37.Header | comet38.Header; declare type CometCommitResponse = tendermint34.CommitResponse | tendermint37.CommitResponse | comet38.CommitResponse; export interface MsgResult { readonly events: readonly Event[]; /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */ readonly transactionHash: string; /** block height where this transaction was committed - only set if we send 'block' mode */ readonly height: number; } export declare type CreateClientResult = MsgResult & { readonly clientId: string; }; export declare type CreateConnectionResult = MsgResult & { readonly connectionId: string; }; export declare type CreateChannelResult = MsgResult & { readonly channelId: string; }; interface ConnectionHandshakeProof { clientId: string; connectionId: string; clientState?: Any; proofHeight: Height; proofConnection: Uint8Array; proofClient: Uint8Array; proofConsensus: Uint8Array; consensusHeight?: Height; } export interface ChannelHandshake { id: ChannelInfo; proofHeight: Height; proof: Uint8Array; } export interface ChannelInfo { readonly portId: string; readonly channelId: string; } export declare type IbcClientOptions = SigningStargateClientOptions & { logger?: Logger; gasPrice: GasPrice; estimatedBlockTime: number; estimatedIndexerTime: number; }; export declare class IbcClient { readonly gasPrice: GasPrice; readonly sign: SigningStargateClient; readonly query: QueryClient & AuthExtension & BankExtension & IbcExtension & StakingExtension; readonly tm: CometClient; readonly senderAddress: string; readonly logger: Logger; readonly chainId: string; readonly revisionNumber: bigint; readonly estimatedBlockTime: number; readonly estimatedIndexerTime: number; static connectWithSigner(endpoint: string, signer: OfflineSigner, senderAddress: string, options: IbcClientOptions): Promise; private constructor(); revisionHeight(height: number): Height; ensureRevisionHeight(height: number | Height): Height; timeoutHeight(blocksInFuture: number): Promise; getChainId(): Promise; header(height: number): Promise; latestHeader(): Promise; currentTime(): Promise; currentHeight(): Promise; currentRevision(): Promise; waitOneBlock(): Promise; waitForIndexer(): Promise; getCommit(height?: number): Promise; /** Returns the unbonding period in seconds */ getUnbondingPeriod(): Promise; getSignedHeader(height?: number): Promise; getValidatorSet(height: number): Promise; buildHeader(lastHeight: number): Promise; getConnectionProof(clientId: string, connectionId: string, headerHeight: Height | number): Promise; getChannelProof(id: ChannelInfo, headerHeight: Height | number): Promise; getPacketProof(packet: Packet, headerHeight: Height | number): Promise; getAckProof({ originalPacket }: Ack, headerHeight: Height | number): Promise; getTimeoutProof({ originalPacket }: Ack, headerHeight: Height | number): Promise; doUpdateClient(clientId: string, src: IbcClient): Promise; /***** These are all direct wrappers around message constructors ********/ sendTokens(recipientAddress: string, transferAmount: readonly Coin[], memo?: string): Promise; sendMultiMsg(msgs: EncodeObject[]): Promise; createTendermintClient(clientState: TendermintClientState, consensusState: TendermintConsensusState): Promise; updateTendermintClient(clientId: string, header: TendermintHeader): Promise; connOpenInit(clientId: string, remoteClientId: string): Promise; connOpenTry(myClientId: string, proof: ConnectionHandshakeProof): Promise; connOpenAck(myConnectionId: string, proof: ConnectionHandshakeProof): Promise; connOpenConfirm(myConnectionId: string, proof: ConnectionHandshakeProof): Promise; channelOpenInit(portId: string, remotePortId: string, ordering: Order, connectionId: string, version: string): Promise; channelOpenTry(portId: string, remote: ChannelInfo, ordering: Order, connectionId: string, version: string, counterpartyVersion: string, proof: ChannelHandshake): Promise; channelOpenAck(portId: string, channelId: string, counterpartyChannelId: string, counterpartyVersion: string, proof: ChannelHandshake): Promise; channelOpenConfirm(portId: string, channelId: string, proof: ChannelHandshake): Promise; receivePacket(packet: Packet, proofCommitment: Uint8Array, proofHeight?: Height): Promise; receivePackets(packets: readonly Packet[], proofCommitments: readonly Uint8Array[], proofHeight?: Height): Promise; acknowledgePacket(ack: Ack, proofAcked: Uint8Array, proofHeight?: Height): Promise; acknowledgePackets(acks: readonly Ack[], proofAckeds: readonly Uint8Array[], proofHeight?: Height): Promise; timeoutPacket(packet: Packet, proofUnreceived: Uint8Array, nextSequenceRecv: bigint, proofHeight: Height): Promise; timeoutPackets(packets: Packet[], proofsUnreceived: Uint8Array[], nextSequenceRecv: bigint[], proofHeight: Height): Promise; transferTokens(sourcePort: string, sourceChannel: string, token: Coin, receiver: string, timeoutHeight?: Height, /** timeout in seconds (SigningStargateClient converts to nanoseconds) */ timeoutTime?: number): Promise; } export interface CreateClientArgs { clientState: TendermintClientState; consensusState: TendermintConsensusState; } export declare function buildCreateClientArgs(src: IbcClient, trustPeriodSec?: number | null): Promise; export declare function prepareConnectionHandshake(src: IbcClient, dest: IbcClient, clientIdSrc: string, clientIdDest: string, connIdSrc: string): Promise; export declare function prepareChannelHandshake(src: IbcClient, dest: IbcClient, clientIdDest: string, portId: string, channelId: string): Promise; export {};