Getting Started
Prerequisites
node v16+
Latest Blade Wallet Build v. 0.4.0 or higher.
Using Blade Connect interface
For example usage and testing the below APIs using a Demo App, please go here and setup the app locally: Demo App
BladeWallet uses the Hedera Signer and Wallet Interface
Install blade-web3
npm package:
npm install --save @bladelabs/blade-web3.js
Create new signer Object:
API
Read the TypeDoc API documentation
BladeConnector
bladeConnector.createSession(params?: SessionParams)
Create session with Blade Wallet.
bladeConnector.killSession()
Close the session with Blade Wallet.
bladeConnector.getSigner()
Get the currently active BladeSigner.
bladeConnector.getSigners()
Get a list of paired BladeSigner objects.
bladeConnector.onWalletLocked(callback)
Execute a callback when wallet is locked.
bladeConnector.onWalletUnlocked(callback)
Execute a callback when wallet is unlocked.
bladeConnector.onSessionDisconnect(callback)
Execute a callback when a session has been disconnected.
bladeConnector.onSessionExpire(callback)
Execute a callback when a session has expired.
BladeSigner
bladeSigner.getAccountId()
Get accountId of active account.
bladeSigner.getAccountBalance(accountId: AccountId⎮string)
Retrieve account balance by accountId
bladeSigner.getAccountInfo(accountId: AccountId⎮string)
Get information about a Hedera account on the connected network.
bladeSigner.checkTransaction(transaction: Transaction)
Check that a transaction is valid.
bladeSigner.populateTransaction(transaction: Transaction)
Set transaction id and node accounts using active account.
bladeSigner.call(request: Executable)
Execute a transaction with provider account.
bladeSigner.sign(message: UInt8Array[])
Sign a transaction with active wallet account.
bladeSigner.signTransaction(transaction: Transaction)
Sign a transaction with active wallet account.
bladeSigner.getLedgerId()
Ledger Id of the currently connected network.
bladeSigner.getMirrorNetwork()
Get an array of mirror nodes for the current network.
bladeSigner.getNetwork()
Get a map of nodes for the current hedera network.
bladeSigner.handshake(serverAccountId: string, serverSignature: string, payload: HandshakePayload)
Make secure client-server handshake
Development
Install dependencies.
Run vite
have a hot-reloaded application.
Note: Once you have the localhost server running, you should be able to connect to the Blade Wallet installed from the GitHub or Chrome Store. In some cases, the Blade Wallet from the Chrome Store will be outdated and may not work so please use the latest build from the GitHub repository mentioned in the prerequisites above.
Production
Run vite build
to build and minify the application.
Note: App must be run in https mode to access Blade Wallet Extension.
Last updated