Mon Aug 26 14:20:28 CST 2019 Source Update...
This commit is contained in:
parent
3fa4fb1ee2
commit
48fe258e2e
@ -141,9 +141,9 @@ textarea {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn span {
|
||||
opacity: .4;
|
||||
}
|
||||
/*.btn span {*/
|
||||
/*opacity: .4;*/
|
||||
/*}*/
|
||||
|
||||
.btn--white {
|
||||
background: #fff;
|
||||
|
@ -100,8 +100,6 @@ td.date
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*SEND SEND SEND SEND SEND SEND SEND SEND SEND SEND */
|
||||
|
||||
table.form_input
|
||||
|
@ -1220,6 +1220,17 @@ MapCurrency[16] = "BTC";
|
||||
var MapCurrencyIcon = {};
|
||||
MapCurrencyIcon[0] = "./PIC/T.svg";
|
||||
MapCurrencyIcon[16] = "./PIC/B.svg";
|
||||
|
||||
function InitMapCurrency()
|
||||
{
|
||||
if(window.NETWORK_NAME === "TERA-TEST3")
|
||||
{
|
||||
MapCurrency = {};
|
||||
MapCurrency[0] = "TERA";
|
||||
MapCurrency[31] = "BTC";
|
||||
MapCurrency[59] = "USD";
|
||||
}
|
||||
};
|
||||
var MapCategory = {};
|
||||
MapCategory[0] = "-";
|
||||
MapCategory[1] = "Art & Music";
|
||||
@ -1312,8 +1323,14 @@ function CurrencyName(Num)
|
||||
|
||||
function FillCurrencyAsync(IdName,StartNum)
|
||||
{
|
||||
InitMapCurrency();
|
||||
if(!StartNum)
|
||||
StartNum = 8;
|
||||
FillCurrencyNext(IdName, StartNum);
|
||||
};
|
||||
|
||||
function FillCurrencyNext(IdName,StartNum)
|
||||
{
|
||||
var MaxCountViewRows = 10;
|
||||
GetData("DappSmartList", {StartNum:StartNum, CountNum:MaxCountViewRows, TokenGenerate:1}, function (Data)
|
||||
{
|
||||
@ -1331,10 +1348,11 @@ function FillCurrencyAsync(IdName,StartNum)
|
||||
if(Smart.Num > MaxNum)
|
||||
MaxNum = Smart.Num;
|
||||
}
|
||||
FillSelect(IdName, MapCurrency, 1);
|
||||
if(IdName)
|
||||
FillSelect(IdName, MapCurrency, 1);
|
||||
if(Data.arr.length === MaxCountViewRows && MaxNum)
|
||||
{
|
||||
FillCurrencyAsync(IdName, MaxNum + 1);
|
||||
FillCurrencyNext(IdName, MaxNum + 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -193,15 +193,25 @@ function CurrencyName(Num)
|
||||
return Name;
|
||||
};
|
||||
var SendCountUpdate = 0;
|
||||
var WasInitCurrency = 0;
|
||||
|
||||
function FindAllCurrency()
|
||||
{
|
||||
WasInitCurrency = 1;
|
||||
InitMapCurrency();
|
||||
FindAllCurrencyNext(8);
|
||||
};
|
||||
|
||||
function FindAllCurrencyNext(StartNum)
|
||||
{
|
||||
SendCountUpdate++;
|
||||
GetSmartList({StartNum:8, CountNum:100, TokenGenerate:1}, function (Err,Arr)
|
||||
var MaxCountViewRows = 10;
|
||||
GetSmartList({StartNum:StartNum, CountNum:MaxCountViewRows, TokenGenerate:1}, function (Err,Arr)
|
||||
{
|
||||
SendCountUpdate--;
|
||||
if(Err)
|
||||
return ;
|
||||
var MaxNum = 0;
|
||||
for(var i = 0; i < Arr.length; i++)
|
||||
{
|
||||
var Smart = Arr[i];
|
||||
@ -210,6 +220,12 @@ function FindAllCurrency()
|
||||
var Name = GetTokenName(Smart.Num, Smart.ShortName);
|
||||
MapCurrency[Smart.Num] = Name;
|
||||
}
|
||||
if(Smart.Num > MaxNum)
|
||||
MaxNum = Smart.Num;
|
||||
}
|
||||
if(Arr.length === MaxCountViewRows && MaxNum)
|
||||
{
|
||||
FindAllCurrencyNext(MaxNum + 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -261,6 +277,62 @@ function GetState(AccNum,F,FErr)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function UpdateListArr(Block,Tr,Arr,StopBlock,IgnoreTailBlock,MaxDepth,F)
|
||||
{
|
||||
Arr.sort(function (a,b)
|
||||
{
|
||||
return a.Num - b.Num;
|
||||
});
|
||||
if(Arr.length)
|
||||
StopBlock = Math.max(StopBlock, Arr[Arr.length - 1].BlockNum);
|
||||
UpdateListArrNext(Block, Tr, Arr, StopBlock, IgnoreTailBlock, MaxDepth, F);
|
||||
};
|
||||
|
||||
function UpdateListArrNext(Block,Tr,Arr,StopMinBlock,IgnoreTailBlock,MaxDepth,F)
|
||||
{
|
||||
if(Block <= StopMinBlock || !MaxDepth)
|
||||
return ;
|
||||
SendCountUpdate++;
|
||||
DappBlockFile(Block, Tr, function (Err,Data)
|
||||
{
|
||||
SendCountUpdate--;
|
||||
if(!Err && Data.Type === 135)
|
||||
{
|
||||
try
|
||||
{
|
||||
var Params = JSON.parse(Data.Params);
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
if(Params)
|
||||
{
|
||||
if(Block <= INFO.CurBlockNum - IgnoreTailBlock)
|
||||
{
|
||||
Params.BlockNum = Block;
|
||||
Params.TrNum = Tr;
|
||||
Params.Num = Params.BlockNum * 100000 + Params.TrNum;
|
||||
Params.Time = Date.now();
|
||||
if(!Arr.length || Arr[Arr.length - 1].Num !== Params.Num)
|
||||
Arr.push(Params);
|
||||
}
|
||||
if(Params.PrevBlock)
|
||||
{
|
||||
UpdateListArrNext(Params.PrevBlock, Params.PrevTr, Arr, StopMinBlock, IgnoreTailBlock, MaxDepth - 1, F);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(F && SendCountUpdate === 0)
|
||||
{
|
||||
Arr.sort(function (a,b)
|
||||
{
|
||||
return a.Num - b.Num;
|
||||
});
|
||||
F(Arr);
|
||||
}
|
||||
});
|
||||
};
|
||||
var glMapF = {};
|
||||
var glKeyF = 0;
|
||||
|
||||
@ -387,8 +459,9 @@ function LoadFromStorageByArr(Arr,F,bAll)
|
||||
LoadFromStorageById(Arr[i]);
|
||||
}
|
||||
}
|
||||
if(bAll && F)
|
||||
F(0);
|
||||
else
|
||||
if(bAll && F)
|
||||
F(0);
|
||||
});
|
||||
};
|
||||
|
||||
@ -482,6 +555,9 @@ function UpdateDappInfo()
|
||||
OPEN_PATH = Data.OPEN_PATH;
|
||||
ACCOUNT_OPEN_NUM = ParseNum(OPEN_PATH);
|
||||
SetBlockChainConstant(Data);
|
||||
window.NETWORK_NAME = INFO.NETWORK;
|
||||
if(!WasInitCurrency)
|
||||
FindAllCurrency();
|
||||
USER_ACCOUNT = Data.ArrWallet;
|
||||
USER_ACCOUNT_MAP = {};
|
||||
for(var i = 0; i < USER_ACCOUNT.length; i++)
|
||||
|
@ -83,18 +83,18 @@ function OnLoad()
|
||||
{
|
||||
if(window.location.protocol === "https:")
|
||||
{
|
||||
NETWORK = "TERA-MAIN";
|
||||
FillSelect("idCurNetwork", [{value:NETWORK, text:"TERA MAIN"}]);
|
||||
$("idCurNetwork").value = NETWORK;
|
||||
Storage.setItem("NETWORK", NETWORK);
|
||||
NETWORK_NAME = "TERA-MAIN";
|
||||
FillSelect("idCurNetwork", [{value:NETWORK_NAME, text:"TERA MAIN"}]);
|
||||
$("idCurNetwork").value = NETWORK_NAME;
|
||||
Storage.setItem("NETWORK", NETWORK_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(Storage.getItem("NETWORK"))
|
||||
{
|
||||
NETWORK = Storage.getItem("NETWORK");
|
||||
NETWORK_NAME = Storage.getItem("NETWORK");
|
||||
}
|
||||
$("idCurNetwork").value = NETWORK;
|
||||
$("idCurNetwork").value = NETWORK_NAME;
|
||||
}
|
||||
LoadValues();
|
||||
InitDappsCard();
|
||||
@ -120,8 +120,8 @@ function ChangeNetwork(bStart)
|
||||
{
|
||||
FirstAccountsData = 1;
|
||||
CONNECT_STATUS = 0;
|
||||
NETWORK = $("idCurNetwork").value;
|
||||
Storage.setItem("NETWORK", NETWORK);
|
||||
NETWORK_NAME = $("idCurNetwork").value;
|
||||
Storage.setItem("NETWORK", NETWORK_NAME);
|
||||
if(bStart)
|
||||
StartWebWallet();
|
||||
else
|
||||
@ -1261,6 +1261,16 @@ function GetNewLangItem()
|
||||
{
|
||||
console.log(JSON.stringify(LangMap["ENG"]));
|
||||
};
|
||||
|
||||
function OpenHelp()
|
||||
{
|
||||
var Key = $("idLang").value;
|
||||
var Map = LangMap[$("idLang").value];
|
||||
var Link = Map["==HELP-LINK=="];
|
||||
if(!Link)
|
||||
Link = "https://medium.com/@evkara777/tera-cryptocurrency-wallet-types-account-creation-97735abad783";
|
||||
window.open(Link);
|
||||
};
|
||||
var LangMap = {};
|
||||
LangMap["ENG"] = {};
|
||||
LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сгенерировать ключ", "OK":"OK", "Cancel":"Отмена", "Edit":"Редактирование",
|
||||
@ -1285,7 +1295,9 @@ LangMap["RUS"] = {"TERA WALLET":"TERA КОШЕЛЕК", "Generate key":"Сген
|
||||
"Load key":"Загруз.", "Create your first account and start using TERA":"Создайте свой первый счет и начните использовать TERA",
|
||||
"0 Accounts":"0 Счетов", "OWNER: {Item.Owner}":"Владелец: {Item.Owner}", "More info":"Инфо", "Public key":"Публичный ключ",
|
||||
"Enter number of dapp":"Введите номер Dapp", "Enter the dapps number that will be added to your account. Attention make sure that you trust this dapp, otherwise you may lose all funds in this account.":"Введите номер Dapp, который будет добавлен в ваш аккаунт. Внимание убедитесь, что Вы доверяете ему, в противном случае вы можете потерять все средства на этом счете.",
|
||||
"Sending Tx":"Отправка транзакции", "Wallet ver:":"Версия:", };
|
||||
"Sending Tx":"Отправка транзакции", "Wallet ver:":"Версия:", "HELP: Tera Wallet creation Guide...":"Руководство по созданию Tera Wallet...",
|
||||
"==HELP-LINK==":"https://medium.com/@evkara777/tera-%D0%BA%D1%80%D0%B8%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D0%BB%D1%8E%D1%82%D0%BD%D1%8B%D0%B9-%D0%BA%D0%BE%D1%88%D0%B5%D0%BB%D0%B5%D0%BA-%D0%B2%D0%B8%D0%B4%D1%8B-%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D1%81%D1%87%D0%B5%D1%82%D0%B0-6402531ecc11",
|
||||
};
|
||||
LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成私钥", "OK":"OK", "Cancel":"取消", "Edit":"编辑", "Save key":"保存私钥",
|
||||
"+ CREATE A NEW ACCOUNT":"+ 新建账号", "Create account":"创建账号", "Send":"发送", "SEND":"转账", "CONFIRM":"确认", "Accounts":"账号", "Account(s)":"账号",
|
||||
"Blocks and Tx":"区块和交易", "Counters":"状态统计", "Open DApp":"打开DApp", "Back":"返回", "Delete":"删除", "Save to book":"保存到地址本", "Choose":"选择",
|
||||
@ -1302,7 +1314,8 @@ LangMap["简体中文"] = {"TERA WALLET":"TERA 钱包", "Generate key":"生成
|
||||
"From:":"付款:", "Set a password for protect entry":"设置密码保护钱包", "Enter password to unlock wallet":"输入密码解锁钱包", "From ID:":"付款ID:",
|
||||
"Pay to ID:":"收款ID:", "Account":"账号", "Owner":"拥有者", "Block num":"区块编号", "Private key (secret)":"私钥 (机密)", "Load key":"载入私钥",
|
||||
"Create your first account and start using TERA":"创建你的第一个账号,开启TERA之旅", "0 Accounts":"0 账号", "OWNER: {Item.Owner}":"拥有者: {Item.Owner}",
|
||||
"More info":"详情", "Public key":"公钥"};
|
||||
"More info":"详情", "Public key":"公钥", "HELP: Tera Wallet creation Guide...":"TERA钱包创作指南", "==HELP-LINK==":"https://terafoundation.org/files/Tera-Wallet-cn.pdf",
|
||||
};
|
||||
LangMap["한글"] = {"TERA WALLET":"TERA 지갑", "Generate key":"개인 키 생성", "OK":"OK", "Cancel":"취소", "Edit":"편집", "Save key":"개인 키 저장",
|
||||
"+ CREATE A NEW ACCOUNT":"+ 새 계정 만들기", "Create account":"계정 만들기", "Send":"발송", "CONFIRM":"확인", "Accounts":"계정", "Account(s)":"계정",
|
||||
"Blocks & Tx":"블록 & 교역 번호", "Counters":"컨디션 통계", "Open DApp":" DApp을 열기", "Back":"되돌아가기", "Delete":"삭제", "Save to book":"저장",
|
||||
|
@ -323,7 +323,7 @@ function SetArrLog(arr)
|
||||
{
|
||||
var Item = arr[i];
|
||||
var tr_text = GetTransactionText(MapSendTransaction[Item.key], Item.key.substr(0, 16));
|
||||
var info = Item.text;
|
||||
var info = Item.time + " " + Item.text;
|
||||
if(tr_text)
|
||||
info += " (" + tr_text + ")";
|
||||
if(Item.final)
|
||||
|
@ -16,7 +16,7 @@ var MaxConnectedCount = 50;
|
||||
var TIME_LENGTH_CONNECT_ALL = 2 * 1000;
|
||||
var StartTimeConnecting = 0;
|
||||
var ConnectedCount = 0;
|
||||
var NETWORK = "TERA-MAIN";
|
||||
var NETWORK_NAME = "TERA-MAIN";
|
||||
var ServerMap = {};
|
||||
var ServerMainMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"}, "terawallet.org":{"ip":"terawallet.org", "port":443,
|
||||
"Name":"terawallet", "System":1}, "teraexplorer.org":{"ip":"teraexplorer.org", "port":443, "Name":"teraexplorer", "System":1},
|
||||
@ -30,7 +30,7 @@ var ServerTestMap = {"127.0.0.1":{"ip":"127.0.0.1", "port":80, "Name":"LOCAL"},
|
||||
|
||||
function StartWebWallet()
|
||||
{
|
||||
if(NETWORK === "TERA-TEST3")
|
||||
if(NETWORK_NAME === "TERA-TEST3")
|
||||
{
|
||||
MIN_SUM_POWER = 0;
|
||||
ServerMap = ServerTestMap;
|
||||
@ -40,14 +40,14 @@ function StartWebWallet()
|
||||
MIN_SUM_POWER = COUNT_BLOCK_PROOF * 35;
|
||||
ServerMap = ServerMainMap;
|
||||
}
|
||||
$("idNetwork").innerText = NETWORK;
|
||||
$("idNetwork").innerText = NETWORK_NAME;
|
||||
OnInitWebWallet();
|
||||
ConnectWebWallet();
|
||||
};
|
||||
|
||||
function OnInitWebWallet()
|
||||
{
|
||||
var str = Storage.getItem(NETWORK + "NodesArrayList");
|
||||
var str = Storage.getItem(NETWORK_NAME + "NodesArrayList");
|
||||
if(str)
|
||||
{
|
||||
var arr = JSON.parse(str);
|
||||
@ -77,7 +77,7 @@ function SaveServerMap()
|
||||
var Item = Arr[i];
|
||||
Arr2.push({ip:Item.ip, port:Item.port, Stat:Item.Stat, t:Item.DeltaTime});
|
||||
}
|
||||
Storage.setItem(NETWORK + "NodesArrayList", JSON.stringify(Arr2));
|
||||
Storage.setItem(NETWORK_NAME + "NodesArrayList", JSON.stringify(Arr2));
|
||||
};
|
||||
|
||||
function SetStatus(Str)
|
||||
@ -145,7 +145,7 @@ function DoNodeList(Item)
|
||||
Item.StartTime = Date.now();
|
||||
GetData(GetProtocolServerPath(Item) + "/GetNodeList", {}, function (Data)
|
||||
{
|
||||
if(Data && Data.result && Data.NETWORK === NETWORK && Data.VersionNum >= MIN_VERSION)
|
||||
if(Data && Data.result && Data.NETWORK === NETWORK_NAME && Data.VersionNum >= MIN_VERSION)
|
||||
{
|
||||
ConnectedCount++;
|
||||
Item.GetHandShake = 1;
|
||||
@ -226,7 +226,7 @@ function DoWalletInfo(Item)
|
||||
{
|
||||
if(!idTimeFindLider)
|
||||
return ;
|
||||
if(Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK)
|
||||
if(Data && Data.result && Data.BlockChain && Data.NETWORK === NETWORK_NAME)
|
||||
{
|
||||
Item.Name = Data.NODES_NAME;
|
||||
Item.GetWalletInfo = 1;
|
||||
|
@ -896,6 +896,10 @@
|
||||
background-color: #e6eefe;
|
||||
}
|
||||
|
||||
.trim
|
||||
{
|
||||
margin: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -921,7 +925,7 @@
|
||||
<select size="45" id="idProjectList" style="width:100%;height:375px;" onchange="SetCurrentProject()" onclick="SetCurrentProject()">
|
||||
</select>
|
||||
Smarts, start:<INPUT type="number" id="idSmartStart" style="width:98%;" onchange="FillSmart()" value="8">
|
||||
<select size="45" id="idSmartList" style="width:100%;height:380px;" onchange="SetCurrentSmart()" onclick="SetCurrentSmart()">
|
||||
<select size="45" id="idSmartList" style="width:100%;height:361px;" onchange="SetCurrentSmart()" onclick="SetCurrentSmart()">
|
||||
</select>
|
||||
</DIV>
|
||||
|
||||
@ -929,7 +933,7 @@
|
||||
<DIV>
|
||||
<DIV>
|
||||
Name:<INPUT type="string" id="idName" style="width: 20%;" value="">
|
||||
Accounts:<INPUT type="number" id="idAccountLength" style="width: 5%;" value="1">
|
||||
Accounts:<INPUT type="number" id="idAccountLength" min=1 max=50 style="width: 5%;" value="1">
|
||||
<INPUT type="button" onclick="SendToBlockchain()" class="bt btdoit" style="width: 150px; " id="idBtSendSmart" value="Send to blockchain">
|
||||
<select size="1" id="idUser" class="" style="width: 300px" onchange="SaveValues()">
|
||||
<option value="">loading</option>
|
||||
@ -964,19 +968,17 @@
|
||||
</select>
|
||||
</DIV>
|
||||
|
||||
|
||||
|
||||
|
||||
<BR>
|
||||
Smart (JS):
|
||||
<button class="bt trim" onclick="TrimRows('idCode');">TRIM ROWS</button>
|
||||
<textarea id="idCode" style="width: 99%;height: 95%;" rows="19" cols="98" autofocus>
|
||||
</textarea>
|
||||
State format:
|
||||
<textarea id="idStateFormat" style="width: 99%;height: 95%;" rows="2" cols="98" autofocus>
|
||||
</textarea>
|
||||
|
||||
|
||||
</DIV>
|
||||
<DIV style="float: left;">UI (HTML):</DIV><DIV id="idRefHTML" style="float: left;">----</DIV>
|
||||
<button class="bt trim" onclick="TrimRows('idHTML');">TRIM ROWS</button>
|
||||
<textarea rows="15" cols="98" id="idHTML" style="width: 99%;">
|
||||
</textarea>
|
||||
</DIV>
|
||||
@ -1016,6 +1018,7 @@
|
||||
<option value="application/javascript">javascript</option>
|
||||
<option value="text/css">css</option>
|
||||
<option value="text/plain">text</option>
|
||||
<option value="application/json">json</option>
|
||||
</select>
|
||||
|
||||
<button class="bt btdoit" onclick="TrimRows('idText');CalclTextLength()">TRIM ROWS</button>
|
||||
|
@ -25,10 +25,7 @@
|
||||
var CONFIG_DATA={};
|
||||
var NumDappGet=0;
|
||||
var NumDappInfo=0;
|
||||
|
||||
// var arr = new Uint8Array(6);
|
||||
// window.crypto.getRandomValues(arr);
|
||||
// var glSession=GetHexFromArr(arr);
|
||||
var DAPPPREFIX="DAPP-";
|
||||
|
||||
|
||||
//DAPP TRANSFER
|
||||
@ -67,12 +64,12 @@
|
||||
}
|
||||
case "setstorage":
|
||||
{
|
||||
Storage.setItem("DAPP-"+DapNumber+"-"+Data.Key,JSON.stringify(Data.Value));
|
||||
Storage.setItem(DAPPPREFIX+DapNumber+"-"+Data.Key,JSON.stringify(Data.Value));
|
||||
break;
|
||||
}
|
||||
case "getstorage":
|
||||
{
|
||||
Data.Value=Storage.getItem("DAPP-"+DapNumber+"-"+Data.Key);
|
||||
Data.Value=Storage.getItem(DAPPPREFIX+DapNumber+"-"+Data.Key);
|
||||
if(Data.Value)
|
||||
Data.Value=JSON.parse(Data.Value);
|
||||
SendMessage(Data);
|
||||
@ -80,12 +77,12 @@
|
||||
}
|
||||
case "setcommon":
|
||||
{
|
||||
Storage.setItem("DAPP-"+Data.Key,JSON.stringify(Data.Value));
|
||||
Storage.setItem(DAPPPREFIX+Data.Key,JSON.stringify(Data.Value));
|
||||
break;
|
||||
}
|
||||
case "getcommon":
|
||||
{
|
||||
Data.Value=Storage.getItem("DAPP-"+Data.Key);
|
||||
Data.Value=Storage.getItem(DAPPPREFIX+Data.Key);
|
||||
if(Data.Value)
|
||||
Data.Value=JSON.parse(Data.Value);
|
||||
SendMessage(Data);
|
||||
@ -322,17 +319,22 @@
|
||||
SetBlockChainConstant(SetData);
|
||||
document.title=SMART.Name;
|
||||
|
||||
if(CONFIG_DATA.NETWORK!=="TERA-MAIN")
|
||||
DAPPPREFIX="DAPP-"+CONFIG_DATA.NETWORK;
|
||||
|
||||
InitMenu();
|
||||
|
||||
|
||||
var HTMLBlock=BASE_ACCOUNT.SmartState.HTMLBlock;
|
||||
var HTMLTr=BASE_ACCOUNT.SmartState.HTMLTr;
|
||||
if(!glDebugPath && HTMLBlock)
|
||||
if(HTMLBlock && !glDebugPath)
|
||||
{
|
||||
console.log("Load HTML from: /file/"+HTMLBlock+"/"+HTMLTr);
|
||||
GetData("DappBlockFile",{BlockNum:HTMLBlock,TrNum:HTMLTr}, function (SetData)
|
||||
{
|
||||
if(SetData && SetData.result)
|
||||
{
|
||||
CreateFrame(SetData);
|
||||
CreateFrame(SetData,0);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -342,7 +344,7 @@
|
||||
{
|
||||
if(SetData && SetData.result)
|
||||
{
|
||||
CreateFrame(SetData);
|
||||
CreateFrame(SetData,0);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -364,16 +366,17 @@
|
||||
|
||||
if(isMobile())
|
||||
SetMobileMode();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function CreateFrame(SetData)
|
||||
function CreateFrame(SetData,bTrust)
|
||||
{
|
||||
|
||||
var SriptLW="";
|
||||
if(MainServer)
|
||||
{
|
||||
var StrPath=GetProtocolServerPath(MainServer);
|
||||
//console.log("StrPath:"+StrPath);
|
||||
//console.log("WAS:\n"+SetData.Body);
|
||||
|
||||
//поддрежка старого кода dapp (после обновления dapp этот код возможно будет удален)
|
||||
SetData.Body=SetData.Body.replace(/.\/CSS\/[0-9a-z_-]+.css\">/g,StrPath+"$&");
|
||||
@ -390,8 +393,10 @@
|
||||
|
||||
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.id="idFrame";
|
||||
iframe.name = 'dapp';
|
||||
iframe.sandbox="allow-scripts";
|
||||
|
||||
SetData.Body='\
|
||||
<meta charset="UTF-8">\
|
||||
<meta http-equiv="X-Frame-Options" value="sameorigin">\
|
||||
@ -423,25 +428,41 @@
|
||||
if(!idInstallApp)
|
||||
idInstallApp=setInterval(RunCheckInstall,2000);
|
||||
}
|
||||
|
||||
function GetWalletLink()
|
||||
{
|
||||
if(MainServer)
|
||||
return "./web-wallet.html#TabAccounts";
|
||||
else
|
||||
if(Storage.getItem("BIGWALLET"))
|
||||
return "/wallet.html#TabAccounts";
|
||||
else
|
||||
return "/web-wallet.html#TabAccounts";
|
||||
}
|
||||
|
||||
function RunCheckInstall()
|
||||
{
|
||||
if(CONFIG_DATA && CONFIG_DATA.ArrWallet && CONFIG_DATA.ArrWallet.length===0)
|
||||
{
|
||||
var StrRef;
|
||||
if(MainServer)
|
||||
StrRef='<A class="btcreate" href="./web-wallet.html#TabAccounts">Accounts</A>';
|
||||
StrRef='<A class="btcreate" href="'+GetWalletLink()+'">Accounts</A>';
|
||||
else
|
||||
{
|
||||
if(Storage.getItem("BIGWALLET"))
|
||||
StrRef='<A class="btcreate" href="/wallet.html#TabAccounts">Config</A>'
|
||||
StrRef='<A class="btcreate" href="'+GetWalletLink()+'">Config</A>'
|
||||
else
|
||||
StrRef='<A class="btcreate" href="/web-wallet.html#TabAccounts">Accounts</A>';
|
||||
StrRef='<A class="btcreate" href="'+GetWalletLink()+'">Accounts</A>';
|
||||
}
|
||||
|
||||
var Str='<DIV style="background-color: #c8ecff;">For install this app press: <button class="btcreate" onclick="InstallApp()">Create account</button> or goto '+StrRef+' tab and Set smart number <B>'+SMART.Num+'</B> to your account<DIV>';
|
||||
//var Str='<DIV style="background-color: #c8ecff;">For install this app press: <button class="btcreate" onclick="InstallApp()">Create account</button> or goto '+StrRef+' tab and Set smart number <B>'+SMART.Num+'</B> to your account<DIV>';
|
||||
var Str='<DIV style="background-color: #c8ecff;">For install this app press: <button class="btcreate" onclick="InstallApp()">Create account</button><DIV>';
|
||||
SetStatus(Str);
|
||||
}
|
||||
|
||||
}
|
||||
function OpenWalletPage()
|
||||
{
|
||||
window.open(GetWalletLink());
|
||||
}
|
||||
|
||||
//LIB
|
||||
@ -463,7 +484,10 @@
|
||||
{
|
||||
var Data={};
|
||||
Data.cmd="OnEvent";
|
||||
Data.Description="Error: "+Item.text;
|
||||
if(isMobile())
|
||||
Data.Description=Item.text;
|
||||
else
|
||||
Data.Description="Error: "+Item.text;
|
||||
Data.Error=1;
|
||||
//console.log(JSON.stringify(Item));
|
||||
SendMessage(Data);
|
||||
@ -471,6 +495,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function IsPrivateMode(PrivKeyStr)
|
||||
{
|
||||
if(PrivKeyStr && PrivKeyStr.length===64)
|
||||
@ -484,7 +509,8 @@
|
||||
{
|
||||
var id = $("idStatus");
|
||||
id.innerHTML=Str;
|
||||
console.log(id.innerText);
|
||||
if(Str)
|
||||
console.log(id.innerText);
|
||||
}
|
||||
|
||||
function SetError(Str,bNoSound)
|
||||
@ -542,32 +568,225 @@
|
||||
|
||||
}
|
||||
|
||||
function ResetDapp()
|
||||
{
|
||||
SetStatus("");
|
||||
DoNewSession();
|
||||
if(idInstallApp)
|
||||
{
|
||||
clearInterval(idInstallApp);
|
||||
idInstallApp=0;
|
||||
}
|
||||
}
|
||||
function RunDappFromFile()
|
||||
{
|
||||
CloseMenu();
|
||||
LoadDappFromFile();
|
||||
|
||||
}
|
||||
var WasLoadFromFile=0;
|
||||
function LoadDappFromFile()
|
||||
{
|
||||
$('idFile').onchange=function ()
|
||||
{
|
||||
ResetDapp();
|
||||
CreateFromFile();
|
||||
};
|
||||
$('idFile').click();
|
||||
}
|
||||
function ReloadDapp()
|
||||
{
|
||||
ResetDapp();
|
||||
|
||||
if(WasLoadFromFile)
|
||||
CreateFromFile();
|
||||
else
|
||||
window.location.reload();
|
||||
}
|
||||
function CreateFromFile()
|
||||
{
|
||||
var file = $("idFile").files[0];
|
||||
var reader = new FileReader();
|
||||
reader.onload = function()
|
||||
{
|
||||
WasLoadFromFile=1;
|
||||
var view = new Uint8Array(reader.result);
|
||||
var Str=Utf8ArrayToStr(view);
|
||||
if($("idFrame"))
|
||||
$("idFrame").outerHTML="";
|
||||
CreateFrame({Body:Str},1);
|
||||
$("idRunItem").innerText="Runing DApp from: "+file.name;
|
||||
}
|
||||
if(file)
|
||||
reader.readAsArrayBuffer(file);
|
||||
}
|
||||
|
||||
function InitMenu()
|
||||
{
|
||||
$("idCreateItem").innerText=$("idCreateItem").innerText.replace("NNN",SMART.Num);
|
||||
}
|
||||
var OpenMenu=0;
|
||||
function OnClickMenu()
|
||||
{
|
||||
DoVisibleMenu(!OpenMenu);
|
||||
}
|
||||
function CloseMenu()
|
||||
{
|
||||
DoVisibleMenu(0);
|
||||
}
|
||||
function DoVisibleMenu(SetMenu)
|
||||
{
|
||||
setTimeout(function ()
|
||||
{
|
||||
OpenMenu=SetMenu;
|
||||
$("idMenu").className="top "+(OpenMenu?"open":"close");
|
||||
},50);
|
||||
|
||||
}
|
||||
|
||||
window.onclick=function (t)
|
||||
{
|
||||
if(OpenMenu)
|
||||
{
|
||||
CloseMenu();
|
||||
}
|
||||
}
|
||||
window.onkeydown = function (e)
|
||||
{
|
||||
//ToLog("keyCode="+e.keyCode);
|
||||
switch (e.keyCode)
|
||||
{
|
||||
case 27:
|
||||
if(OpenMenu)
|
||||
{
|
||||
CloseMenu();
|
||||
}
|
||||
break;
|
||||
case 115:
|
||||
e.preventDefault();
|
||||
ReloadDapp();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
iframe
|
||||
:root
|
||||
{
|
||||
left:0;
|
||||
top: 20px;
|
||||
width: 100%;
|
||||
height: 97vh;
|
||||
border: 0;
|
||||
--colorMenu0: black;
|
||||
--colorMenu1: #8daab2;
|
||||
--colorMenu2: #86b0cb;
|
||||
|
||||
--colorMenu0: white;
|
||||
--colorMenu1: black;
|
||||
--colorMenu2: #343434;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.top
|
||||
{
|
||||
z-index:20;
|
||||
position:fixed;
|
||||
top: 0;
|
||||
height:25px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
#idStatus
|
||||
{
|
||||
text-align: center;
|
||||
position:fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 90%;
|
||||
min-width: 90%;
|
||||
height:25px;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#idMenu
|
||||
{
|
||||
z-index:30;
|
||||
right: 2px;
|
||||
min-width: 70px;
|
||||
max-width: 150px;
|
||||
color: var(--colorMenu0);
|
||||
background-color: var(--colorMenu1);
|
||||
cursor: pointer;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#idMenuList
|
||||
{
|
||||
top: 30px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
#idMenu.open
|
||||
{
|
||||
width: 100px;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.open
|
||||
{
|
||||
z-index:30;
|
||||
right: 0;
|
||||
width: 100px;
|
||||
min-width: 150px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.close
|
||||
{
|
||||
width: 10%;
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
.item
|
||||
{
|
||||
width: 100px;
|
||||
color: var(--colorMenu0);
|
||||
background-color: var(--colorMenu1);
|
||||
cursor: pointer;
|
||||
padding: 4px;
|
||||
margin: 0;
|
||||
margin-left: 5px;
|
||||
min-height: 24px;
|
||||
border: 1px solid #5a6c74;
|
||||
vertical-align: middle;
|
||||
|
||||
min-width: 130px;
|
||||
max-width: 130px;
|
||||
|
||||
}
|
||||
.item:hover
|
||||
{
|
||||
color: #ecb84e;
|
||||
background-color: var(--colorMenu2);
|
||||
}
|
||||
|
||||
#idMenu.close #idMenuList
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#idFrame
|
||||
{
|
||||
z-index:10;
|
||||
position:fixed;
|
||||
left:0;
|
||||
top: 30px;
|
||||
width: 100%;
|
||||
height:18px;
|
||||
height: 97vh;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background-color:white;
|
||||
}
|
||||
|
||||
.btcreate
|
||||
{
|
||||
height:18px;
|
||||
height:22px;
|
||||
background-color: #347867;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
@ -577,23 +796,41 @@
|
||||
border: 1px solid gray;
|
||||
}
|
||||
|
||||
#idMenu.close
|
||||
{
|
||||
background-image: url('./PIC/down.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px;
|
||||
background-position: right;
|
||||
}
|
||||
#idMenu.open
|
||||
{
|
||||
background-image: url('./PIC/up.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px;
|
||||
background-position: right;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<DIV id="idStatus"></DIV>
|
||||
<DIV id="idStatus" class="top"></DIV>
|
||||
<DIV id="idMenu" class="top close" onclick="OnClickMenu()">Menu
|
||||
<div id="idMenuList" class="top open">
|
||||
<div class="item" onclick="OpenWalletPage();">Open wallet page</div>
|
||||
<div class="item" onclick="RunDappFromFile();" id="idRunItem">Load from file...</div>
|
||||
<div class="item" onclick="ReloadDapp();">F4: Rerun</div>
|
||||
<div class="item" onclick="InstallApp();" id="idCreateItem">Create account with DApp NNN</div>
|
||||
</div>
|
||||
</DIV>
|
||||
<input type="file" id="idFile" style="display: none">
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
var glDebugPath="";
|
||||
//glDebugPath="./dapp-smart/forum.html";
|
||||
//glDebugPath="./dapp-smart/DEX.html";
|
||||
//glDebugPath="./dapp-smart/OnlineStore.html";
|
||||
//glDebugPath="./dapp-smart/BTC-coin.html";
|
||||
//glDebugPath="./dapp-smart/static/miner-list.html";
|
||||
//glDebugPath="./dapp-smart/acc-control/RescueMoney.html";
|
||||
//glDebugPath="./dapp-smart/airdrop/page.html";
|
||||
//glDebugPath="./dapp-smart/ambassador/page.html";
|
||||
//glDebugPath="./dapp-smart/mixer/mixer.html";
|
||||
//{"HTMLBlock":2303846,"HTMLTr":0}
|
||||
</script>
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
|
||||
<script>
|
||||
var WasInitCurrency=0;
|
||||
var CONFIG_DATA={}; CONFIG_DATA.CONSTANTS={};
|
||||
var ServerBlockNumDB=0;
|
||||
var ServerCurBlockNum=0;
|
||||
@ -453,6 +454,12 @@
|
||||
SetBlockChainConstant(Data);
|
||||
MaxBlockNum=GetCurrentBlockNumByTime();
|
||||
|
||||
|
||||
window.NETWORK_NAME=CONFIG_DATA.NETWORK;
|
||||
if(!WasInitCurrency)
|
||||
FillCurrencyAsync("idCurrency");
|
||||
WasInitCurrency=1;
|
||||
|
||||
var StrVersion=" 0."+Data.VersionNum;
|
||||
if(Data.CODE_VERSION.VersionNum && Data.VersionNum<Data.CODE_VERSION.VersionNum)
|
||||
{
|
||||
@ -619,7 +626,6 @@
|
||||
|
||||
DrawBlockInfo();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function SetVisibleBtOpenWallet()
|
||||
@ -1414,7 +1420,7 @@
|
||||
|
||||
<body>
|
||||
<DIV align='center'>
|
||||
<DIV align='left' style="width: 800px;border2: 1px solid #727473;">
|
||||
<DIV align='left' style="width: 800px;border2: 1px solid #727473;">
|
||||
|
||||
<table id="TabHeader">
|
||||
<tr>
|
||||
@ -1514,91 +1520,75 @@
|
||||
|
||||
|
||||
<DIV>
|
||||
<DIV id="edit_mining_set" style="display: none">
|
||||
<table class="form_input keys" id="grid_mining_set">
|
||||
<tr>
|
||||
<td><DIV>Mining account:</DIV></td><td><INPUT type="number" id="idMiningAccount" min=0 max=1000000000000 value="0"></td>
|
||||
</tr>
|
||||
<DIV id="edit_mining_set" style="display: none">
|
||||
<table class="form_input keys" id="grid_mining_set">
|
||||
<tr>
|
||||
<td><DIV>Mining account:</DIV></td><td><INPUT type="number" id="idMiningAccount" min=0 max=1000000000000 value="0"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><INPUT type="button" onclick="SaveMiningSet()" class="bt" value="Save">
|
||||
<INPUT type="button" onclick="CancalMiningSet()" class="bt" value="Cancel"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</DIV>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><INPUT type="button" onclick="SaveMiningSet()" class="bt" value="Save">
|
||||
<INPUT type="button" onclick="CancalMiningSet()" class="bt" value="Cancel"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV id="edit_keys" style="display: none">
|
||||
<table class="form_input keys" id="grid_edit_key">
|
||||
<tr>
|
||||
<td>
|
||||
<select size="1" id="idTypeKey" onkeyup="SelectTypeKey();" onchange="SelectTypeKey();">
|
||||
<option value="private">Private key</option>
|
||||
<option value="public">Public key (sign from another wallet)</option>
|
||||
<option value="brain">Brain key generator</option>
|
||||
</select>
|
||||
</td><td><INPUT type="string" autocomplete="off" id="idKeyNew" value=""></td>
|
||||
</tr>
|
||||
<tr id="idViewKeyNew2" style="display: none">
|
||||
<td>You can repeat the secret words:</td>
|
||||
<td><INPUT type="string" id="idKeyNew2" value=""></td>
|
||||
</tr>
|
||||
<DIV id="edit_keys" style="display: none">
|
||||
<table class="form_input keys" id="grid_edit_key">
|
||||
<tr>
|
||||
<td>
|
||||
<select size="1" id="idTypeKey" onkeyup="SelectTypeKey();" onchange="SelectTypeKey();">
|
||||
<option value="private">Private key</option>
|
||||
<option value="public">Public key (sign from another wallet)</option>
|
||||
<option value="brain">Brain key generator</option>
|
||||
</select>
|
||||
</td><td><INPUT type="string" autocomplete="off" id="idKeyNew" value=""></td>
|
||||
</tr>
|
||||
<tr id="idViewKeyNew2" style="display: none">
|
||||
<td>You can repeat the secret words:</td>
|
||||
<td><INPUT type="string" id="idKeyNew2" value=""></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<INPUT type="button" onclick="ConvertToPrivateKey()" class="btdoit bt" style="width: 130px;display: none;" id="idBtConvertKey" value="Convert to key">
|
||||
<INPUT type="button" onclick="SavePrivateKey()" class="bt" id="idBtSaveKey" value="Save">
|
||||
<INPUT type="button" onclick="CancelSavePrivateKey()" class="bt" value="Cancel">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</DIV>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<INPUT type="button" onclick="ConvertToPrivateKey()" class="btdoit bt" style="width: 130px;display: none;" id="idBtConvertKey" value="Convert to key">
|
||||
<INPUT type="button" onclick="SavePrivateKey()" class="bt" id="idBtSaveKey" value="Save">
|
||||
<INPUT type="button" onclick="CancelSavePrivateKey()" class="bt" value="Cancel">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</DIV>
|
||||
|
||||
<DIV id="idAccountEdit" style="display: none">
|
||||
<table class="form_input keys" id="grid_edit_newacc">
|
||||
<tr>
|
||||
<td><DIV>Public name:</DIV></td>
|
||||
<td>
|
||||
<INPUT type="string" maxlength="40" autocomplete="off" id="idAccountName" onkeyup="CheckLengthAccDesription('idAccountName',40)" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<!--<tr>-->
|
||||
<!--<td>-->
|
||||
<!--<DIV>Adviser:</DIV></td><td><INPUT type="number" id="idAdviser" min=0 max=1000000000000 value="0">-->
|
||||
<!--</td>-->
|
||||
<!--</tr>-->
|
||||
<DIV id="idAccountEdit" class="" style="display: none">
|
||||
<table class="form_input keys" id="grid_edit_newacc">
|
||||
<tr><td>Public name:</td>
|
||||
<td>
|
||||
<INPUT type="string" maxlength="40" style="width: 220px;text-align: left" autocomplete="off" id="idAccountName" onkeyup="CheckLengthAccDesription('idAccountName',40)">
|
||||
Currency:
|
||||
<select size="1" id="idCurrency" style="width: 80px;">
|
||||
<option value="0">Loading...</option>
|
||||
</select>
|
||||
Smart:
|
||||
<INPUT type="number" id="idSmart" min=0 max=100000000 value="0" style="width: 80px;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<DIV>Currency:</DIV></td><td><INPUT type="number" id="idCurrency" min=0 max=1000000000 value="0">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<DIV>Smart:</DIV></td><td><INPUT type="number" id="idSmart" min=0 max=1000000000 value="0">
|
||||
</td>
|
||||
</tr>
|
||||
<!--<tr>-->
|
||||
<!--<td></td><td><INPUT type="checkbox" checked id="idAutoSetMining">Mining on this account</td>-->
|
||||
<!--</tr>-->
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
<td><INPUT type="button" onclick="CreateAccount(0)" class="bt" value="Create">
|
||||
<INPUT type="button" onclick="CancelCreateAccount()" class="bt" value="Cancel">
|
||||
<INPUT type="button" onclick="CreateAccount(1)" class="bt btdoit" style="width: 130px;" id="idBtRun" value="Add to Pay list">
|
||||
</td>
|
||||
<td>
|
||||
<span id="idRowWN" style="display: none;">WN:<INPUT type="number" id="idWN" min=0 max=100 style="width: 30px;" value=""></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="idRowWN" style="display: none">
|
||||
<td>
|
||||
<DIV>Wallet number:</DIV></td><td><INPUT type="number" id="idWN" min=0 max=100 value="0">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><INPUT type="button" onclick="CreateAccount(0)" class="bt" value="Create">
|
||||
<INPUT type="button" onclick="CancelCreateAccount()" class="bt" value="Cancel">
|
||||
<INPUT type="button" onclick="CreateAccount(1)" class="bt btdoit" style="width: 130px;" id="idBtRun" value="Add to Pay list">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</DIV>
|
||||
</table>
|
||||
</DIV>
|
||||
</DIV>
|
||||
|
||||
|
||||
@ -2071,7 +2061,6 @@
|
||||
|
||||
|
||||
</DIV>
|
||||
|
||||
</DIV>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -63,6 +63,7 @@
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="welcome__title title">Welcome to TERA Wallet</h1>
|
||||
<p><a onclick="OpenHelp()" class="pointer">HELP: Tera Wallet creation Guide...</a></p>
|
||||
<p><a onclick="SelectTab('TabKeySet')" class="pointer">ATTENTION: Before using the wallet, save the private key.</a></p>
|
||||
|
||||
<ul id="idStableScroll" align='center' class="social-list">
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Telegram: https://t.me/terafoundation
|
||||
*/
|
||||
|
||||
global.UPDATE_CODE_VERSION_NUM = 1188;
|
||||
global.UPDATE_CODE_VERSION_NUM = 1194;
|
||||
global.MIN_CODE_VERSION_NUM = 1114;
|
||||
global.MINING_VERSION_NUM = 0;
|
||||
global.InitParamsArg = InitParamsArg;
|
||||
@ -20,6 +20,7 @@ global.CONST_NAME_ARR = ["AUTO_CORRECT_TIME", "DELTA_CURRENT_TIME", "COMMON_KEY"
|
||||
"LIMIT_SEND_TRAFIC", "WATCHDOG_DEV", "ADDRLIST_MODE", "CheckPointDelta", "MIN_VER_STAT", "DEBUG_WALLET", "HTTP_HOSTING_PORT",
|
||||
"HTTPS_HOSTING_DOMAIN", "HTTP_MAX_COUNT_ROWS", "HTTP_ADMIN_PASSWORD", "HTTP_START_PAGE", "WATCHDOG_BADACCOUNT", "RESYNC_CONDITION",
|
||||
"MAX_CONNECTIONS_COUNT", "TRUST_PROCESS_COUNT", "REST_START_COUNT", "LOAD_TO_BEGIN", ];
|
||||
global.UPDATE_CODE_1 = 36000000;
|
||||
global.MAX_LENGTH_SENDER_MAP = 3000;
|
||||
global.DELTA_START_SENDER_MAP = 24;
|
||||
global.NODES_DELTA_CALC_HOUR = 4;
|
||||
@ -169,6 +170,7 @@ if(global.LOCAL_RUN)
|
||||
global.MIN_POWER_POW_TR = 0;
|
||||
global.AUTO_CORRECT_TIME = 0;
|
||||
global.CHECK_GLOBAL_TIME = 0;
|
||||
global.UPDATE_CODE_1 = 0;
|
||||
}
|
||||
else
|
||||
if(global.TEST_NETWORK)
|
||||
@ -204,6 +206,7 @@ else
|
||||
global.REST_START_COUNT = 10000;
|
||||
global.LOAD_TO_BEGIN = 2;
|
||||
global.START_BAD_ACCOUNT_CONTROL = 3105000;
|
||||
global.UPDATE_CODE_1 = 3180000;
|
||||
}
|
||||
global.GetNetworkName = function ()
|
||||
{
|
||||
|
@ -398,7 +398,7 @@ HTTPCaller.DappInfo = function (Params,responce,ObjectOnly)
|
||||
}
|
||||
var Ret = {result:1, DELTA_CURRENT_TIME:DELTA_CURRENT_TIME, MIN_POWER_POW_TR:MIN_POWER_POW_TR, FIRST_TIME_BLOCK:FIRST_TIME_BLOCK,
|
||||
CONSENSUS_PERIOD_TIME:CONSENSUS_PERIOD_TIME, PRICE_DAO:PRICE_DAO(SERVER.BlockNumDB), NEW_SIGN_TIME:NEW_SIGN_TIME, Smart:Smart,
|
||||
Account:Account, ArrWallet:WLData.arr, ArrEvent:EArr, ArrLog:ArrLog, };
|
||||
Account:Account, NETWORK:global.NETWORK, ArrWallet:WLData.arr, ArrEvent:EArr, ArrLog:ArrLog, };
|
||||
if(global.WALLET)
|
||||
{
|
||||
Ret.WalletIsOpen = (WALLET.WalletOpen !== false);
|
||||
@ -612,7 +612,8 @@ HTTPCaller.GetWalletInfo = function (Params)
|
||||
STAT_MODE:global.STAT_MODE, HTTPPort:global.HTTP_PORT_NUMBER, HTTPPassword:HTTP_PORT_PASSWORD, CONSTANTS:Constants, CheckPointBlockNum:CHECK_POINT.BlockNum,
|
||||
MiningAccount:global.GENERATE_BLOCK_ACCOUNT, CountMiningCPU:GetCountMiningCPU(), CountRunCPU:global.ArrMiningWrk.length, MiningPaused:global.MiningPaused,
|
||||
HashRate:HashRateOneSec, MIN_POWER_POW_TR:MIN_POWER_POW_TR, PRICE_DAO:PRICE_DAO(SERVER.BlockNumDB), NWMODE:global.NWMODE, PERIOD_ACCOUNT_HASH:PERIOD_ACCOUNT_HASH,
|
||||
MAX_ACCOUNT_HASH:DApps.Accounts.DBAccountsHash.GetMaxNum(), TXBlockNum:TXBlockNum, SpeedSignLib:global.SpeedSignLib, };
|
||||
MAX_ACCOUNT_HASH:DApps.Accounts.DBAccountsHash.GetMaxNum(), TXBlockNum:TXBlockNum, SpeedSignLib:global.SpeedSignLib, NETWORK:global.NETWORK,
|
||||
};
|
||||
if(Params.Account)
|
||||
Ret.PrivateKey = GetHexFromArr(WALLET.GetPrivateKey(WALLET.AccountMap[Params.Account]));
|
||||
else
|
||||
@ -938,6 +939,7 @@ HTTPCaller.SaveConstant = function (SetObj)
|
||||
}
|
||||
SAVE_CONST(true);
|
||||
SERVER.DO_CONSTANT();
|
||||
WALLET.FindMyAccounts(1);
|
||||
if(!WasUpdate && global.USE_AUTO_UPDATE && CODE_VERSION.VersionNum && global.UPDATE_CODE_VERSION_NUM < CODE_VERSION.VersionNum)
|
||||
{
|
||||
SERVER.UseCode(CODE_VERSION.VersionNum, true);
|
||||
|
@ -101,7 +101,7 @@ function ToLogClient(Str,StrKey,bFinal)
|
||||
ToLogFile(file_name_log, Str);
|
||||
if(!StrKey)
|
||||
StrKey = "";
|
||||
ArrLogClient.push({text:GetStrOnlyTime() + " " + Str, key:StrKey, final:bFinal, });
|
||||
ArrLogClient.push({time:GetStrOnlyTime(), text:Str, key:StrKey, final:bFinal, });
|
||||
if(ArrLogClient.length > 13)
|
||||
ArrLogClient.shift();
|
||||
};
|
||||
|
@ -198,7 +198,7 @@ module.exports = class CNode
|
||||
if(Buf)
|
||||
{
|
||||
var Str = Buf.Data;
|
||||
if(Str && Str.substr(0, 24) === "WAIT_CONNECT_FROM_SERVER")
|
||||
if(Str && typeof Str === "string" && Str.substr(0, 24) === "WAIT_CONNECT_FROM_SERVER")
|
||||
{
|
||||
AddNodeInfo(NODE, "2. CLIENT OK POW")
|
||||
CloseSocket(SOCKET, "WAIT_CONNECT_FROM_SERVER")
|
||||
|
@ -13,8 +13,8 @@ require("../system/dapp");
|
||||
require("../system/accounts");
|
||||
require("../system/smart");
|
||||
require("../system/file");
|
||||
require("../system/messager");
|
||||
require("../system/names");
|
||||
require("../system/messager");
|
||||
if(global.PROCESS_NAME === "MAIN")
|
||||
{
|
||||
require("./wallet");
|
||||
|
@ -16,6 +16,7 @@ require("./crypto-library");
|
||||
const WalletPath = "WALLET";
|
||||
const DBRow = require("./db/db-row");
|
||||
const CONFIG_NAME = GetDataPath(WalletPath + "/config.lst");
|
||||
global.HIDDEN_ACC_PATH = GetDataPath(WalletPath + "/hidden.lst");
|
||||
class CApp
|
||||
{
|
||||
constructor()
|
||||
@ -223,9 +224,10 @@ class CApp
|
||||
{
|
||||
if(IsZeroArr(this.PubKeyArr))
|
||||
return ;
|
||||
var HiddenMap = LoadParams(HIDDEN_ACC_PATH, {});
|
||||
if(bClean)
|
||||
this.AccountMap = {}
|
||||
DApps.Accounts.FindAccounts([this.PubKeyArr], this.AccountMap, 0)
|
||||
DApps.Accounts.FindAccounts([this.PubKeyArr], this.AccountMap, HiddenMap, 0)
|
||||
}
|
||||
GetAccountKey(Num)
|
||||
{
|
||||
|
@ -283,6 +283,8 @@ WalletFileMap["check.svg"] = 1;
|
||||
WalletFileMap["right-arrow.svg"] = 1;
|
||||
WalletFileMap["down-arrow.svg"] = 1;
|
||||
WalletFileMap["glass.svg"] = 1;
|
||||
WalletFileMap["up.png"] = 1;
|
||||
WalletFileMap["down.png"] = 1;
|
||||
WalletFileMap["dapp-edit.html"] = 1;
|
||||
WalletFileMap["TeraLogo.svg"] = 1;
|
||||
WalletFileMap["mobile-wallet.html"] = "web-wallet.html";
|
||||
|
@ -968,12 +968,12 @@ class AccountApp extends require("./dapp")
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
FindAccounts(PubKeyArr, map, nSet)
|
||||
FindAccounts(PubKeyArr, Map, HiddenMap, nSet)
|
||||
{
|
||||
var Count = 0;
|
||||
for(var num = 0; true; num++)
|
||||
{
|
||||
if(this.IsHole(num))
|
||||
if(this.IsHole(num) || HiddenMap[num] !== undefined)
|
||||
continue;
|
||||
var Data = this.ReadState(num);
|
||||
if(!Data)
|
||||
@ -981,7 +981,7 @@ class AccountApp extends require("./dapp")
|
||||
for(var i = 0; i < PubKeyArr.length; i++)
|
||||
if(CompareArr(Data.PubKey, PubKeyArr[i]) === 0)
|
||||
{
|
||||
map[Data.Num] = i
|
||||
Map[Data.Num] = i
|
||||
Count++
|
||||
}
|
||||
}
|
||||
|
@ -610,6 +610,10 @@ function RunSmartMethod(Block,SmartOrSmartID,Account,BlockNum,TrNum,PayContext,M
|
||||
return ;
|
||||
}
|
||||
var context = {};
|
||||
if(BlockNum >= UPDATE_CODE_1 && !PayContext)
|
||||
{
|
||||
PayContext = {FromID:0, ToID:Account.Num, Description:"", Value:{SumCOIN:0, SumCENT:0}};
|
||||
}
|
||||
if(PayContext)
|
||||
{
|
||||
context.BlockNum = BlockNum;
|
||||
|
Loading…
Reference in New Issue
Block a user