From 80be33b621e247bea8ffc5c6b9b76d8deafc04b9 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 3 Feb 2020 18:47:59 +0100 Subject: [PATCH] Fix types re-export --- packages/bcp/src/decode.ts | 4 ++-- packages/sdk/src/index.ts | 6 +++--- packages/sdk/types/index.d.ts | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/bcp/src/decode.ts b/packages/bcp/src/decode.ts index a1db9910..6fa4ead7 100644 --- a/packages/bcp/src/decode.ts +++ b/packages/bcp/src/decode.ts @@ -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) { diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/index.ts index 21c4f489..a38d5033 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/index.ts @@ -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 }; diff --git a/packages/sdk/types/index.d.ts b/packages/sdk/types/index.d.ts index e96d3116..13b0904b 100644 --- a/packages/sdk/types/index.d.ts +++ b/packages/sdk/types/index.d.ts @@ -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";