diff --git a/src/index.ts b/src/index.ts index 2fabfdb0..22b06776 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,5 @@ import * as accounts from "./accounts/index"; -import * as aggregate from "./messages/aggregate/index"; -import * as post from "./messages/post/index"; -import * as store from "./messages/store/index"; -import * as forget from "./messages/forget/index"; -import * as program from "./messages/program/index"; - +import { messages } from "./messages"; import * as Ledger from "./accounts/providers/Ledger"; -export { accounts, Ledger, aggregate, post, store, forget, program }; +export { accounts, Ledger, messages }; diff --git a/src/messages/index.ts b/src/messages/index.ts index 025f3e72..186c6a6f 100644 --- a/src/messages/index.ts +++ b/src/messages/index.ts @@ -1,4 +1,11 @@ import { BaseMessage } from "./message"; +import * as aggregate from "./aggregate"; +import * as forget from "./forget"; +import * as post from "./post"; +import * as program from "./program"; +import * as store from "./store"; + +export const messages = { aggregate, forget, post, program, store }; /** * Extracts some fields from an Aleph message to sign it using an account. diff --git a/testsAuto/accounts/substrate.auto.ts b/testsAuto/accounts/substrate.auto.ts index ed613c90..9dd885e1 100644 --- a/testsAuto/accounts/substrate.auto.ts +++ b/testsAuto/accounts/substrate.auto.ts @@ -1,9 +1,9 @@ import * as bip39 from "bip39"; -import assert = require("assert"); +import assert from "assert"; import { mnemonicToMiniSecret } from "@polkadot/util-crypto"; import { testsFunc } from "../index"; -import { accounts, aggregate } from "../../src"; +import { accounts, messages } from "../../src"; import { DEFAULT_API_V2 } from "../../src/global"; import { Chain, ItemType } from "../../src/messages/message"; @@ -50,7 +50,7 @@ async function PublishAggregate(): Promise { body: "Typescript sdk", }; - await aggregate.Publish({ + await messages.aggregate.Publish({ account: account, key: key, content: content, @@ -65,7 +65,7 @@ async function PublishAggregate(): Promise { body: string; }; }; - const amends = await aggregate.Get({ + const amends = await messages.aggregate.Get({ APIServer: DEFAULT_API_V2, address: account.address, keys: [key],