import { Chain, ChainId, Network, Platform } from "@wormhole-foundation/sdk-base";
import { AccountAddress, ChainAddress, NativeAddress } from "../address";
import { IbcMessageId, WormholeMessageId } from "../attestation";
import { EmptyPlatformMap } from "../protocol";
import { TokenAddress, TokenId, TxHash } from "../types";
import { UnsignedTransaction } from "../unsignedTransaction";
declare global {
    namespace WormholeNamespace {
        interface ProtocolToPlatformMapping {
            IbcBridge: EmptyPlatformMap<Platform, "IbcBridge">;
        }
    }
}
/** Configuration for a transfer through the Gateway */
export type GatewayTransferDetails = {
    token: TokenId<Chain>;
    amount: bigint;
    from: ChainAddress;
    to: ChainAddress;
    nonce?: number;
    fee?: bigint;
    payload?: Uint8Array;
    nativeGas?: bigint;
};
/**
 * Holds the data of a gateway message without
 * special keys required by cosmos contracts
 */
export interface GatewayMsg {
    chain: ChainId;
    recipient: string;
    fee: string;
    nonce: number;
    payload?: string;
}
export interface GatewayTransferMsg {
    gateway_transfer: Exclude<GatewayMsg, "payload">;
}
export interface GatewayTransferWithPayloadMsg {
    gateway_transfer_with_payload: GatewayMsg;
}
export interface GatewayIbcTransferMsg {
    gateway_ibc_token_bridge_payload: GatewayTransferMsg | GatewayTransferWithPayloadMsg;
}
export declare function isGatewayTransferMsg(thing: GatewayTransferMsg | any): thing is GatewayTransferMsg;
export declare function isGatewayTransferWithPayloadMsg(thing: GatewayTransferWithPayloadMsg | any): thing is GatewayTransferWithPayloadMsg;
export declare function isGatewayIbcTransferMsg(thing: GatewayIbcTransferMsg | any): thing is GatewayIbcTransferMsg;
export declare function isGatewayTransferDetails(thing: GatewayTransferDetails | any): thing is GatewayTransferDetails;
export declare function toGatewayMsg(msg: GatewayTransferMsg | GatewayTransferWithPayloadMsg | GatewayIbcTransferMsg | string): GatewayMsg;
export declare function gatewayTransferMsg(gtd: GatewayTransferDetails | GatewayMsg): GatewayTransferMsg | GatewayTransferWithPayloadMsg;
export declare function makeGatewayTransferMsg<CN extends Chain>(chain: CN, recipient: NativeAddress<CN> | string, fee: bigint | undefined, nonce: number, payload?: string): GatewayTransferWithPayloadMsg | GatewayTransferMsg;
export interface IbcTransferInfo {
    id: IbcMessageId;
    data: IbcTransferData;
    pending: boolean;
}
export declare function isIbcTransferInfo(thing: IbcTransferInfo | any): thing is IbcTransferInfo;
/**
 * The expected payload sent as a string over IBC
 */
export interface IbcTransferData {
    amount: string;
    denom: string;
    memo: string;
    receiver: string;
    sender: string;
}
/**
 * IbcBridge provides an interface to use the IBC token transfer protocol
 *
 * See more here {@link https://tutorials.cosmos.network/academy/3-ibc/7-token-transfer.html}
 *
 */
export interface IbcBridge<N extends Network, C extends Chain> {
    /** Initiate an IBC token transfer */
    transfer(sender: AccountAddress<C>, recipient: ChainAddress, token: TokenAddress<C>, amount: bigint, payload?: Uint8Array): AsyncGenerator<UnsignedTransaction<N, C>>;
    /** Get the transfer channel for a remote chain, pulled from local cache */
    getTransferChannel(chain: Chain): string | null;
    /** Get the transfer channel for a remote chain, pulled from contract */
    fetchTransferChannel(chain: Chain): Promise<string | null>;
    /**
     * Find the wormhole emitted message id for a given IBC transfer
     * if it does not exist, this will return null
     */
    lookupMessageFromIbcMsgId(msg: IbcMessageId): Promise<WormholeMessageId | null>;
    /** Find the IBCTransferInfo given a transaction id */
    lookupTransferFromTx(txid: TxHash): Promise<IbcTransferInfo>;
    /** Find the IBCTransferInfo from a message id */
    lookupTransferFromIbcMsgId(msg: IbcMessageId): Promise<IbcTransferInfo>;
    /** Find the IBCTransferInfo from a gateway transfer message */
    lookupTransferFromMsg(payload: GatewayTransferMsg | GatewayTransferWithPayloadMsg): Promise<IbcTransferInfo>;
}
//# sourceMappingURL=ibc.d.ts.map