![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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,
checkIsInternal,
} 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,
archival: true,
}),
RETRY_LIMIT,
RETRY_DELAY_MS,
)) as Transaction[];
};
const transactions = await getTransactions();
for (const tx of transactions) {
if (checkIsInternal(tx)) {
const commentText = getTxComment(tx);
const tonValue = getTxValueAmount(tx);
const nanoValue = getTxValueAmount(tx, {
currency: 'nano',
returnBigint: true,
});
const sender = getTxSender(tx);
const hexAddress = getTxSender(tx, { hex: true });
console.log('Transaction', {
commentText,
tonValue,
nanoValue,
sender,
hexAddress,
});
}
// Transaction {
// commentText: 'Hello, TON!',
// nanoValue: 50000000n,
// tonValue: '0.05'
// sender: <sender-object>,
// hexAddress: '0:....'
// }
}
FAQs
Useful utilities for working with TON in NodeJS
The npm package ton-node-kit receives a total of 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.