
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
rn-electrum-client
Advanced tools
yarn add rn-electrum-client
import {
start,
getPeers,
getAddressScriptHashBalance,
getAddressScriptHashBalances,
subscribeHeader,
subscribeAddress
} from "rn-electrum-client/helpers";
//Connect To A Random Electrum Server
const startResponse = await start({ network: "bitcoinTestnet" });
console.log(startResponse);
if (startResponse.error) return;
//Get Server Peers
const getPeersResponse = await getPeers({ network: "bitcoinTestnet" });
console.log(getPeersResponse);
//Get Address Balance
const getAddressScriptHashBalanceResponse = await getAddressScriptHashBalance({
network: "bitcoinTestnet",
scriptHash: "77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd"
});
console.log(getAddressScriptHashBalanceResponse);
//Subscribe To Headers
const subscribeHeaderResponse = await subscribeHeader({
network: "bitcoinTestnet",
onReceive: (data) => { console.log("New block!", data); }
});
console.log(subscribeHeaderResponse);
//Subscribe To An Address
const subscribeAddressResponse = await subscribeAddress({
network: "bitcoinTestnet",
scriptHash: "77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd", //tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx
onReceive: (data) => { console.log("Received some Testnet BTC!", data); }
});
console.log(subscribeAddressResponse);
//Get Address Balances (Batch Method)
const getAddressScriptHashes = [
"21031994b184684de964e930e9937b1b6d75c9af12bb99ae6ee266a724e12632",
"9ff2d1500272589aff699e1582dbc2f47a7bbe19f7d3a4d77e1c9e54735d4fc4",
"bfb2a1c0a45421f908e0b3f63cee65a2dee33ae276bdb82c6f53f6ec1d53093b",
"ce2b6d0b4ed19ff9b264d1d218220cae85388b6d53a539bd0852404b65d74b1b",
"4470798cb53a34f8adf763248c90b7b09e6375043a74346d5ad9a1b6c6cc1130"
];
const getAddressScriptHashBalancesResponse = await getAddressScriptHashBalances({
scriptHashes: getAddressScriptHashes,
network: "bitcoinTestnet"
});
console.log(getAddressScriptHashBalancesResponse);
/*
We are also able to get out what we put in using the following patterns.
This works with any batch method.
*/
const getAddressScriptHashes2 = {
key: "scriptHash",
data: [
{
address: "tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx",
path: "m/84'/1'/0'/0/0",
scriptHash: "77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd"
},
]
};
const getAddressScriptHashBalancesResponse2 = await getAddressScriptHashBalances({
scriptHashes: getAddressScriptHashes2,
network: "bitcoinTestnet"
});
console.log(getAddressScriptHashBalancesResponse2);
const getAddressScriptHashes3 = {
key: "scriptHash",
data: {
77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd: {
address: "tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx",
path: "m/84'/1'/0'/0/0",
scriptHash: "77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd"
},
}
};
const getAddressScriptHashBalancesResponse3 = await getAddressScriptHashBalances({
scriptHashes: getAddressScriptHashes3,
network: "bitcoinTestnet"
});
console.log(getAddressScriptHashBalancesResponse3);
FAQs
Electrum protocol client for React Native & Node.js
The npm package rn-electrum-client receives a total of 72 weekly downloads. As such, rn-electrum-client popularity was classified as not popular.
We found that rn-electrum-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.