74 lines
1.6 KiB
TypeScript
74 lines
1.6 KiB
TypeScript
/*
|
|
* @project: TERA
|
|
* @version: Development (beta)
|
|
* @license: MIT (not for evil)
|
|
* @copyright: Yuriy Ivanov (Vtools) 2017-2019 [progr76@gmail.com]
|
|
* Web: https://terafoundation.org
|
|
* Twitter: https://twitter.com/terafoundation
|
|
* Telegram: https://t.me/terafoundation
|
|
*/
|
|
|
|
"use strict";
|
|
export default class DApp {
|
|
constructor() {
|
|
}
|
|
Name() {
|
|
return "";
|
|
}
|
|
SendMessage(Body, ToAddr) {
|
|
global.SERVER.SendMessage(Body, ToAddr)
|
|
}
|
|
AddTransaction(Tr) {
|
|
global.SERVER.AddTransaction(Tr)
|
|
}
|
|
GetScriptTransaction(Body) {
|
|
return "";
|
|
}
|
|
GetVerifyTransaction(Block, BlockNum, TrNum, Body) {
|
|
return 1;
|
|
}
|
|
ClearDataBase() {
|
|
}
|
|
GetSenderNum(BlockNum, Body) {
|
|
return 0;
|
|
}
|
|
OnWriteBlockStart(Block) {
|
|
}
|
|
OnWriteBlockFinish(Block) {
|
|
}
|
|
OnDeleteBlock(Block) {
|
|
}
|
|
OnWriteTransaction(Block, Body, BlockNum, TrNum, next) {
|
|
}
|
|
OnMessage(Msg) {
|
|
}
|
|
Close() {
|
|
}
|
|
};
|
|
|
|
import AccountApp from './accounts'
|
|
import SmartApp from './smart'
|
|
import MessagerApp from './messager'
|
|
import FileApp from './file'
|
|
import NameApp from './names'
|
|
|
|
declare global {
|
|
namespace NodeJS {
|
|
interface Global {
|
|
//#region dapp.ts
|
|
DApps: {
|
|
Accounts?: AccountApp,
|
|
File?: FileApp,
|
|
Names?: NameApp,
|
|
Messager?: MessagerApp,
|
|
Smart?: SmartApp,
|
|
DBHistory?: DApp,
|
|
};
|
|
DAppByType: any;
|
|
//#endregion
|
|
}
|
|
}
|
|
}
|
|
global.DApps = {};
|
|
global.DAppByType = {};
|