diff --git a/examples/interchainjs/src/codegen/helpers.ts b/examples/interchainjs/src/codegen/helpers.ts index 16bc1def..4d6e84aa 100644 --- a/examples/interchainjs/src/codegen/helpers.ts +++ b/examples/interchainjs/src/codegen/helpers.ts @@ -5,9 +5,6 @@ */ import { BinaryReader, BinaryWriter } from "./binary"; -import { StdFee, DeliverTxResponse } from '@interchainjs/cosmos-types/types'; -import { AminoConverter, Encoder, Message } from '@interchainjs/cosmos/types/signer'; - declare var self: any | undefined; declare var window: any | undefined; @@ -335,4 +332,86 @@ export function buildTx(opts: TxBuilderOptions) { ]; return client.signAndBroadcast!(signerAddress, data, fee, memo); }; +} + +export interface Coin { + denom: string; + amount: string; +} + +export interface StdFee { + amount: Coin[]; + gas: string; + /** The granter address that is used for paying with feegrants */ + granter?: string; + /** The fee payer address. The payer must have signed the transaction. */ + payer?: string; +} + +/** + * The response after successfully broadcasting a transaction. + * Success or failure refer to the execution result. + */ +export interface DeliverTxResponse { + height: number; + /** The position of the transaction within the block. This is a 0-based index. */ + txIndex: number; + /** Error code. The transaction suceeded if and only if code is 0. */ + code: number; + transactionHash: string; + events: Event[]; + /** + * A string-based log document. + * + * This currently seems to merge attributes of multiple events into one event per type + * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events` + * field instead. + */ + rawLog?: string; + /** @deprecated Use `msgResponses` instead. */ + data?: MsgData[]; + /** + * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140) + * as `Any`s. + * This field is an empty list for chains running Cosmos SDK < 0.46. + */ + msgResponses: Array<{ + typeUrl: string; + value: Uint8Array; + }>; + gasUsed: bigint; + gasWanted: bigint; +} + +export interface MsgData { + msgType: string; + data: Uint8Array; +} + +export interface Attribute { + key: string; + value: string; + index: boolean; +} +export interface Event { + type: string; + attributes: Attribute[]; +} + +export interface Message { + typeUrl: string; + value: T; +} + +export interface Encoder { + typeUrl: string; + fromPartial: (data: any) => any; + encode: (data: any) => Uint8Array; +} + +export interface AminoConverter { + typeUrl: string; + aminoType: string; + fromAmino: (data: any) => any; + toAmino: (data: any) => any; } \ No newline at end of file