Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ton-watcher

Package Overview
Dependencies
Maintainers
0
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ton-watcher - npm Package Compare versions

Comparing version 1.1.12 to 1.1.14

15

build/modules/txs/tonTxWatcherV4.js

@@ -75,4 +75,4 @@ "use strict";

async fetchTxs(lastTransaction) {
const txsHashes = {};
const params = Object.create(null);
params.limit = 100;
if (lastTransaction) {

@@ -85,12 +85,19 @@ params.lt = lastTransaction.lt;

}
let all_txs = [];
const all_txs = [];
while (true) {
const batchTxs = [];
const txs = await (0, common_helpers_1.retry)(() => this.client.getAccountTransactions(this.address, params.lt, params.hash), { retries: 5, delay: 5000 });
for (let i = 0; i < txs.length; i++) {
if (txs[i].tx.hash().toString('hex') === this.last_hash) {
const txHash = txs[i].tx.hash().toString('base64');
if (txsHashes[txHash]) {
continue;
}
if (txHash === this.last_hash) {
break;
}
txsHashes[txHash] = true;
batchTxs.push(txs[i]);
all_txs.push(txs[i]);
}
if (txs.length < params.limit || (this.last_lt && txs[txs.length - 1].tx.lt <= BigInt(this.last_lt))) {
if (batchTxs.length === 0) {
break;

@@ -97,0 +104,0 @@ }

{
"name": "ton-watcher",
"version": "1.1.12",
"version": "1.1.14",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -104,4 +104,4 @@ import { Address, TonClient4, Transaction, WalletContractV5R1 } from "@ton/ton";

private async fetchTxs(lastTransaction: { lt: string, hash: string } | null): Promise<void> {
const txsHashes = {} as Record<string, boolean>;
const params = Object.create(null);
params.limit = 100;
if (lastTransaction) {

@@ -113,14 +113,24 @@ params.lt = lastTransaction.lt;

}
let all_txs = [];
const all_txs = [];
while(true) {
const batchTxs = [];
const txs = await retry(() => this.client.getAccountTransactions(this.address, params.lt, params.hash), { retries: 5, delay: 5000 });
for (let i = 0; i < txs.length; i++) {
if (txs[i].tx.hash().toString('hex') === this.last_hash) {
const txHash = txs[i].tx.hash().toString('base64');
if (txsHashes[txHash]) {
continue;
}
if (txHash === this.last_hash) {
break;
}
txsHashes[txHash] = true;
batchTxs.push(txs[i]);
all_txs.push(txs[i]);
}
if (txs.length < params.limit || (this.last_lt && txs[txs.length -1].tx.lt <= BigInt(this.last_lt))) {
if (batchTxs.length === 0) {
break;

@@ -127,0 +137,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc