Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/reafactor send #6

Merged
merged 6 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build js
  • Loading branch information
kesha-antonov committed Feb 2, 2024
commit f02058286bccc4e2937c6ef1114e8be6e11121e0
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc"
},
"compilerOptions": {
"module": "esnext",
"target": "esnext"
},
"include": [
"**/*.ts"
],
"keywords": [],
"author": "",
"license": "ISC",
Expand Down
26 changes: 13 additions & 13 deletions send_multigpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dotenv_1.default.config();
dotenv_1.default.config({ path: 'config.txt' });
const args = (0, arg_1.default)({
'--givers': Number, // 100 1000 10000
'--api': String, // lite, tonhub
'--api': String, // lite, tonhub, tonapi
'--bin': String, // cuda, opencl or path to miner
'--gpu-count': Number, // GPU COUNT!!!
'--timeout': Number, // Timeout for mining in seconds
Expand Down Expand Up @@ -289,18 +289,6 @@ main();
function sendMinedBoc(wallet, seqno, keyPair, giverAddress, boc) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const wallets = [];
const ton4Client = yield (0, client_1.getTon4Client)();
const tonOrbsClient = yield (0, client_1.getTon4ClientOrbs)();
const w2 = ton4Client.open(wallet);
const w3 = tonOrbsClient.open(wallet);
wallets.push(w2);
wallets.push(w3);
if (args['--api'] === 'lite') {
const liteServerClient = yield (0, client_1.getLiteClient)((_a = args['-c']) !== null && _a !== void 0 ? _a : 'https://ton-blockchain.github.io/global.config.json');
const w1 = liteServerClient.open(wallet);
wallets.push(w1);
}
if (args['--api'] === 'tonapi') {
const tonapiClient = yield (0, client_1.getTonapiClient)();
const transfer = wallet.createTransfer({
Expand Down Expand Up @@ -343,6 +331,18 @@ function sendMinedBoc(wallet, seqno, keyPair, giverAddress, boc) {
}
}
else {
const wallets = [];
const ton4Client = yield (0, client_1.getTon4Client)();
const tonOrbsClient = yield (0, client_1.getTon4ClientOrbs)();
const w2 = ton4Client.open(wallet);
const w3 = tonOrbsClient.open(wallet);
wallets.push(w2);
wallets.push(w3);
if (args['--api'] === 'lite') {
const liteServerClient = yield (0, client_1.getLiteClient)((_a = args['-c']) !== null && _a !== void 0 ? _a : 'https://ton-blockchain.github.io/global.config.json');
const w1 = liteServerClient.open(wallet);
wallets.push(w1);
}
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
Expand Down
26 changes: 13 additions & 13 deletions send_universal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dotenv_1.default.config();
dotenv_1.default.config({ path: 'config.txt' });
const args = (0, arg_1.default)({
'--givers': Number, // 100 1000 10000
'--api': String, // lite, tonhub
'--api': String, // lite, tonhub, tonapi
'--bin': String, // cuda, opencl or path to miner
'--gpu': Number, // gpu id, default 0
'--timeout': Number, // Timeout for mining in seconds
Expand Down Expand Up @@ -259,18 +259,6 @@ main();
function sendMinedBoc(wallet, seqno, keyPair, giverAddress, boc) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const wallets = [];
const ton4Client = yield (0, client_1.getTon4Client)();
const tonOrbsClient = yield (0, client_1.getTon4ClientOrbs)();
const w2 = ton4Client.open(wallet);
const w3 = tonOrbsClient.open(wallet);
wallets.push(w2);
wallets.push(w3);
if (args['--api'] === 'lite') {
const liteServerClient = yield (0, client_1.getLiteClient)((_a = args['-c']) !== null && _a !== void 0 ? _a : 'https://ton-blockchain.github.io/global.config.json');
const w1 = liteServerClient.open(wallet);
wallets.push(w1);
}
if (args['--api'] === 'tonapi') {
const tonapiClient = yield (0, client_1.getTonapiClient)();
const transfer = wallet.createTransfer({
Expand Down Expand Up @@ -313,6 +301,18 @@ function sendMinedBoc(wallet, seqno, keyPair, giverAddress, boc) {
}
}
else {
const wallets = [];
const ton4Client = yield (0, client_1.getTon4Client)();
const tonOrbsClient = yield (0, client_1.getTon4ClientOrbs)();
const w2 = ton4Client.open(wallet);
const w3 = tonOrbsClient.open(wallet);
wallets.push(w2);
wallets.push(w3);
if (args['--api'] === 'lite') {
const liteServerClient = yield (0, client_1.getLiteClient)((_a = args['-c']) !== null && _a !== void 0 ? _a : 'https://ton-blockchain.github.io/global.config.json');
const w1 = liteServerClient.open(wallet);
wallets.push(w1);
}
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
Expand Down