@trezor/connect 9.2.4-beta.2 → 9.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -38
- package/README.md +1 -1
- package/lib/api/bitcoin/Fees.js +3 -4
- package/lib/api/bitcoin/TransactionComposer.js +3 -4
- package/lib/api/bitcoin/createPendingTx.js +3 -4
- package/lib/api/composeTransaction.d.ts +1 -1
- package/lib/api/composeTransaction.js +2 -2
- package/lib/api/ethereum/ethereumSignTypedData.js +4 -5
- package/lib/api/signTransaction.js +2 -3
- package/lib/data/config.js +5 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +3 -3
- package/lib/device/Device.js +4 -6
- package/lib/device/DeviceCommands.d.ts +3 -3
- package/lib/utils/formatUtils.js +3 -4
- package/package.json +11 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
| Package | stable | canary |
|
|
2
2
|
| -------------------------------- | :----: | :----------: |
|
|
3
|
-
| npm @trezor/connect | 9.2.
|
|
4
|
-
| npm @trezor/connect-web | 9.2.
|
|
5
|
-
| npm @trezor/connect-webextension | 9.2.
|
|
6
|
-
| connect.trezor.io/9 | 9.2.2 | x |
|
|
3
|
+
| npm @trezor/connect | 9.2.4 | 9.2.4-beta.2 |
|
|
4
|
+
| npm @trezor/connect-web | 9.2.4 | 9.2.4-beta.2 |
|
|
5
|
+
| npm @trezor/connect-webextension | 9.2.4 | 9.2.4-beta.2 |
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
| Connect explorer | stable | canary |
|
|
8
|
+
| ------------------- | :----: | :----------: |
|
|
9
|
+
| connect.trezor.io/9 | 9.2.4 | 9.2.4-beta.2 |
|
|
9
10
|
|
|
11
|
+
User the persistent link connect.trezor.io/9 to access the latest stable version of Connect Explorer.
|
|
12
|
+
|
|
13
|
+
# 9.2.4
|
|
14
|
+
|
|
15
|
+
- chore: BigNumber wrapper (d18ba9a879)
|
|
16
|
+
- chore(connect): add Rabby to knownHosts (1ec4c5bfc5)
|
|
17
|
+
- chore(transport): make Session type literal (72570f2219)
|
|
10
18
|
- chore(connect): re-add feature support checking in cardanoSignTransaction (acf9ffc2cb)
|
|
11
19
|
- chore(connect): fw-update: add error message when binary is too small (b0c1173f8d)
|
|
12
20
|
- chore(connect): remove legacyresults from cardano fixtures (acd9e1e510)
|
|
@@ -18,29 +26,6 @@
|
|
|
18
26
|
- chore(connect): remove DataManager from DeviceList (afc8760213)
|
|
19
27
|
- chore(connect): remove DataManager dependency from DeviceList constructor (7971515d71)
|
|
20
28
|
- chore(connect): simplify reduce code duplication in DeviceList (0cf8a04ed0)
|
|
21
|
-
|
|
22
|
-
## connect-explorer
|
|
23
|
-
|
|
24
|
-
- fix(connect-explorer): method testing tool scrollbars (f15f6487d8)
|
|
25
|
-
- fix(connect-explorer): support GitHub emoji (fda80e5aa3)
|
|
26
|
-
|
|
27
|
-
## connect-popup
|
|
28
|
-
|
|
29
|
-
- fix(connect-popup): use PassphraseTypeCardLegacy (629d6f8671)
|
|
30
|
-
|
|
31
|
-
## transport
|
|
32
|
-
|
|
33
|
-
- feat(transport): make signal required param in constructor (4b82f8d505)
|
|
34
|
-
|
|
35
|
-
## Dependencies update
|
|
36
|
-
|
|
37
|
-
- npm-release: @trezor/blockchain-link 2.1.30-beta.2
|
|
38
|
-
- npm-release: @trezor/blockchain-link-types 1.0.17-beta.2
|
|
39
|
-
- npm-release: @trezor/connect-analytics 1.0.15-beta.1
|
|
40
|
-
- npm-release: @trezor/transport 1.1.29-beta.1
|
|
41
|
-
|
|
42
|
-
# 9.2.4-beta.1
|
|
43
|
-
|
|
44
29
|
- feat(connect): BackupDevice now has params (4120912)
|
|
45
30
|
- chore(connect): update protobuf messages (41bff13)
|
|
46
31
|
- chore(connect): add new TS3 CA pubkeys and update timestamp (3ae06ac)
|
|
@@ -49,10 +34,23 @@
|
|
|
49
34
|
- fix(connect): intermediary reconnect improved, device authenticity, multi-apps synchronization, reading translations, bin_outputs in txcache (115c718, de1b969, 140ec9a a881142, 88d7608, 0bb13d3)
|
|
50
35
|
- fix(connect): bin_outputs in txcache (0bb13d3)
|
|
51
36
|
|
|
37
|
+
## connect-examples
|
|
38
|
+
|
|
39
|
+
- Update building process to allow multiple lines replacing of url mv2 and mv3 (e88b6f6f47)
|
|
40
|
+
|
|
41
|
+
## connect-explorer
|
|
42
|
+
|
|
43
|
+
Connect-explorer has been completely revamped into a new design :tada:
|
|
44
|
+
|
|
45
|
+
- feat(connect-explorer): use relative paths for assets and connect (f6f7cdf32c)
|
|
46
|
+
- fix(connect-explorer): method testing tool scrollbars (f15f6487d8)
|
|
47
|
+
- fix(connect-explorer): support GitHub emoji (fda80e5aa3)
|
|
48
|
+
|
|
52
49
|
## connect-popup
|
|
53
50
|
|
|
54
51
|
In general measures to address popup closing unexpectedly were taken. Update of content-script.js will be needed to make these changes effective.
|
|
55
52
|
|
|
53
|
+
- fix(connect-popup): use PassphraseTypeCardLegacy (629d6f8671)
|
|
56
54
|
- fix(connect-popup): update text in selectAccount (21f4382)
|
|
57
55
|
- fix(connect-popup): add delay before popup bootstrap to allow contentscript load (00b2056)
|
|
58
56
|
- fix(connect-popup): webextension example e2e (b9cce02)
|
|
@@ -61,20 +59,25 @@ In general measures to address popup closing unexpectedly were taken. Update of
|
|
|
61
59
|
- fix(connect-popup): delay popup.js loading to allow content script to init (92d15bc)
|
|
62
60
|
- fix(connect-popup): wait for POPUP.LOADED in webextension (cb18673)
|
|
63
61
|
|
|
64
|
-
##
|
|
62
|
+
## transport
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
- feat(transport): make signal required param in constructor (4b82f8d505)
|
|
67
65
|
|
|
68
66
|
## Dependencies update
|
|
69
67
|
|
|
70
|
-
- npm-release: @trezor/blockchain-link
|
|
71
|
-
- npm-release: @trezor/blockchain-link-
|
|
72
|
-
- npm-release: @trezor/
|
|
73
|
-
- npm-release: @trezor/connect-
|
|
74
|
-
- npm-release: @trezor/
|
|
75
|
-
- npm-release: @trezor/
|
|
76
|
-
- npm-release: @trezor/
|
|
77
|
-
- npm-release: @trezor/
|
|
68
|
+
- npm-release: @trezor/blockchain-link 2.1.30
|
|
69
|
+
- npm-release: @trezor/blockchain-link-utils 1.0.18
|
|
70
|
+
- npm-release: @trezor/blockchain-link-types 1.0.17
|
|
71
|
+
- npm-release: @trezor/connect-analytics 1.0.15
|
|
72
|
+
- npm-release: @trezor/analytics 1.0.17
|
|
73
|
+
- npm-release: @trezor/connect-common 0.0.33
|
|
74
|
+
- npm-release: @trezor/env-utils 1.0.17
|
|
75
|
+
- npm-release: @trezor/transport 1.1.29
|
|
76
|
+
- npm-release: @trezor/protobuf 1.0.13
|
|
77
|
+
- npm-release: @trezor/schema-utils 1.0.4
|
|
78
|
+
- npm-release: @trezor/protocol 1.0.9
|
|
79
|
+
- npm-release: @trezor/utxo-lib 2.0.10
|
|
80
|
+
- npm-release: @trezor/utils 9.0.24
|
|
78
81
|
|
|
79
82
|
# 9.2.3
|
|
80
83
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.2.4
|
|
3
|
+
API version 9.2.4
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
package/lib/api/bitcoin/Fees.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FeeLevels = void 0;
|
|
4
|
-
const
|
|
5
|
-
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
6
5
|
const convertFeeRate = (fee, minFee) => {
|
|
7
|
-
const feePerKB = new
|
|
6
|
+
const feePerKB = new bigNumber_1.BigNumber(fee);
|
|
8
7
|
if (feePerKB.isNaN() || feePerKB.lte('0'))
|
|
9
8
|
return;
|
|
10
9
|
const feePerB = feePerKB.div(1000);
|
|
@@ -41,7 +40,7 @@ const findLowest = (blocks) => blocks
|
|
|
41
40
|
.reverse()
|
|
42
41
|
.find(item => typeof item === 'string');
|
|
43
42
|
const findBlocksForFee = (feePerUnit, blocks) => {
|
|
44
|
-
const bn = new
|
|
43
|
+
const bn = new bigNumber_1.BigNumber(feePerUnit);
|
|
45
44
|
const lower = blocks.find(b => typeof b === 'string' && bn.gte(b));
|
|
46
45
|
if (!lower)
|
|
47
46
|
return -1;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransactionComposer = void 0;
|
|
4
|
-
const
|
|
5
|
-
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
6
5
|
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
7
6
|
const Fees_1 = require("./Fees");
|
|
8
7
|
class TransactionComposer {
|
|
@@ -24,7 +23,7 @@ class TransactionComposer {
|
|
|
24
23
|
.concat(addresses.change)
|
|
25
24
|
.map(a => a.address);
|
|
26
25
|
this.utxos = options.utxos.flatMap(u => {
|
|
27
|
-
if (!u.required && new
|
|
26
|
+
if (!u.required && new bigNumber_1.BigNumber(u.amount).lte(this.coinInfo.dustLimit))
|
|
28
27
|
return [];
|
|
29
28
|
return {
|
|
30
29
|
...u,
|
|
@@ -55,7 +54,7 @@ class TransactionComposer {
|
|
|
55
54
|
});
|
|
56
55
|
if (!atLeastOneValid) {
|
|
57
56
|
const lastLevel = levels[levels.length - 1];
|
|
58
|
-
let lastFee = new
|
|
57
|
+
let lastFee = new bigNumber_1.BigNumber(lastLevel.feePerUnit);
|
|
59
58
|
while (lastFee.gt(this.coinInfo.minFee) && this.composed.custom === undefined) {
|
|
60
59
|
lastFee = lastFee.minus(1);
|
|
61
60
|
const tx = this.compose(lastFee.toString());
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPendingTransaction = void 0;
|
|
4
|
-
const
|
|
5
|
-
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
6
5
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
7
6
|
const createPendingTransaction = (tx, { addresses, inputs, outputs, }) => {
|
|
8
|
-
const valueOut = outputs.reduce((sum, out) => (0,
|
|
9
|
-
const valueIn = inputs.reduce((sum, ins) => (0,
|
|
7
|
+
const valueOut = outputs.reduce((sum, out) => (0, bigNumber_1.BigNumber)(sum).plus(out.amount), new bigNumber_1.BigNumber('0'));
|
|
8
|
+
const valueIn = inputs.reduce((sum, ins) => (0, bigNumber_1.BigNumber)(sum).plus(ins.amount), new bigNumber_1.BigNumber('0'));
|
|
10
9
|
const allAddresses = addresses.unused.concat(addresses.used, addresses.change);
|
|
11
10
|
const findAddress = ({ address_n }) => {
|
|
12
11
|
const path = address_n ? (0, pathUtils_1.getSerializedPath)(address_n) : undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
5
5
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
const events_1 = require("../events");
|
|
@@ -36,7 +36,7 @@ class ComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
36
36
|
(0, BlockchainLink_1.isBackendSupported)(coinInfo);
|
|
37
37
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
38
38
|
const outputs = [];
|
|
39
|
-
let total = new
|
|
39
|
+
let total = new bigNumber_1.BigNumber(0);
|
|
40
40
|
payload.outputs.forEach(out => {
|
|
41
41
|
const output = (0, bitcoin_1.validateHDOutput)(out, coinInfo);
|
|
42
42
|
if ('amount' in output && typeof output.amount === 'string') {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFieldType = exports.encodeData = exports.parseArrayType = void 0;
|
|
4
|
-
const
|
|
5
|
-
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
6
5
|
const constants_1 = require("../../constants");
|
|
7
6
|
const formatUtils_1 = require("../../utils/formatUtils");
|
|
8
7
|
const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
|
|
@@ -24,9 +23,9 @@ function twosComplement(number, bytes) {
|
|
|
24
23
|
if (bytes < 1 || bytes > 32) {
|
|
25
24
|
throw constants_1.ERRORS.TypedError('Runtime', 'Int byte size must be between 1 and 32 (8 and 256 bits)');
|
|
26
25
|
}
|
|
27
|
-
const minValue = new
|
|
26
|
+
const minValue = new bigNumber_1.BigNumber(2).exponentiatedBy(bytes * 8 - 1).negated();
|
|
28
27
|
const maxValue = minValue.negated().minus(1);
|
|
29
|
-
const bigNumber = new
|
|
28
|
+
const bigNumber = new bigNumber_1.BigNumber(number);
|
|
30
29
|
if (bigNumber.isGreaterThan(maxValue) || bigNumber.isLessThan(minValue)) {
|
|
31
30
|
throw constants_1.ERRORS.TypedError('Runtime', `Overflow when trying to convert number ${number} into ${bytes} bytes`);
|
|
32
31
|
}
|
|
@@ -36,7 +35,7 @@ function twosComplement(number, bytes) {
|
|
|
36
35
|
return bigNumber.minus(minValue).minus(minValue);
|
|
37
36
|
}
|
|
38
37
|
function intToHex(number, bytes, signed) {
|
|
39
|
-
let bigNumber = new
|
|
38
|
+
let bigNumber = new bigNumber_1.BigNumber(number);
|
|
40
39
|
if (signed) {
|
|
41
40
|
bigNumber = twosComplement(bigNumber, bytes);
|
|
42
41
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
3
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
5
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
6
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
7
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
@@ -65,7 +64,7 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
65
64
|
const outputsWithAmount = outputs.filter(output => typeof output.amount === 'string' &&
|
|
66
65
|
!Object.prototype.hasOwnProperty.call(output, 'op_return_data'));
|
|
67
66
|
if (outputsWithAmount.length > 0) {
|
|
68
|
-
const total = outputsWithAmount.reduce((bn, output) => bn.plus(typeof output.amount === 'string' ? output.amount : '0'), new
|
|
67
|
+
const total = outputsWithAmount.reduce((bn, output) => bn.plus(typeof output.amount === 'string' ? output.amount : '0'), new bigNumber_1.BigNumber(0));
|
|
69
68
|
if (total.lt(coinInfo.dustLimit)) {
|
|
70
69
|
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Total amount is below dust limit.');
|
|
71
70
|
}
|
package/lib/data/config.js
CHANGED
package/lib/data/version.d.ts
CHANGED
package/lib/data/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '9.2.4
|
|
4
|
+
exports.VERSION = '9.2.4';
|
|
5
5
|
const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
|
|
6
6
|
const isBeta = exports.VERSION.includes('beta');
|
|
7
7
|
exports.DEFAULT_DOMAIN = isBeta
|
package/lib/device/Device.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TypedEmitter } from '@trezor/utils';
|
|
2
|
-
import {
|
|
1
|
+
import { Deferred, TypedEmitter } from '@trezor/utils';
|
|
2
|
+
import { Session } from '@trezor/transport';
|
|
3
3
|
import { TransportProtocol } from '@trezor/protocol';
|
|
4
4
|
import { DeviceCommands, PassphrasePromptResponse } from './DeviceCommands';
|
|
5
5
|
import { PROTO, NETWORK } from '../constants';
|
|
@@ -40,7 +40,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
|
|
|
40
40
|
loaded: boolean;
|
|
41
41
|
inconsistent: boolean;
|
|
42
42
|
firstRunPromise: Deferred<boolean>;
|
|
43
|
-
activitySessionID?:
|
|
43
|
+
activitySessionID?: Session | null;
|
|
44
44
|
commands?: DeviceCommands;
|
|
45
45
|
keepSession: boolean;
|
|
46
46
|
instance: number;
|
package/lib/device/Device.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Device = exports.GET_FEATURES_TIMEOUT = void 0;
|
|
4
4
|
const utils_1 = require("@trezor/utils");
|
|
5
|
-
const utils_2 = require("@trezor/utils");
|
|
6
|
-
const utils_3 = require("@trezor/utils");
|
|
7
5
|
const protocol_1 = require("@trezor/protocol");
|
|
8
6
|
const DeviceCommands_1 = require("./DeviceCommands");
|
|
9
7
|
const constants_1 = require("../constants");
|
|
@@ -47,7 +45,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
47
45
|
}
|
|
48
46
|
this.transport = transport;
|
|
49
47
|
this.originalDescriptor = descriptor;
|
|
50
|
-
this.firstRunPromise = (0,
|
|
48
|
+
this.firstRunPromise = (0, utils_1.createDeferred)();
|
|
51
49
|
}
|
|
52
50
|
static fromDescriptor(transport, originalDescriptor) {
|
|
53
51
|
const descriptor = { ...originalDescriptor, session: null };
|
|
@@ -124,7 +122,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
124
122
|
throw constants_1.ERRORS.TypedError('Device_CallInProgress');
|
|
125
123
|
}
|
|
126
124
|
options = parseRunOptions(options);
|
|
127
|
-
const runPromise = (0,
|
|
125
|
+
const runPromise = (0, utils_1.createDeferred)();
|
|
128
126
|
this.runPromise = runPromise;
|
|
129
127
|
this._runInner(fn, options).catch(err => {
|
|
130
128
|
runPromise.reject(err);
|
|
@@ -380,7 +378,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
380
378
|
feat.minor_version,
|
|
381
379
|
feat.patch_version,
|
|
382
380
|
];
|
|
383
|
-
if (!
|
|
381
|
+
if (!utils_1.versionUtils.isEqual(version, this.getVersion())) {
|
|
384
382
|
this.unavailableCapabilities = (0, deviceFeaturesUtils_1.getUnavailableCapabilities)(feat, (0, coinInfo_1.getAllNetworks)());
|
|
385
383
|
this.firmwareStatus = (0, firmwareInfo_1.getFirmwareStatus)(feat);
|
|
386
384
|
this.firmwareRelease = (0, firmwareInfo_1.getRelease)(feat);
|
|
@@ -448,7 +446,7 @@ class Device extends utils_1.TypedEmitter {
|
|
|
448
446
|
if (!this.features)
|
|
449
447
|
return false;
|
|
450
448
|
const modelVersion = typeof versions === 'string' ? versions : versions[this.features.major_version - 1];
|
|
451
|
-
return
|
|
449
|
+
return utils_1.versionUtils.isNewerOrEqual(this.getVersion().join('.'), modelVersion);
|
|
452
450
|
}
|
|
453
451
|
isUsed() {
|
|
454
452
|
return typeof this.originalDescriptor.session === 'string';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transport } from '@trezor/transport';
|
|
1
|
+
import { Transport, Session } from '@trezor/transport';
|
|
2
2
|
import { MessagesSchema as Messages } from '@trezor/protobuf';
|
|
3
3
|
import { Device } from './Device';
|
|
4
4
|
import type { CoinInfo, BitcoinNetworkInfo } from '../types';
|
|
@@ -21,12 +21,12 @@ export type PassphrasePromptResponse = {
|
|
|
21
21
|
export declare class DeviceCommands {
|
|
22
22
|
device: Device;
|
|
23
23
|
transport: Transport;
|
|
24
|
-
sessionId:
|
|
24
|
+
sessionId: Session;
|
|
25
25
|
disposed: boolean;
|
|
26
26
|
callPromise?: ReturnType<Transport['call']>;
|
|
27
27
|
_cancelableRequest?: (error?: any) => void;
|
|
28
28
|
_cancelableRequestBySend?: boolean;
|
|
29
|
-
constructor(device: Device, transport: Transport, sessionId:
|
|
29
|
+
constructor(device: Device, transport: Transport, sessionId: Session);
|
|
30
30
|
dispose(): void;
|
|
31
31
|
isDisposed(): boolean;
|
|
32
32
|
unlockPath(params?: Messages.UnlockPath): Promise<TypedResponseMessage<"UnlockedPathRequest">>;
|
package/lib/utils/formatUtils.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deepTransform = exports.messageToHex = exports.addHexPrefix = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const formatAmount = (n, coinInfo) => `${new bignumber_js_1.default(n).div(10 ** coinInfo.decimals).toString(10)} ${coinInfo.shortcut}`;
|
|
4
|
+
const bigNumber_1 = require("@trezor/utils/lib/bigNumber");
|
|
5
|
+
const formatAmount = (n, coinInfo) => `${new bigNumber_1.BigNumber(n).div(10 ** coinInfo.decimals).toString(10)} ${coinInfo.shortcut}`;
|
|
7
6
|
exports.formatAmount = formatAmount;
|
|
8
7
|
const formatTime = (n) => {
|
|
9
8
|
if (!n || n <= 0)
|
|
@@ -24,7 +23,7 @@ const formatTime = (n) => {
|
|
|
24
23
|
return res;
|
|
25
24
|
};
|
|
26
25
|
exports.formatTime = formatTime;
|
|
27
|
-
const btckb2satoshib = (n) => new
|
|
26
|
+
const btckb2satoshib = (n) => new bigNumber_1.BigNumber(n).times(1e5).toFixed(0, bigNumber_1.BigNumber.ROUND_HALF_UP);
|
|
28
27
|
exports.btckb2satoshib = btckb2satoshib;
|
|
29
28
|
const hasHexPrefix = (str) => str.slice(0, 2).toLowerCase() === '0x';
|
|
30
29
|
exports.hasHexPrefix = hasHexPrefix;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.2.4
|
|
3
|
+
"version": "9.2.4",
|
|
4
4
|
"author": "Trezor <info@trezor.io>",
|
|
5
5
|
"homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
|
|
6
6
|
"description": "High-level javascript interface for Trezor hardware wallet.",
|
|
@@ -70,17 +70,16 @@
|
|
|
70
70
|
"@ethereumjs/common": "^4.2.0",
|
|
71
71
|
"@ethereumjs/tx": "^5.2.1",
|
|
72
72
|
"@fivebinaries/coin-selection": "2.2.1",
|
|
73
|
-
"@trezor/blockchain-link": "2.1.30
|
|
74
|
-
"@trezor/blockchain-link-types": "1.0.17
|
|
75
|
-
"@trezor/connect-analytics": "1.0.15
|
|
76
|
-
"@trezor/connect-common": "0.0.33
|
|
77
|
-
"@trezor/protobuf": "1.0.13
|
|
78
|
-
"@trezor/protocol": "1.0.9
|
|
79
|
-
"@trezor/schema-utils": "1.0.4
|
|
80
|
-
"@trezor/transport": "1.1.29
|
|
81
|
-
"@trezor/utils": "9.0.
|
|
82
|
-
"@trezor/utxo-lib": "2.0.
|
|
83
|
-
"bignumber.js": "^9.1.2",
|
|
73
|
+
"@trezor/blockchain-link": "2.1.30",
|
|
74
|
+
"@trezor/blockchain-link-types": "1.0.17",
|
|
75
|
+
"@trezor/connect-analytics": "1.0.15",
|
|
76
|
+
"@trezor/connect-common": "0.0.33",
|
|
77
|
+
"@trezor/protobuf": "1.0.13",
|
|
78
|
+
"@trezor/protocol": "1.0.9",
|
|
79
|
+
"@trezor/schema-utils": "1.0.4",
|
|
80
|
+
"@trezor/transport": "1.1.29",
|
|
81
|
+
"@trezor/utils": "9.0.24",
|
|
82
|
+
"@trezor/utxo-lib": "2.0.10",
|
|
84
83
|
"blakejs": "^1.2.1",
|
|
85
84
|
"bs58": "^5.0.0",
|
|
86
85
|
"bs58check": "^3.0.1",
|