From 929e79bc7f9dd0eabd7ddc81c8d7c4512e841b32 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 3 Aug 2020 07:33:10 +0200 Subject: [PATCH 1/4] Remove SigningCallback from @cosmjs/cosmwasm --- CHANGELOG.md | 2 ++ packages/cli/src/cli.ts | 1 - packages/cosmwasm/src/index.ts | 1 - packages/cosmwasm/src/signingcosmwasmclient.ts | 5 ----- packages/cosmwasm/types/index.d.ts | 1 - packages/cosmwasm/types/signingcosmwasmclient.d.ts | 13 +------------ 6 files changed, 3 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f054fab157..9b22eeb19f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ - @cosmjs/cosmwasm: `ContractDetails` was removed in favour of just `Contract`. The missing `init_msg` is now available via the contract's code history (see `getContractCodeHistory`). +- @cosmjs/cosmwasm: Remove `SigningCallback` in favour of the `OfflineSigner` + interface. - @cosmjs/sdk38: Rename `CosmosClient.getNonce` method to `.getSequence`. - @cosmjs/sdk38: Remove `RestClient` class in favour of new modular `LcdClient` class. diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index a19172c828..1bee333e8f 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -52,7 +52,6 @@ export function main(originalArgs: readonly string[]): void { "ExecuteResult", "FeeTable", "InstantiateResult", - "SigningCallback", "SigningCosmWasmClient", "UploadMeta", "UploadResult", diff --git a/packages/cosmwasm/src/index.ts b/packages/cosmwasm/src/index.ts index 9b946c6022..52a495d913 100644 --- a/packages/cosmwasm/src/index.ts +++ b/packages/cosmwasm/src/index.ts @@ -25,7 +25,6 @@ export { InstantiateOptions, InstantiateResult, MigrateResult, - SigningCallback, SigningCosmWasmClient, UploadMeta, UploadResult, diff --git a/packages/cosmwasm/src/signingcosmwasmclient.ts b/packages/cosmwasm/src/signingcosmwasmclient.ts index 4d3d978110..a97f8739cb 100644 --- a/packages/cosmwasm/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm/src/signingcosmwasmclient.ts @@ -13,7 +13,6 @@ import { PostTxFailure, PostTxResult, StdFee, - StdSignature, StdTx, } from "@cosmjs/launchpad"; import { Uint53 } from "@cosmjs/math"; @@ -31,10 +30,6 @@ import { MsgUpdateAdmin, } from "./msgs"; -export interface SigningCallback { - (signBytes: Uint8Array): Promise; -} - export interface FeeTable { readonly upload: StdFee; readonly init: StdFee; diff --git a/packages/cosmwasm/types/index.d.ts b/packages/cosmwasm/types/index.d.ts index 9b83854477..1b875e29fc 100644 --- a/packages/cosmwasm/types/index.d.ts +++ b/packages/cosmwasm/types/index.d.ts @@ -24,7 +24,6 @@ export { InstantiateOptions, InstantiateResult, MigrateResult, - SigningCallback, SigningCosmWasmClient, UploadMeta, UploadResult, diff --git a/packages/cosmwasm/types/signingcosmwasmclient.d.ts b/packages/cosmwasm/types/signingcosmwasmclient.d.ts index d7408acd0e..6c414c039a 100644 --- a/packages/cosmwasm/types/signingcosmwasmclient.d.ts +++ b/packages/cosmwasm/types/signingcosmwasmclient.d.ts @@ -1,17 +1,6 @@ -import { - BroadcastMode, - Coin, - Msg, - OfflineSigner, - PostTxResult, - StdFee, - StdSignature, -} from "@cosmjs/launchpad"; +import { BroadcastMode, Coin, Msg, OfflineSigner, PostTxResult, StdFee } from "@cosmjs/launchpad"; import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient"; import { Log } from "./logs"; -export interface SigningCallback { - (signBytes: Uint8Array): Promise; -} export interface FeeTable { readonly upload: StdFee; readonly init: StdFee; From 4e5a25c6251a477e64a68718dac6dae3e3b2affb Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 3 Aug 2020 07:59:27 +0200 Subject: [PATCH 2/4] Remove obsolete properties from FeeTable --- CHANGELOG.md | 2 ++ packages/launchpad/src/signingcosmosclient.ts | 18 +++--------------- .../launchpad/types/signingcosmosclient.d.ts | 6 +++--- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b22eeb19f..e30637d855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,3 +39,5 @@ words. - @cosmjs/sdk38: The new `Secp256k1Wallet.serialize` and `.deserialize` allow encrypted serialization of the wallet. +- @cosmjs/sdk38: Remove the obsolete `upload`, `init`, `exec` properties from + `FeeTable`. @cosmjs/cosmwasm has its own `FeeTable` with those properties. diff --git a/packages/launchpad/src/signingcosmosclient.ts b/packages/launchpad/src/signingcosmosclient.ts index d901425a65..cd9eb6d864 100644 --- a/packages/launchpad/src/signingcosmosclient.ts +++ b/packages/launchpad/src/signingcosmosclient.ts @@ -7,26 +7,14 @@ import { Msg, MsgSend } from "./msgs"; import { StdFee, StdTx } from "./types"; import { OfflineSigner } from "./wallet"; +/** + * Those fees are used by the higher level methods of SigningCosmosClient + */ export interface FeeTable { - readonly upload: StdFee; - readonly init: StdFee; - readonly exec: StdFee; readonly send: StdFee; } const defaultFees: FeeTable = { - upload: { - amount: coins(25000, "ucosm"), - gas: "1000000", // one million - }, - init: { - amount: coins(12500, "ucosm"), - gas: "500000", // 500k - }, - exec: { - amount: coins(5000, "ucosm"), - gas: "200000", // 200k - }, send: { amount: coins(2000, "ucosm"), gas: "80000", // 80k diff --git a/packages/launchpad/types/signingcosmosclient.d.ts b/packages/launchpad/types/signingcosmosclient.d.ts index d99470750a..7add9e989c 100644 --- a/packages/launchpad/types/signingcosmosclient.d.ts +++ b/packages/launchpad/types/signingcosmosclient.d.ts @@ -4,10 +4,10 @@ import { BroadcastMode } from "./lcdapi"; import { Msg } from "./msgs"; import { StdFee } from "./types"; import { OfflineSigner } from "./wallet"; +/** + * Those fees are used by the higher level methods of SigningCosmosClient + */ export interface FeeTable { - readonly upload: StdFee; - readonly init: StdFee; - readonly exec: StdFee; readonly send: StdFee; } export declare class SigningCosmosClient extends CosmosClient { From aaeb7983de8c69589eaaee6141d9f814b734ae5d Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 3 Aug 2020 08:00:05 +0200 Subject: [PATCH 3/4] Document whatFeeTable from @cosmjs/cosmwasm is for --- packages/cosmwasm/src/signingcosmwasmclient.ts | 3 +++ packages/cosmwasm/types/signingcosmwasmclient.d.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/cosmwasm/src/signingcosmwasmclient.ts b/packages/cosmwasm/src/signingcosmwasmclient.ts index a97f8739cb..febecbba1b 100644 --- a/packages/cosmwasm/src/signingcosmwasmclient.ts +++ b/packages/cosmwasm/src/signingcosmwasmclient.ts @@ -30,6 +30,9 @@ import { MsgUpdateAdmin, } from "./msgs"; +/** + * Those fees are used by the higher level methods of SigningCosmWasmClient + */ export interface FeeTable { readonly upload: StdFee; readonly init: StdFee; diff --git a/packages/cosmwasm/types/signingcosmwasmclient.d.ts b/packages/cosmwasm/types/signingcosmwasmclient.d.ts index 6c414c039a..c42c7ff4e1 100644 --- a/packages/cosmwasm/types/signingcosmwasmclient.d.ts +++ b/packages/cosmwasm/types/signingcosmwasmclient.d.ts @@ -1,6 +1,9 @@ import { BroadcastMode, Coin, Msg, OfflineSigner, PostTxResult, StdFee } from "@cosmjs/launchpad"; import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient"; import { Log } from "./logs"; +/** + * Those fees are used by the higher level methods of SigningCosmWasmClient + */ export interface FeeTable { readonly upload: StdFee; readonly init: StdFee; From 34548ffb65d948829c9c7b9932050f948479e368 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 3 Aug 2020 08:00:16 +0200 Subject: [PATCH 4/4] Add missing package rename to CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e30637d855..b4ceaf4ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,3 +41,4 @@ encrypted serialization of the wallet. - @cosmjs/sdk38: Remove the obsolete `upload`, `init`, `exec` properties from `FeeTable`. @cosmjs/cosmwasm has its own `FeeTable` with those properties. +- @cosmjs/sdk38: Rename package to @cosmjs/launchpad.