
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@yaring/coinscheck
Advanced tools
Here’s a technical English translation of your provided README:
A multi-network library for checking cryptocurrency wallet balances with support for a wide range of blockchains.
npm install @yaring/coinscheck
const { BalanceChecker } = require('@yaring/coinscheck');
const checker = new BalanceChecker({
timeout: 30000 // optional, timeout in ms
});
// Single network balance check
const chain = {
chainId: '1',
rpc: 'https://eth-mainnet.public.blastapi.io',
chainType: 'EVM',
};
const balance = await checker.checkSingleChainBalance(
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
chain
);
console.log(balance);
// {
// chainId: '1',
// balance: '1000000000000000000',
// chainType: 'EVM'
// }
const balances = await checker.checkBalances([
{
address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
chain: {
chainId: '1',
rpc: 'https://eth-mainnet.public.blastapi.io',
chainType: 'EVM',
},
},
{
address: 'DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy',
chain: {
chainId: 'solana-mainnet',
rpc: 'https://api.mainnet-beta.solana.com',
chainType: 'SOLANA',
},
},
]);
const { AddressValidator } = require('@yaring/coinscheck');
// EVM address validation
const isValidEvm = AddressValidator.validateAddress(
'0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
'EVM'
);
// Solana address validation
const isValidSolana = AddressValidator.validateAddress(
'DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy',
'SOLANA'
);
BalanceChecker
new BalanceChecker(options?: {
timeout?: number; // timeout in milliseconds, default is 30000
});
checkSingleChainBalance(address: string, chain: Chain): Promise<Balance>
Checks the balance for a single address in a specified network.
interface Chain {
chainId: string;
rpc: string;
chainType: string;
name?: string;
nativeDenom?: string; // for Cosmos-based networks
}
interface Balance {
chainId: string;
balance: string;
chainType: string;
error?: string;
}
checkBalances(items: CheckItem[]): Promise<Balance[]>
Checks balances for an array of addresses across different networks.
interface CheckItem {
address: string;
chain: Chain;
}
dispose(): void
Releases resources and closes connections to providers.
AddressValidator
validateAddress(address: string, chainType: string): boolean
Validates the address format for a given network type.
validateAddressFormat(address: string, chainType: string): boolean
Checks if the address matches the regular expression for the specified network type.
getAddressExamples(): Record<string, string>
Returns examples of valid addresses for each network type.
getTestAddresses(): Record<string, { valid: string[], invalid: string[] }>
Provides sets of valid and invalid addresses for testing.
0x[0-9a-fA-F]{40}
[1-9A-HJ-NP-Za-km-z]{32,44}
[chain-prefix]1[a-zA-Z0-9]{38}
(1|3|bc1)[a-zA-HJ-NP-Z0-9]{25,62}
[1-9A-HJ-NP-Za-km-z]{47,48}
T[A-Za-z1-9]{33}
(?:EQ|UQ)[a-zA-Z0-9_-]{48}
The library provides informative error messages for each network:
try {
const balance = await checker.checkSingleChainBalance(address, chain);
} catch (error) {
console.error(error.message);
// Example messages:
// "EVM balance check failed: invalid response from RPC"
// "Solana balance check failed: invalid address"
// "TRON balance check failed: network error"
}
MIT
Let me know if you need further adjustments!
FAQs
Blockchain balance checker
The npm package @yaring/coinscheck receives a total of 1 weekly downloads. As such, @yaring/coinscheck popularity was classified as not popular.
We found that @yaring/coinscheck 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.