@leofcoin/launch-chain 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/batch.js +6 -4
- package/package.json +1 -1
package/exports/batch.js
CHANGED
|
@@ -58,12 +58,14 @@ async function interactiveBatch(wallet, interaction) {
|
|
|
58
58
|
throw new Error('Invalid or unsafe nonce range');
|
|
59
59
|
const transactions = [];
|
|
60
60
|
let fees = 0n;
|
|
61
|
-
for (let
|
|
62
|
-
const signed = await wallet.sign(startNonce +
|
|
61
|
+
for (let offset = 0; offset < count; offset++) {
|
|
62
|
+
const signed = await wallet.sign(startNonce + offset + 1, to, amount);
|
|
63
|
+
if (signed.from !== wallet.account || signed.nonce !== startNonce + offset + 1)
|
|
64
|
+
throw new Error('Signer returned an unexpected sender or nonce');
|
|
63
65
|
fees += BigInt(await calculateFee(signed));
|
|
64
66
|
transactions.push(signed);
|
|
65
|
-
if (
|
|
66
|
-
log(`Signed ${
|
|
67
|
+
if (transactions.length % 1000 === 0 || transactions.length === count)
|
|
68
|
+
log(`Signed ${transactions.length}/${count}`);
|
|
67
69
|
}
|
|
68
70
|
// Self-transfers recycle principal, but still need enough for a transfer plus
|
|
69
71
|
// every fee. Fees are not assumed to return as validator rewards.
|