Web App SDK (for Browser based Apps)
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
Usage
Providing account credentials
There are two ways passing accountId
and accountPrivateKey
arguments to the SDK methods:
Pass
accountId
andaccountPrivateKey
as parameters to the SDK methods as strings. Make sure that private keys contain DER prefix (like:302e020100300506032b657004220420
and are hex-encoded)Pass empty
accountId
andaccountPrivateKey
in case you calledsetUser()
before. That credentials stored in SDK memory and will be used for all SDK methods calls until you destroy instance of BladeSDK or callresetUser()
orsetUser()
again. CurrentlysetUser()
support next user providers:Magic
- Magic.link. Example:setUser("Magic", "your_email@domain.com")
Hedera
- enteraccountId
andaccountPrivateKey
. 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
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:
On repos create pull request from newly created branch js/latest-build
Last updated