@hiveio/keychain

1.0.7 • Public • Published

This module makes it easy to add Keychain support within the browser. It also includes helpful functions to check whether Keychain was used before.

import {keychain, isKeychainInstalled, hasKeychainBeenUsed} from '@hiveio/keychain'

const {success, msg, cancel, notInstalled, notActive} = await keychain(window, 'requestTransfer', 'test', 'therealwolf', 5,  test memo', 'HIVE')

// All good
if(success) {
 // do your thing
}
// User didn't cancel, so something must have happened
else if(!cancel) {
  if(notActive) {
    // alert('Please allow Keychain to access this website')
  } else if(notInstalled) {
    // alert('Please install Keychain')
  } else {
    // error happened - check msg
  }
}

Package Sidebar

Install

npm i @hiveio/keychain

Weekly Downloads

8

Version

1.0.7

License

MIT

Unpacked Size

9.4 kB

Total Files

4

Last publish

Collaborators

  • mtyszczak
  • thebeedevs
  • mahdiyari
  • therealwolf
  • bgornicki
  • openhive
  • feruzm