You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vladimir Volek dde0c8f78d
9 months ago
lib Publish new lib, added repository 1 year ago
src cleanup tests 1 year ago
.eslintignore Fix jest eslint import 1 year ago
.eslintrc Better importts 1 year ago
.gitignore Removed submodule 1 year ago
.gitlab-ci.yml Update eslint, bump node version 1 year ago Added details 1 year ago Added details 1 year ago Update 9 months ago
babel.config.js Better importts 1 year ago
jest.config.js coverage must be at least 100% 1 year ago
package.json v1.0.5 1 year ago
rollup.config.js Fixed lib name 1 year ago
yarn.lock Update eslint, bump node version 1 year ago



We’ve moved to monorepo trezor-suite. Please file all issues and Pull Requests there.

npm version

Tldr: For historical reasons, Trezor devices firmware updates are not always straightforward.

Incremental update: not every firmware update can be applied on any installed firmware. This currently applies only for T1 devices. min_bootloader_version and min_firmware_version should be observed.

Incremental downgrade: it is not possible to downgrade to lower version of bootloader.

Rollout update: sometimes we might want to offer firmware only to small portion of users. This behaviour is defined by rollout field and handled by this lib.



to build a bundle run yarn build


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


yarn run lint




#### Yarn
```yarn add trezor-rollout```


```import { getLatestSafeFw, getScore } from 'trezor-rollout';```


#### getScore()
- returns random number from 0 to 1 (0.21, 0.89, 0,45)
- You may use this method to implement "rolling update". You probably want to save result of this function client side (local storage) under a key defined by concrete firmware. Items in releases list might have rollout field (number 0-1) that should be evaluated against getScore() result.

#### getLatestSafeFw(options, score)
- options: Object

{ releaseList: Array // (see below), isInBootloader: boolean, firmwareVersion: Array ([1, 0, 0]) bootloaderVersion: Array ([1, 0, 0]), firmwarePresent: boolean }

releaseList is either [t1 list](
or [t2 list](

`isInBootloader`, `firmwareVersion`, `bootloaderVersion` and `firmwarePresent` are supplied by trezor via getFeatures call.

- score: Number (result of getScore()). This is to used to decide whether items with `rollout` defined are to be offered. Update is offered in case `score` provided is lower than `rollout`.

- returns UpdateInfo item


firmware: Object,               // single object from releaseList,
isLatest: boolean || null,      // is returned firwmare the latest one? null means we cant tell
isRequired: boolean,            // true if any of unistalled firmwares are required
isNewer: boolean || null,       // is returned firmware newer then actual? null means we cant tell

} ```