@trezor/connect 9.0.0-beta.4 → 9.0.0-beta.7
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/README.md +37 -14
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/binanceSignTransaction.js +1 -1
- package/lib/api/bitcoin/Fees.js +1 -1
- package/lib/api/bitcoin/TransactionComposer.js +1 -1
- package/lib/api/bitcoin/enhanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/index.js +9 -9
- package/lib/api/bitcoin/refTx.d.ts +3 -3
- package/lib/api/bitcoin/signtx.d.ts +1 -1
- package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
- package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
- package/lib/api/cardano/cardanoInputs.d.ts +1 -0
- package/lib/api/cardano/cardanoInputs.js +12 -1
- package/lib/api/cardano/cardanoOutputs.d.ts +6 -3
- package/lib/api/cardano/cardanoOutputs.js +37 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
- package/lib/api/cardano/cardanoUtils.d.ts +3 -0
- package/lib/api/cardano/cardanoUtils.js +17 -0
- package/lib/api/cardano/cardanoWitnesses.js +4 -4
- package/lib/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardanoGetNativeScriptHash.d.ts +1 -1
- package/lib/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/api/cardanoSignTransaction.d.ts +8 -4
- package/lib/api/cardanoSignTransaction.js +40 -17
- package/lib/api/common/Discovery.js +1 -1
- package/lib/api/common/paramsValidator.d.ts +1 -1
- package/lib/api/composeTransaction.d.ts +1 -1
- package/lib/api/composeTransaction.js +2 -2
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/eosGetPublicKey.d.ts +1 -1
- package/lib/api/eosSignTransaction.js +1 -1
- package/lib/api/ethereum/__fixtures__/ethereumSignTypedData.js +1 -1
- package/lib/api/ethereum/ethereumSignTx.d.ts +3 -3
- package/lib/api/ethereum/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/ethereum/ethereumSignTypedData.js +1 -1
- package/lib/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereumSignTransaction.js +1 -1
- package/lib/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/firmware/calculateFirmwareHash.d.ts +6 -0
- package/lib/api/firmware/calculateFirmwareHash.js +26 -0
- package/lib/api/firmware/getBinary.d.ts +2 -2
- package/lib/api/firmware/getBinary.js +2 -3
- package/lib/api/firmware/index.d.ts +5 -0
- package/lib/api/firmware/index.js +13 -0
- package/lib/api/firmware/modifyFirmware.d.ts +3 -5
- package/lib/api/firmware/modifyFirmware.js +12 -10
- package/lib/api/{management → firmware}/uploadFirmware.d.ts +0 -0
- package/lib/api/{management → firmware}/uploadFirmware.js +0 -0
- package/lib/api/firmwareUpdate.d.ts +4 -1
- package/lib/api/firmwareUpdate.js +8 -13
- package/lib/api/getFirmwareHash.d.ts +7 -0
- package/lib/api/getFirmwareHash.js +29 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +4 -2
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nemSignTransaction.js +1 -1
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +1 -1
- package/lib/api/stellar/stellarSignTx.d.ts +1 -1
- package/lib/api/stellarSignTransaction.d.ts +1 -1
- package/lib/api/stellarSignTransaction.js +1 -1
- package/lib/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +1 -1
- package/lib/api/tezosSignTransaction.js +1 -1
- package/lib/backend/BlockchainLink.js +1 -1
- package/lib/constants/errors.d.ts +1 -1
- package/lib/constants/errors.js +1 -1
- package/lib/constants/index.js +5 -5
- package/lib/core/AbstractMethod.js +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/method.d.ts +1 -1
- package/lib/core/method.js +1 -1
- package/lib/data/DataManager.js +1 -1
- package/lib/data/connectSettings.d.ts +1 -1
- package/lib/data/firmwareInfo.js +0 -9
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/AbortController.js +1 -1
- package/lib/device/DescriptorStream.js +1 -1
- package/lib/device/Device.js +1 -1
- package/lib/device/DeviceCommands.js +2 -2
- package/lib/device/DeviceList.js +6 -4
- package/lib/events/index.js +10 -10
- package/lib/exports.js +3 -3
- package/lib/factory.js +1 -0
- package/lib/index-browser.js +1 -1
- package/lib/index.js +2 -2
- package/lib/types/api/binance/index.d.ts +29 -0
- package/lib/types/api/binance/index.js +3 -0
- package/lib/types/api/binanceSignTransaction.d.ts +1 -27
- package/lib/types/api/bitcoin/index.d.ts +82 -0
- package/lib/types/api/bitcoin/index.js +3 -0
- package/lib/types/api/cardano/index.d.ts +193 -0
- package/lib/types/api/cardano/index.js +3 -0
- package/lib/types/api/cardanoGetAddress.d.ts +1 -31
- package/lib/types/api/cardanoGetNativeScriptHash.d.ts +1 -18
- package/lib/types/api/cardanoGetPublicKey.d.ts +1 -12
- package/lib/types/api/cardanoSignTransaction.d.ts +1 -127
- package/lib/types/api/eos/index.d.ts +119 -0
- package/lib/types/api/eos/index.js +3 -0
- package/lib/types/api/eosGetPublicKey.d.ts +1 -10
- package/lib/types/api/eosSignTransaction.d.ts +1 -107
- package/lib/types/api/ethereum/index.d.ts +86 -0
- package/lib/types/api/ethereum/index.js +3 -0
- package/lib/types/api/ethereumSignMessage.d.ts +1 -5
- package/lib/types/api/ethereumSignTransaction.d.ts +1 -37
- package/lib/types/api/ethereumSignTypedData.d.ts +1 -37
- package/lib/types/api/ethereumVerifyMessage.d.ts +1 -6
- package/lib/types/api/firmwareUpdate.d.ts +6 -3
- package/lib/types/api/getFirmwareHash.d.ts +4 -0
- package/lib/types/api/getFirmwareHash.js +3 -0
- package/lib/types/api/index.d.ts +2 -0
- package/lib/types/api/nem/index.d.ts +90 -0
- package/lib/types/api/nem/index.js +3 -0
- package/lib/types/api/nemSignTransaction.d.ts +2 -89
- package/lib/types/api/ripple/index.d.ts +21 -0
- package/lib/types/api/ripple/index.js +3 -0
- package/lib/types/api/rippleSignTransaction.d.ts +1 -20
- package/lib/types/api/signMessage.d.ts +1 -7
- package/lib/types/api/signTransaction.d.ts +1 -67
- package/lib/types/api/stellar/index.d.ts +180 -0
- package/lib/types/api/stellar/index.js +3 -0
- package/lib/types/api/stellarSignTransaction.d.ts +1 -179
- package/lib/types/api/tezos/index.d.ts +58 -0
- package/lib/types/api/tezos/index.js +3 -0
- package/lib/types/api/tezosSignTransaction.d.ts +1 -57
- package/lib/types/api/verifyMessage.d.ts +1 -7
- package/lib/types/index.d.ts +8 -4
- package/lib/types/index.js +15 -7
- package/lib/utils/__fixtures__/accountUtils.js +1 -1
- package/lib/utils/__fixtures__/ethereumUtils.js +1 -1
- package/lib/utils/__fixtures__/formatUtils.js +1 -1
- package/lib/utils/accountUtils.d.ts +2 -2
- package/lib/utils/assetUtils.d.ts +2 -0
- package/lib/utils/assetUtils.js +22 -0
- package/lib/utils/assets-browser.js +1 -1
- package/lib/utils/assets-native.d.ts +2 -0
- package/lib/utils/assets-native.js +7 -0
- package/lib/utils/assets.js +6 -14
- package/lib/utils/browserUtils.js +1 -1
- package/lib/utils/debug.d.ts +2 -2
- package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.js +1 -1
- package/lib/utils/ethereumUtils.d.ts +1 -1
- package/lib/utils/formatUtils.js +1 -1
- package/lib/utils/hdnodeUtils.d.ts +1 -1
- package/lib/utils/pathUtils.d.ts +2 -2
- package/lib/workers/workers-browser.js +5 -5
- package/lib/workers/workers-react-native.js +4 -4
- package/lib/workers/workers.js +4 -4
- package/package.json +12 -9
- package/CHANGELOG.md +0 -26
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface TezosRevealOperation {
|
|
2
|
+
source: string;
|
|
3
|
+
fee: number;
|
|
4
|
+
counter: number;
|
|
5
|
+
gas_limit: number;
|
|
6
|
+
storage_limit: number;
|
|
7
|
+
public_key: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TezosManagerTransfer {
|
|
10
|
+
destination: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
}
|
|
13
|
+
export interface TezosParametersManager {
|
|
14
|
+
set_delegate?: string;
|
|
15
|
+
cancel_delegate?: boolean;
|
|
16
|
+
transfer?: TezosManagerTransfer;
|
|
17
|
+
}
|
|
18
|
+
export interface TezosTransactionOperation {
|
|
19
|
+
source: string;
|
|
20
|
+
destination: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
counter: number;
|
|
23
|
+
fee: number;
|
|
24
|
+
gas_limit: number;
|
|
25
|
+
storage_limit: number;
|
|
26
|
+
parameters?: number[];
|
|
27
|
+
parameters_manager?: TezosParametersManager;
|
|
28
|
+
}
|
|
29
|
+
export interface TezosOriginationOperation {
|
|
30
|
+
source: string;
|
|
31
|
+
balance: number;
|
|
32
|
+
delegate?: string;
|
|
33
|
+
script: string | number[];
|
|
34
|
+
fee: number;
|
|
35
|
+
counter: number;
|
|
36
|
+
gas_limit: number;
|
|
37
|
+
storage_limit: number;
|
|
38
|
+
}
|
|
39
|
+
export interface TezosDelegationOperation {
|
|
40
|
+
source: string;
|
|
41
|
+
delegate: string;
|
|
42
|
+
fee: number;
|
|
43
|
+
counter: number;
|
|
44
|
+
gas_limit: number;
|
|
45
|
+
storage_limit: number;
|
|
46
|
+
}
|
|
47
|
+
export interface TezosOperation {
|
|
48
|
+
reveal?: TezosRevealOperation;
|
|
49
|
+
transaction?: TezosTransactionOperation;
|
|
50
|
+
origination?: TezosOriginationOperation;
|
|
51
|
+
delegation?: TezosDelegationOperation;
|
|
52
|
+
}
|
|
53
|
+
export interface TezosSignTransaction {
|
|
54
|
+
path: string | number[];
|
|
55
|
+
branch: string;
|
|
56
|
+
operation: TezosOperation;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,61 +1,5 @@
|
|
|
1
1
|
import type { PROTO } from '../../constants';
|
|
2
2
|
import type { Params, Response } from '../params';
|
|
3
|
-
|
|
4
|
-
source: string;
|
|
5
|
-
fee: number;
|
|
6
|
-
counter: number;
|
|
7
|
-
gas_limit: number;
|
|
8
|
-
storage_limit: number;
|
|
9
|
-
public_key: string;
|
|
10
|
-
}
|
|
11
|
-
export interface TezosManagerTransfer {
|
|
12
|
-
destination: string;
|
|
13
|
-
amount: number;
|
|
14
|
-
}
|
|
15
|
-
export interface TezosParametersManager {
|
|
16
|
-
set_delegate?: string;
|
|
17
|
-
cancel_delegate?: boolean;
|
|
18
|
-
transfer?: TezosManagerTransfer;
|
|
19
|
-
}
|
|
20
|
-
export interface TezosTransactionOperation {
|
|
21
|
-
source: string;
|
|
22
|
-
destination: string;
|
|
23
|
-
amount: number;
|
|
24
|
-
counter: number;
|
|
25
|
-
fee: number;
|
|
26
|
-
gas_limit: number;
|
|
27
|
-
storage_limit: number;
|
|
28
|
-
parameters?: number[];
|
|
29
|
-
parameters_manager?: TezosParametersManager;
|
|
30
|
-
}
|
|
31
|
-
export interface TezosOriginationOperation {
|
|
32
|
-
source: string;
|
|
33
|
-
balance: number;
|
|
34
|
-
delegate?: string;
|
|
35
|
-
script: string | number[];
|
|
36
|
-
fee: number;
|
|
37
|
-
counter: number;
|
|
38
|
-
gas_limit: number;
|
|
39
|
-
storage_limit: number;
|
|
40
|
-
}
|
|
41
|
-
export interface TezosDelegationOperation {
|
|
42
|
-
source: string;
|
|
43
|
-
delegate: string;
|
|
44
|
-
fee: number;
|
|
45
|
-
counter: number;
|
|
46
|
-
gas_limit: number;
|
|
47
|
-
storage_limit: number;
|
|
48
|
-
}
|
|
49
|
-
export interface TezosOperation {
|
|
50
|
-
reveal?: TezosRevealOperation;
|
|
51
|
-
transaction?: TezosTransactionOperation;
|
|
52
|
-
origination?: TezosOriginationOperation;
|
|
53
|
-
delegation?: TezosDelegationOperation;
|
|
54
|
-
}
|
|
55
|
-
export interface TezosSignTransaction {
|
|
56
|
-
path: string | number[];
|
|
57
|
-
branch: string;
|
|
58
|
-
operation: TezosOperation;
|
|
59
|
-
}
|
|
3
|
+
import type { TezosSignTransaction } from './tezos';
|
|
60
4
|
export declare function tezosSignTransaction(params: Params<TezosSignTransaction>): Response<PROTO.TezosSignedTx>;
|
|
61
5
|
//# sourceMappingURL=tezosSignTransaction.d.ts.map
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { PROTO } from '../../constants';
|
|
2
2
|
import type { Params, Response } from '../params';
|
|
3
|
-
|
|
4
|
-
address: string;
|
|
5
|
-
signature: string;
|
|
6
|
-
message: string;
|
|
7
|
-
coin: string;
|
|
8
|
-
hex?: boolean;
|
|
9
|
-
}
|
|
3
|
+
import type { VerifyMessage } from './bitcoin';
|
|
10
4
|
export declare function verifyMessage(params: Params<VerifyMessage>): Response<PROTO.Success>;
|
|
11
5
|
//# sourceMappingURL=verifyMessage.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5,11 +5,15 @@ export * from './device';
|
|
|
5
5
|
export * from './firmware';
|
|
6
6
|
export * from './params';
|
|
7
7
|
export * from './settings';
|
|
8
|
-
export
|
|
8
|
+
export * from './api/cardano';
|
|
9
|
+
export * from './api/binance';
|
|
10
|
+
export * from './api/bitcoin';
|
|
11
|
+
export * from './api/eos';
|
|
12
|
+
export * from './api/ripple';
|
|
13
|
+
export * from './api/ethereum';
|
|
14
|
+
export * from './api/stellar';
|
|
15
|
+
export * from './api/tezos';
|
|
9
16
|
export type { ComposeOutput, PrecomposedTransaction } from './api/composeTransaction';
|
|
10
|
-
export type { SignTransaction } from './api/signTransaction';
|
|
11
|
-
export type { EthereumTransaction } from './api/ethereumSignTransaction';
|
|
12
|
-
export type { CardanoOutput, CardanoInput, CardanoCertificate } from './api/cardanoSignTransaction';
|
|
13
17
|
export type { RecoveryDevice } from './api/recoveryDevice';
|
|
14
18
|
export type { TokenInfo, Transaction as AccountTransaction, Target as TransactionTarget, AccountBalanceHistory as BlockchainAccountBalanceHistory, } from '@trezor/blockchain-link';
|
|
15
19
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./api"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./account"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./coinInfo"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./device"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./firmware"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./params"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./settings"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./api/cardano"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./api/binance"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./api/bitcoin"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./api/eos"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./api/ripple"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./api/ethereum"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./api/stellar"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./api/tezos"), exports);
|
|
11
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isUtxoBasedFixtures = exports.getAccountLabelFixtures = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const coins_json_1 =
|
|
5
|
+
const coins_json_1 = tslib_1.__importDefault(require("@trezor/connect-common/files/coins.json"));
|
|
6
6
|
const coinInfo_1 = require("../../data/coinInfo");
|
|
7
7
|
(0, coinInfo_1.parseCoinsJson)(coins_json_1.default);
|
|
8
8
|
exports.getAccountLabelFixtures = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNetworkLabelFixtures = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const coins_json_1 =
|
|
5
|
+
const coins_json_1 = tslib_1.__importDefault(require("@trezor/connect-common/files/coins.json"));
|
|
6
6
|
const coinInfo_1 = require("../../data/coinInfo");
|
|
7
7
|
(0, coinInfo_1.parseCoinsJson)(coins_json_1.default);
|
|
8
8
|
exports.getNetworkLabelFixtures = [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatAmountFixtures = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const coins_json_1 =
|
|
5
|
+
const coins_json_1 = tslib_1.__importDefault(require("@trezor/connect-common/files/coins.json"));
|
|
6
6
|
const coinInfo_1 = require("../../data/coinInfo");
|
|
7
7
|
(0, coinInfo_1.parseCoinsJson)(coins_json_1.default);
|
|
8
8
|
exports.formatAmountFixtures = [
|
|
@@ -3,9 +3,9 @@ declare type Bip44Options = {
|
|
|
3
3
|
purpose?: number;
|
|
4
4
|
coinType?: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const getAccountAddressN: (coinInfo: CoinInfo, accountIndex: number, bip44?: Bip44Options
|
|
6
|
+
export declare const getAccountAddressN: (coinInfo: CoinInfo, accountIndex: number, bip44?: Bip44Options) => number[];
|
|
7
7
|
export declare const getAccountLabel: (path: number[], coinInfo: CoinInfo) => string;
|
|
8
|
-
export declare const getPublicKeyLabel: (path: number[], coinInfo?: BitcoinNetworkInfo
|
|
8
|
+
export declare const getPublicKeyLabel: (path: number[], coinInfo?: BitcoinNetworkInfo) => string;
|
|
9
9
|
export declare const isUtxoBased: (coinInfo: CoinInfo) => boolean;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=accountUtils.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetByUrl = void 0;
|
|
4
|
+
const getAssetByUrl = (url) => {
|
|
5
|
+
const fileUrl = url.split('?')[0];
|
|
6
|
+
switch (fileUrl) {
|
|
7
|
+
case './data/coins.json':
|
|
8
|
+
return require('@trezor/connect-common/files/coins.json');
|
|
9
|
+
case './data/bridge/releases.json':
|
|
10
|
+
return require('@trezor/connect-common/files/bridge/releases.json');
|
|
11
|
+
case './data/firmware/1/releases.json':
|
|
12
|
+
return require('@trezor/connect-common/files/firmware/1/releases.json');
|
|
13
|
+
case './data/firmware/2/releases.json':
|
|
14
|
+
return require('@trezor/connect-common/files/firmware/2/releases.json');
|
|
15
|
+
case './data/messages/messages.json':
|
|
16
|
+
return require('@trezor/transport/messages.json');
|
|
17
|
+
default:
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.getAssetByUrl = getAssetByUrl;
|
|
22
|
+
//# sourceMappingURL=assetUtils.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.httpRequest = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const cross_fetch_1 =
|
|
5
|
+
const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
|
|
6
6
|
const httpRequest = async (url, type = 'text') => {
|
|
7
7
|
const response = await (0, cross_fetch_1.default)(url, { credentials: 'same-origin' });
|
|
8
8
|
if (response.ok) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpRequest = void 0;
|
|
4
|
+
const assetUtils_1 = require("./assetUtils");
|
|
5
|
+
const httpRequest = (url, _type) => (0, assetUtils_1.getAssetByUrl)(url);
|
|
6
|
+
exports.httpRequest = httpRequest;
|
|
7
|
+
//# sourceMappingURL=assets-native.js.map
|
package/lib/utils/assets.js
CHANGED
|
@@ -2,27 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.httpRequest = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const cross_fetch_1 =
|
|
5
|
+
const cross_fetch_1 = tslib_1.__importDefault(require("cross-fetch"));
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const assets_browser_1 = require("./assets-browser");
|
|
8
|
+
const assetUtils_1 = require("./assetUtils");
|
|
8
9
|
if (global && typeof global.fetch !== 'function') {
|
|
9
10
|
global.fetch = cross_fetch_1.default;
|
|
10
11
|
}
|
|
11
12
|
const httpRequest = (url, _type) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return require('@trezor/connect-common/files/coins.json');
|
|
16
|
-
case './data/bridge/releases.json':
|
|
17
|
-
return require('@trezor/connect-common/files/bridge/releases.json');
|
|
18
|
-
case './data/firmware/1/releases.json':
|
|
19
|
-
return require('@trezor/connect-common/files/firmware/1/releases.json');
|
|
20
|
-
case './data/firmware/2/releases.json':
|
|
21
|
-
return require('@trezor/connect-common/files/firmware/2/releases.json');
|
|
22
|
-
case './data/messages/messages.json':
|
|
23
|
-
return require('@trezor/transport/messages.json');
|
|
13
|
+
const asset = (0, assetUtils_1.getAssetByUrl)(url);
|
|
14
|
+
if (!asset) {
|
|
15
|
+
return /^https?/.test(url) ? (0, assets_browser_1.httpRequest)(url) : fs_1.promises.readFile(url);
|
|
24
16
|
}
|
|
25
|
-
return
|
|
17
|
+
return asset;
|
|
26
18
|
};
|
|
27
19
|
exports.httpRequest = httpRequest;
|
|
28
20
|
//# sourceMappingURL=assets.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.suggestUdevInstaller = exports.suggestBridgeInstaller = exports.getSuggestedPlatform = exports.getOS = exports.getBrowserState = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const bowser_1 =
|
|
5
|
+
const bowser_1 = tslib_1.__importDefault(require("bowser"));
|
|
6
6
|
const transportInfo_1 = require("../data/transportInfo");
|
|
7
7
|
const udevInfo_1 = require("../data/udevInfo");
|
|
8
8
|
const DEFAULT_STATE = {
|
package/lib/utils/debug.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ declare class Log {
|
|
|
16
16
|
warn(...args: any[]): void;
|
|
17
17
|
debug(...args: any[]): void;
|
|
18
18
|
}
|
|
19
|
-
export declare const initLog: (prefix: string, enabled?: boolean
|
|
20
|
-
export declare const enableLog: (enabled?: boolean
|
|
19
|
+
export declare const initLog: (prefix: string, enabled?: boolean) => Log;
|
|
20
|
+
export declare const enableLog: (enabled?: boolean) => void;
|
|
21
21
|
export declare const enableLogByPrefix: (prefix: string, enabled: boolean) => void;
|
|
22
22
|
export declare const getLog: () => LogMessage[];
|
|
23
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PROTO } from '../constants';
|
|
2
2
|
import type { Features, CoinInfo, UnavailableCapabilities } from '../types';
|
|
3
|
-
export declare const parseCapabilities: (features?:
|
|
3
|
+
export declare const parseCapabilities: (features?: Features) => PROTO.Capability[];
|
|
4
4
|
export declare const getUnavailableCapabilities: (features: Features, coins: CoinInfo[]) => UnavailableCapabilities;
|
|
5
5
|
export declare const parseRevision: (features: Features) => string | null;
|
|
6
6
|
//# sourceMappingURL=deviceFeaturesUtils.d.ts.map
|
|
@@ -52,7 +52,7 @@ const getUnavailableCapabilities = (features, coins) => {
|
|
|
52
52
|
});
|
|
53
53
|
const unavailable = supported.filter(info => {
|
|
54
54
|
if (info.type === 'bitcoin') {
|
|
55
|
-
if (info.name === 'Bitcoin' || info.name === 'Testnet') {
|
|
55
|
+
if (info.name === 'Bitcoin' || info.name === 'Testnet' || info.name === 'Regtest') {
|
|
56
56
|
return !capabilities.includes('Capability_Bitcoin');
|
|
57
57
|
}
|
|
58
58
|
return !capabilities.includes('Capability_Bitcoin_like');
|
package/lib/utils/formatUtils.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.messageToHex = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const bignumber_js_1 =
|
|
5
|
+
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
6
6
|
const formatAmount = (n, coinInfo) => `${new bignumber_js_1.default(n).div(10 ** coinInfo.decimals).toString(10)} ${coinInfo.shortcut}`;
|
|
7
7
|
exports.formatAmount = formatAmount;
|
|
8
8
|
const formatTime = (n) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Network } from '@trezor/utxo-lib';
|
|
2
2
|
import { PROTO } from '../constants';
|
|
3
|
-
export declare const convertXpub: (xpub: string, originalNetwork?: Network
|
|
3
|
+
export declare const convertXpub: (xpub: string, originalNetwork?: Network, requestedNetwork?: Network) => string;
|
|
4
4
|
export declare const convertBitcoinXpub: (xpub: string, network: Network) => string;
|
|
5
5
|
export declare function xpubDerive<PK extends PROTO.PublicKey | PROTO.EthereumPublicKey>(xpub: PK, childXPub: PK, suffix: number, network?: Network, _requestedNetwork?: Network): PK;
|
|
6
6
|
export declare const xpubToHDNodeType: (xpub: string, network: Network) => PROTO.HDNodeType;
|
package/lib/utils/pathUtils.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ export declare const isBech32Path: (path: number[] | undefined) => boolean;
|
|
|
10
10
|
export declare const isTaprootPath: (path: number[] | undefined) => boolean;
|
|
11
11
|
export declare const getAccountType: (path: number[] | undefined) => "p2pkh" | "p2sh" | "p2tr" | "p2wpkh";
|
|
12
12
|
export declare const getScriptType: (path: number[] | undefined) => PROTO.InternalInputScriptType;
|
|
13
|
-
export declare const getOutputScriptType: (path?: number[]
|
|
13
|
+
export declare const getOutputScriptType: (path?: number[]) => PROTO.ChangeOutputScriptType;
|
|
14
14
|
export declare const validatePath: (path: string | number[], length?: number, base?: boolean) => number[];
|
|
15
15
|
export declare const getSerializedPath: (path: number[]) => string;
|
|
16
16
|
export declare const getPathFromIndex: (bip44purpose: number, bip44cointype: number, index: number) => number[];
|
|
17
17
|
export declare const getIndexFromPath: (path: number[]) => number;
|
|
18
18
|
export declare const fixPath: <T extends PROTO.TxInputType | PROTO.TxOutputType>(utxo: T) => T;
|
|
19
|
-
export declare const getLabel: (label: string, coinInfo?: CoinInfo
|
|
19
|
+
export declare const getLabel: (label: string, coinInfo?: CoinInfo) => string;
|
|
20
20
|
//# sourceMappingURL=pathUtils.d.ts.map
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = exports.ReactNativeUsbPlugin = exports.WebUsbPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const sharedConnectionWorker_1 =
|
|
6
|
-
const blockbook_1 =
|
|
5
|
+
const sharedConnectionWorker_1 = tslib_1.__importDefault(require("@trezor/transport/lib/lowlevel/sharedConnectionWorker"));
|
|
6
|
+
const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
|
|
7
7
|
exports.BlockbookWorker = blockbook_1.default;
|
|
8
|
-
const ripple_1 =
|
|
8
|
+
const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/ripple"));
|
|
9
9
|
exports.RippleWorker = ripple_1.default;
|
|
10
|
-
const blockfrost_1 =
|
|
10
|
+
const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
|
|
11
11
|
exports.BlockfrostWorker = blockfrost_1.default;
|
|
12
|
-
const transport_1 =
|
|
12
|
+
const transport_1 = tslib_1.__importDefault(require("@trezor/transport"));
|
|
13
13
|
const WebUsbPlugin = () => new transport_1.default.Lowlevel(new transport_1.default.WebUsb(), typeof SharedWorker !== 'undefined' ? () => new sharedConnectionWorker_1.default() : null);
|
|
14
14
|
exports.WebUsbPlugin = WebUsbPlugin;
|
|
15
15
|
const ReactNativeUsbPlugin = undefined;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = exports.ReactNativeUsbPlugin = exports.WebUsbPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const blockbook_1 =
|
|
5
|
+
const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
|
|
6
6
|
exports.BlockbookWorker = blockbook_1.default;
|
|
7
|
-
const ripple_1 =
|
|
7
|
+
const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/ripple"));
|
|
8
8
|
exports.RippleWorker = ripple_1.default;
|
|
9
|
-
const blockfrost_1 =
|
|
9
|
+
const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
|
|
10
10
|
exports.BlockfrostWorker = blockfrost_1.default;
|
|
11
|
-
const transport_1 =
|
|
11
|
+
const transport_1 = tslib_1.__importDefault(require("@trezor/transport"));
|
|
12
12
|
const RNUsbPlugin_1 = require("./RNUsbPlugin");
|
|
13
13
|
const WebUsbPlugin = undefined;
|
|
14
14
|
exports.WebUsbPlugin = WebUsbPlugin;
|
package/lib/workers/workers.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = exports.ReactNativeUsbPlugin = exports.WebUsbPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const blockbook_1 =
|
|
5
|
+
const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
|
|
6
6
|
exports.BlockbookWorker = blockbook_1.default;
|
|
7
|
-
const ripple_1 =
|
|
7
|
+
const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/ripple"));
|
|
8
8
|
exports.RippleWorker = ripple_1.default;
|
|
9
|
-
const blockfrost_1 =
|
|
9
|
+
const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
|
|
10
10
|
exports.BlockfrostWorker = blockfrost_1.default;
|
|
11
|
-
const electrum_1 =
|
|
11
|
+
const electrum_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/electrum"));
|
|
12
12
|
exports.ElectrumWorker = electrum_1.default;
|
|
13
13
|
const WebUsbPlugin = undefined;
|
|
14
14
|
exports.WebUsbPlugin = WebUsbPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.7",
|
|
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.",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
"./lib/utils/assets": "./lib/utils/assets-browser"
|
|
26
26
|
},
|
|
27
27
|
"react-native": {
|
|
28
|
-
"./lib/
|
|
28
|
+
"./lib/index": "./lib/index",
|
|
29
|
+
"./lib/workers/workers": "./lib/workers/workers-react-native",
|
|
30
|
+
"./lib/utils/assets": "./lib/utils/assets-native"
|
|
29
31
|
},
|
|
30
32
|
"files": [
|
|
31
33
|
"lib/",
|
|
@@ -36,18 +38,19 @@
|
|
|
36
38
|
"test:unit": "jest",
|
|
37
39
|
"type-check": "tsc --build",
|
|
38
40
|
"build:lib": "rimraf ./lib && tsc --build tsconfig.lib.json",
|
|
39
|
-
"version:beta": "
|
|
40
|
-
"version:patch": "
|
|
41
|
-
"version:minor": "
|
|
42
|
-
"version:major": "
|
|
41
|
+
"version:beta": "tsx scripts/bump-version.ts prerelease",
|
|
42
|
+
"version:patch": "tsx scripts/bump-version.ts patch",
|
|
43
|
+
"version:minor": "tsx scripts/bump-version.ts minor",
|
|
44
|
+
"version:major": "tsx scripts/bump-version.ts major"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"@trezor/blockchain-link": "^2.1.3",
|
|
46
|
-
"@trezor/connect-common": "0.0.
|
|
47
|
-
"@trezor/transport": "^1.1.
|
|
48
|
+
"@trezor/connect-common": "0.0.9",
|
|
49
|
+
"@trezor/transport": "^1.1.4",
|
|
48
50
|
"@trezor/utils": "^9.0.2",
|
|
49
51
|
"@trezor/utxo-lib": "^1.0.0",
|
|
50
|
-
"bignumber.js": "^9.0
|
|
52
|
+
"bignumber.js": "^9.1.0",
|
|
53
|
+
"blakejs": "^1.2.1",
|
|
51
54
|
"bowser": "^2.11.0",
|
|
52
55
|
"cross-fetch": "^3.1.5",
|
|
53
56
|
"events": "^3.3.0",
|
package/CHANGELOG.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# 9.0.0
|
|
2
|
-
|
|
3
|
-
## Breaking changes:
|
|
4
|
-
|
|
5
|
-
- Changed codebase to typescript.
|
|
6
|
-
- Removed `Lisk` methods from api.
|
|
7
|
-
- Exported constants:
|
|
8
|
-
- `CARDANO.ADDRESS_TYPE` => `PROTO.CardanoAddressType`
|
|
9
|
-
- `CARDANO.CERTIFICATE_TYPE` => `PROTO.CardanoCertificateType`
|
|
10
|
-
- `CARDANO.POOL_RELAY_TYPE` => `PROTO.CardanoPoolRelayType`
|
|
11
|
-
- `CardanoCertificateType`
|
|
12
|
-
- `CardanoNativeScriptType` => `PROTO.CardanoNativeScriptType`
|
|
13
|
-
- `CardanoNativeScriptHashDisplayFormat` => `PROTO.CardanoNativeScriptHashDisplayFormat`
|
|
14
|
-
- `CardanoPoolRelayType` => `PROTO.CardanoPoolRelayType`
|
|
15
|
-
- `CardanoTxSigningMode` => `PROTO.CardanoTxSigningMode`
|
|
16
|
-
- `CardanoTxWitnessType` => `PROTO.CardanoTxWitnessType`
|
|
17
|
-
- removed unused `DEVICE.WAIT_FOR_SELECTION`
|
|
18
|
-
- removed unused `UI.CHANGE_ACCOUNT`
|
|
19
|
-
- Minimum firmware requirements bumped:
|
|
20
|
-
- 2.4.2 CardanoSignTransaction
|
|
21
|
-
|
|
22
|
-
## Added:
|
|
23
|
-
|
|
24
|
-
- `getOwnershipId` method
|
|
25
|
-
- `getOwnershipProof` method
|
|
26
|
-
- `authorizeCoinJoin` method
|