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

@bladelabs/blade-sdk.js

v0.6.30

Published

Hedera SDK wrapper with Blade features

Downloads

133

Readme

Blade-SDK.js

Build Status

Disclaimer

Please note that the security of your private keys is your sole responsibility. Our JS SDK, which wraps Hedera SDK and Blade wallet API, has been developed to ensure the highest level of security possible. However, we do not take any responsibility for the security of your private keys. Please be aware that once someone else gains access to your private keys, they will have full control of your account, funds, tokens, and NFTs. We strongly recommend that you follow best practices for securing your private keys when using our SDK. Please be aware that private keys will never be sent over the network or shared with any third party through our SDK.

Getting Started

Requirements

  • Node.js 16.x or higher (MacOS/Linux)
  • Node.js 16.x to 18.x (Windows)

Install

npm i @bladelabs/blade-sdk.js

Usage

import {BladeSDK, SdkEnvironment} from '@bladelabs/blade-sdk.js';

...

const apiKey = "ygUgCzRrsvhWmb3dsLcApGnApSZ4tk8hBCmZqg9BngpuQYKsnD5m9FjfPV3tVBeB" // provided by BladeLabs team
const network = "Mainnet"; // or "Testnet"
const dAppCode = "your-dApp-code"; // provided by BladeLabs team

const bladeSDK = new BladeSDK();
await bladeSDK.init(apiKey, network, dAppCode)
const balance = await bladeSDK.getBalance("0.0.8235");
console.log(balance);

Providing account credentials

There are two ways passing accountId and accountPrivateKey arguments to the SDK methods:

  1. Pass accountId and accountPrivateKey as parameters to the SDK methods as strings. Make sure that private keys contain DER prefix (like: 302e020100300506032b657004220420 and are hex-encoded)
  2. Pass empty accountId and accountPrivateKey in case you called setUser() before. That credentials stored in SDK memory and will be used for all SDK methods calls until you destroy instance of BladeSDK or call resetUser() or setUser() again. Currently setUser() support next user providers:
    1. Magic - Magic.link. Example: setUser("Magic", "[email protected]")
    2. Hedera - enter accountId and accountPrivateKey. Example: setUser("Hedera", "0.0.45467464", "302e020100300506032b6570042204204323472EA5374E80B07346243234DEADBEEF25235235...")

In case of calling method with accountId and accountPrivateKey arguments, SDK will override current user with this credentials.

Documentation

Blade-SDK.js documentation.

For more information, please check our Blade SDK Portal

Contribution

Some other SDKs (Kotlin-Blade and Swift-Blade) depend on this repo. To publish a new bundle to those repos, run the following command:

npm run publish:web-view

On repos create pull request from newly created branch js/latest-build