@trezor/connect 9.1.9 → 9.1.11
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 +16 -0
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +4 -2
- package/lib/api/applyFlags.js +3 -2
- package/lib/api/applySettings.d.ts +4 -2
- package/lib/api/applySettings.js +3 -13
- package/lib/api/authenticateDevice.js +3 -11
- package/lib/api/authorizeCoinjoin.d.ts +3 -1
- package/lib/api/authorizeCoinjoin.js +3 -11
- package/lib/api/backupDevice.d.ts +3 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +4 -2
- package/lib/api/binance/api/binanceGetAddress.js +4 -10
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +9 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +3 -5
- package/lib/api/binance/api/binanceSignTransaction.d.ts +4 -1
- package/lib/api/binance/api/binanceSignTransaction.js +5 -6
- package/lib/api/binance/binanceSignTx.d.ts +84 -3
- package/lib/api/binance/binanceSignTx.js +3 -26
- package/lib/api/bitcoin/Fees.d.ts +14 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +13 -2
- package/lib/api/bitcoin/refTx.d.ts +2 -2
- package/lib/api/bitcoin/refTx.js +22 -24
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +3 -2
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/blockchainGetTransactions.d.ts +1 -1
- package/lib/api/cancelCoinjoinAuthorization.d.ts +3 -1
- package/lib/api/cancelCoinjoinAuthorization.js +3 -0
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -2
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -13
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +3 -13
- package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetPublicKey.js +4 -7
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +26 -4
- package/lib/api/cardano/api/cardanoSignTransaction.js +15 -46
- package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
- package/lib/api/cardano/cardanoAddressParameters.js +3 -14
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +5 -20
- package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
- package/lib/api/cardano/cardanoCertificate.js +20 -59
- package/lib/api/cardano/cardanoInputs.d.ts +20 -8
- package/lib/api/cardano/cardanoInputs.js +18 -14
- package/lib/api/cardano/cardanoOutputs.d.ts +31 -2
- package/lib/api/cardano/cardanoOutputs.js +14 -11
- package/lib/api/cardano/cardanoTokenBundle.d.ts +11 -6
- package/lib/api/cardano/cardanoTokenBundle.js +9 -21
- package/lib/api/changePin.d.ts +4 -2
- package/lib/api/changePin.js +3 -2
- package/lib/api/changeWipeCode.d.ts +3 -1
- package/lib/api/cipherKeyValue.d.ts +5 -1
- package/lib/api/cipherKeyValue.js +13 -21
- package/lib/api/common/paramsValidator.js +5 -4
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -1
- package/lib/api/eos/api/eosGetPublicKey.js +3 -6
- package/lib/api/eos/api/eosSignTransaction.js +3 -5
- package/lib/api/eos/eosSignTx.d.ts +160 -2
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -10
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +21 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -5
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +6 -3
- package/lib/api/ethereum/api/ethereumSignMessage.js +3 -5
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTransaction.js +3 -25
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +83 -3
- package/lib/api/ethereum/api/ethereumSignTypedData.js +20 -12
- package/lib/api/ethereum/api/ethereumVerifyMessage.d.ts +3 -1
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +3 -6
- package/lib/api/ethereum/ethereumDefinitions.d.ts +37 -19
- package/lib/api/ethereum/ethereumDefinitions.js +21 -15
- package/lib/api/ethereum/ethereumSignTx.d.ts +1 -1
- package/lib/api/firmware/getBinary.js +5 -4
- package/lib/api/firmware/modifyFirmware.js +3 -2
- package/lib/api/firmware/uploadFirmware.d.ts +3 -1
- package/lib/api/firmware/verifyAuthenticityProof.js +3 -3
- package/lib/api/firmwareUpdate.js +10 -15
- package/lib/api/getAccountDescriptor.d.ts +2 -2
- package/lib/api/getAccountDescriptor.js +4 -7
- package/lib/api/getAccountInfo.d.ts +8 -8
- package/lib/api/getAddress.d.ts +8 -2
- package/lib/api/getAddress.js +10 -20
- package/lib/api/getCoinInfo.d.ts +117 -2
- package/lib/api/getCoinInfo.js +3 -2
- package/lib/api/getFeatures.d.ts +49 -1
- package/lib/api/getFirmwareHash.d.ts +3 -1
- package/lib/api/getFirmwareHash.js +3 -1
- package/lib/api/getOwnershipId.js +4 -7
- package/lib/api/getOwnershipProof.js +4 -11
- package/lib/api/getPublicKey.d.ts +21 -1
- package/lib/api/getPublicKey.js +4 -18
- package/lib/api/nem/api/nemGetAddress.d.ts +4 -2
- package/lib/api/nem/api/nemGetAddress.js +4 -11
- package/lib/api/nem/api/nemSignTransaction.d.ts +4 -1
- package/lib/api/nem/api/nemSignTransaction.js +7 -5
- package/lib/api/nem/nemSignTx.d.ts +75 -1
- package/lib/api/pushTransaction.js +3 -5
- package/lib/api/rebootToBootloader.d.ts +3 -1
- package/lib/api/recoveryDevice.d.ts +3 -1
- package/lib/api/recoveryDevice.js +3 -12
- package/lib/api/requestLogin.js +7 -9
- package/lib/api/resetDevice.d.ts +3 -1
- package/lib/api/resetDevice.js +3 -12
- package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -2
- package/lib/api/ripple/api/rippleGetAddress.js +4 -10
- package/lib/api/ripple/api/rippleSignTransaction.js +3 -17
- package/lib/api/setBusy.d.ts +3 -1
- package/lib/api/setBusy.js +3 -1
- package/lib/api/showDeviceTutorial.d.ts +3 -1
- package/lib/api/signMessage.d.ts +4 -1
- package/lib/api/signMessage.js +3 -7
- package/lib/api/solana/additionalInfo.js +3 -14
- package/lib/api/solana/api/solanaGetAddress.d.ts +4 -2
- package/lib/api/solana/api/solanaGetAddress.js +4 -7
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +13 -1
- package/lib/api/solana/api/solanaGetPublicKey.js +3 -5
- package/lib/api/solana/api/solanaSignTransaction.js +3 -4
- package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -2
- package/lib/api/stellar/api/stellarGetAddress.js +4 -10
- package/lib/api/stellar/api/stellarSignTransaction.js +3 -5
- package/lib/api/stellar/stellarSignTx.d.ts +5 -3
- package/lib/api/stellar/stellarSignTx.js +3 -15
- package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -2
- package/lib/api/tezos/api/tezosGetAddress.js +4 -10
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +9 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +3 -6
- package/lib/api/tezos/api/tezosSignTransaction.d.ts +5 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +3 -5
- package/lib/api/tezos/tezosSignTx.d.ts +70 -2
- package/lib/api/tezos/tezosSignTx.js +3 -44
- package/lib/api/unlockPath.js +3 -4
- package/lib/api/verifyMessage.d.ts +3 -1
- package/lib/api/verifyMessage.js +3 -7
- package/lib/api/wipeDevice.d.ts +3 -1
- package/lib/constants/index.d.ts +1 -1
- package/lib/constants/index.js +1 -1
- package/lib/constants/nem.d.ts +7 -0
- package/lib/constants/nem.js +5 -1
- package/lib/core/AbstractMethod.d.ts +1 -1
- package/lib/core/AbstractMethod.js +4 -3
- package/lib/core/index.js +4 -4
- package/lib/data/coinInfo.d.ts +588 -12
- package/lib/data/coinInfo.js +6 -6
- package/lib/data/config.js +5 -0
- package/lib/data/deviceAuthenticityConfig.d.ts +19 -13
- package/lib/data/deviceAuthenticityConfig.js +23 -1
- package/lib/data/firmwareInfo.js +11 -10
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +2 -6
- package/lib/device/Device.js +8 -27
- package/lib/device/DeviceCommands.d.ts +36 -4
- package/lib/device/DeviceCommands.js +5 -2
- package/lib/device/DeviceList.js +1 -1
- package/lib/events/ui-promise.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/types/api/applySettings.d.ts +18 -2
- package/lib/types/api/applySettings.js +9 -0
- package/lib/types/api/authenticateDevice.d.ts +22 -5
- package/lib/types/api/authenticateDevice.js +7 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +15 -13
- package/lib/types/api/authorizeCoinjoin.js +15 -0
- package/lib/types/api/binance/index.d.ts +203 -30
- package/lib/types/api/binance/index.js +48 -0
- package/lib/types/api/bitcoin/index.d.ts +18 -15
- package/lib/types/api/bitcoin/index.js +17 -0
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +5 -4
- package/lib/types/api/cancelCoinjoinAuthorization.js +5 -0
- package/lib/types/api/cardano/index.d.ts +685 -187
- package/lib/types/api/cardano/index.js +208 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +5 -8
- package/lib/types/api/cipherKeyValue.d.ts +12 -11
- package/lib/types/api/cipherKeyValue.js +12 -0
- package/lib/types/api/eos/index.d.ts +783 -116
- package/lib/types/api/eos/index.js +177 -0
- package/lib/types/api/ethereum/index.d.ts +163 -57
- package/lib/types/api/ethereum/index.js +90 -0
- package/lib/types/api/firmwareUpdate.d.ts +11 -11
- package/lib/types/api/firmwareUpdate.js +15 -0
- package/lib/types/api/getAccountDescriptor.d.ts +10 -8
- package/lib/types/api/getAccountDescriptor.js +10 -0
- package/lib/types/api/getAddress.d.ts +42 -9
- package/lib/types/api/getAddress.js +14 -0
- package/lib/types/api/getOwnershipId.d.ts +33 -8
- package/lib/types/api/getOwnershipId.js +10 -0
- package/lib/types/api/getOwnershipProof.d.ts +37 -12
- package/lib/types/api/getOwnershipProof.js +14 -0
- package/lib/types/api/getPublicKey.d.ts +31 -21
- package/lib/types/api/getPublicKey.js +26 -0
- package/lib/types/api/nem/index.d.ts +841 -91
- package/lib/types/api/nem/index.js +130 -0
- package/lib/types/api/pushTransaction.d.ts +6 -4
- package/lib/types/api/pushTransaction.js +6 -0
- package/lib/types/api/recoveryDevice.d.ts +14 -4
- package/lib/types/api/recoveryDevice.js +9 -0
- package/lib/types/api/requestLogin.d.ts +38 -13
- package/lib/types/api/requestLogin.js +15 -0
- package/lib/types/api/resetDevice.d.ts +15 -13
- package/lib/types/api/resetDevice.js +9 -0
- package/lib/types/api/ripple/index.d.ts +40 -22
- package/lib/types/api/ripple/index.js +24 -0
- package/lib/types/api/solana/index.d.ts +42 -21
- package/lib/types/api/solana/index.js +26 -0
- package/lib/types/api/stellar/index.d.ts +890 -180
- package/lib/types/api/stellar/index.js +249 -0
- package/lib/types/api/tezos/index.d.ts +162 -59
- package/lib/types/api/tezos/index.js +61 -0
- package/lib/types/api/unlockPath.d.ts +7 -5
- package/lib/types/api/unlockPath.js +7 -0
- package/lib/types/coinInfo.d.ts +273 -56
- package/lib/types/coinInfo.js +81 -0
- package/lib/types/device.d.ts +1 -1
- package/lib/types/device.js +2 -2
- package/lib/types/fees.d.ts +29 -25
- package/lib/types/fees.js +36 -0
- package/lib/types/firmware.d.ts +1 -0
- package/lib/types/firmware.js +3 -0
- package/lib/types/params.d.ts +26 -17
- package/lib/types/params.js +23 -0
- package/lib/utils/deviceFeaturesUtils.js +5 -4
- package/lib/utils/firmwareUtils.js +5 -4
- package/lib/utils/hdnodeUtils.d.ts +191 -1
- package/lib/utils/pathUtils.d.ts +191 -1
- package/lib/utils/urlUtils.js +3 -3
- package/package.json +10 -9
package/lib/types/params.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicKey = exports.GetPublicKey = exports.GetAddress = exports.DerivationPath = exports.Bundle = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
|
+
const Bundle = (type) => schema_utils_1.Type.Object({ bundle: schema_utils_1.Type.Array(type, { minItems: 1 }) });
|
|
6
|
+
exports.Bundle = Bundle;
|
|
7
|
+
exports.DerivationPath = schema_utils_1.Type.Union([schema_utils_1.Type.String(), schema_utils_1.Type.Array(schema_utils_1.Type.Number())]);
|
|
8
|
+
exports.GetAddress = schema_utils_1.Type.Object({
|
|
9
|
+
path: exports.DerivationPath,
|
|
10
|
+
address: schema_utils_1.Type.Optional(schema_utils_1.Type.String()),
|
|
11
|
+
showOnTrezor: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
12
|
+
chunkify: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
13
|
+
useEventListener: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
14
|
+
});
|
|
15
|
+
exports.GetPublicKey = schema_utils_1.Type.Object({
|
|
16
|
+
path: exports.DerivationPath,
|
|
17
|
+
showOnTrezor: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
18
|
+
suppressBackupWarning: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
19
|
+
chunkify: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
|
|
20
|
+
});
|
|
21
|
+
exports.PublicKey = schema_utils_1.Type.Object({
|
|
22
|
+
publicKey: schema_utils_1.Type.String(),
|
|
23
|
+
path: schema_utils_1.Type.Array(schema_utils_1.Type.Number()),
|
|
24
|
+
serializedPath: schema_utils_1.Type.String(),
|
|
25
|
+
});
|
|
3
26
|
//# sourceMappingURL=params.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureInternalModelFeature = exports.parseRevision = exports.getUnavailableCapabilities = exports.parseCapabilities = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const versionUtils = tslib_1.__importStar(require("@trezor/utils/lib/versionUtils"));
|
|
5
6
|
const config_1 = require("../data/config");
|
|
6
7
|
const types_1 = require("../types");
|
|
7
8
|
const DEFAULT_CAPABILITIES_T1 = [
|
|
@@ -81,7 +82,7 @@ const getUnavailableCapabilities = (features, coins) => {
|
|
|
81
82
|
.filter(info => !unavailable.includes(info))
|
|
82
83
|
.forEach(info => {
|
|
83
84
|
const supportVersion = info.support[key];
|
|
84
|
-
if (typeof supportVersion === 'string' &&
|
|
85
|
+
if (typeof supportVersion === 'string' && versionUtils.isNewer(supportVersion, fw)) {
|
|
85
86
|
list[info.shortcut.toLowerCase()] = 'update-required';
|
|
86
87
|
unavailable.push(info);
|
|
87
88
|
}
|
|
@@ -91,13 +92,13 @@ const getUnavailableCapabilities = (features, coins) => {
|
|
|
91
92
|
return;
|
|
92
93
|
const min = s.min ? s.min[key] : null;
|
|
93
94
|
const max = s.max ? s.max[key] : null;
|
|
94
|
-
if (min && (min === '0' ||
|
|
95
|
+
if (min && (min === '0' || versionUtils.isNewer(min, fw))) {
|
|
95
96
|
const value = min === '0' ? 'no-support' : 'update-required';
|
|
96
97
|
s.capabilities.forEach(m => {
|
|
97
98
|
list[m] = value;
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
|
-
if (max && !
|
|
101
|
+
if (max && !versionUtils.isNewerOrEqual(max, fw)) {
|
|
101
102
|
s.capabilities.forEach(m => {
|
|
102
103
|
list[m] = 'trezor-connect-outdated';
|
|
103
104
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.filterSafeListByFirmware = exports.filterSafeListByBootloader = exports.isValidReleases = exports.isStrictFeatures = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const versionUtils = tslib_1.__importStar(require("@trezor/utils/lib/versionUtils"));
|
|
5
6
|
const isStrictFeatures = (extFeatures) => [1, 2].includes(extFeatures.major_version) &&
|
|
6
7
|
(extFeatures.firmware_present === false ||
|
|
7
8
|
extFeatures.bootloader_mode == null ||
|
|
@@ -11,10 +12,10 @@ const isValidReleases = (extReleases) => Array.isArray(extReleases) &&
|
|
|
11
12
|
extReleases.every(release => release.version && release.min_firmware_version && release.min_bootloader_version);
|
|
12
13
|
exports.isValidReleases = isValidReleases;
|
|
13
14
|
const filterSafeListByBootloader = (releasesList, bootloaderVersion) => releasesList.filter(item => (!item.min_bootloader_version ||
|
|
14
|
-
|
|
15
|
+
versionUtils.isNewerOrEqual(bootloaderVersion, item.min_bootloader_version)) &&
|
|
15
16
|
(!item.bootloader_version ||
|
|
16
|
-
|
|
17
|
+
versionUtils.isNewerOrEqual(item.bootloader_version, bootloaderVersion)));
|
|
17
18
|
exports.filterSafeListByBootloader = filterSafeListByBootloader;
|
|
18
|
-
const filterSafeListByFirmware = (releasesList, firmwareVersion) => releasesList.filter(item =>
|
|
19
|
+
const filterSafeListByFirmware = (releasesList, firmwareVersion) => releasesList.filter(item => versionUtils.isNewerOrEqual(firmwareVersion, item.min_firmware_version));
|
|
19
20
|
exports.filterSafeListByFirmware = filterSafeListByFirmware;
|
|
20
21
|
//# sourceMappingURL=firmwareUtils.js.map
|
|
@@ -4,5 +4,195 @@ export declare const convertXpub: (xpub: string, originalNetwork?: Network, requ
|
|
|
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;
|
|
7
|
-
export declare const convertMultisigPubKey: <T extends
|
|
7
|
+
export declare const convertMultisigPubKey: <T extends ({
|
|
8
|
+
sequence?: number | undefined;
|
|
9
|
+
multisig?: {
|
|
10
|
+
address_n?: number[] | undefined;
|
|
11
|
+
nodes?: {
|
|
12
|
+
private_key?: string | undefined;
|
|
13
|
+
public_key: string;
|
|
14
|
+
depth: number;
|
|
15
|
+
fingerprint: number;
|
|
16
|
+
child_num: number;
|
|
17
|
+
chain_code: string;
|
|
18
|
+
}[] | undefined;
|
|
19
|
+
pubkeys: {
|
|
20
|
+
address_n: number[];
|
|
21
|
+
node: string | {
|
|
22
|
+
private_key?: string | undefined;
|
|
23
|
+
public_key: string;
|
|
24
|
+
depth: number;
|
|
25
|
+
fingerprint: number;
|
|
26
|
+
child_num: number;
|
|
27
|
+
chain_code: string;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
signatures: string[];
|
|
31
|
+
m: number;
|
|
32
|
+
} | undefined;
|
|
33
|
+
decred_tree?: number | undefined;
|
|
34
|
+
orig_hash?: string | undefined;
|
|
35
|
+
orig_index?: number | undefined;
|
|
36
|
+
decred_staking_spend?: PROTO.DecredStakingSpendType | undefined;
|
|
37
|
+
script_pubkey?: string | undefined;
|
|
38
|
+
coinjoin_flags?: number | undefined;
|
|
39
|
+
script_sig?: string | undefined;
|
|
40
|
+
witness?: string | undefined;
|
|
41
|
+
ownership_proof?: string | undefined;
|
|
42
|
+
commitment_data?: string | undefined;
|
|
43
|
+
amount: string | number;
|
|
44
|
+
prev_hash: string;
|
|
45
|
+
prev_index: number;
|
|
46
|
+
} & {
|
|
47
|
+
script_type?: "SPENDADDRESS" | "SPENDMULTISIG" | "SPENDWITNESS" | "SPENDP2SHWITNESS" | "SPENDTAPROOT" | undefined;
|
|
48
|
+
address_n: number[];
|
|
49
|
+
}) | ({
|
|
50
|
+
sequence?: number | undefined;
|
|
51
|
+
multisig?: {
|
|
52
|
+
address_n?: number[] | undefined;
|
|
53
|
+
nodes?: {
|
|
54
|
+
private_key?: string | undefined;
|
|
55
|
+
public_key: string;
|
|
56
|
+
depth: number;
|
|
57
|
+
fingerprint: number;
|
|
58
|
+
child_num: number;
|
|
59
|
+
chain_code: string;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
pubkeys: {
|
|
62
|
+
address_n: number[];
|
|
63
|
+
node: string | {
|
|
64
|
+
private_key?: string | undefined;
|
|
65
|
+
public_key: string;
|
|
66
|
+
depth: number;
|
|
67
|
+
fingerprint: number;
|
|
68
|
+
child_num: number;
|
|
69
|
+
chain_code: string;
|
|
70
|
+
};
|
|
71
|
+
}[];
|
|
72
|
+
signatures: string[];
|
|
73
|
+
m: number;
|
|
74
|
+
} | undefined;
|
|
75
|
+
decred_tree?: number | undefined;
|
|
76
|
+
orig_hash?: string | undefined;
|
|
77
|
+
orig_index?: number | undefined;
|
|
78
|
+
decred_staking_spend?: PROTO.DecredStakingSpendType | undefined;
|
|
79
|
+
script_pubkey?: string | undefined;
|
|
80
|
+
coinjoin_flags?: number | undefined;
|
|
81
|
+
script_sig?: string | undefined;
|
|
82
|
+
witness?: string | undefined;
|
|
83
|
+
ownership_proof?: string | undefined;
|
|
84
|
+
commitment_data?: string | undefined;
|
|
85
|
+
amount: string | number;
|
|
86
|
+
prev_hash: string;
|
|
87
|
+
prev_index: number;
|
|
88
|
+
} & {
|
|
89
|
+
address_n?: undefined;
|
|
90
|
+
script_pubkey: string;
|
|
91
|
+
script_type: "EXTERNAL";
|
|
92
|
+
}) | {
|
|
93
|
+
address_n?: undefined;
|
|
94
|
+
multisig?: {
|
|
95
|
+
address_n?: number[] | undefined;
|
|
96
|
+
nodes?: {
|
|
97
|
+
private_key?: string | undefined;
|
|
98
|
+
public_key: string;
|
|
99
|
+
depth: number;
|
|
100
|
+
fingerprint: number;
|
|
101
|
+
child_num: number;
|
|
102
|
+
chain_code: string;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
pubkeys: {
|
|
105
|
+
address_n: number[];
|
|
106
|
+
node: string | {
|
|
107
|
+
private_key?: string | undefined;
|
|
108
|
+
public_key: string;
|
|
109
|
+
depth: number;
|
|
110
|
+
fingerprint: number;
|
|
111
|
+
child_num: number;
|
|
112
|
+
chain_code: string;
|
|
113
|
+
};
|
|
114
|
+
}[];
|
|
115
|
+
signatures: string[];
|
|
116
|
+
m: number;
|
|
117
|
+
} | undefined;
|
|
118
|
+
orig_hash?: string | undefined;
|
|
119
|
+
orig_index?: number | undefined;
|
|
120
|
+
payment_req_index?: number | undefined;
|
|
121
|
+
address: string;
|
|
122
|
+
amount: string | number;
|
|
123
|
+
script_type: "PAYTOADDRESS";
|
|
124
|
+
} | {
|
|
125
|
+
address?: undefined;
|
|
126
|
+
multisig?: {
|
|
127
|
+
address_n?: number[] | undefined;
|
|
128
|
+
nodes?: {
|
|
129
|
+
private_key?: string | undefined;
|
|
130
|
+
public_key: string;
|
|
131
|
+
depth: number;
|
|
132
|
+
fingerprint: number;
|
|
133
|
+
child_num: number;
|
|
134
|
+
chain_code: string;
|
|
135
|
+
}[] | undefined;
|
|
136
|
+
pubkeys: {
|
|
137
|
+
address_n: number[];
|
|
138
|
+
node: string | {
|
|
139
|
+
private_key?: string | undefined;
|
|
140
|
+
public_key: string;
|
|
141
|
+
depth: number;
|
|
142
|
+
fingerprint: number;
|
|
143
|
+
child_num: number;
|
|
144
|
+
chain_code: string;
|
|
145
|
+
};
|
|
146
|
+
}[];
|
|
147
|
+
signatures: string[];
|
|
148
|
+
m: number;
|
|
149
|
+
} | undefined;
|
|
150
|
+
orig_hash?: string | undefined;
|
|
151
|
+
orig_index?: number | undefined;
|
|
152
|
+
script_type?: "PAYTOADDRESS" | "PAYTOSCRIPTHASH" | "PAYTOMULTISIG" | "PAYTOWITNESS" | "PAYTOP2SHWITNESS" | "PAYTOTAPROOT" | undefined;
|
|
153
|
+
payment_req_index?: number | undefined;
|
|
154
|
+
address_n: number[];
|
|
155
|
+
amount: string | number;
|
|
156
|
+
} | {
|
|
157
|
+
address_n?: undefined;
|
|
158
|
+
multisig?: {
|
|
159
|
+
address_n?: number[] | undefined;
|
|
160
|
+
nodes?: {
|
|
161
|
+
private_key?: string | undefined;
|
|
162
|
+
public_key: string;
|
|
163
|
+
depth: number;
|
|
164
|
+
fingerprint: number;
|
|
165
|
+
child_num: number;
|
|
166
|
+
chain_code: string;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
pubkeys: {
|
|
169
|
+
address_n: number[];
|
|
170
|
+
node: string | {
|
|
171
|
+
private_key?: string | undefined;
|
|
172
|
+
public_key: string;
|
|
173
|
+
depth: number;
|
|
174
|
+
fingerprint: number;
|
|
175
|
+
child_num: number;
|
|
176
|
+
chain_code: string;
|
|
177
|
+
};
|
|
178
|
+
}[];
|
|
179
|
+
signatures: string[];
|
|
180
|
+
m: number;
|
|
181
|
+
} | undefined;
|
|
182
|
+
orig_hash?: string | undefined;
|
|
183
|
+
orig_index?: number | undefined;
|
|
184
|
+
script_type?: "PAYTOADDRESS" | "PAYTOSCRIPTHASH" | "PAYTOMULTISIG" | "PAYTOWITNESS" | "PAYTOP2SHWITNESS" | "PAYTOTAPROOT" | undefined;
|
|
185
|
+
payment_req_index?: number | undefined;
|
|
186
|
+
address: string;
|
|
187
|
+
amount: string | number;
|
|
188
|
+
} | {
|
|
189
|
+
address_n?: undefined;
|
|
190
|
+
address?: undefined;
|
|
191
|
+
orig_hash?: string | undefined;
|
|
192
|
+
orig_index?: number | undefined;
|
|
193
|
+
payment_req_index?: number | undefined;
|
|
194
|
+
amount: 0 | "0";
|
|
195
|
+
script_type: "PAYTOOPRETURN";
|
|
196
|
+
op_return_data: string;
|
|
197
|
+
}>(network: Network, utxo: T) => T;
|
|
8
198
|
//# sourceMappingURL=hdnodeUtils.d.ts.map
|
package/lib/utils/pathUtils.d.ts
CHANGED
|
@@ -15,6 +15,196 @@ export declare const validatePath: (path: DerivationPath, length?: number, base?
|
|
|
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
|
-
export declare const fixPath: <T extends ProtoWithDerivationPath<
|
|
18
|
+
export declare const fixPath: <T extends ProtoWithDerivationPath<({
|
|
19
|
+
sequence?: number | undefined;
|
|
20
|
+
multisig?: {
|
|
21
|
+
address_n?: number[] | undefined;
|
|
22
|
+
nodes?: {
|
|
23
|
+
private_key?: string | undefined;
|
|
24
|
+
public_key: string;
|
|
25
|
+
depth: number;
|
|
26
|
+
fingerprint: number;
|
|
27
|
+
child_num: number;
|
|
28
|
+
chain_code: string;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
pubkeys: {
|
|
31
|
+
address_n: number[];
|
|
32
|
+
node: string | {
|
|
33
|
+
private_key?: string | undefined;
|
|
34
|
+
public_key: string;
|
|
35
|
+
depth: number;
|
|
36
|
+
fingerprint: number;
|
|
37
|
+
child_num: number;
|
|
38
|
+
chain_code: string;
|
|
39
|
+
};
|
|
40
|
+
}[];
|
|
41
|
+
signatures: string[];
|
|
42
|
+
m: number;
|
|
43
|
+
} | undefined;
|
|
44
|
+
decred_tree?: number | undefined;
|
|
45
|
+
orig_hash?: string | undefined;
|
|
46
|
+
orig_index?: number | undefined;
|
|
47
|
+
decred_staking_spend?: PROTO.DecredStakingSpendType | undefined;
|
|
48
|
+
script_pubkey?: string | undefined;
|
|
49
|
+
coinjoin_flags?: number | undefined;
|
|
50
|
+
script_sig?: string | undefined;
|
|
51
|
+
witness?: string | undefined;
|
|
52
|
+
ownership_proof?: string | undefined;
|
|
53
|
+
commitment_data?: string | undefined;
|
|
54
|
+
amount: string | number;
|
|
55
|
+
prev_hash: string;
|
|
56
|
+
prev_index: number;
|
|
57
|
+
} & {
|
|
58
|
+
script_type?: "SPENDADDRESS" | "SPENDMULTISIG" | "SPENDWITNESS" | "SPENDP2SHWITNESS" | "SPENDTAPROOT" | undefined;
|
|
59
|
+
address_n: number[];
|
|
60
|
+
}) | ({
|
|
61
|
+
sequence?: number | undefined;
|
|
62
|
+
multisig?: {
|
|
63
|
+
address_n?: number[] | undefined;
|
|
64
|
+
nodes?: {
|
|
65
|
+
private_key?: string | undefined;
|
|
66
|
+
public_key: string;
|
|
67
|
+
depth: number;
|
|
68
|
+
fingerprint: number;
|
|
69
|
+
child_num: number;
|
|
70
|
+
chain_code: string;
|
|
71
|
+
}[] | undefined;
|
|
72
|
+
pubkeys: {
|
|
73
|
+
address_n: number[];
|
|
74
|
+
node: string | {
|
|
75
|
+
private_key?: string | undefined;
|
|
76
|
+
public_key: string;
|
|
77
|
+
depth: number;
|
|
78
|
+
fingerprint: number;
|
|
79
|
+
child_num: number;
|
|
80
|
+
chain_code: string;
|
|
81
|
+
};
|
|
82
|
+
}[];
|
|
83
|
+
signatures: string[];
|
|
84
|
+
m: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
decred_tree?: number | undefined;
|
|
87
|
+
orig_hash?: string | undefined;
|
|
88
|
+
orig_index?: number | undefined;
|
|
89
|
+
decred_staking_spend?: PROTO.DecredStakingSpendType | undefined;
|
|
90
|
+
script_pubkey?: string | undefined;
|
|
91
|
+
coinjoin_flags?: number | undefined;
|
|
92
|
+
script_sig?: string | undefined;
|
|
93
|
+
witness?: string | undefined;
|
|
94
|
+
ownership_proof?: string | undefined;
|
|
95
|
+
commitment_data?: string | undefined;
|
|
96
|
+
amount: string | number;
|
|
97
|
+
prev_hash: string;
|
|
98
|
+
prev_index: number;
|
|
99
|
+
} & {
|
|
100
|
+
address_n?: undefined;
|
|
101
|
+
script_pubkey: string;
|
|
102
|
+
script_type: "EXTERNAL";
|
|
103
|
+
})> | ProtoWithDerivationPath<{
|
|
104
|
+
address_n?: undefined;
|
|
105
|
+
multisig?: {
|
|
106
|
+
address_n?: number[] | undefined;
|
|
107
|
+
nodes?: {
|
|
108
|
+
private_key?: string | undefined;
|
|
109
|
+
public_key: string;
|
|
110
|
+
depth: number;
|
|
111
|
+
fingerprint: number;
|
|
112
|
+
child_num: number;
|
|
113
|
+
chain_code: string;
|
|
114
|
+
}[] | undefined;
|
|
115
|
+
pubkeys: {
|
|
116
|
+
address_n: number[];
|
|
117
|
+
node: string | {
|
|
118
|
+
private_key?: string | undefined;
|
|
119
|
+
public_key: string;
|
|
120
|
+
depth: number;
|
|
121
|
+
fingerprint: number;
|
|
122
|
+
child_num: number;
|
|
123
|
+
chain_code: string;
|
|
124
|
+
};
|
|
125
|
+
}[];
|
|
126
|
+
signatures: string[];
|
|
127
|
+
m: number;
|
|
128
|
+
} | undefined;
|
|
129
|
+
orig_hash?: string | undefined;
|
|
130
|
+
orig_index?: number | undefined;
|
|
131
|
+
payment_req_index?: number | undefined;
|
|
132
|
+
address: string;
|
|
133
|
+
amount: string | number;
|
|
134
|
+
script_type: "PAYTOADDRESS";
|
|
135
|
+
} | {
|
|
136
|
+
address?: undefined;
|
|
137
|
+
multisig?: {
|
|
138
|
+
address_n?: number[] | undefined;
|
|
139
|
+
nodes?: {
|
|
140
|
+
private_key?: string | undefined;
|
|
141
|
+
public_key: string;
|
|
142
|
+
depth: number;
|
|
143
|
+
fingerprint: number;
|
|
144
|
+
child_num: number;
|
|
145
|
+
chain_code: string;
|
|
146
|
+
}[] | undefined;
|
|
147
|
+
pubkeys: {
|
|
148
|
+
address_n: number[];
|
|
149
|
+
node: string | {
|
|
150
|
+
private_key?: string | undefined;
|
|
151
|
+
public_key: string;
|
|
152
|
+
depth: number;
|
|
153
|
+
fingerprint: number;
|
|
154
|
+
child_num: number;
|
|
155
|
+
chain_code: string;
|
|
156
|
+
};
|
|
157
|
+
}[];
|
|
158
|
+
signatures: string[];
|
|
159
|
+
m: number;
|
|
160
|
+
} | undefined;
|
|
161
|
+
orig_hash?: string | undefined;
|
|
162
|
+
orig_index?: number | undefined;
|
|
163
|
+
script_type?: "PAYTOADDRESS" | "PAYTOSCRIPTHASH" | "PAYTOMULTISIG" | "PAYTOWITNESS" | "PAYTOP2SHWITNESS" | "PAYTOTAPROOT" | undefined;
|
|
164
|
+
payment_req_index?: number | undefined;
|
|
165
|
+
address_n: number[];
|
|
166
|
+
amount: string | number;
|
|
167
|
+
} | {
|
|
168
|
+
address_n?: undefined;
|
|
169
|
+
multisig?: {
|
|
170
|
+
address_n?: number[] | undefined;
|
|
171
|
+
nodes?: {
|
|
172
|
+
private_key?: string | undefined;
|
|
173
|
+
public_key: string;
|
|
174
|
+
depth: number;
|
|
175
|
+
fingerprint: number;
|
|
176
|
+
child_num: number;
|
|
177
|
+
chain_code: string;
|
|
178
|
+
}[] | undefined;
|
|
179
|
+
pubkeys: {
|
|
180
|
+
address_n: number[];
|
|
181
|
+
node: string | {
|
|
182
|
+
private_key?: string | undefined;
|
|
183
|
+
public_key: string;
|
|
184
|
+
depth: number;
|
|
185
|
+
fingerprint: number;
|
|
186
|
+
child_num: number;
|
|
187
|
+
chain_code: string;
|
|
188
|
+
};
|
|
189
|
+
}[];
|
|
190
|
+
signatures: string[];
|
|
191
|
+
m: number;
|
|
192
|
+
} | undefined;
|
|
193
|
+
orig_hash?: string | undefined;
|
|
194
|
+
orig_index?: number | undefined;
|
|
195
|
+
script_type?: "PAYTOADDRESS" | "PAYTOSCRIPTHASH" | "PAYTOMULTISIG" | "PAYTOWITNESS" | "PAYTOP2SHWITNESS" | "PAYTOTAPROOT" | undefined;
|
|
196
|
+
payment_req_index?: number | undefined;
|
|
197
|
+
address: string;
|
|
198
|
+
amount: string | number;
|
|
199
|
+
} | {
|
|
200
|
+
address_n?: undefined;
|
|
201
|
+
address?: undefined;
|
|
202
|
+
orig_hash?: string | undefined;
|
|
203
|
+
orig_index?: number | undefined;
|
|
204
|
+
payment_req_index?: number | undefined;
|
|
205
|
+
amount: 0 | "0";
|
|
206
|
+
script_type: "PAYTOOPRETURN";
|
|
207
|
+
op_return_data: string;
|
|
208
|
+
}>>(utxo: T) => ProtoWithAddressN<T>;
|
|
19
209
|
export declare const getLabel: (label: string, coinInfo?: CoinInfo) => string;
|
|
20
210
|
//# sourceMappingURL=pathUtils.d.ts.map
|
package/lib/utils/urlUtils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOnionDomain = exports.getHost = exports.getOrigin = void 0;
|
|
4
|
-
const
|
|
4
|
+
const urlToOnion_1 = require("@trezor/utils/lib/urlToOnion");
|
|
5
5
|
const getOrigin = (url) => {
|
|
6
6
|
var _a;
|
|
7
7
|
if (typeof url !== 'string')
|
|
@@ -29,9 +29,9 @@ exports.getHost = getHost;
|
|
|
29
29
|
const getOnionDomain = (url, dict) => {
|
|
30
30
|
var _a;
|
|
31
31
|
if (Array.isArray(url))
|
|
32
|
-
return url.map(u => { var _a; return (_a = (0,
|
|
32
|
+
return url.map(u => { var _a; return (_a = (0, urlToOnion_1.urlToOnion)(u, dict)) !== null && _a !== void 0 ? _a : u; });
|
|
33
33
|
if (typeof url === 'string')
|
|
34
|
-
return (_a = (0,
|
|
34
|
+
return (_a = (0, urlToOnion_1.urlToOnion)(url, dict)) !== null && _a !== void 0 ? _a : url;
|
|
35
35
|
return url;
|
|
36
36
|
};
|
|
37
37
|
exports.getOnionDomain = getOnionDomain;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trezor/connect",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.11",
|
|
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.",
|
|
@@ -52,15 +52,16 @@
|
|
|
52
52
|
"@ethereumjs/common": "^4.1.0",
|
|
53
53
|
"@ethereumjs/tx": "^5.1.0",
|
|
54
54
|
"@fivebinaries/coin-selection": "2.2.1",
|
|
55
|
-
"@trezor/blockchain-link": "2.1.
|
|
56
|
-
"@trezor/blockchain-link-types": "1.0.
|
|
55
|
+
"@trezor/blockchain-link": "2.1.23",
|
|
56
|
+
"@trezor/blockchain-link-types": "1.0.11",
|
|
57
57
|
"@trezor/connect-analytics": "1.0.11",
|
|
58
|
-
"@trezor/connect-common": "0.0.
|
|
59
|
-
"@trezor/protobuf": "1.0.
|
|
58
|
+
"@trezor/connect-common": "0.0.26",
|
|
59
|
+
"@trezor/protobuf": "1.0.7",
|
|
60
60
|
"@trezor/protocol": "1.0.5",
|
|
61
|
-
"@trezor/
|
|
62
|
-
"@trezor/
|
|
63
|
-
"@trezor/
|
|
61
|
+
"@trezor/schema-utils": "1.0.1",
|
|
62
|
+
"@trezor/transport": "1.1.22",
|
|
63
|
+
"@trezor/utils": "9.0.19",
|
|
64
|
+
"@trezor/utxo-lib": "2.0.4",
|
|
64
65
|
"bignumber.js": "^9.1.1",
|
|
65
66
|
"blakejs": "^1.2.1",
|
|
66
67
|
"bs58": "^5.0.0",
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
"tsx": "^4.6.2",
|
|
87
88
|
"typescript": "5.3.2",
|
|
88
89
|
"webpack": "^5.89.0",
|
|
89
|
-
"ws": "
|
|
90
|
+
"ws": "^8.16.0"
|
|
90
91
|
},
|
|
91
92
|
"peerDependencies": {
|
|
92
93
|
"tslib": "^2.6.2"
|