Merge pull request #333 from CosmWasm/rm-SigningCallback

Cleanup some types
This commit is contained in:
Ethan Frey 2020-08-03 14:51:47 +02:00 committed by GitHub
commit 5cf59a4380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 18 additions and 38 deletions

View File

@ -13,6 +13,8 @@
- @cosmjs/cosmwasm: `ContractDetails` was removed in favour of just `Contract`. - @cosmjs/cosmwasm: `ContractDetails` was removed in favour of just `Contract`.
The missing `init_msg` is now available via the contract's code history (see The missing `init_msg` is now available via the contract's code history (see
`getContractCodeHistory`). `getContractCodeHistory`).
- @cosmjs/cosmwasm: Remove `SigningCallback` in favour of the `OfflineSigner`
interface.
- @cosmjs/sdk38: Rename `CosmosClient.getNonce` method to `.getSequence`. - @cosmjs/sdk38: Rename `CosmosClient.getNonce` method to `.getSequence`.
- @cosmjs/sdk38: Remove `RestClient` class in favour of new modular `LcdClient` - @cosmjs/sdk38: Remove `RestClient` class in favour of new modular `LcdClient`
class. class.
@ -37,3 +39,6 @@
words. words.
- @cosmjs/sdk38: The new `Secp256k1Wallet.serialize` and `.deserialize` allow - @cosmjs/sdk38: The new `Secp256k1Wallet.serialize` and `.deserialize` allow
encrypted serialization of the wallet. 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.

View File

@ -52,7 +52,6 @@ export function main(originalArgs: readonly string[]): void {
"ExecuteResult", "ExecuteResult",
"FeeTable", "FeeTable",
"InstantiateResult", "InstantiateResult",
"SigningCallback",
"SigningCosmWasmClient", "SigningCosmWasmClient",
"UploadMeta", "UploadMeta",
"UploadResult", "UploadResult",

View File

@ -25,7 +25,6 @@ export {
InstantiateOptions, InstantiateOptions,
InstantiateResult, InstantiateResult,
MigrateResult, MigrateResult,
SigningCallback,
SigningCosmWasmClient, SigningCosmWasmClient,
UploadMeta, UploadMeta,
UploadResult, UploadResult,

View File

@ -13,7 +13,6 @@ import {
PostTxFailure, PostTxFailure,
PostTxResult, PostTxResult,
StdFee, StdFee,
StdSignature,
StdTx, StdTx,
} from "@cosmjs/launchpad"; } from "@cosmjs/launchpad";
import { Uint53 } from "@cosmjs/math"; import { Uint53 } from "@cosmjs/math";
@ -31,10 +30,9 @@ import {
MsgUpdateAdmin, MsgUpdateAdmin,
} from "./msgs"; } from "./msgs";
export interface SigningCallback { /**
(signBytes: Uint8Array): Promise<StdSignature>; * Those fees are used by the higher level methods of SigningCosmWasmClient
} */
export interface FeeTable { export interface FeeTable {
readonly upload: StdFee; readonly upload: StdFee;
readonly init: StdFee; readonly init: StdFee;

View File

@ -24,7 +24,6 @@ export {
InstantiateOptions, InstantiateOptions,
InstantiateResult, InstantiateResult,
MigrateResult, MigrateResult,
SigningCallback,
SigningCosmWasmClient, SigningCosmWasmClient,
UploadMeta, UploadMeta,
UploadResult, UploadResult,

View File

@ -1,17 +1,9 @@
import { import { BroadcastMode, Coin, Msg, OfflineSigner, PostTxResult, StdFee } from "@cosmjs/launchpad";
BroadcastMode,
Coin,
Msg,
OfflineSigner,
PostTxResult,
StdFee,
StdSignature,
} from "@cosmjs/launchpad";
import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient"; import { Account, CosmWasmClient, GetSequenceResult } from "./cosmwasmclient";
import { Log } from "./logs"; import { Log } from "./logs";
export interface SigningCallback { /**
(signBytes: Uint8Array): Promise<StdSignature>; * Those fees are used by the higher level methods of SigningCosmWasmClient
} */
export interface FeeTable { export interface FeeTable {
readonly upload: StdFee; readonly upload: StdFee;
readonly init: StdFee; readonly init: StdFee;

View File

@ -7,26 +7,14 @@ import { Msg, MsgSend } from "./msgs";
import { StdFee, StdTx } from "./types"; import { StdFee, StdTx } from "./types";
import { OfflineSigner } from "./wallet"; import { OfflineSigner } from "./wallet";
/**
* Those fees are used by the higher level methods of SigningCosmosClient
*/
export interface FeeTable { export interface FeeTable {
readonly upload: StdFee;
readonly init: StdFee;
readonly exec: StdFee;
readonly send: StdFee; readonly send: StdFee;
} }
const defaultFees: FeeTable = { 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: { send: {
amount: coins(2000, "ucosm"), amount: coins(2000, "ucosm"),
gas: "80000", // 80k gas: "80000", // 80k

View File

@ -4,10 +4,10 @@ import { BroadcastMode } from "./lcdapi";
import { Msg } from "./msgs"; import { Msg } from "./msgs";
import { StdFee } from "./types"; import { StdFee } from "./types";
import { OfflineSigner } from "./wallet"; import { OfflineSigner } from "./wallet";
/**
* Those fees are used by the higher level methods of SigningCosmosClient
*/
export interface FeeTable { export interface FeeTable {
readonly upload: StdFee;
readonly init: StdFee;
readonly exec: StdFee;
readonly send: StdFee; readonly send: StdFee;
} }
export declare class SigningCosmosClient extends CosmosClient { export declare class SigningCosmosClient extends CosmosClient {