Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ton-node-kit
Advanced tools
Useful utilities for working with TON in NodeJS
npm install ton-node-kit
import { Address, TonClient } from '@ton/ton';
import type { Transaction } from '@ton/ton';
import {
getTxComment,
getTxSender,
getTxValueAmount,
withRetry,
} from 'ton-node-kit';
const myAddress = Address.parse('<your-wallet-address>');
const client = new TonClient({
endpoint: 'https://testnet.toncenter.com/api/v2/jsonRPC',
apiKey: process.env.TON_API_KEY,
});
const TRANSACTION_LIMIT = 1;
const RETRY_LIMIT = 30;
const RETRY_DELAY_MS = 100;
const getTransactions = async () => {
return (await withRetry(
() =>
client.getTransactions(myAddress, {
limit: TRANSACTION_LIMIT,
}),
RETRY_LIMIT,
RETRY_DELAY_MS,
)) as Transaction[];
};
const transactions = await getTransactions();
for (const tx of transactions) {
const commentText = getTxComment(tx);
const tonValue = getTxValueAmount(tx);
const nanoValue = getTxValueAmount(tx, {
currency: 'nano',
returnBigint: true,
});
const sender = getTxSender(tx);
console.log('Transaction', {
commentText,
tonValue,
nanoValue,
sender,
});
// Transaction {
// commentText: 'Hello, TON!',
// nanoValue: 50000000n,
// tonValue: '0.05'
// sender: <sender-wallet-address>
// }
}
FAQs
Useful utilities for working with TON in NodeJS
The npm package ton-node-kit receives a total of 1 weekly downloads. As such, ton-node-kit popularity was classified as not popular.
We found that ton-node-kit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.