Skip to content

Commit

Permalink
removed extra calls to wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
kesha-antonov committed Feb 2, 2024
1 parent f516144 commit 134f108
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 64 deletions.
66 changes: 34 additions & 32 deletions send_multigpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,20 +314,6 @@ async function sendMinedBoc(
boc: Cell
) {

const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}

if (args['--api'] === 'tonapi') {
const tonapiClient = await getTonapiClient()

Expand Down Expand Up @@ -371,23 +357,39 @@ async function sendMinedBoc(

}
}
} else {
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}

return
}

const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? '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({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
}
}
Expand Down Expand Up @@ -465,4 +467,4 @@ function formatTime() {
year: "numeric",
second: "numeric"
});
}
}
66 changes: 34 additions & 32 deletions send_universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,20 +272,6 @@ async function sendMinedBoc(
boc: Cell
) {

const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? 'https://ton-blockchain.github.io/global.config.json')
const w1 = liteServerClient.open(wallet)
wallets.push(w1)
}

if (args['--api'] === 'tonapi') {
const tonapiClient = await getTonapiClient()

Expand Down Expand Up @@ -329,23 +315,39 @@ async function sendMinedBoc(

}
}
} else {
for (let i = 0; i < 3; i++) {
for (const w of wallets) {
w.sendTransfer({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}

return
}

const wallets: OpenedContract<WalletContractV4>[] = []
const ton4Client = await getTon4Client()
const tonOrbsClient = await getTon4ClientOrbs()
const w2 = ton4Client.open(wallet)
const w3 = tonOrbsClient.open(wallet)
wallets.push(w2)
wallets.push(w3)

if (args['--api'] === 'lite') {
const liteServerClient = await getLiteClient(args['-c'] ?? '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({
seqno,
secretKey: keyPair.secretKey,
messages: [internal({
to: giverAddress,
value: toNano('0.05'),
bounce: true,
body: boc,
})],
sendMode: 3 as any,
}).catch(e => {
//
})
}
}
}
Expand Down Expand Up @@ -419,4 +421,4 @@ function formatTime() {
year: "numeric",
second: "numeric"
});
}
}

0 comments on commit 134f108

Please sign in to comment.