From 7a9963d6e26df4381ef88d9931649c1f53e48486 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 22 Jul 2021 11:37:37 +0200 Subject: [PATCH] Copy Contract and ContractCodeHistoryEntry --- .../cosmwasm-stargate/src/cosmwasmclient.ts | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.ts index 165dc9d3..c0529b86 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.ts @@ -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; +} + /** Use for testing only */ export interface PrivateCosmWasmClient { readonly tmClient: Tendermint34Client | undefined;