Socket
Book a DemoInstallSign in
Socket

@emurgo/cardano-serialization-lib-browser

Package Overview
Dependencies
Maintainers
6
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emurgo/cardano-serialization-lib-browser

(De)serialization functions for the Cardano blockchain along with related utility functions

Source
npmnpm
Version
14.1.2-beta.2
Version published
Weekly downloads
211K
23.67%
Maintainers
6
Weekly downloads
 
Created

What is @emurgo/cardano-serialization-lib-browser?

@emurgo/cardano-serialization-lib-browser is a JavaScript library designed for use in browser environments to interact with the Cardano blockchain. It provides functionalities for creating, signing, and managing Cardano transactions, addresses, and keys.

What are @emurgo/cardano-serialization-lib-browser's main functionalities?

Creating and Managing Cardano Addresses

This feature allows users to create and manage Cardano addresses. The code sample demonstrates how to create an address object from a Bech32 string and convert it back to a Bech32 string.

const { Address } = require('@emurgo/cardano-serialization-lib-browser');
const address = Address.from_bech32('addr1...');
console.log(address.to_bech32());

Building Transactions

This feature allows users to build Cardano transactions. The code sample shows how to create a transaction builder, define an output with an address and value, and add it to the transaction.

const { TransactionBuilder, TransactionOutput, Address, Value } = require('@emurgo/cardano-serialization-lib-browser');
const txBuilder = TransactionBuilder.new();
const address = Address.from_bech32('addr1...');
const output = TransactionOutput.new(address, Value.new(1000));
txBuilder.add_output(output);

Signing Transactions

This feature allows users to sign Cardano transactions. The code sample demonstrates how to create a transaction, generate a witness set, and sign the transaction using a private key.

const { Transaction, TransactionWitnessSet, Vkeywitnesses, Vkeywitness, PrivateKey } = require('@emurgo/cardano-serialization-lib-browser');
const tx = Transaction.new();
const witnessSet = TransactionWitnessSet.new();
const privateKey = PrivateKey.from_bech32('ed25519_sk...');
const vkeyWitness = Vkeywitness.new(privateKey.to_public(), privateKey.sign(tx.body()));
witnessSet.set_vkeys(Vkeywitnesses.new().add(vkeyWitness));

Other packages similar to @emurgo/cardano-serialization-lib-browser

FAQs

Package last updated on 05 May 2025

Did you know?

Socket

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.

Install

Related posts