From 51f429bb46bcdff95039101841ebeaf7f285500d Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 6 May 2021 11:44:03 +0200 Subject: [PATCH 1/2] Export CosmWasmClient types --- CHANGELOG.md | 6 ++++++ packages/cosmwasm-stargate/src/cosmwasmclient.ts | 10 ++++++++++ packages/cosmwasm-stargate/src/index.ts | 9 ++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 206c706b..d9a063d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to ## [Unreleased] +### Added + +- @cosmjs/cosmwasm-stargate: Export types `Code`, `CodeDetails`, `Contract`, + `ContractCodeHistoryEntry` and `JsonObject` which are response types of + `CosmWasmClient` methods. + ### Fixed - @cosmjs/cosmwasm-stargate: Use `CosmWasmFeeTable` instead of `CosmosFeeTable` diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.ts index a94cde6f..33f71156 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.ts @@ -35,6 +35,16 @@ import { CodeInfoResponse } from "./codec/cosmwasm/wasm/v1beta1/query"; import { ContractCodeHistoryOperationType } from "./codec/cosmwasm/wasm/v1beta1/types"; import { 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 { + Code, // returned by CosmWasmClient.getCode + CodeDetails, // returned by CosmWasmClient.getCodeDetails + Contract, // returned by CosmWasmClient.getContract + ContractCodeHistoryEntry, // returned by CosmWasmClient.getContractCodeHistory + JsonObject, // returned by CosmWasmClient.queryContractSmart +}; + /** Use for testing only */ export interface PrivateCosmWasmClient { readonly tmClient: Tendermint34Client | undefined; diff --git a/packages/cosmwasm-stargate/src/index.ts b/packages/cosmwasm-stargate/src/index.ts index 3e60a6ba..c3c65869 100644 --- a/packages/cosmwasm-stargate/src/index.ts +++ b/packages/cosmwasm-stargate/src/index.ts @@ -1,5 +1,12 @@ export { cosmWasmTypes } from "./aminotypes"; -export { CosmWasmClient } from "./cosmwasmclient"; +export { + Code, + CodeDetails, + Contract, + ContractCodeHistoryEntry, + CosmWasmClient, + JsonObject, +} from "./cosmwasmclient"; export { isMsgClearAdminEncodeObject, isMsgExecuteEncodeObject, From 6ef9912d892c694a1c31566c499f14cf8ea67fc0 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 6 May 2021 11:45:17 +0200 Subject: [PATCH 2/2] Export types of SigningCosmWasmClient --- CHANGELOG.md | 5 ++++- packages/cosmwasm-stargate/src/index.ts | 7 +++++++ .../cosmwasm-stargate/src/signingcosmwasmclient.ts | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a063d1..875719fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,10 @@ and this project adheres to - @cosmjs/cosmwasm-stargate: Export types `Code`, `CodeDetails`, `Contract`, `ContractCodeHistoryEntry` and `JsonObject` which are response types of - `CosmWasmClient` methods. + `CosmWasmClient` methods. Export types `ChangeAdminResult`, `ExecuteResult`, + `InstantiateOptions`, `InstantiateResult`, `MigrateResult`, `UploadMeta` and + `UploadResult` which are argument or response types of `SigningCosmWasmClient` + methods. ### Fixed diff --git a/packages/cosmwasm-stargate/src/index.ts b/packages/cosmwasm-stargate/src/index.ts index c3c65869..c48f6a81 100644 --- a/packages/cosmwasm-stargate/src/index.ts +++ b/packages/cosmwasm-stargate/src/index.ts @@ -23,7 +23,14 @@ export { } from "./encodeobjects"; export { defaultGasLimits, + ChangeAdminResult, CosmWasmFeeTable, // part of SigningCosmWasmClientOptions + ExecuteResult, + InstantiateOptions, + InstantiateResult, + MigrateResult, SigningCosmWasmClient, SigningCosmWasmClientOptions, + UploadMeta, + UploadResult, } from "./signingcosmwasmclient"; diff --git a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts index 51319870..e1025909 100644 --- a/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/signingcosmwasmclient.ts @@ -72,6 +72,18 @@ import { MsgUpdateAdminEncodeObject, } from "./encodeobjects"; +// 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 { + ChangeAdminResult, // returned by SigningCosmWasmClient.updateAdmin/SigningCosmWasmClient.clearAdmin + ExecuteResult, // returned by SigningCosmWasmClient.execute + InstantiateOptions, // argument type of SigningCosmWasmClient.instantiate + InstantiateResult, // returned by SigningCosmWasmClient.instantiate + MigrateResult, // returned by SigningCosmWasmClient.migrate + UploadMeta, // argument type of SigningCosmWasmClient.upload + UploadResult, // returned by SigningCosmWasmClient.upload +}; + /** * These fees are used by the higher level methods of SigningCosmWasmClient */