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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@symbol-blockchain-community/symbol-light-sdk

v0.0.2

Published

This is a lightweight SDK for signing transactions on the Symbol blockchain.

Downloads

7

Readme

Symbol SDK Lightweight SDK for Signing Transactions

This is a lightweight SDK for signing transactions on the Symbol blockchain. It provides a simple interface for creating keypairs, signing transactions, and verifying signatures.

Installation

npm install symbol-sdk-lightweight

Usage

Here's a basic example of how to use the SDK:

const { SymbolKeypair } = require("symbol-sdk-lightweight");

// Create a keypair from a private key
const privateKey = "EDB671EB741BD676969D8A035271D1EE5E75DF33278083D877F23615EB839FEC";
const keypair = new SymbolKeypair(privateKey);

// Generation hash seed (network specific)
const generationHashSeed = "49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4";

// Serialized transaction (example)
const serializedTransaction =
  "b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000087da603e7be5656c45692d5fc7f6d0ef8f24bb7a5c10ed5fda8c5cfbc49fcbc8000000000198544140420f00000000004f0047c709000000988e1191a25a88142c2fb3f69787576e3dc713efc1ce4de90000010000000000cc403c7a113bdf7c40420f0000000000";

// Sign the transaction
const signature = keypair.sign(serializedTransaction, generationHashSeed);
console.log("Signature:", signature);

API Reference

SymbolKeypair

Constructor

constructor(privateKey: string | Uint8Array)

Creates a new SymbolKeypair instance from a private key.

Static Methods

static createNewKeyPair(): SymbolKeypair

Creates a new random keypair.

static verify(serializedTransaction: string | Uint8Array, generationHashSeed: string | Uint8Array, signature: string | Uint8Array, publicKey: string | Uint8Array): boolean

Verifies a signature for a given transaction.

Instance Properties

get publicKey(): string

Returns the public key as a hexadecimal string.

get privateKey(): string

Returns the private key as a hexadecimal string.

Instance Methods

sign(serializedTransaction: string | Uint8Array, generationHashSeed: string | Uint8Array): string

Signs a serialized transaction using the keypair's private key and the network's generation hash seed.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.