interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
730 lines (729 loc) • 23.9 kB
TypeScript
import { Height, HeightAmino } from "../../client/v1/client";
import { DeepPartial } from "../../../../helpers";
import { BinaryReader, BinaryWriter } from "../../../../binary";
/**
* State defines if a channel is in one of the following states:
* CLOSED, INIT, TRYOPEN, OPEN, or UNINITIALIZED.
*/
export declare enum State {
/** STATE_UNINITIALIZED_UNSPECIFIED - Default State */
STATE_UNINITIALIZED_UNSPECIFIED = 0,
/** STATE_INIT - A channel has just started the opening handshake. */
STATE_INIT = 1,
/** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */
STATE_TRYOPEN = 2,
/**
* STATE_OPEN - A channel has completed the handshake. Open channels are
* ready to send and receive packets.
*/
STATE_OPEN = 3,
/**
* STATE_CLOSED - A channel has been closed and can no longer be used to send or receive
* packets.
*/
STATE_CLOSED = 4,
UNRECOGNIZED = -1
}
export declare const StateAmino: typeof State;
export declare function stateFromJSON(object: any): State;
export declare function stateToJSON(object: State): string;
/** Order defines if a channel is ORDERED or UNORDERED */
export declare enum Order {
/** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */
ORDER_NONE_UNSPECIFIED = 0,
/**
* ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in
* which they were sent.
*/
ORDER_UNORDERED = 1,
/** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */
ORDER_ORDERED = 2,
UNRECOGNIZED = -1
}
export declare const OrderAmino: typeof Order;
export declare function orderFromJSON(object: any): Order;
export declare function orderToJSON(object: Order): string;
/**
* Channel defines pipeline for exactly-once packet delivery between specific
* modules on separate blockchains, which has at least one end capable of
* sending packets and one end capable of receiving packets.
* @name Channel
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Channel
*/
export interface Channel {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
}
export interface ChannelProtoMsg {
typeUrl: "/ibc.core.channel.v1.Channel";
value: Uint8Array;
}
/**
* Channel defines pipeline for exactly-once packet delivery between specific
* modules on separate blockchains, which has at least one end capable of
* sending packets and one end capable of receiving packets.
* @name ChannelAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Channel
*/
export interface ChannelAmino {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty: CounterpartyAmino;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connection_hops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
}
export interface ChannelAminoMsg {
type: "cosmos-sdk/Channel";
value: ChannelAmino;
}
/**
* IdentifiedChannel defines a channel with additional port and channel
* identifier fields.
* @name IdentifiedChannel
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.IdentifiedChannel
*/
export interface IdentifiedChannel {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty: Counterparty;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connectionHops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
/**
* port identifier
*/
portId: string;
/**
* channel identifier
*/
channelId: string;
}
export interface IdentifiedChannelProtoMsg {
typeUrl: "/ibc.core.channel.v1.IdentifiedChannel";
value: Uint8Array;
}
/**
* IdentifiedChannel defines a channel with additional port and channel
* identifier fields.
* @name IdentifiedChannelAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.IdentifiedChannel
*/
export interface IdentifiedChannelAmino {
/**
* current state of the channel end
*/
state: State;
/**
* whether the channel is ordered or unordered
*/
ordering: Order;
/**
* counterparty channel end
*/
counterparty: CounterpartyAmino;
/**
* list of connection identifiers, in order, along which packets sent on
* this channel will travel
*/
connection_hops: string[];
/**
* opaque channel version, which is agreed upon during the handshake
*/
version: string;
/**
* port identifier
*/
port_id: string;
/**
* channel identifier
*/
channel_id: string;
}
export interface IdentifiedChannelAminoMsg {
type: "cosmos-sdk/IdentifiedChannel";
value: IdentifiedChannelAmino;
}
/**
* Counterparty defines a channel end counterparty
* @name Counterparty
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Counterparty
*/
export interface Counterparty {
/**
* port on the counterparty chain which owns the other end of the channel.
*/
portId: string;
/**
* channel end on the counterparty chain
*/
channelId: string;
}
export interface CounterpartyProtoMsg {
typeUrl: "/ibc.core.channel.v1.Counterparty";
value: Uint8Array;
}
/**
* Counterparty defines a channel end counterparty
* @name CounterpartyAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Counterparty
*/
export interface CounterpartyAmino {
/**
* port on the counterparty chain which owns the other end of the channel.
*/
port_id: string;
/**
* channel end on the counterparty chain
*/
channel_id: string;
}
export interface CounterpartyAminoMsg {
type: "cosmos-sdk/Counterparty";
value: CounterpartyAmino;
}
/**
* Packet defines a type that carries data across different chains through IBC
* @name Packet
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Packet
*/
export interface Packet {
/**
* number corresponds to the order of sends and receives, where a Packet
* with an earlier sequence number must be sent and received before a Packet
* with a later sequence number.
*/
sequence: bigint;
/**
* identifies the port on the sending chain.
*/
sourcePort: string;
/**
* identifies the channel end on the sending chain.
*/
sourceChannel: string;
/**
* identifies the port on the receiving chain.
*/
destinationPort: string;
/**
* identifies the channel end on the receiving chain.
*/
destinationChannel: string;
/**
* actual opaque bytes transferred directly to the application module
*/
data: Uint8Array;
/**
* block height after which the packet times out
*/
timeoutHeight: Height;
/**
* block timestamp (in nanoseconds) after which the packet times out
*/
timeoutTimestamp: bigint;
}
export interface PacketProtoMsg {
typeUrl: "/ibc.core.channel.v1.Packet";
value: Uint8Array;
}
/**
* Packet defines a type that carries data across different chains through IBC
* @name PacketAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Packet
*/
export interface PacketAmino {
/**
* number corresponds to the order of sends and receives, where a Packet
* with an earlier sequence number must be sent and received before a Packet
* with a later sequence number.
*/
sequence: string;
/**
* identifies the port on the sending chain.
*/
source_port: string;
/**
* identifies the channel end on the sending chain.
*/
source_channel: string;
/**
* identifies the port on the receiving chain.
*/
destination_port: string;
/**
* identifies the channel end on the receiving chain.
*/
destination_channel: string;
/**
* actual opaque bytes transferred directly to the application module
*/
data: string;
/**
* block height after which the packet times out
*/
timeout_height: HeightAmino;
/**
* block timestamp (in nanoseconds) after which the packet times out
*/
timeout_timestamp: string;
}
export interface PacketAminoMsg {
type: "cosmos-sdk/Packet";
value: PacketAmino;
}
/**
* PacketState defines the generic type necessary to retrieve and store
* packet commitments, acknowledgements, and receipts.
* Caller is responsible for knowing the context necessary to interpret this
* state as a commitment, acknowledgement, or a receipt.
* @name PacketState
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketState
*/
export interface PacketState {
/**
* channel port identifier.
*/
portId: string;
/**
* channel unique identifier.
*/
channelId: string;
/**
* packet sequence.
*/
sequence: bigint;
/**
* embedded data that represents packet state.
*/
data: Uint8Array;
}
export interface PacketStateProtoMsg {
typeUrl: "/ibc.core.channel.v1.PacketState";
value: Uint8Array;
}
/**
* PacketState defines the generic type necessary to retrieve and store
* packet commitments, acknowledgements, and receipts.
* Caller is responsible for knowing the context necessary to interpret this
* state as a commitment, acknowledgement, or a receipt.
* @name PacketStateAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketState
*/
export interface PacketStateAmino {
/**
* channel port identifier.
*/
port_id: string;
/**
* channel unique identifier.
*/
channel_id: string;
/**
* packet sequence.
*/
sequence: string;
/**
* embedded data that represents packet state.
*/
data: string;
}
export interface PacketStateAminoMsg {
type: "cosmos-sdk/PacketState";
value: PacketStateAmino;
}
/**
* PacketId is an identifier for a unique Packet
* Source chains refer to packets by source port/channel
* Destination chains refer to packets by destination port/channel
* @name PacketId
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketId
*/
export interface PacketId {
/**
* channel port identifier
*/
portId: string;
/**
* channel unique identifier
*/
channelId: string;
/**
* packet sequence
*/
sequence: bigint;
}
export interface PacketIdProtoMsg {
typeUrl: "/ibc.core.channel.v1.PacketId";
value: Uint8Array;
}
/**
* PacketId is an identifier for a unique Packet
* Source chains refer to packets by source port/channel
* Destination chains refer to packets by destination port/channel
* @name PacketIdAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketId
*/
export interface PacketIdAmino {
/**
* channel port identifier
*/
port_id: string;
/**
* channel unique identifier
*/
channel_id: string;
/**
* packet sequence
*/
sequence: string;
}
export interface PacketIdAminoMsg {
type: "cosmos-sdk/PacketId";
value: PacketIdAmino;
}
/**
* Acknowledgement is the recommended acknowledgement format to be used by
* app-specific protocols.
* NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
* conflicts with other protobuf message formats used for acknowledgements.
* The first byte of any message with this format will be the non-ASCII values
* `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
* https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope
* @name Acknowledgement
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Acknowledgement
*/
export interface Acknowledgement {
result?: Uint8Array;
error?: string;
}
export interface AcknowledgementProtoMsg {
typeUrl: "/ibc.core.channel.v1.Acknowledgement";
value: Uint8Array;
}
/**
* Acknowledgement is the recommended acknowledgement format to be used by
* app-specific protocols.
* NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
* conflicts with other protobuf message formats used for acknowledgements.
* The first byte of any message with this format will be the non-ASCII values
* `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
* https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope
* @name AcknowledgementAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Acknowledgement
*/
export interface AcknowledgementAmino {
result?: string;
error?: string;
}
export interface AcknowledgementAminoMsg {
type: "cosmos-sdk/Acknowledgement";
value: AcknowledgementAmino;
}
/**
* Timeout defines an execution deadline structure for 04-channel handlers.
* This includes packet lifecycle handlers.
* A valid Timeout contains either one or both of a timestamp and block height (sequence).
* @name Timeout
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Timeout
*/
export interface Timeout {
/**
* block height after which the packet times out
*/
height: Height;
/**
* block timestamp (in nanoseconds) after which the packet times out
*/
timestamp: bigint;
}
export interface TimeoutProtoMsg {
typeUrl: "/ibc.core.channel.v1.Timeout";
value: Uint8Array;
}
/**
* Timeout defines an execution deadline structure for 04-channel handlers.
* This includes packet lifecycle handlers.
* A valid Timeout contains either one or both of a timestamp and block height (sequence).
* @name TimeoutAmino
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Timeout
*/
export interface TimeoutAmino {
/**
* block height after which the packet times out
*/
height: HeightAmino;
/**
* block timestamp (in nanoseconds) after which the packet times out
*/
timestamp: string;
}
export interface TimeoutAminoMsg {
type: "cosmos-sdk/Timeout";
value: TimeoutAmino;
}
/**
* Channel defines pipeline for exactly-once packet delivery between specific
* modules on separate blockchains, which has at least one end capable of
* sending packets and one end capable of receiving packets.
* @name Channel
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Channel
*/
export declare const Channel: {
typeUrl: string;
aminoType: string;
is(o: any): o is Channel;
isAmino(o: any): o is ChannelAmino;
encode(message: Channel, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Channel;
fromPartial(object: DeepPartial<Channel>): Channel;
fromAmino(object: ChannelAmino): Channel;
toAmino(message: Channel): ChannelAmino;
fromAminoMsg(object: ChannelAminoMsg): Channel;
toAminoMsg(message: Channel): ChannelAminoMsg;
fromProtoMsg(message: ChannelProtoMsg): Channel;
toProto(message: Channel): Uint8Array;
toProtoMsg(message: Channel): ChannelProtoMsg;
registerTypeUrl(): void;
};
/**
* IdentifiedChannel defines a channel with additional port and channel
* identifier fields.
* @name IdentifiedChannel
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.IdentifiedChannel
*/
export declare const IdentifiedChannel: {
typeUrl: string;
aminoType: string;
is(o: any): o is IdentifiedChannel;
isAmino(o: any): o is IdentifiedChannelAmino;
encode(message: IdentifiedChannel, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel;
fromPartial(object: DeepPartial<IdentifiedChannel>): IdentifiedChannel;
fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel;
toAmino(message: IdentifiedChannel): IdentifiedChannelAmino;
fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel;
toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg;
fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel;
toProto(message: IdentifiedChannel): Uint8Array;
toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg;
registerTypeUrl(): void;
};
/**
* Counterparty defines a channel end counterparty
* @name Counterparty
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Counterparty
*/
export declare const Counterparty: {
typeUrl: string;
aminoType: string;
is(o: any): o is Counterparty;
isAmino(o: any): o is CounterpartyAmino;
encode(message: Counterparty, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Counterparty;
fromPartial(object: DeepPartial<Counterparty>): Counterparty;
fromAmino(object: CounterpartyAmino): Counterparty;
toAmino(message: Counterparty): CounterpartyAmino;
fromAminoMsg(object: CounterpartyAminoMsg): Counterparty;
toAminoMsg(message: Counterparty): CounterpartyAminoMsg;
fromProtoMsg(message: CounterpartyProtoMsg): Counterparty;
toProto(message: Counterparty): Uint8Array;
toProtoMsg(message: Counterparty): CounterpartyProtoMsg;
registerTypeUrl(): void;
};
/**
* Packet defines a type that carries data across different chains through IBC
* @name Packet
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Packet
*/
export declare const Packet: {
typeUrl: string;
aminoType: string;
is(o: any): o is Packet;
isAmino(o: any): o is PacketAmino;
encode(message: Packet, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Packet;
fromPartial(object: DeepPartial<Packet>): Packet;
fromAmino(object: PacketAmino): Packet;
toAmino(message: Packet): PacketAmino;
fromAminoMsg(object: PacketAminoMsg): Packet;
toAminoMsg(message: Packet): PacketAminoMsg;
fromProtoMsg(message: PacketProtoMsg): Packet;
toProto(message: Packet): Uint8Array;
toProtoMsg(message: Packet): PacketProtoMsg;
registerTypeUrl(): void;
};
/**
* PacketState defines the generic type necessary to retrieve and store
* packet commitments, acknowledgements, and receipts.
* Caller is responsible for knowing the context necessary to interpret this
* state as a commitment, acknowledgement, or a receipt.
* @name PacketState
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketState
*/
export declare const PacketState: {
typeUrl: string;
aminoType: string;
is(o: any): o is PacketState;
isAmino(o: any): o is PacketStateAmino;
encode(message: PacketState, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): PacketState;
fromPartial(object: DeepPartial<PacketState>): PacketState;
fromAmino(object: PacketStateAmino): PacketState;
toAmino(message: PacketState): PacketStateAmino;
fromAminoMsg(object: PacketStateAminoMsg): PacketState;
toAminoMsg(message: PacketState): PacketStateAminoMsg;
fromProtoMsg(message: PacketStateProtoMsg): PacketState;
toProto(message: PacketState): Uint8Array;
toProtoMsg(message: PacketState): PacketStateProtoMsg;
registerTypeUrl(): void;
};
/**
* PacketId is an identifier for a unique Packet
* Source chains refer to packets by source port/channel
* Destination chains refer to packets by destination port/channel
* @name PacketId
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.PacketId
*/
export declare const PacketId: {
typeUrl: string;
aminoType: string;
is(o: any): o is PacketId;
isAmino(o: any): o is PacketIdAmino;
encode(message: PacketId, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): PacketId;
fromPartial(object: DeepPartial<PacketId>): PacketId;
fromAmino(object: PacketIdAmino): PacketId;
toAmino(message: PacketId): PacketIdAmino;
fromAminoMsg(object: PacketIdAminoMsg): PacketId;
toAminoMsg(message: PacketId): PacketIdAminoMsg;
fromProtoMsg(message: PacketIdProtoMsg): PacketId;
toProto(message: PacketId): Uint8Array;
toProtoMsg(message: PacketId): PacketIdProtoMsg;
registerTypeUrl(): void;
};
/**
* Acknowledgement is the recommended acknowledgement format to be used by
* app-specific protocols.
* NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental
* conflicts with other protobuf message formats used for acknowledgements.
* The first byte of any message with this format will be the non-ASCII values
* `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS:
* https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope
* @name Acknowledgement
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Acknowledgement
*/
export declare const Acknowledgement: {
typeUrl: string;
aminoType: string;
is(o: any): o is Acknowledgement;
isAmino(o: any): o is AcknowledgementAmino;
encode(message: Acknowledgement, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement;
fromPartial(object: DeepPartial<Acknowledgement>): Acknowledgement;
fromAmino(object: AcknowledgementAmino): Acknowledgement;
toAmino(message: Acknowledgement): AcknowledgementAmino;
fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement;
toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg;
fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement;
toProto(message: Acknowledgement): Uint8Array;
toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg;
registerTypeUrl(): void;
};
/**
* Timeout defines an execution deadline structure for 04-channel handlers.
* This includes packet lifecycle handlers.
* A valid Timeout contains either one or both of a timestamp and block height (sequence).
* @name Timeout
* @package ibc.core.channel.v1
* @see proto type: ibc.core.channel.v1.Timeout
*/
export declare const Timeout: {
typeUrl: string;
aminoType: string;
is(o: any): o is Timeout;
isAmino(o: any): o is TimeoutAmino;
encode(message: Timeout, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Timeout;
fromPartial(object: DeepPartial<Timeout>): Timeout;
fromAmino(object: TimeoutAmino): Timeout;
toAmino(message: Timeout): TimeoutAmino;
fromAminoMsg(object: TimeoutAminoMsg): Timeout;
toAminoMsg(message: Timeout): TimeoutAminoMsg;
fromProtoMsg(message: TimeoutProtoMsg): Timeout;
toProto(message: Timeout): Uint8Array;
toProtoMsg(message: Timeout): TimeoutProtoMsg;
registerTypeUrl(): void;
};