npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@uledger/uledger-sdk

v1.0.1

Published

ULedger TypeScript SDK

Readme

ULedger TypeScript SDK

TypeScript implementation for Public ULedger SDK.

Docs

npm run generate:docs

The definition of the API is available from ./docs/index.html

Installation

To install the package run:

npm i @uledger/uledger-sdk

Quickstart

To get started, please walk through the instalation steps above. Once this is done and you have installed the uledger-sdk using NPM, you may proceed with the following steps. Note: This tutorial assumes that you have an existing blockchain set up with uledger.

The code snippet below is typescript implementation of creating a transaction and submitting it to the blockchain using the uledger SDK. To execute this successfully, you will need to replace the placeholder values with real values. This includes your node url, the node id, the url to the atomic clock service, blockchain id, and have user accounts set up with uledger.

import { ULedgerTransactionInputV2, ULedgerTransactionSessionV2 } from '@uledger/uledger-sdk';

async function main() {
    try {
        (async () => {
        const txnSession = new ULedgerTransactionSessionV2(
            {
                nodeUrl: "{{ URL TO A ULEDGER NODE }}",
                // url is a parameter coming from ULedger Team, make sure you specify the version.
                atomicClockUrl: "{{ ACS URL }}",
                nodeId: "{{ ULEDGER NODE ID }}"
            }
        );

        // Customize the payload to be sent
        const txnInputData: ULedgerTransactionInputV2 = {
            blockchainId: "{{ your blockchain id }}",
            to: "{{ the address of the user you would like to send the transaction to }}", 
            from: "{{ the address of the account you are sending the transaction from }}", 
            payload: { 
                myPayload: "Hello World!" 
            }, 
            payloadType: "DATA",
            senderSignature: "{{ This is where you would put the cryptographic signature of the transaction }}"
        }

        // Send the request to the node
        const txn = await txnSession.createTransaction(txnInputData);
        // Show the result
        console.log(txn);

        })();
    } catch (error) {
        console.log("Fail ", error);
    }
}

main();

In the next example, we will perform the same operation as above but this time we will take the response from the blockchain node and use that to query the transaction in the bms and the block that minted it.

import { ULedgerTransactionInputV2, ULedgerTransactionSessionV2, ULedgerBMSSession } from '@uledger/uledger-sdk';

async function main() {
    try {
        (async () => {
        const txnSession = new ULedgerTransactionSessionV2(
            {
                nodeUrl: "{{ URL TO A ULEDGER NODE }}",
                // url is a parameter coming from ULedger Team, make sure you specify the version.
                atomicClockUrl: "{{ ACS URL }}/api/v1/acs",
                nodeId: "{{ ULEDGER NODE ID }}"
            }
        );

        // Customize the payload to be sent
        const txnInputData: ULedgerTransactionInputV2 = {
            blockchainId: "{{ your blockchain id }}",
            to: "{{ the address of the user you would like to send the transaction to }}", 
            from: "{{ the address of the account you are sending the transaction from }}", 
            payload: { 
                myPayload: "Hello World!" 
            }, 
            payloadType: "DATA",
            senderSignature: "{{ This is where you would put the cryptographic signature of the transaction }}"
        }

        // Send the request to the node
        const txn = await txnSession.createTransaction(txnInputData);
        // Show the result
        console.log(txn);

        // Create a new BMS session
        const session = new ULedgerBMSSession({
            // url is a parameter coming from ULedger Team, make sure you specify the version.
            url: "{{ MY_BMS_URL }}/api/v1/bms"
        });

        // "trim" = exclude the inner payload of the transaction or block to be queried
        const trim = true;

        // Extract the transaction Id from the createTransaction response
        const transactionId = txn.transactionId;

        // --- Search for your transaction in the BMS
        const bmsTxn = await session.searchTransactionById(transactionId, trim);
        console.log("Retrieved transaction by ID:\n", bmsTxn);

        // Extract the block Id from the createTransaction response
        const blockId = txn.blockId;

        // --- Search for your transaction in the BMS
        const bmsBlock = await session.searchBlockById(blockId, trim);
        console.log("Retrieved block by ID:\n", bmsBlock); 

        })();
    } catch (error) {
        console.log("Fail ", error);
    }
}

main();