1.0.2 • Published 6 years ago

trezor-flags v1.0.2

Weekly downloads
8
License
SEE LICENSE IN LI...
Repository
-
Last release
6 years ago

trezor-flags

codecov

This library provides interface for working with flags stored in trezor devices.

Commands

Build

to build a bundle run yarn build

Tests

run tests using yarn test or yarn run test:watch for watch mode

eslint

yarn run lint

Installation

Npm

npm install trezor-flags --save

or

Yarn

yarn add trezor-flags

Usage

import { Flags, TREZOR_FLAG_KEYS } from 'trezor-flags';

Functions

Flags.isFlagPresent(flag: string, trezorSavedFlags: number): boolean

  • Flag variable represents one of possible flags defined in TREZOR_FLAG_KEYS array. TrezorSavedFlags is number (binary mask) which represents flags field from trezor features.

Flags.setFlag(flag: string, trezorSavedFlags: number): number

  • Returns representation of new combinantions of flag that might be saved into device with applyFlags call