interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
426 lines (425 loc) • 16 kB
TypeScript
import { Duration, DurationAmino } from "../../../../google/protobuf/duration";
import { Height, HeightAmino } from "../../../core/client/v1/client";
import { ProofSpec, ProofSpecAmino } from "../../../../cosmos/ics23/v1/proofs";
import { MerkleRoot, MerkleRootAmino } from "../../../core/commitment/v1/commitment";
import { SignedHeader, SignedHeaderAmino } from "../../../../tendermint/types/types";
import { ValidatorSet, ValidatorSetAmino } from "../../../../tendermint/types/validator";
import { BinaryReader, BinaryWriter } from "../../../../binary";
import { DeepPartial } from "../../../../helpers";
/**
* ClientState from Tendermint tracks the current validator set, latest height,
* and a possible frozen height.
* @name ClientState
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ClientState
*/
export interface ClientState {
chainId: string;
trustLevel: Fraction;
/**
* duration of the period since the LatestTimestamp during which the
* submitted headers are valid for upgrade
*/
trustingPeriod: Duration;
/**
* duration of the staking unbonding period
*/
unbondingPeriod: Duration;
/**
* defines how much new (untrusted) header's Time can drift into the future.
*/
maxClockDrift: Duration;
/**
* Block height when the client was frozen due to a misbehaviour
*/
frozenHeight: Height;
/**
* Latest height the client was updated to
*/
latestHeight: Height;
/**
* Proof specifications used in verifying counterparty state
*/
proofSpecs: ProofSpec[];
/**
* Path at which next upgraded client will be committed.
* Each element corresponds to the key for a single CommitmentProof in the
* chained proof. NOTE: ClientState must stored under
* `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
* under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
* the default upgrade module, upgrade_path should be []string{"upgrade",
* "upgradedIBCState"}`
*/
upgradePath: string[];
/**
* allow_update_after_expiry is deprecated
* @deprecated
*/
allowUpdateAfterExpiry: boolean;
/**
* allow_update_after_misbehaviour is deprecated
* @deprecated
*/
allowUpdateAfterMisbehaviour: boolean;
}
export interface ClientStateProtoMsg {
typeUrl: "/ibc.lightclients.tendermint.v1.ClientState";
value: Uint8Array;
}
/**
* ClientState from Tendermint tracks the current validator set, latest height,
* and a possible frozen height.
* @name ClientStateAmino
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ClientState
*/
export interface ClientStateAmino {
chain_id: string;
trust_level: FractionAmino;
/**
* duration of the period since the LatestTimestamp during which the
* submitted headers are valid for upgrade
*/
trusting_period: DurationAmino;
/**
* duration of the staking unbonding period
*/
unbonding_period: DurationAmino;
/**
* defines how much new (untrusted) header's Time can drift into the future.
*/
max_clock_drift: DurationAmino;
/**
* Block height when the client was frozen due to a misbehaviour
*/
frozen_height: HeightAmino;
/**
* Latest height the client was updated to
*/
latest_height: HeightAmino;
/**
* Proof specifications used in verifying counterparty state
*/
proof_specs: ProofSpecAmino[];
/**
* Path at which next upgraded client will be committed.
* Each element corresponds to the key for a single CommitmentProof in the
* chained proof. NOTE: ClientState must stored under
* `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored
* under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using
* the default upgrade module, upgrade_path should be []string{"upgrade",
* "upgradedIBCState"}`
*/
upgrade_path: string[];
/**
* allow_update_after_expiry is deprecated
* @deprecated
*/
allow_update_after_expiry: boolean;
/**
* allow_update_after_misbehaviour is deprecated
* @deprecated
*/
allow_update_after_misbehaviour: boolean;
}
export interface ClientStateAminoMsg {
type: "cosmos-sdk/ClientState";
value: ClientStateAmino;
}
/**
* ConsensusState defines the consensus state from Tendermint.
* @name ConsensusState
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ConsensusState
*/
export interface ConsensusState {
/**
* timestamp that corresponds to the block height in which the ConsensusState
* was stored.
*/
timestamp: Date;
/**
* commitment root (i.e app hash)
*/
root: MerkleRoot;
nextValidatorsHash: Uint8Array;
}
export interface ConsensusStateProtoMsg {
typeUrl: "/ibc.lightclients.tendermint.v1.ConsensusState";
value: Uint8Array;
}
/**
* ConsensusState defines the consensus state from Tendermint.
* @name ConsensusStateAmino
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ConsensusState
*/
export interface ConsensusStateAmino {
/**
* timestamp that corresponds to the block height in which the ConsensusState
* was stored.
*/
timestamp: string;
/**
* commitment root (i.e app hash)
*/
root: MerkleRootAmino;
next_validators_hash: string;
}
export interface ConsensusStateAminoMsg {
type: "cosmos-sdk/ConsensusState";
value: ConsensusStateAmino;
}
/**
* Misbehaviour is a wrapper over two conflicting Headers
* that implements Misbehaviour interface expected by ICS-02
* @name Misbehaviour
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Misbehaviour
*/
export interface Misbehaviour {
/**
* ClientID is deprecated
* @deprecated
*/
clientId: string;
header1?: Header;
header2?: Header;
}
export interface MisbehaviourProtoMsg {
typeUrl: "/ibc.lightclients.tendermint.v1.Misbehaviour";
value: Uint8Array;
}
/**
* Misbehaviour is a wrapper over two conflicting Headers
* that implements Misbehaviour interface expected by ICS-02
* @name MisbehaviourAmino
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Misbehaviour
*/
export interface MisbehaviourAmino {
/**
* ClientID is deprecated
* @deprecated
*/
client_id: string;
header_1?: HeaderAmino;
header_2?: HeaderAmino;
}
export interface MisbehaviourAminoMsg {
type: "cosmos-sdk/Misbehaviour";
value: MisbehaviourAmino;
}
/**
* Header defines the Tendermint client consensus Header.
* It encapsulates all the information necessary to update from a trusted
* Tendermint ConsensusState. The inclusion of TrustedHeight and
* TrustedValidators allows this update to process correctly, so long as the
* ConsensusState for the TrustedHeight exists, this removes race conditions
* among relayers The SignedHeader and ValidatorSet are the new untrusted update
* fields for the client. The TrustedHeight is the height of a stored
* ConsensusState on the client that will be used to verify the new untrusted
* header. The Trusted ConsensusState must be within the unbonding period of
* current time in order to correctly verify, and the TrustedValidators must
* hash to TrustedConsensusState.NextValidatorsHash since that is the last
* trusted validator set at the TrustedHeight.
* @name Header
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Header
*/
export interface Header {
signedHeader?: SignedHeader;
validatorSet?: ValidatorSet;
trustedHeight: Height;
trustedValidators?: ValidatorSet;
}
export interface HeaderProtoMsg {
typeUrl: "/ibc.lightclients.tendermint.v1.Header";
value: Uint8Array;
}
/**
* Header defines the Tendermint client consensus Header.
* It encapsulates all the information necessary to update from a trusted
* Tendermint ConsensusState. The inclusion of TrustedHeight and
* TrustedValidators allows this update to process correctly, so long as the
* ConsensusState for the TrustedHeight exists, this removes race conditions
* among relayers The SignedHeader and ValidatorSet are the new untrusted update
* fields for the client. The TrustedHeight is the height of a stored
* ConsensusState on the client that will be used to verify the new untrusted
* header. The Trusted ConsensusState must be within the unbonding period of
* current time in order to correctly verify, and the TrustedValidators must
* hash to TrustedConsensusState.NextValidatorsHash since that is the last
* trusted validator set at the TrustedHeight.
* @name HeaderAmino
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Header
*/
export interface HeaderAmino {
signed_header?: SignedHeaderAmino;
validator_set?: ValidatorSetAmino;
trusted_height: HeightAmino;
trusted_validators?: ValidatorSetAmino;
}
export interface HeaderAminoMsg {
type: "cosmos-sdk/Header";
value: HeaderAmino;
}
/**
* Fraction defines the protobuf message type for tmmath.Fraction that only
* supports positive values.
* @name Fraction
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Fraction
*/
export interface Fraction {
numerator: bigint;
denominator: bigint;
}
export interface FractionProtoMsg {
typeUrl: "/ibc.lightclients.tendermint.v1.Fraction";
value: Uint8Array;
}
/**
* Fraction defines the protobuf message type for tmmath.Fraction that only
* supports positive values.
* @name FractionAmino
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Fraction
*/
export interface FractionAmino {
numerator: string;
denominator: string;
}
export interface FractionAminoMsg {
type: "cosmos-sdk/Fraction";
value: FractionAmino;
}
/**
* ClientState from Tendermint tracks the current validator set, latest height,
* and a possible frozen height.
* @name ClientState
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ClientState
*/
export declare const ClientState: {
typeUrl: string;
aminoType: string;
is(o: any): o is ClientState;
isAmino(o: any): o is ClientStateAmino;
encode(message: ClientState, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): ClientState;
fromPartial(object: DeepPartial<ClientState>): ClientState;
fromAmino(object: ClientStateAmino): ClientState;
toAmino(message: ClientState): ClientStateAmino;
fromAminoMsg(object: ClientStateAminoMsg): ClientState;
toAminoMsg(message: ClientState): ClientStateAminoMsg;
fromProtoMsg(message: ClientStateProtoMsg): ClientState;
toProto(message: ClientState): Uint8Array;
toProtoMsg(message: ClientState): ClientStateProtoMsg;
registerTypeUrl(): void;
};
/**
* ConsensusState defines the consensus state from Tendermint.
* @name ConsensusState
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.ConsensusState
*/
export declare const ConsensusState: {
typeUrl: string;
aminoType: string;
is(o: any): o is ConsensusState;
isAmino(o: any): o is ConsensusStateAmino;
encode(message: ConsensusState, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState;
fromPartial(object: DeepPartial<ConsensusState>): ConsensusState;
fromAmino(object: ConsensusStateAmino): ConsensusState;
toAmino(message: ConsensusState): ConsensusStateAmino;
fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState;
toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg;
fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState;
toProto(message: ConsensusState): Uint8Array;
toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg;
registerTypeUrl(): void;
};
/**
* Misbehaviour is a wrapper over two conflicting Headers
* that implements Misbehaviour interface expected by ICS-02
* @name Misbehaviour
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Misbehaviour
*/
export declare const Misbehaviour: {
typeUrl: string;
aminoType: string;
is(o: any): o is Misbehaviour;
isAmino(o: any): o is MisbehaviourAmino;
encode(message: Misbehaviour, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour;
fromPartial(object: DeepPartial<Misbehaviour>): Misbehaviour;
fromAmino(object: MisbehaviourAmino): Misbehaviour;
toAmino(message: Misbehaviour): MisbehaviourAmino;
fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour;
toAminoMsg(message: Misbehaviour): MisbehaviourAminoMsg;
fromProtoMsg(message: MisbehaviourProtoMsg): Misbehaviour;
toProto(message: Misbehaviour): Uint8Array;
toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg;
registerTypeUrl(): void;
};
/**
* Header defines the Tendermint client consensus Header.
* It encapsulates all the information necessary to update from a trusted
* Tendermint ConsensusState. The inclusion of TrustedHeight and
* TrustedValidators allows this update to process correctly, so long as the
* ConsensusState for the TrustedHeight exists, this removes race conditions
* among relayers The SignedHeader and ValidatorSet are the new untrusted update
* fields for the client. The TrustedHeight is the height of a stored
* ConsensusState on the client that will be used to verify the new untrusted
* header. The Trusted ConsensusState must be within the unbonding period of
* current time in order to correctly verify, and the TrustedValidators must
* hash to TrustedConsensusState.NextValidatorsHash since that is the last
* trusted validator set at the TrustedHeight.
* @name Header
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Header
*/
export declare const Header: {
typeUrl: string;
aminoType: string;
is(o: any): o is Header;
isAmino(o: any): o is HeaderAmino;
encode(message: Header, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Header;
fromPartial(object: DeepPartial<Header>): Header;
fromAmino(object: HeaderAmino): Header;
toAmino(message: Header): HeaderAmino;
fromAminoMsg(object: HeaderAminoMsg): Header;
toAminoMsg(message: Header): HeaderAminoMsg;
fromProtoMsg(message: HeaderProtoMsg): Header;
toProto(message: Header): Uint8Array;
toProtoMsg(message: Header): HeaderProtoMsg;
registerTypeUrl(): void;
};
/**
* Fraction defines the protobuf message type for tmmath.Fraction that only
* supports positive values.
* @name Fraction
* @package ibc.lightclients.tendermint.v1
* @see proto type: ibc.lightclients.tendermint.v1.Fraction
*/
export declare const Fraction: {
typeUrl: string;
aminoType: string;
is(o: any): o is Fraction;
isAmino(o: any): o is FractionAmino;
encode(message: Fraction, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Fraction;
fromPartial(object: DeepPartial<Fraction>): Fraction;
fromAmino(object: FractionAmino): Fraction;
toAmino(message: Fraction): FractionAmino;
fromAminoMsg(object: FractionAminoMsg): Fraction;
toAminoMsg(message: Fraction): FractionAminoMsg;
fromProtoMsg(message: FractionProtoMsg): Fraction;
toProto(message: Fraction): Uint8Array;
toProtoMsg(message: Fraction): FractionProtoMsg;
registerTypeUrl(): void;
};