Skip to content

Getting started

Installation

You can start using the wallet before the official release by going to the releases page and download the latest version for your browser.

Chrome

  • Extract the contents of the zip file
  • Open Chrome's kebab menu and navigate to Extensions -> Manage extensions
  • Turn on developer mode from the top-right corner
  • Click on Load unpacked (top-left corner) and open the extension's folder

Firefox

  • Open the hamburger menu and go to Settings
  • Navigate to Extensions & Themes in the bottom-left corner
  • Click on the gear icon next to Manage your extensions and select Debug Add-ons
  • Click on Load Temporary Add-on and choose the Peak Vault zip file
  • Now return to the Manage your extensions page
  • Find peak-vault and click on it
  • Then go to Permissions and turn on Access your data for all websites

Usage

bash
$ npm i @peakd/hive-wallet-sdk

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
const wallet = getWallet('peakvault')
// Use wallet
wallet.broadcast(...)

Referencing the extension directly

If the user has Peak Vault installed the wallet reference will be accessible from the browser's window object.

javascript
// Get wallet reference
const peakvault = window.peakvault
// Use wallet
peakvault.requestBroadcast(...)

For now type definitions can be downloaded <a href="peakvault.d.ts" target="_blank">here</a>. Save the file as peakvault.d.ts and add it to your project.

typescript
import { PeakVault } from 'peakvault'

// Get wallet reference
const peakvault: PeakVault = window.peakvault
// Use wallet
peakvault.requestBroadcast(...)