diff --git a/src/ainize.ts b/src/ainize.ts index ae8550f..ee0dab5 100644 --- a/src/ainize.ts +++ b/src/ainize.ts @@ -6,11 +6,14 @@ import AppController from "./controllers/appController"; import Model from "./model"; import { deployConfig } from "./types/type"; import AinModule from "./ain"; +import Internal from "./internal"; + export default class Ainize { private cache: NodeCache; - ain: AinModule = AinModule.getInstance(); private handler: Handler = Handler.getInstance(); + ain: AinModule = AinModule.getInstance(); middleware: Middleware; + internal: Internal; appController: AppController = AppController.getInstance(); constructor(chainId: 1 | 0) { @@ -18,6 +21,7 @@ export default class Ainize { this.handler.connect(); this.cache = new NodeCache(); this.middleware = new Middleware(this.cache); + this.internal = new Internal(); } static createAinAccount () { diff --git a/src/internal.ts b/src/internal.ts index 1ae9b53..1fa53c3 100644 --- a/src/internal.ts +++ b/src/internal.ts @@ -5,8 +5,9 @@ import { HISTORY_TYPE, RESPONSE_STATUS, deposit, request, response } from "./typ import { buildTxBody } from "./utils/builder"; import AinModule from "./ain"; -export default class internal { +export default class Internal { private ain = AinModule.getInstance(); + async handleDeposit(req: Request) { const { requesterAddress, appName, transferKey, transferValue } = this.getDataFromDepositRequest(req); const ops: SetOperation[] = [];