forked from circlecloud/tera
548
src/global.d.ts
vendored
Normal file
548
src/global.d.ts
vendored
Normal file
@@ -0,0 +1,548 @@
|
||||
export { };
|
||||
|
||||
declare global {
|
||||
var nw: any;
|
||||
interface TeraError {
|
||||
code: string;
|
||||
stack: any;
|
||||
}
|
||||
interface Window {
|
||||
RUN_CLIENT: number;
|
||||
RUN_SERVER: number;
|
||||
}
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
//#region run-node.ts
|
||||
DATA_PATH: string;
|
||||
CODE_PATH: string;
|
||||
HTTP_PORT_NUMBER: number;
|
||||
LOCAL_RUN: number;
|
||||
//#endregion
|
||||
//#region main-process.ts
|
||||
PROCESS_NAME: string;
|
||||
POWPROCESS: number;
|
||||
DEBUGPROCESS: any;
|
||||
UPDATE_CODE_VERSION_NUM: number;
|
||||
MIN_CODE_VERSION_NUM: number;
|
||||
MINING_VERSION_NUM: number;
|
||||
InitParamsArg: Function;
|
||||
CONST_NAME_ARR: string[];
|
||||
NODES_DELTA_CALC_HOUR: number;
|
||||
USE_HARD_API_V2: number;
|
||||
USE_TICKET: number;
|
||||
USE_CHECK_SENDING: number;
|
||||
USE_LEVEL_WAY: number;
|
||||
TR_TICKET_HASH_LENGTH: number;
|
||||
BLOCKNUM_TICKET_ALGO: number;
|
||||
WATCHDOG_BADACCOUNT: number;
|
||||
WATCHDOG_DEV: number;
|
||||
RESYNC_CONDITION: any;
|
||||
REST_BLOCK_SCALE: number;
|
||||
REST_START_COUNT: number;
|
||||
LOAD_TO_BEGIN: number;
|
||||
DEBUG_WALLET: number;
|
||||
CHECK_GLOBAL_TIME: number;
|
||||
AUTO_CORRECT_TIME: number;
|
||||
DELTA_CURRENT_TIME: number;
|
||||
NODES_NAME: string;
|
||||
COMMON_KEY: string;
|
||||
SERVER_PRIVATE_KEY_HEX: string;
|
||||
USE_NET_FOR_SERVER_ADDRES: number;
|
||||
NET_WORK_MODE: {
|
||||
ip: string;
|
||||
port: number;
|
||||
UseDirectIP: boolean;
|
||||
NodeWhiteList: string;
|
||||
DoRestartNode: number;
|
||||
}
|
||||
STAT_MODE: number;
|
||||
MAX_STAT_PERIOD: number;
|
||||
UPDATE_NUM_COMPLETE: number;
|
||||
WALLET_NAME: string;
|
||||
WALLET_DESCRIPTION: string;
|
||||
USE_MINING: number;
|
||||
POW_MAX_PERCENT: number;
|
||||
POW_RUN_COUNT: number;
|
||||
POWRunPeriod: number;
|
||||
CheckPointDelta: number;
|
||||
ALL_LOG_TO_CLIENT: number;
|
||||
LOG_LEVEL: number;
|
||||
LIMIT_SEND_TRAFIC: number;
|
||||
COUNT_VIEW_ROWS: number;
|
||||
MIN_VER_STAT: number;
|
||||
STOPGETBLOCK: number;
|
||||
RESTART_PERIOD_SEC: number;
|
||||
HARD_PACKET_PERIOD120: number;
|
||||
MINING_START_TIME: string;
|
||||
MINING_PERIOD_TIME: string;
|
||||
CHECK_RUN_MINING: number;
|
||||
CHECK_STOP_CHILD_PROCESS: number;
|
||||
COUNT_MINING_CPU: number;
|
||||
SIZE_MINING_MEMORY: number;
|
||||
HTTP_HOSTING_PORT: number;
|
||||
HTTPS_HOSTING_DOMAIN: string;
|
||||
HTTP_MAX_COUNT_ROWS: number;
|
||||
HTTP_ADMIN_PASSORD: string;
|
||||
MIN_POWER_POW_HANDSHAKE: number;
|
||||
USE_HINT: number;
|
||||
ALL_VIEW_ROWS: number;
|
||||
COUNT_BLOCK_PROOF: number;
|
||||
COUNT_NODE_PROOF: number;
|
||||
MIN_POWER_POW_MSG: number;
|
||||
MEM_POOL_MSG_COUNT: number;
|
||||
MAX_LEVEL_SPECIALIZATION: number;
|
||||
MIN_CONNECT_CHILD: number;
|
||||
MAX_CONNECT_CHILD: number;
|
||||
MAX_CONNECTIONS_COUNT: number;
|
||||
TRUST_PROCESS_COUNT: number;
|
||||
MAX_NODES_RETURN: number;
|
||||
MAX_WAIT_PERIOD_FOR_STATUS: number;
|
||||
MAX_GRAY_CONNECTIONS_TO_SERVER: number;
|
||||
MAX_PACKET_LENGTH: number;
|
||||
COUNT_BLOCKS_FOR_LOAD: number;
|
||||
TR_LEN: number;
|
||||
BLOCK_PROCESSING_LENGTH: number;
|
||||
BLOCK_PROCESSING_LENGTH2: number;
|
||||
CONSENSUS_PERIOD_TIME: number;
|
||||
MAX_BLOCK_SIZE: number;
|
||||
MAX_TRANSACTION_SIZE: number;
|
||||
MIN_TRANSACTION_SIZE: number;
|
||||
MAX_TRANSACTION_COUNT: number;
|
||||
MAX_TRANSACTION_LIMIT: number;
|
||||
MIN_POWER_POW_TR: number;
|
||||
MIN_POWER_POW_BL: number;
|
||||
GENERATE_BLOCK_ACCOUNT: number;
|
||||
TOTAL_SUPPLY_TERA: number;
|
||||
TRANSACTION_PROOF_COUNT: number;
|
||||
MIN_POWER_POW_ACC_CREATE: number;
|
||||
START_MINING: number;
|
||||
REF_PERIOD_MINING: number;
|
||||
DELTA_BLOCK_ACCOUNT_HASH: number;
|
||||
PERIOD_ACCOUNT_HASH: number;
|
||||
START_BLOCK_ACCOUNT_HASH: number;
|
||||
START_BLOCK_ACCOUNT_HASH3: number;
|
||||
NEW_ACCOUNT_INCREMENT: number;
|
||||
NEW_BLOCK_REWARD1: number;
|
||||
NEW_FORMULA_START: number;
|
||||
NEW_FORMULA_KTERA: number;
|
||||
NEW_FORMULA_TARGET1: number;
|
||||
NEW_FORMULA_TARGET2: number;
|
||||
BLOCK_COUNT_IN_MEMORY: number;
|
||||
HISTORY_BLOCK_COUNT: number;
|
||||
MAX_SIZE_LOG: number;
|
||||
READ_ONLY_DB: number;
|
||||
USE_CHECK_SAVE_DB: number;
|
||||
START_NETWORK_DATE: number;
|
||||
NETWORK: string;
|
||||
DEF_MAJOR_VERSION: string;
|
||||
SMART_BLOCKNUM_START: number;
|
||||
PRICE_DAO: Function;
|
||||
NEW_SIGN_TIME: number;
|
||||
TEST_TRANSACTION_GENERATE: number;
|
||||
TEST_NETWORK: boolean | number;
|
||||
START_PORT_NUMBER: number;
|
||||
GetNetworkName: Function;
|
||||
DEF_VERSION: string;
|
||||
DEF_CLIENT: string;
|
||||
FIRST_TIME_BLOCK: number;
|
||||
START_BLOCK_RUN: number;
|
||||
START_IP: string;
|
||||
LISTEN_IP: string;
|
||||
HTTP_PORT_PASSWORD: string;
|
||||
HTTP_IP_CONNECT: string;
|
||||
USE_AUTO_UPDATE: number;
|
||||
USE_PARAM_JS: number;
|
||||
CREATE_ON_START: boolean | number;
|
||||
DEBUG_MODE: number;
|
||||
RUN_CLIENT: number;
|
||||
RUN_SERVER: number;
|
||||
CHILD_POW: boolean;
|
||||
ADDRLIST_MODE: boolean;
|
||||
NWMODE: number;
|
||||
NOALIVE: number;
|
||||
DEV_MODE: number;
|
||||
START_SERVER: number;
|
||||
SetCalcPOW: Function;
|
||||
RunStopPOWProcess: Function;
|
||||
NEW_SERVER_PRIVATE_KEY: number;
|
||||
//#endregion
|
||||
|
||||
//#region startlib.ts
|
||||
GetDataPath: (str: string) => string;
|
||||
GetCodePath: (str: string) => string;
|
||||
GetNormalPathString: (str: string) => string;
|
||||
CheckCreateDir: (l, o?, t?) => void;
|
||||
CopyFiles: (l, o, t) => void;
|
||||
ToLog: Function;
|
||||
//#endregion
|
||||
|
||||
TO_ERROR_LOG: Function;
|
||||
ToLogClient: Function;
|
||||
|
||||
glCurNumFindArr: number;
|
||||
ArrReconnect: [];
|
||||
ArrConnect: [];
|
||||
|
||||
//#region main-process.ts:51
|
||||
SERVER: any;
|
||||
NeedRestart: number;
|
||||
WEB_PROCESS: TeraProcess;
|
||||
CountAllNode: number;
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:100
|
||||
GetCurrentTime: Function;
|
||||
//#region main-process.ts:100
|
||||
|
||||
//#region
|
||||
SpeedSignLib: number;
|
||||
TestSignLib: Function;
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:118
|
||||
TX_PROCESS: TeraProcess
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:141
|
||||
AddTransactionFromWeb: Function;
|
||||
STATIC_PROCESS: TeraProcess;
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:204
|
||||
WALLET: any;
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:342
|
||||
StopChildProcess: Function;
|
||||
//#endregion
|
||||
|
||||
//#region main-process.ts:375
|
||||
MiningPaused: number;
|
||||
ArrMiningWrk: any[];
|
||||
//#endregion
|
||||
|
||||
//#region library.ts:118
|
||||
DelDir: Function;
|
||||
SliceArr: Function;
|
||||
random: Function;
|
||||
AddrLevelArrFromBegin: Function;
|
||||
AddrLevelArr: Function;
|
||||
SaveToFile: Function;
|
||||
LoadParams: Function;
|
||||
SaveParams: Function;
|
||||
StartTime: Function;
|
||||
FinishTime: Function;
|
||||
CompareItemBufFD: Function;
|
||||
CompareArr33: Function;
|
||||
CompareItemHashSimple: Function;
|
||||
CompareItemHash: Function;
|
||||
CompareItemHash32: Function;
|
||||
CompareItemHASH32: Function;
|
||||
CompareItemHash33: Function;
|
||||
CompareItemHashPow: Function;
|
||||
CompareItemTimePow: Function;
|
||||
LOAD_CONST: Function;
|
||||
SAVE_CONST: Function;
|
||||
CheckGlobalTime: Function;
|
||||
GetDeltaCurrentTime: Function;
|
||||
GetStrTimeUTC: Function;
|
||||
GetStrOnlyTimeUTC: Function;
|
||||
GetSecFromStrTime: Function;
|
||||
DateFromBlock: Function;
|
||||
NormalizeName: Function;
|
||||
CreateEval: Function;
|
||||
GetCountMiningCPU: Function;
|
||||
AddTrMap: string[];
|
||||
GrayConnect: Function;
|
||||
//#endregion
|
||||
|
||||
//#region library.ts:118
|
||||
RBTree: any;
|
||||
ntpClient: any;
|
||||
Stun: any;
|
||||
ZIP: any;
|
||||
secp256k1: any;
|
||||
BufLib: any;
|
||||
GetCurrentBlockNumByTime: Function;
|
||||
TimeStart: number;
|
||||
//#endregion
|
||||
|
||||
//#region run-nw.ts
|
||||
NWVERSION: string;
|
||||
HTTP_SERVER_START_OK: boolean;
|
||||
//#endregion
|
||||
|
||||
//#region crypto-library.ts
|
||||
MAX_SUPER_VALUE_POW: number;
|
||||
GetHexFromAddres: Function;
|
||||
GetArr32FromHex: Function;
|
||||
GetAddresFromHex: Function;
|
||||
GetHexAddresFromPublicKey: Function;
|
||||
GetHexFromArr: Function;
|
||||
GetArrFromHex: Function;
|
||||
GetHexFromArrBlock: Function;
|
||||
GetPublicKeyFromAddres: Function;
|
||||
CheckDevelopSign: Function;
|
||||
CheckContextSecret: Function;
|
||||
GetSignHash: Function;
|
||||
GetVerifyHash: Function;
|
||||
GetKeyPair: Function;
|
||||
GetKeyPairTest: Function;
|
||||
GetHashWithValues: Function;
|
||||
CreateNoncePOWExtern: Function;
|
||||
CreateNoncePOWExternMinPower: Function;
|
||||
CreateNoncePOWInner: Function;
|
||||
CreateAddrPOW: Function;
|
||||
CalcMerkl3FromArray: Function;
|
||||
CalcMerkl0FromArray: Function;
|
||||
ClientHex: Function;
|
||||
CalcHash3FromArray: Function;
|
||||
CalcHashFromArray: Function;
|
||||
CalcMerklFromArray: Function;
|
||||
CalcTreeHashFromArrBody: Function;
|
||||
UpdateMerklTree: Function;
|
||||
GetMerkleProof: Function;
|
||||
CheckMerkleProof: Function;
|
||||
IsZeroArr: Function;
|
||||
GetHashWithNonce: Function;
|
||||
GetPowPower: Function;
|
||||
GetArrFromValue: Function;
|
||||
GetPowValue: Function;
|
||||
Mesh: Function;
|
||||
Encrypt: Function;
|
||||
Decrypt: Function;
|
||||
toUTF8Array: Function;
|
||||
Utf8ArrayToStr: Function;
|
||||
GetArrFromStr: Function;
|
||||
IsDeveloperAccount: Function;
|
||||
DEVELOP_PUB_KEY_ARR: Buffer[] | string[];
|
||||
DEVELOP_PUB_KEY: any;
|
||||
DEVELOP_PUB_KEY0: Buffer;
|
||||
ARR_PUB_KEY: any;
|
||||
//#endregion
|
||||
|
||||
//#region log-strict.ts
|
||||
CheckSizeLogFile: Function;
|
||||
//#endregion
|
||||
|
||||
//#region log.ts
|
||||
ArrLogClient: any[];
|
||||
ToLogWeb: Function;
|
||||
SmallAddr: Function;
|
||||
ToErrorTrace: Function;
|
||||
ToLogTrace: Function;
|
||||
ToInfo: Function;
|
||||
ToError: Function;
|
||||
ToLogClient0: Function;
|
||||
PrepareStatEverySecond: Function;
|
||||
HASH_RATE: number;
|
||||
ADD_HASH_RATE: Function;
|
||||
GET_STAT: Function;
|
||||
ADD_TO_STAT_TIME: Function;
|
||||
ADD_TO_STAT: Function;
|
||||
GET_STATDIAGRAMS: Function;
|
||||
GET_STATS: Function;
|
||||
StartCommonStat: Function;
|
||||
ClearCommonStat: Function;
|
||||
ResizeArrAvg: Function;
|
||||
ResizeArrMax: Function;
|
||||
TO_DEBUG_LOG: Function;
|
||||
GetStrOnlyTime: Function;
|
||||
GetStrTime: Function;
|
||||
//#endregion
|
||||
|
||||
//#region geo.ts
|
||||
SetGeoLocation: Function;
|
||||
//#endregion
|
||||
|
||||
//#region geo.ts
|
||||
WebApi2: any;
|
||||
HostingCaller: any;
|
||||
//#endregion
|
||||
|
||||
//#region web-process.ts
|
||||
LoadBlockFromNetwork: Function;
|
||||
GlobalRunID: number;
|
||||
//#endregion
|
||||
|
||||
//#region base.ts
|
||||
glStopNode: any;
|
||||
//#endregion
|
||||
|
||||
//#region html-server.ts
|
||||
HTTPCaller: any;
|
||||
DappTemplateFile: Function;
|
||||
DappSmartCodeFile: Function;
|
||||
DappClientCodeFile
|
||||
SendBlockFile
|
||||
|
||||
AddDappEventToGlobalMap: Function;
|
||||
//#endregion
|
||||
|
||||
//#region accounts.ts
|
||||
HistoryDB: any;
|
||||
TYPE_TRANSACTION_CREATE: number;
|
||||
TYPE_TRANSACTION_ACC_HASH: number;
|
||||
FORMAT_CREATE: string;
|
||||
FORMAT_MONEY_TRANSFER: string;
|
||||
FORMAT_MONEY_TRANSFER_BODY: string;
|
||||
FORMAT_MONEY_TRANSFER2: string;
|
||||
FORMAT_MONEY_TRANSFER_BODY2: string;
|
||||
FORMAT_MONEY_TRANSFER3: string;
|
||||
FORMAT_MONEY_TRANSFER_BODY3: string;
|
||||
FORMAT_ACCOUNT_HASH: string;
|
||||
FORMAT_ACCOUNT_HASH3: string;
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region block-db.ts
|
||||
BlockDB: any;
|
||||
BLOCK_HEADER_SIZE
|
||||
BLOCK_HEADER_SIZE2
|
||||
DB_VERSION
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region db.ts
|
||||
CheckStartOneProcess: Function;
|
||||
//#endregion
|
||||
|
||||
//#region update.ts
|
||||
UpdateMode: number;
|
||||
//#endregion
|
||||
|
||||
//#region file.ts
|
||||
TYPE_TRANSACTION_FILE: number;
|
||||
FORMAT_FILE_CREATE: string;
|
||||
//#endregion
|
||||
|
||||
//#region dapp.ts
|
||||
DApps: any;
|
||||
DAppByType: any;
|
||||
//#endregion
|
||||
|
||||
//#region names.ts
|
||||
NAMES: any;
|
||||
//#endregion
|
||||
|
||||
//#region smart.ts
|
||||
TickCounter: number;
|
||||
TYPE_TRANSACTION_SMART_RUN: number;
|
||||
FORMAT_SMART_CREATE: string;
|
||||
FORMAT_SMART_RUN
|
||||
FORMAT_SMART_CHANGE
|
||||
RunSmartMethod: Function;
|
||||
DebugEvent: Function;
|
||||
//#endregion
|
||||
|
||||
//#region transaction-validator.ts
|
||||
//#endregion
|
||||
|
||||
//#region connect.ts
|
||||
PERIOD_FOR_RECONNECT: number;
|
||||
CHECK_DELTA_TIME: any;
|
||||
CHECK_POINT: any;
|
||||
CODE_VERSION: any;
|
||||
NET_CONSTANT: any;
|
||||
START_LOAD_CODE: any;
|
||||
MIN_PERIOD_PING: number;
|
||||
MAX_PING_FOR_CONNECT: number;
|
||||
MAX_WAIT_PERIOD_FOR_HOT: number;
|
||||
//#endregion
|
||||
|
||||
//#region code.ts
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region terahashlib.js
|
||||
GetHashFromSeqAddr: Function;
|
||||
CalcHashBlockFromSeqAddr: Function;
|
||||
GetHashFromNum2: Function;
|
||||
GetHashFromNum3: Function;
|
||||
GetHashFromArrNum2: Function;
|
||||
XORArr: Function;
|
||||
GetHash: Function;
|
||||
ReadUint32FromArr: Function;
|
||||
ReadUintFromArr: Function;
|
||||
ReadUint16FromArr: Function;
|
||||
WriteUintToArr: Function;
|
||||
WriteUint32ToArr: Function;
|
||||
WriteUint32ToArrOnPos: Function;
|
||||
WriteUint16ToArrOnPos: Function;
|
||||
WriteUintToArrOnPos: Function;
|
||||
WriteArrToArr: Function;
|
||||
WriteArrToArrOnPos: Function;
|
||||
WriteArrToArrHOnPos: Function;
|
||||
ConvertBufferToStr: Function;
|
||||
CopyObjValue: Function;
|
||||
CopyArr: Function;
|
||||
ParseNum: Function;
|
||||
CompareArr: Function;
|
||||
CompareArrL: Function;
|
||||
shaarr2: Function;
|
||||
sha3arr2: Function;
|
||||
arr2: Function;
|
||||
GetBlockArrFromBuffer: Function;
|
||||
shaarrblock2: Function;
|
||||
//#endregion
|
||||
|
||||
SendWebFile: Function;
|
||||
|
||||
GlobalRunMap: any;
|
||||
sha3: any;
|
||||
SHA3BUF: any;
|
||||
shaarr: any;
|
||||
}
|
||||
interface Process {
|
||||
RunRPC: Function;
|
||||
}
|
||||
}
|
||||
interface TeraProcess {
|
||||
Name: string;
|
||||
idInterval: number | any;
|
||||
idInterval1: number | any;
|
||||
idInterval2: number | any;
|
||||
LastAlive: number;
|
||||
Worker: Worker;
|
||||
Path: string;
|
||||
OnMessage: Function;
|
||||
PeriodAlive: number;
|
||||
}
|
||||
interface Worker {
|
||||
connected: boolean;
|
||||
send: Function;
|
||||
}
|
||||
interface Number {
|
||||
//#region library.ts:118
|
||||
toStringZ: Function;
|
||||
//#region
|
||||
}
|
||||
interface String {
|
||||
right: Function;
|
||||
}
|
||||
interface HostingCaller {
|
||||
GetCurrentInfo?: Function;
|
||||
GetAccountList?: Function;
|
||||
GetAccount?: Function;
|
||||
GetBlockList?: Function;
|
||||
GetTransactionList?: Function;
|
||||
GetTransactionAll?: Function;
|
||||
GetDappList?: Function;
|
||||
GetNodeList?: Function;
|
||||
GetAccountListByKey?: Function;
|
||||
GetDappCategory?: Function;
|
||||
SendTransactionHex?: Function;
|
||||
DappSmartHTMLFile?: Function;
|
||||
DappBlockFile?: Function;
|
||||
DappInfo?: Function;
|
||||
DappWalletList?: Function;
|
||||
DappAccountList?: Function;
|
||||
DappSmartList?: Function;
|
||||
DappBlockList?: Function;
|
||||
DappTransactionList?: Function;
|
||||
DappStaticCall?: Function;
|
||||
GetHistoryTransactions?: Function;
|
||||
GetTotalSupply?: Function;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user