Fix types re-export

This commit is contained in:
Ethan Frey 2020-02-03 18:47:59 +01:00
parent 1491b13e83
commit 80be33b621
3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { coinToDecimal, isAminoStdTx, TxsResponse, types } from "@cosmwasm/sdk";
import { coinToDecimal, TxsResponse, types } from "@cosmwasm/sdk";
import {
Address,
Algorithm,
@ -95,7 +95,7 @@ export function parseFee(fee: types.StdFee, tokens: TokenInfos): Fee {
export function parseTx(tx: types.Tx, chainId: ChainId, nonce: Nonce, tokens: TokenInfos): SignedTransaction {
const txValue = tx.value;
if (!isAminoStdTx(txValue)) {
if (!types.isAminoStdTx(txValue)) {
throw new Error("Only Amino StdTx is supported");
}
if (txValue.msg.length !== 1) {

View File

@ -1,6 +1,6 @@
export { coinToDecimal } from "./decoding";
export { decimalToCoin } from "./encoding";
export { RestClient, TxsResponse } from "./restclient";
// types.X are all the types we re-export
// Note: this doesn't work for functions, just typescript types, so we must explicitly re-export functions
export { default as types, isAminoStdTx } from "./types";
import * as types from "./types";
export { types };

View File

@ -1,4 +1,6 @@
export { coinToDecimal } from "./decoding";
export { decimalToCoin } from "./encoding";
export { RestClient, TxsResponse } from "./restclient";
export { default as types, isAminoStdTx } from "./types";
import * as types from "./types";
export { types };
export { isAminoStdTx } from "./types";