
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@emurgo/cardano-serialization-lib-nodejs
Advanced tools
(De)serialization functions for the Cardano blockchain along with related utility functions
@emurgo/cardano-serialization-lib-nodejs is a library for Cardano blockchain developers that provides tools for serialization and deserialization of data structures used in Cardano transactions. It allows developers to create, sign, and manage Cardano transactions and addresses programmatically.
Transaction Creation
This feature allows developers to create Cardano transactions by building transaction outputs and inputs. The code sample demonstrates how to create a transaction builder, add an output with a specific address and value, and build the transaction.
const { TransactionBuilder, TransactionOutput, Address, Value } = require('@emurgo/cardano-serialization-lib-nodejs');
const txBuilder = TransactionBuilder.new();
const address = Address.from_bech32('addr_test...');
const value = Value.new(BigInt(1000000));
const output = TransactionOutput.new(address, value);
txBuilder.add_output(output);
const tx = txBuilder.build();
Address Handling
This feature provides utilities for handling Cardano addresses, including conversion between different address formats. The code sample shows how to create an address from a Bech32 string and convert it back to a Bech32 string.
const { Address } = require('@emurgo/cardano-serialization-lib-nodejs');
const address = Address.from_bech32('addr_test...');
console.log(address.to_bech32());
Transaction Signing
This feature allows developers to sign transactions using private keys. The code sample demonstrates how to deserialize a transaction from bytes, sign it with a private key, and obtain a signed transaction.
const { Transaction, PrivateKey } = require('@emurgo/cardano-serialization-lib-nodejs');
const tx = Transaction.from_bytes(Buffer.from('...'));
const privateKey = PrivateKey.from_bech32('...');
const signedTx = tx.sign(privateKey);
cardano-wallet-js is a JavaScript library for interacting with Cardano wallets. It provides functionalities for managing wallets, addresses, and transactions. Compared to @emurgo/cardano-serialization-lib-nodejs, cardano-wallet-js focuses more on wallet management and less on low-level transaction serialization.
cardano-crypto.js is a library for cryptographic operations related to Cardano, such as key generation and signing. While it provides some overlapping functionalities with @emurgo/cardano-serialization-lib-nodejs, it is more focused on cryptographic primitives rather than transaction serialization and deserialization.
This is a library, written in Rust, for serialization & deserialization of data structures used in Cardano's Haskell implementation of Alonzo along with useful utility functions.
Note: This package uses weak references flag from wasm-bindgen.
It uses FinalizationRegistry
under the hood to automatically call "free" for each CSL struct when it is no longer needed. However, use this feature with caution as it may have unpredictable behaviors.
You can find documentation here
FAQs
(De)serialization functions for the Cardano blockchain along with related utility functions
The npm package @emurgo/cardano-serialization-lib-nodejs receives a total of 230,415 weekly downloads. As such, @emurgo/cardano-serialization-lib-nodejs popularity was classified as popular.
We found that @emurgo/cardano-serialization-lib-nodejs 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
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.