Appearance
Hive Wallet SDK
Installation
bash
$ npm i @peakd/hive-wallet-sdk
Basic usage
The hive-wallet-sdk
allows developers to handle every Hive wallet (Peak Vault, MetaMask and Keychain) without the need to write duplicate code.
javascript
import { getWallet } from '@peakd/hive-wallet-sdk'
// Get wallet reference
// Supported wallet IDs: 'peakvault', 'metamask' and 'keychain'
const wallet = await getWallet('peakvault')
// Use wallet
const json = {
message: `Sending json from ${wallet.name}`
}
// Request custom json
const res = await wallet.customJson('muwave', 'test', 'posting', json)
Supported functions
Function | PeakVault | Keychain | Metamask |
---|---|---|---|
signTx | ✔️ | ✔️ | ✔️ |
broadcast | ✔️ | ✔️ | ✔️ |
customJson | ✔️ | ✔️ | ✔️ |
signBuffer | ✔️ | ✔️ | ✔️ |
transfer | ✔️ | ✔️ | ✔️ |
recurrentTransfer | ✔️ | ✔️ | ✔️ |
vote | ✔️ | ✔️ | ✔️ |
post | ✔️ | ✔️ | ✔️ |
connect | ✔️ | ❌ | ✔️ |
decode | ✔️ | ✔️ | ✔️ |
encode | ✔️ | ✔️ | ✔️ |
encodeWithKeys | ✔️ | ✔️ | ❌ |
addAccountAuthority | ✔️ | ✔️ | ✔️ |
removeAccountAuthority | ✔️ | ✔️ | ✔️ |
addKeyAuthority | ✔️ | ✔️ | ✔️ |
removeKeyAuthority | ✔️ | ✔️ | ✔️ |
witnessVote | ✔️ | ✔️ | ✔️ |
governanceProxy | ✔️ | ✔️ | ✔️ |
createProposal | ✔️ | ✔️ | ✔️ |
removeProposal | ✔️ | ✔️ | ✔️ |
updateProposalVotes | ✔️ | ✔️ | ✔️ |
delegation | ✔️ | ✔️ | ✔️ |
stake | ✔️ | ✔️ | ✔️ |
unstake | ✔️ | ✔️ | ✔️ |
convert | ✔️ | ✔️ | ✔️ |
createClaimedAccount | ✔️ | ✔️ | ✔️ |
chooseContact | ✔️ | ❌ | ❌ |
setRpc | ✔️ | ✔️ | ✔️ |