NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

let tG = new Date();

async function NS(zz) {
console.log('Таймер1, милисек', zz);
await getMineDelay2(zz);
console.log('Таймер2, милисек', tG);
setTimeout(function () {
console.log('Таймер, милисек', tG, zz);
setTimeout(function () {
server_mine(zz);
}, tG + 5 * 1000);
}, 5000);
}

async function server_mine(account) {
try {
background_mine(account).then((mine_work) => {
//unityInstance.SendMessage('Controller', 'Server_Response_Mine', JSON.stringify(mine_work));
console.log('77777', JSON.stringify(mine_work));
let zz = mine_work.account;
setTimeout(async function () {
//server_claim('{"account": "' + mine_work.account + '", "hex_digest":"' + mine_work.hex_digest + '", "rand_str": "' + mine_work.rand_str + '"}');
server_claim(JSON.stringify(mine_work));

}, 5 * 1000);
//server_claim('{"account": "' + mine_work.account + '", "rand_str": "' + mine_work.rand_str + '"}');

});
} catch (error) {
unityInstance.SendMessage('ErrorHandler', 'Server_Response_SetErrorData', 'server_mine' + error.message);
}
}


async function server_claim(data) {
var mine_work = JSON.parse(data);
console.log('data', data);
try {
console.log(`${mine_work.account} Pushing mine results...`);
const mine_data = {miner: mine_work.account, nonce: mine_work.rand_str,};
console.log('mine_data', mine_data);
const actions = [{
account: mining_account,
name: 'mine',
authorization: [{actor: mine_work.account, permission: 'active',},],
data: mine_data,
},];
wax.api.transact({actions,}, {blocksBehind: 3, expireSeconds: 90,}).then((result) => {
console.log('result is=', result);
var amounts = new Map();
if (result && result.processed) {
result.processed.action_traces[0].inline_traces.forEach((t) => {
if (t.act.data.quantity) {
const mine_amount = t.act.data.quantity;
console.log(`${mine_work.account} Mined ${mine_amount}`);
if (amounts.has(t.act.data.to)) {
var obStr = amounts.get(t.act.data.to);
obStr = obStr.substring(0, obStr.length - 4);
var nbStr = t.act.data.quantity;
nbStr = nbStr.substring(0, nbStr.length - 4);
var balance = (parseFloat(obStr) + parseFloat(nbStr)).toFixed(4);
amounts.set(t.act.data.to, balance.toString() + ' TLM');
} else {
amounts.set(t.act.data.to, t.act.data.quantity);
}
}
});
unityInstance.SendMessage('Controller', 'Server_Response_Claim', amounts.get(mine_work.account));
setTimeout(function () {
console.log('Выход на получение таймера', mine_work.account);
NS(mine_work.account);
}, 15 * 1000);
}
}).catch((err) => {
//unityInstance.SendMessage('ErrorHandler', 'Server_Response_SetErrorData', err.message);
console.log('err.message', err.message);
setTimeout(function () {
server_claim(data);
}, 15000)

});
} catch (error) {
unityInstance.SendMessage('ErrorHandler', 'Server_Response_SetErrorData', error.message);

}
}


const getMineDelay2 = async function (account) {
try {
const bag = await getBag(mining_account, account, wax.api.rpc, aa_api);
const land = await getLand(federation_account, mining_account, account, wax.api.rpc, aa_api);
const params = getBagMiningParams(bag);
const land_params = getLandMiningParams(land);
params.delay *= land_params.delay / 10;
params.difficulty += land_params.difficulty;
var minedelay = await getNextMineDelay(mining_account, account, params, wax.api.rpc);
tG = minedelay
return minedelay;
} catch (error) {
return error;
}
};

server_mine('**********');
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.