Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

8.1.0 #544

Merged
merged 53 commits into from
Apr 15, 2020
Merged

8.1.0 #544

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6b568b2
fix messages overwrite (#517)
mroz22 Jan 21, 2020
18c7f2f
fix disableWebusb method (#526)
mroz22 Feb 10, 2020
50432fa
Passphrase redesign (#525)
szymonlesisz Feb 18, 2020
fb59937
Fix/types cleanup (#530)
szymonlesisz Feb 18, 2020
9e10d89
pass backupDevice params
szymonlesisz Feb 18, 2020
d858dbe
version 8.1.0
szymonlesisz Feb 18, 2020
340c939
btc: add hex support to sign message. (#527)
nodech Feb 18, 2020
7fa6a84
add "hex" param to sigMessage and verifyMessage tests
szymonlesisz Feb 18, 2020
c3a2b48
hex parameter in signMessage and verifyMessage (docs, changelog)
szymonlesisz Feb 18, 2020
8357dbb
update dependencies
szymonlesisz Feb 18, 2020
d8b731e
Update build-npm-extended.js
szymonlesisz Feb 19, 2020
4bc940a
update coins & fw releases
szymonlesisz Feb 19, 2020
886a467
Update build-npm-extended.js
szymonlesisz Feb 19, 2020
f45f60a
Update messages.json
szymonlesisz Feb 19, 2020
1500cef
Update deviceFeaturesUtils.test.js
szymonlesisz Feb 19, 2020
ed0cd68
Update build-npm-extended.js
szymonlesisz Feb 19, 2020
20fdb0d
Update GetAccountInfo.js
szymonlesisz Feb 20, 2020
a53eaf8
update modules (blockchain-link 1.0.8)
szymonlesisz Mar 6, 2020
81de5d5
Update messages.json
szymonlesisz Mar 6, 2020
2beca25
fix 1.8.0+ internal state caching
szymonlesisz Mar 6, 2020
aa62a43
move Device.Features.device_id to Device.id
szymonlesisz Mar 6, 2020
d2fbe50
Revert "move Device.Features.device_id to Device.id"
szymonlesisz Mar 6, 2020
81731ef
move Device.Features.device_id to Device.id (2)
szymonlesisz Mar 6, 2020
e2a1dcc
Feature/blockchain-link fiat rates (#536)
slowbackspace Mar 17, 2020
a1de0bf
fix: invalid default capabilities for TT@2.1.0+
szymonlesisz Mar 17, 2020
00c858d
cherry-pick fix #504
szymonlesisz Dec 7, 2019
685b50f
Feature/cancel (#537)
szymonlesisz Mar 18, 2020
299f4f4
Feature/custom backend (#538)
szymonlesisz Mar 18, 2020
511f345
Update CHANGELOG.md
szymonlesisz Mar 18, 2020
bbf9ec5
update dependencies
szymonlesisz Mar 18, 2020
98e8825
Bump acorn from 6.3.0 to 6.4.1 (#534)
dependabot[bot] Mar 18, 2020
d31fdc2
update/trezor-link@1.7.0 (#539)
szymonlesisz Mar 18, 2020
8a6e0d5
Update coins.json
szymonlesisz Mar 18, 2020
d43c0cd
p2wsh program patch (#541)
bucko13 Mar 19, 2020
df224ea
add unit tests to signTxVerify
szymonlesisz Mar 19, 2020
b7497a2
Merge branch 'v8' into develop
szymonlesisz Mar 19, 2020
3cb6813
Merge branch 'v8' into develop
szymonlesisz Mar 19, 2020
49de148
implement rollout lib (#532)
mroz22 Mar 23, 2020
fe5c4a1
changelog for 8.1.0-beta.4
mroz22 Mar 23, 2020
8f3db7b
correct changelog
mroz22 Mar 23, 2020
24825a5
fix firmware update types (#545)
mroz22 Mar 23, 2020
568f5fd
Merge branch 'v8' into develop
szymonlesisz Mar 29, 2020
b5320d3
add missing types from branch v8
szymonlesisz Mar 29, 2020
c8aef29
add flowtype missing fields
szymonlesisz Mar 30, 2020
e029507
Feature/custom connectSrc (#549)
szymonlesisz Apr 1, 2020
1051df9
Fix/blockchain link bump (#550)
szymonlesisz Apr 1, 2020
98738c5
filter custom connectSrc (#551)
szymonlesisz Apr 2, 2020
9d1c84c
fix BlockchainAccountBalanceHistory type (#552)
slowbackspace Apr 3, 2020
cc804ce
Tests (#553)
mroz22 Apr 6, 2020
a4ca290
fw update fix - base url without trailing slash and better error (#557)
mroz22 Apr 9, 2020
5c8448f
empty capabilities if no firmware (#559)
mroz22 Apr 13, 2020
441121d
fix unreadable hid device (#558)
mroz22 Apr 14, 2020
ed42ded
update FW releases
szymonlesisz Apr 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/_old/*
**/npm/*
**/npm-extended/*
**/build/*
**/build/*
**/src/ts/*
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"flowtype/use-flow-type": 1,
"flowtype/object-type-delimiter": [
2,
"comma"
"semicolon"
],
"flowtype/delimiter-dangle": [
2,
Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.*/npm/.*
.*/npm-extended/.*
.*/build/.*
.*/tests/*

[libs]
./node_modules/trezor-link/flowtype/chrome.js
Expand Down
23 changes: 20 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
image: node:8.10
image: node:12.14.1

stages:
- build
- deploy
# - test-integration

build:
stage: build
script:
- npm install -g yarn
- yarn
- yarn flow
- yarn eslint
- yarn lint
- yarn test:unit
- make build-connect
artifacts:
Expand Down Expand Up @@ -38,3 +38,20 @@ deploy review:
- branches
tags:
- deploy

# todo: does not work yet. I would like not to use image with docker installed and rather use
# docker mounted from parent container https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
# but I'd say it is not configured on the runners at the moment
#
# test integration:
# stage: test-integration
# dependencies:
# - deploy review
# variables:
# DOCKER_TLS_CERTDIR: ''
# services:
# - docker:dind
# before_script:
# - docker info
# script:
# - ./tests/run.sh ci
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ language: node_js
build: trusty

node_js:
- "8.10"
- "12.14.1"

script:
- npm install -g yarn
- yarn
- yarn flow
- yarn eslint
- yarn lint
- yarn test:unit
- make build-connect
- ./tests/run.sh 3 ci

notifications:
webhooks:
Expand All @@ -20,3 +21,6 @@ notifications:
on_success: always
on_failure: always
on_start: always

services:
- docker
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 8.1.0
#### Added
- Support for FW 1.9.0 and 2.3.0 (passphrase redesign)
- Typescript types
- `hex` parameter to `signMessage` and `verifyMessage` methods
- Blockchain methods for fiat rates:
- `TrezorConnect.blockchainGetAccountBalanceHistory`
- `TrezorConnect.blockchainGetCurrentFiatRates`
- `TrezorConnect.blockchainGetFiatRatesForTimestamps`
- `TrezorConnect.blockchainSubscribeFiatRates`
- `TrezorConnect.blockchainUnsubscribeFiatRates`
- `TrezorConnect.blockchainSetCustomBackend` method
- `TrezorConnect.cancel` is now trying to send (post) 'Cancel' message to acquired device (not working with TrezorBridge < 2.0.29)
- Implement @trezor/rollout module https://github.com/trezor/connect/issues/295
#### Fixed
- General cleanup in flowtype declarations
- disableWebUsb method
- trezor-link protobuf messages overrides
- Fixed race condition in nodejs https://github.com/trezor/connect/issues/504
# 8.0.15 (server side only)
#### Fixed
- `getAccountInfo` Bech32 accounts shouldn't be default #547
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Trezor Connect API version 8.0.15
# Trezor Connect API version 8.1.0
[![Build Status](https://travis-ci.org/trezor/connect.png?branch=develop)](https://travis-ci.org/trezor/connect)
[![NPM](https://img.shields.io/npm/v/trezor-connect.svg)](https://www.npmjs.org/package/trezor-connect)
[![Known Vulnerabilities](https://snyk.io/test/github/trezor/connect/badge.svg?targetFile=package.json)](https://snyk.io/test/github/trezor/connect?targetFile=package.json)
Expand Down
1 change: 1 addition & 0 deletions docs/methods/signMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TrezorConnect.signMessage(params).then(function(result) {
* `path` — *obligatory* `string | Array<number>` minimum length is `3`. [read more](path.md)
* `message` - *obligatory* `string`
* `coin` - *optional* `string` Determines network definition specified in [coins.json](../../src/data/coins.json) file. Coin `shortcut`, `name` or `label` can be used. If `coin` is not set API will try to get network definition from `path`.
* `hex` - *optional* `boolean` convert message from hex

### Example
```javascript
Expand Down
1 change: 1 addition & 0 deletions docs/methods/verifyMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TrezorConnect.verifyMessage(params).then(function(result) {
* `message` - *obligatory* `string` signed message,
* `signature` - *obligatory* `string` signature in base64 format,
* `coin` - *obligatory* `string` Determines network definition specified in [coins.json](../../src/data/coins.json) file. Coin `shortcut`, `name` or `label` can be used.
* `hex` - *optional* `boolean` convert message from hex

### Example
```javascript
Expand Down
14 changes: 14 additions & 0 deletions jest.config.integration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Integration tests
*/

module.exports = {
rootDir: './',
moduleFileExtensions: ['js'],
testMatch: ['**/tests/device/**/*.test.(js)'],
modulePathIgnorePatterns: ['node_modules', '_old', 'src/types', 'src/ui', 'src/utils/ws.ts'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.js', '<rootDir>/tests/common.setup.js'],
transform: {
'^.+\\.js$': 'babel-jest',
},
};
8 changes: 4 additions & 4 deletions jest.config.js → jest.config.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module.exports = {
rootDir: './',
moduleFileExtensions: ['js'],
testMatch: ['**/src/js/**/*.test.(js)'],
// coverageDirectory: './coverage/',
// collectCoverage: true,
// collectCoverageFrom: ['**/src/**/*.js'],
// modulePathIgnorePatterns: ['node_modules'],
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/src/js/device/_old/'],
coverageDirectory: './coverage/',
collectCoverage: true,
modulePathIgnorePatterns: ['node_modules'],
setupFiles: ['./tests/jest.setup.js'],
transform: {
'^.+\\.js$': 'babel-jest',
Expand Down
103 changes: 53 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trezor-connect",
"version": "8.0.15",
"version": "8.1.0",
"author": "Trezor <info@trezor.io>",
"homepage": "https://github.com/trezor/connect",
"description": "High-level javascript interface for Trezor hardware wallet.",
Expand Down Expand Up @@ -39,93 +39,96 @@
"build:npm-extended": "rm -rf npm-extended && babel-node ./scripts/build-npm-extended.js && babel ./npm-extended/lib --out-dir ./npm-extended/lib",
"stats": "webpack --config ./webpack/config.prod.babel.js --json > build/stats.json",
"test": "bash ./src/__tests__/run.sh",
"test:unit": "jest --verbose -c jest.config.js",
"test:unit": "jest --verbose -c jest.config.unit.js",
"test:integration": "./tests/run.sh",
"flow": "flow check src/js",
"flow-tests": "flow check src/__tests__",
"eslint": "eslint src/js",
"eslint-tests": "eslint src/__tests__",
"eslint-tests-fix": "eslint --fix src/__tests__",
"eslint-fix": "eslint --fix src/js"
"lint": "eslint src/js",
"lint:fix": "eslint --fix src/js",
"lint:tests": "eslint src/__tests__",
"lint:tests:fix": "eslint --fix src/__tests__"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/node": "^7.7.0",
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-transform-runtime": "^7.6.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-flow": "^7.0.0",
"@trezor/blockchain-link": "^1.0.6",
"@trezor/utxo-lib": "0.1.0",
"@babel/cli": "7.8.4",
"@babel/core": "7.8.7",
"@babel/node": "7.8.7",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/preset-env": "7.8.7",
"@babel/preset-flow": "7.8.3",
"@trezor/blockchain-link": "^1.0.10",
"@trezor/rollout": "^1.0.4",
"@trezor/utxo-lib": "^0.1.0",
"babel-collect-imports": "https://github.com/szymonlesisz/babel-collect-imports",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-eslint": "^10.1.0",
"babel-jest": "25.1.0",
"babel-loader": "^8.0.0",
"bchaddrjs": "0.4.4",
"bchaddrjs": "0.4.7",
"bignumber.js": "^9.0.0",
"bowser": "^2.7.0",
"copy-webpack-plugin": "^5.0.5",
"css-loader": "^3.2.0",
"bowser": "2.9.0",
"copy-webpack-plugin": "5.1.1",
"css-loader": "3.4.2",
"es6-promise": "^4.2.2",
"eslint": "^6.6.0",
"eslint-plugin-flowtype": "^4.4.1",
"eslint-plugin-jest": "^23.0.3",
"eslint": "6.8.0",
"eslint-plugin-flowtype": "4.6.0",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.1",
"file-loader": "^4.2.0",
"flow-bin": "0.112.0",
"file-loader": "^6.0.0",
"flow-bin": "0.120.1",
"fs-extra": "^8.1.0",
"hd-wallet": "9.0.0",
"html-webpack-plugin": "^3.2.0",
"jasmine-core": "^3.5.0",
"jest": "^24.9.0",
"jest": "25.1.0",
"karma": "^4.4.1",
"karma-babel-preprocessor": "^8.0.0",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.2.0",
"karma-jasmine": "^2.0.1",
"karma-firefox-launcher": "1.3.0",
"karma-jasmine": "3.1.1",
"karma-jasmine-async": "^0.0.1",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^4.0.2",
"keccak": "^2.0.0",
"less": "^3.10.3",
"keccak": "^3.0.0",
"less": "3.11.1",
"less-loader": "^5.0.0",
"less-plugin-autoprefix": "^2.0.0",
"less-plugin-clean-css": "^1.5.1",
"mini-css-extract-plugin": "^0.8.0",
"mini-css-extract-plugin": "0.9.0",
"node-fetch": "^2.6.0",
"parse-uri": "^1.0.0",
"ripple-lib": "^1.4.0",
"ripple-lib": "1.6.5",
"sharedworker-loader": "^2.1.1",
"style-loader": "^1.0.0",
"terser-webpack-plugin": "^2.2.1",
"style-loader": "1.1.3",
"terser-webpack-plugin": "2.3.5",
"tiny-worker": "^2.3.0",
"trezor-link": "1.6.7",
"trezor-link": "1.7.0",
"uglify-es": "3.3.9",
"version-bump-prompt": "^5.0.6",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"worker-loader": "^2.0.0"
"version-bump-prompt": "6.0.3",
"webpack": "^4.42.0",
"webpack-cli": "3.3.11",
"webpack-dev-server": "3.10.3",
"worker-loader": "2.0.0"
},
"dependencies": {
"@babel/runtime": "^7.7.2",
"events": "^3.0.0",
"@babel/runtime": "^7.8.7",
"events": "^3.1.0",
"whatwg-fetch": "^3.0.0"
},
"extendedDependencies": {
"@trezor/blockchain-link": "^1.0.6",
"@trezor/utxo-lib": "0.1.0",
"bchaddrjs": "^0.4.4",
"@trezor/blockchain-link": "^1.0.10",
"@trezor/rollout": "^1.0.4",
"@trezor/utxo-lib": "^0.1.0",
"bchaddrjs": "0.4.7",
"bignumber.js": "^9.0.0",
"bowser": "^2.7.0",
"bowser": "^2.9.0",
"hd-wallet": "9.0.0",
"keccak": "^2.0.0",
"keccak": "^3.0.0",
"node-fetch": "^2.6.0",
"parse-uri": "^1.0.0",
"tiny-worker": "^2.3.0",
"trezor-link": "1.6.7"
"trezor-link": "1.7.0"
}
}
21 changes: 16 additions & 5 deletions scripts/build-npm-extended.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import path from 'path';
import packageJSON from '../package.json';

const src = path.resolve(__dirname, '../src/js');
const ts = path.resolve(__dirname, '../src/ts/types');
const npm = path.resolve(__dirname, '../npm-extended');
const lib = path.resolve(__dirname, '../npm-extended/lib');
const dataSrc = path.resolve(__dirname, '../src/data');
const data = path.resolve(__dirname, '../npm-extended/data');

const ignored = ['__tests__', '_old', 'icons', 'udev'];
const shouldIgnore = (src) => ignored.find(i => src.indexOf(i) >= 0);

// copy all js files any make a copy with .flow extension
fse.copySync(src, lib, {
filter: function (src, dest) {
// do not copy "*/_old" directory
if (src.indexOf('_old') >= 0) return false;
if (shouldIgnore(src)) return false;
const ext = src.split('.').pop();
if (ext === 'js') {
fse.copySync(src, dest + '.flow');
Expand All @@ -21,12 +24,19 @@ fse.copySync(src, lib, {
},
});

// copy typescript
fse.copySync(ts, `${lib}/typescript`, {
filter: function (src, dest) {
if (shouldIgnore(src)) return false;
if (src.indexOf('.json') >= 0) return false;
return true;
},
});

// copy assets (only json)
fse.copySync(dataSrc, data, {
filter: function (src, dest) {
const ext = src.split('.').pop();
const copy = ext === 'json' || ext.indexOf('/') >= 0;
return copy;
return !shouldIgnore(src);
},
});

Expand All @@ -42,6 +52,7 @@ delete packageJSON.bin;
delete packageJSON.private;
packageJSON.version = packageJSON.version + '-extended';
packageJSON.main = 'lib/index.js';
packageJSON.types = 'lib/typescript/index.d.ts';

fse.writeFileSync(path.resolve(npm, 'package.json'), JSON.stringify(packageJSON, null, ' '), 'utf-8');

Expand Down
19 changes: 19 additions & 0 deletions scripts/generate-typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

const convertFlowToTypescript = (srcFile, destFile) => {
fse.readFile(srcFile, 'utf8', function (err, data) {
if (err) return console.log(err);
const result = data
.replace('/* @flow */', '')
.replace(/import type/g, 'import')
.replace(/\$Shape</g, 'Partial<')
.replace(/\{\|/g, '{')
.replace(/\|\}/g, '}')
.replace(/\?: \?}/g, '?: ')
.replace(/: \?}/g, '?: ');

const dest = destFile.replace('.js', '.d.ts');
fse.writeFile(dest, result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
};
Loading