Copy Contract and ContractCodeHistoryEntry

This commit is contained in:
Simon Warta 2021-07-22 11:37:37 +02:00
parent 77bd2e70a1
commit 7a9963d6e2

View File

@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { Contract, ContractCodeHistoryEntry } from "@cosmjs/cosmwasm-launchpad";
import { fromAscii, toHex } from "@cosmjs/encoding";
import { Uint53 } from "@cosmjs/math";
import {
@ -29,13 +28,6 @@ import { ContractCodeHistoryOperationType } from "cosmjs-types/cosmwasm/wasm/v1b
import { JsonObject, setupWasmExtension, WasmExtension } from "./queries";
// Those types can be copied over to allow them to evolve independently of @cosmjs/cosmwasm-launchpad.
// For now just re-export them such that they can be imported via @cosmjs/cosmwasm-stargate.
export {
Contract, // returned by CosmWasmClient.getContract
ContractCodeHistoryEntry, // returned by CosmWasmClient.getContractCodeHistory
};
// Re-exports that belong to public CosmWasmClient interfaces
export {
JsonObject, // returned by CosmWasmClient.queryContractSmart
@ -67,6 +59,23 @@ export interface CodeDetails extends Code {
readonly data: Uint8Array;
}
export interface Contract {
readonly address: string;
readonly codeId: number;
/** Bech32 account address */
readonly creator: string;
/** Bech32-encoded admin address */
readonly admin: string | undefined;
readonly label: string;
}
export interface ContractCodeHistoryEntry {
/** The source of this history entry */
readonly operation: "Genesis" | "Init" | "Migrate";
readonly codeId: number;
readonly msg: Record<string, unknown>;
}
/** Use for testing only */
export interface PrivateCosmWasmClient {
readonly tmClient: Tendermint34Client | undefined;