diff --git a/packages/cosmwasm/src/cw1subkeycosmwasmclient.ts b/packages/cosmwasm/src/cw1subkeycosmwasmclient.ts index a9a45297..8f55228b 100644 --- a/packages/cosmwasm/src/cw1subkeycosmwasmclient.ts +++ b/packages/cosmwasm/src/cw1subkeycosmwasmclient.ts @@ -2,8 +2,8 @@ import { Coin } from "@cosmjs/launchpad"; import { Cw1CosmWasmClient } from "./cw1cosmwasmclient"; +import { Expiration } from "./interfaces"; import { ExecuteResult } from "./signingcosmwasmclient"; -import { Expiration } from "./types"; export interface AllowanceResult { readonly balance: readonly Coin[]; diff --git a/packages/cosmwasm/src/cw3cosmwasmclient.ts b/packages/cosmwasm/src/cw3cosmwasmclient.ts index 15f74941..6603bc7c 100644 --- a/packages/cosmwasm/src/cw3cosmwasmclient.ts +++ b/packages/cosmwasm/src/cw3cosmwasmclient.ts @@ -3,8 +3,8 @@ import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launc import { CosmosMsg } from "./cosmosmsg"; import { Account } from "./cosmwasmclient"; +import { Expiration } from "./interfaces"; import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient"; -import { Expiration } from "./types"; export enum Vote { Yes = "yes", diff --git a/packages/cosmwasm/src/index.ts b/packages/cosmwasm/src/index.ts index a9151c7d..692d9bbc 100644 --- a/packages/cosmwasm/src/index.ts +++ b/packages/cosmwasm/src/index.ts @@ -1,4 +1,6 @@ +export { Expiration } from "./interfaces"; export { setupWasmExtension, WasmExtension } from "./lcdapi/wasm"; + export { BankMsg, CosmosMsg, CustomMsg, StakingMsg, WasmMsg } from "./cosmosmsg"; export { Account, @@ -53,4 +55,3 @@ export { MsgUpdateAdmin, MsgStoreCode, } from "./msgs"; -export { Expiration } from "./types"; diff --git a/packages/cosmwasm/src/interfaces/cw0.ts b/packages/cosmwasm/src/interfaces/cw0.ts new file mode 100644 index 00000000..17d098dd --- /dev/null +++ b/packages/cosmwasm/src/interfaces/cw0.ts @@ -0,0 +1,15 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +/** + * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw0/src/expiration.rs#L14 + */ +export type Expiration = + | { + readonly at_height: number; + } + | { + readonly at_time: number; + } + | { + readonly never: Record; + }; diff --git a/packages/cosmwasm/src/interfaces/index.ts b/packages/cosmwasm/src/interfaces/index.ts new file mode 100644 index 00000000..b91ff756 --- /dev/null +++ b/packages/cosmwasm/src/interfaces/index.ts @@ -0,0 +1 @@ +export { Expiration } from "./cw0"; diff --git a/packages/cosmwasm/src/types.ts b/packages/cosmwasm/src/types.ts index 0d0ba0ba..bba7fc95 100644 --- a/packages/cosmwasm/src/types.ts +++ b/packages/cosmwasm/src/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { fromBase64, fromHex } from "@cosmjs/encoding"; export interface WasmData { @@ -26,14 +25,3 @@ export function parseWasmData({ key, val }: WasmData): Model { * This doen't privide any type safety over `any` but expresses intent in the code. */ export type JsonObject = any; - -export type Expiration = - | { - readonly at_height: number; - } - | { - readonly at_time: number; - } - | { - readonly never: Record; - }; diff --git a/packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts b/packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts index 0e7c1ef5..015829fd 100644 --- a/packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts +++ b/packages/cosmwasm/types/cw1subkeycosmwasmclient.d.ts @@ -1,7 +1,7 @@ import { Coin } from "@cosmjs/launchpad"; import { Cw1CosmWasmClient } from "./cw1cosmwasmclient"; +import { Expiration } from "./interfaces"; import { ExecuteResult } from "./signingcosmwasmclient"; -import { Expiration } from "./types"; export interface AllowanceResult { readonly balance: readonly Coin[]; readonly expires: Expiration; diff --git a/packages/cosmwasm/types/cw3cosmwasmclient.d.ts b/packages/cosmwasm/types/cw3cosmwasmclient.d.ts index fdc96478..21b63d46 100644 --- a/packages/cosmwasm/types/cw3cosmwasmclient.d.ts +++ b/packages/cosmwasm/types/cw3cosmwasmclient.d.ts @@ -1,8 +1,8 @@ import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad"; import { CosmosMsg } from "./cosmosmsg"; import { Account } from "./cosmwasmclient"; +import { Expiration } from "./interfaces"; import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient"; -import { Expiration } from "./types"; export declare enum Vote { Yes = "yes", No = "no", diff --git a/packages/cosmwasm/types/index.d.ts b/packages/cosmwasm/types/index.d.ts index a9151c7d..071e9351 100644 --- a/packages/cosmwasm/types/index.d.ts +++ b/packages/cosmwasm/types/index.d.ts @@ -1,3 +1,4 @@ +export { Expiration } from "./interfaces"; export { setupWasmExtension, WasmExtension } from "./lcdapi/wasm"; export { BankMsg, CosmosMsg, CustomMsg, StakingMsg, WasmMsg } from "./cosmosmsg"; export { @@ -53,4 +54,3 @@ export { MsgUpdateAdmin, MsgStoreCode, } from "./msgs"; -export { Expiration } from "./types"; diff --git a/packages/cosmwasm/types/interfaces/cw0.d.ts b/packages/cosmwasm/types/interfaces/cw0.d.ts new file mode 100644 index 00000000..1a9bae43 --- /dev/null +++ b/packages/cosmwasm/types/interfaces/cw0.d.ts @@ -0,0 +1,13 @@ +/** + * @see https://github.com/CosmWasm/cosmwasm-plus/blob/v0.3.2/packages/cw0/src/expiration.rs#L14 + */ +export declare type Expiration = + | { + readonly at_height: number; + } + | { + readonly at_time: number; + } + | { + readonly never: Record; + }; diff --git a/packages/cosmwasm/types/interfaces/index.d.ts b/packages/cosmwasm/types/interfaces/index.d.ts new file mode 100644 index 00000000..b91ff756 --- /dev/null +++ b/packages/cosmwasm/types/interfaces/index.d.ts @@ -0,0 +1 @@ +export { Expiration } from "./cw0"; diff --git a/packages/cosmwasm/types/types.d.ts b/packages/cosmwasm/types/types.d.ts index 33928389..45d870c7 100644 --- a/packages/cosmwasm/types/types.d.ts +++ b/packages/cosmwasm/types/types.d.ts @@ -12,13 +12,3 @@ export declare function parseWasmData({ key, val }: WasmData): Model; * This doen't privide any type safety over `any` but expresses intent in the code. */ export declare type JsonObject = any; -export declare type Expiration = - | { - readonly at_height: number; - } - | { - readonly at_time: number; - } - | { - readonly never: Record; - };