diff --git a/packages/sdk38/src/index.ts b/packages/sdk38/src/index.ts index e8119970..d55d2149 100644 --- a/packages/sdk38/src/index.ts +++ b/packages/sdk38/src/index.ts @@ -29,6 +29,7 @@ export { LcdClient, LcdModule, NodeInfoResponse, + normalizeLcdApiArray, PostTxsResponse, SearchTxsResponse, TxsResponse, diff --git a/packages/sdk38/src/lcdapi/index.ts b/packages/sdk38/src/lcdapi/index.ts index 04eeb8d9..2dfbd914 100644 --- a/packages/sdk38/src/lcdapi/index.ts +++ b/packages/sdk38/src/lcdapi/index.ts @@ -18,4 +18,4 @@ export { SearchTxsResponse, TxsResponse, } from "./base"; -export { LcdApiArray, LcdClient, LcdModule } from "./lcdclient"; +export { LcdApiArray, LcdClient, LcdModule, normalizeLcdApiArray } from "./lcdclient"; diff --git a/packages/sdk38/src/lcdapi/lcdclient.spec.ts b/packages/sdk38/src/lcdapi/lcdclient.spec.ts index e80ee2c0..a8e0951d 100644 --- a/packages/sdk38/src/lcdapi/lcdclient.spec.ts +++ b/packages/sdk38/src/lcdapi/lcdclient.spec.ts @@ -22,7 +22,7 @@ import { } from "../testutils.spec"; import { StdFee } from "../types"; import { TxsResponse } from "./base"; -import { LcdApiArray, LcdClient, normalizeArray } from "./lcdclient"; +import { LcdApiArray, LcdClient, normalizeLcdApiArray } from "./lcdclient"; /** Deployed as part of scripts/wasmd/init.sh */ export const deployedErc20 = { @@ -94,7 +94,7 @@ describe("LcdClient", () => { listCodeInfo: async (): Promise => { const path = `/wasm/code`; const responseData = (await base.get(path)) as WasmResponse>; - return normalizeArray(unwrapWasmResponse(responseData)); + return normalizeLcdApiArray(unwrapWasmResponse(responseData)); }, }; } @@ -115,7 +115,7 @@ describe("LcdClient", () => { listCodeInfo: async (): Promise => { const path = `/wasm/code`; const responseData = (await base.get(path)) as WasmResponse>; - return normalizeArray(unwrapWasmResponse(responseData)); + return normalizeLcdApiArray(unwrapWasmResponse(responseData)); }, }; } diff --git a/packages/sdk38/src/lcdapi/lcdclient.ts b/packages/sdk38/src/lcdapi/lcdclient.ts index 5151297a..f0889396 100644 --- a/packages/sdk38/src/lcdapi/lcdclient.ts +++ b/packages/sdk38/src/lcdapi/lcdclient.ts @@ -17,7 +17,7 @@ import { /** Unfortunately, Cosmos SDK encodes empty arrays as null */ export type LcdApiArray = readonly T[] | null; -export function normalizeArray(backend: LcdApiArray): readonly T[] { +export function normalizeLcdApiArray(backend: LcdApiArray): readonly T[] { return backend || []; } diff --git a/packages/sdk38/types/index.d.ts b/packages/sdk38/types/index.d.ts index b11f2e8a..b3fd530d 100644 --- a/packages/sdk38/types/index.d.ts +++ b/packages/sdk38/types/index.d.ts @@ -27,6 +27,7 @@ export { LcdClient, LcdModule, NodeInfoResponse, + normalizeLcdApiArray, PostTxsResponse, SearchTxsResponse, TxsResponse, diff --git a/packages/sdk38/types/lcdapi/index.d.ts b/packages/sdk38/types/lcdapi/index.d.ts index e8512af4..5dd4140a 100644 --- a/packages/sdk38/types/lcdapi/index.d.ts +++ b/packages/sdk38/types/lcdapi/index.d.ts @@ -9,4 +9,4 @@ export { SearchTxsResponse, TxsResponse, } from "./base"; -export { LcdApiArray, LcdClient, LcdModule } from "./lcdclient"; +export { LcdApiArray, LcdClient, LcdModule, normalizeLcdApiArray } from "./lcdclient"; diff --git a/packages/sdk38/types/lcdapi/lcdclient.d.ts b/packages/sdk38/types/lcdapi/lcdclient.d.ts index b03afd8b..379051c7 100644 --- a/packages/sdk38/types/lcdapi/lcdclient.d.ts +++ b/packages/sdk38/types/lcdapi/lcdclient.d.ts @@ -11,7 +11,7 @@ import { } from "./base"; /** Unfortunately, Cosmos SDK encodes empty arrays as null */ export declare type LcdApiArray = readonly T[] | null; -export declare function normalizeArray(backend: LcdApiArray): readonly T[]; +export declare function normalizeLcdApiArray(backend: LcdApiArray): readonly T[]; export declare type LcdModule = Record any>; declare type LcdModuleSetup = (base: LcdClient) => M; export interface LcdClientBaseOptions {