@trezor/connect 9.4.7 → 9.4.8-beta.2
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 +59 -8
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +1 -1
- package/lib/api/applyFlags.js +1 -1
- package/lib/api/applySettings.d.ts +1 -1
- package/lib/api/authenticateDevice.js +1 -1
- package/lib/api/authorizeCoinjoin.d.ts +1 -1
- package/lib/api/authorizeCoinjoin.js +1 -1
- package/lib/api/backupDevice.d.ts +1 -1
- package/lib/api/backupDevice.js +1 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +3 -3
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +1 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +2 -2
- package/lib/api/binance/api/binanceSignTransaction.js +2 -2
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/TransactionComposer.d.ts +1 -1
- package/lib/api/bitcoin/inputs.d.ts +1 -1
- package/lib/api/bitcoin/inputs.js +1 -1
- package/lib/api/bitcoin/outputs.js +2 -2
- package/lib/api/bitcoin/refTx.d.ts +2 -2
- package/lib/api/bitcoin/refTx.js +4 -4
- package/lib/api/bitcoin/signtx.d.ts +2 -2
- package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +2 -2
- package/lib/api/blockchainEstimateFee.d.ts +1 -1
- package/lib/api/blockchainEstimateFee.js +3 -2
- package/lib/api/blockchainEvmRpcCall.js +2 -2
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
- package/lib/api/blockchainGetAccountBalanceHistory.js +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.js +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.js +1 -1
- package/lib/api/blockchainGetInfo.js +1 -1
- package/lib/api/blockchainGetTransactions.js +1 -1
- package/lib/api/blockchainSetCustomBackend.js +1 -1
- package/lib/api/blockchainSubscribe.d.ts +1 -1
- package/lib/api/blockchainSubscribe.js +1 -1
- package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/api/blockchainSubscribeFiatRates.js +1 -1
- package/lib/api/blockchainUnsubscribe.d.ts +1 -1
- package/lib/api/blockchainUnsubscribe.js +1 -1
- package/lib/api/blockchainUnsubscribeFiatRates.js +1 -1
- package/lib/api/cancelCoinjoinAuthorization.d.ts +1 -1
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +1 -1
- package/lib/api/cardano/api/cardanoComposeTransaction.js +3 -11
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -4
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -2
- package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -2
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +3 -3
- package/lib/api/cardano/api/cardanoSignTransaction.js +4 -4
- package/lib/api/cardano/cardanoAddressParameters.js +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
- package/lib/api/cardano/cardanoCertificate.js +1 -1
- package/lib/api/cardano/cardanoInputs.js +1 -1
- package/lib/api/cardano/cardanoUtils.js +30 -0
- package/lib/api/changePin.d.ts +1 -1
- package/lib/api/changePin.js +1 -1
- package/lib/api/changeWipeCode.d.ts +1 -1
- package/lib/api/cipherKeyValue.d.ts +1 -1
- package/lib/api/cipherKeyValue.js +3 -3
- package/lib/api/common/Discovery.d.ts +2 -2
- package/lib/api/common/paramsValidator.js +1 -1
- package/lib/api/composeTransaction.d.ts +3 -3
- package/lib/api/composeTransaction.js +9 -9
- package/lib/api/eos/api/eosGetPublicKey.d.ts +1 -1
- package/lib/api/eos/api/eosGetPublicKey.js +2 -2
- package/lib/api/eos/api/eosSignTransaction.d.ts +1 -1
- package/lib/api/eos/api/eosSignTransaction.js +2 -2
- package/lib/api/eos/eosSignTx.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +6 -6
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -3
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignMessage.js +3 -3
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTransaction.js +4 -4
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -1
- package/lib/api/ethereum/api/ethereumSignTypedData.js +6 -6
- package/lib/api/ethereum/api/ethereumVerifyMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -2
- package/lib/api/ethereum/ethereumDefinitions.d.ts +2 -2
- package/lib/api/ethereum/ethereumDefinitions.js +1 -0
- package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +2 -2
- package/lib/api/firmware/parseFirmwareHeaders.d.ts +2 -1
- package/lib/api/firmware/uploadFirmware.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.js +1 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +1 -1
- package/lib/api/firmware/verifyEntropy.d.ts +19 -0
- package/lib/api/firmware/verifyEntropy.js +112 -0
- package/lib/api/getAccountDescriptor.js +4 -4
- package/lib/api/getAccountInfo.d.ts +21 -1
- package/lib/api/getAccountInfo.js +7 -7
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +3 -3
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getCoinInfo.js +1 -1
- package/lib/api/getDeviceState.js +1 -1
- package/lib/api/getFirmwareHash.d.ts +1 -1
- package/lib/api/getFirmwareHash.js +1 -1
- package/lib/api/getOwnershipId.d.ts +1 -1
- package/lib/api/getOwnershipId.js +2 -2
- package/lib/api/getOwnershipProof.d.ts +1 -1
- package/lib/api/getOwnershipProof.js +2 -2
- package/lib/api/getPublicKey.d.ts +1 -1
- package/lib/api/getPublicKey.js +4 -4
- package/lib/api/loadDevice.d.ts +1 -1
- package/lib/api/loadDevice.js +1 -1
- package/lib/api/nem/api/nemGetAddress.d.ts +1 -1
- package/lib/api/nem/api/nemGetAddress.js +3 -3
- package/lib/api/nem/api/nemSignTransaction.d.ts +1 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -2
- package/lib/api/pushTransaction.js +2 -2
- package/lib/api/recoveryDevice.d.ts +1 -1
- package/lib/api/requestLogin.d.ts +1 -1
- package/lib/api/requestLogin.js +2 -2
- package/lib/api/resetDevice.d.ts +3 -1
- package/lib/api/resetDevice.js +58 -3
- package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +3 -3
- package/lib/api/ripple/api/rippleSignTransaction.d.ts +1 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +2 -2
- package/lib/api/setBrightness.d.ts +1 -1
- package/lib/api/setBrightness.js +1 -1
- package/lib/api/setBusy.d.ts +1 -1
- package/lib/api/setBusy.js +1 -1
- package/lib/api/setProxy.js +1 -1
- package/lib/api/showDeviceTutorial.d.ts +1 -1
- package/lib/api/showDeviceTutorial.js +1 -1
- package/lib/api/signMessage.d.ts +1 -1
- package/lib/api/signMessage.js +2 -2
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +3 -3
- package/lib/api/solana/api/index.d.ts +1 -0
- package/lib/api/solana/api/index.js +3 -1
- package/lib/api/solana/api/solanaComposeTransaction.d.ts +25 -0
- package/lib/api/solana/api/solanaComposeTransaction.js +61 -0
- package/lib/api/solana/api/solanaGetAddress.js +2 -2
- package/lib/api/solana/api/solanaGetPublicKey.js +2 -2
- package/lib/api/solana/api/solanaSignTransaction.d.ts +9 -1
- package/lib/api/solana/api/solanaSignTransaction.js +20 -2
- package/lib/api/solana/solanaUtils.d.ts +48 -0
- package/lib/api/solana/solanaUtils.js +213 -0
- package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellar/api/stellarGetAddress.js +3 -3
- package/lib/api/stellar/api/stellarSignTransaction.js +3 -3
- package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +3 -3
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -2
- package/lib/api/tezos/api/tezosSignTransaction.d.ts +1 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +2 -2
- package/lib/api/tezos/tezosSignTx.d.ts +17 -17
- package/lib/api/unlockPath.d.ts +1 -1
- package/lib/api/verifyMessage.d.ts +1 -1
- package/lib/api/verifyMessage.js +3 -3
- package/lib/backend/BackendManager.d.ts +1 -1
- package/lib/backend/BackendManager.js +1 -1
- package/lib/backend/Blockchain.d.ts +2 -2
- package/lib/backend/Blockchain.js +4 -7
- package/lib/constants/errors.d.ts +2 -0
- package/lib/constants/errors.js +4 -0
- package/lib/core/AbstractMethod.d.ts +2 -2
- package/lib/core/AbstractMethod.js +2 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.js +44 -48
- package/lib/core/onCallFirmwareUpdate.d.ts +3 -8
- package/lib/core/onCallFirmwareUpdate.js +63 -21
- package/lib/data/DataManager.js +1 -5
- package/lib/data/coinInfo.d.ts +15 -131
- package/lib/data/coinInfo.js +8 -8
- package/lib/data/config.d.ts +23 -0
- package/lib/data/config.js +4 -0
- package/lib/data/connectSettings.js +1 -1
- package/lib/data/defaultFeeLevels.d.ts +2 -2
- package/lib/data/defaultFeeLevels.js +34 -14
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +1 -0
- package/lib/data/deviceAuthenticityConfigTypes.js +2 -2
- package/lib/data/firmwareInfo.js +1 -1
- package/lib/data/models.js +5 -1
- package/lib/data/transportInfo.d.ts +0 -1
- package/lib/data/transportInfo.js +41 -28
- package/lib/data/udevInfo.d.ts +0 -1
- package/lib/data/udevInfo.js +2 -5
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +11 -10
- package/lib/device/Device.js +47 -17
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +42 -27
- package/lib/device/DeviceList.d.ts +27 -22
- package/lib/device/DeviceList.js +222 -133
- package/lib/device/StateStorage.js +11 -13
- package/lib/device/prompts.js +28 -36
- package/lib/device/resolveDescriptorForTaproot.d.ts +2 -2
- package/lib/device/resolveDescriptorForTaproot.js +5 -13
- package/lib/events/blockchain.d.ts +1 -1
- package/lib/events/call.d.ts +1 -1
- package/lib/events/core.d.ts +3 -3
- package/lib/events/device.d.ts +11 -1
- package/lib/events/device.js +1 -0
- package/lib/events/popup.d.ts +2 -2
- package/lib/events/transport.d.ts +15 -9
- package/lib/events/transport.js +10 -1
- package/lib/events/ui-promise.d.ts +1 -1
- package/lib/events/ui-request.d.ts +3 -3
- package/lib/factory.d.ts +3 -2
- package/lib/factory.js +3 -1
- package/lib/impl/core-in-module.d.ts +4 -2
- package/lib/impl/core-in-module.js +9 -1
- package/lib/impl/dynamic.d.ts +4 -2
- package/lib/impl/dynamic.js +5 -4
- package/lib/index-browser.js +1 -0
- package/lib/index.js +11 -3
- package/lib/types/account.d.ts +1 -1
- package/lib/types/api/authenticateDevice.d.ts +1 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +1 -1
- package/lib/types/api/authorizeCoinjoin.js +1 -1
- package/lib/types/api/binanceGetAddress.d.ts +1 -1
- package/lib/types/api/binanceGetPublicKey.d.ts +1 -1
- package/lib/types/api/blockchainEstimateFee.d.ts +1 -1
- package/lib/types/api/blockchainSetCustomBackend.d.ts +1 -1
- package/lib/types/api/blockchainSubscribe.d.ts +1 -1
- package/lib/types/api/cardanoComposeTransaction.d.ts +112 -6
- package/lib/types/api/cardanoComposeTransaction.js +77 -0
- package/lib/types/api/cardanoGetAddress.d.ts +1 -1
- package/lib/types/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/types/api/changeLanguage.d.ts +1 -1
- package/lib/types/api/cipherKeyValue.d.ts +1 -1
- package/lib/types/api/composeTransaction.d.ts +1 -1
- package/lib/types/api/eosGetPublicKey.d.ts +1 -1
- package/lib/types/api/ethereumGetAddress.d.ts +1 -1
- package/lib/types/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/types/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/types/api/firmwareUpdate.d.ts +11 -2
- package/lib/types/api/getAccountDescriptor.d.ts +1 -1
- package/lib/types/api/getAccountInfo.d.ts +1 -1
- package/lib/types/api/getAddress.d.ts +2 -1
- package/lib/types/api/getCoinInfo.d.ts +1 -1
- package/lib/types/api/getDeviceState.d.ts +1 -1
- package/lib/types/api/getFeatures.d.ts +1 -1
- package/lib/types/api/getOwnershipId.d.ts +2 -1
- package/lib/types/api/getOwnershipProof.d.ts +2 -1
- package/lib/types/api/getPublicKey.d.ts +1 -1
- package/lib/types/api/index.d.ts +7 -3
- package/lib/types/api/nem/index.d.ts +1 -1
- package/lib/types/api/nemGetAddress.d.ts +1 -1
- package/lib/types/api/on.d.ts +1 -1
- package/lib/types/api/recoveryDevice.d.ts +1 -1
- package/lib/types/api/rippleGetAddress.d.ts +1 -1
- package/lib/types/api/setTransports.d.ts +4 -0
- package/lib/types/api/setTransports.js +3 -0
- package/lib/types/api/solana/index.d.ts +41 -0
- package/lib/types/api/solana/index.js +31 -1
- package/lib/types/api/solanaComposeTransaction.d.ts +4 -0
- package/lib/types/api/solanaComposeTransaction.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +1 -1
- package/lib/types/api/solanaGetPublicKey.d.ts +1 -1
- package/lib/types/api/stellarGetAddress.d.ts +1 -1
- package/lib/types/api/tezosGetAddress.d.ts +1 -1
- package/lib/types/api/tezosGetPublicKey.d.ts +1 -1
- package/lib/types/api/unlockPath.d.ts +1 -1
- package/lib/types/coinInfo.d.ts +33 -0
- package/lib/types/coinInfo.js +8 -2
- package/lib/types/params.d.ts +1 -1
- package/lib/utils/abortablePromise.d.ts +5 -0
- package/lib/utils/abortablePromise.js +17 -0
- package/lib/utils/accountUtils.d.ts +1 -1
- package/lib/utils/accountUtils.js +1 -1
- package/lib/utils/assetUtils.js +1 -2
- package/lib/utils/assets-browser.d.ts +1 -1
- package/lib/utils/assets.js +1 -1
- package/lib/utils/assets.native.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.js +6 -12
- package/lib/utils/ethereumUtils.d.ts +3 -2
- package/lib/utils/firmwareUtils.d.ts +1 -1
- package/lib/utils/firmwareUtils.js +11 -4
- package/lib/utils/pathUtils.d.ts +1 -1
- package/lib/utils/urlUtils.js +2 -0
- package/lib/workers/workers-browser.d.ts +2 -2
- package/lib/workers/workers-browser.js +2 -2
- package/lib/workers/workers.native.d.ts +1 -1
- package/lib/workers/workers.native.js +2 -2
- package/package.json +22 -12
- package/lib/utils/promiseUtils.d.ts +0 -5
- package/lib/utils/promiseUtils.js +0 -14
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBinaryForFirmwareUpgrade = void 0;
|
|
4
4
|
const utils_1 = require("@trezor/utils");
|
|
5
|
+
const getBinary_1 = require("./getBinary");
|
|
6
|
+
const firmwareInfo_1 = require("../../data/firmwareInfo");
|
|
5
7
|
const assets_1 = require("../../utils/assets");
|
|
6
8
|
const firmwareUtils_1 = require("../../utils/firmwareUtils");
|
|
7
|
-
const firmwareInfo_1 = require("../../data/firmwareInfo");
|
|
8
|
-
const getBinary_1 = require("./getBinary");
|
|
9
9
|
const getBinaryForFirmwareUpgrade = ({ releases, baseUrl, version, btcOnly, intermediaryVersion, features, }) => {
|
|
10
10
|
if (!(0, firmwareUtils_1.isStrictFeatures)(features)) {
|
|
11
11
|
throw new Error('Features of unexpected shape provided');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CoreEventMessage } from '../../events';
|
|
2
1
|
import { PROTO } from '../../constants';
|
|
3
2
|
import type { Device } from '../../device/Device';
|
|
4
3
|
import type { TypedCall } from '../../device/DeviceCommands';
|
|
4
|
+
import { CoreEventMessage } from '../../events';
|
|
5
5
|
export declare const uploadFirmware: (typedCall: TypedCall, postMessage: (message: CoreEventMessage) => void, device: Device, { payload }: PROTO.FirmwareUpload) => Promise<{
|
|
6
6
|
type: "Success";
|
|
7
7
|
message: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uploadFirmware = void 0;
|
|
4
|
-
const events_1 = require("../../events");
|
|
5
4
|
const constants_1 = require("../../constants");
|
|
5
|
+
const events_1 = require("../../events");
|
|
6
6
|
const postConfirmationMessage = (device) => {
|
|
7
7
|
if (device.features.firmware_present) {
|
|
8
8
|
device.emit(events_1.DEVICE.BUTTON, device, { code: 'ButtonRequest_FirmwareUpdate' });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PROTO } from '../../constants';
|
|
2
|
-
import { AuthenticateDeviceResult } from '../../types/api/authenticateDevice';
|
|
3
2
|
import { DeviceAuthenticityConfig } from '../../data/deviceAuthenticityConfigTypes';
|
|
3
|
+
import { AuthenticateDeviceResult } from '../../types/api/authenticateDevice';
|
|
4
4
|
interface AuthenticityProofData extends PROTO.AuthenticityProof {
|
|
5
5
|
challenge: Buffer;
|
|
6
6
|
config: DeviceAuthenticityConfig;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PROTO } from '../../constants';
|
|
2
|
+
export declare const generateEntropy: (len: number) => Buffer;
|
|
3
|
+
type VerifyEntropyOptions = {
|
|
4
|
+
type?: PROTO.Enum_BackupType;
|
|
5
|
+
strength?: number;
|
|
6
|
+
commitment?: string;
|
|
7
|
+
hostEntropy: string;
|
|
8
|
+
trezorEntropy?: string;
|
|
9
|
+
xpubs: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
export declare const verifyEntropy: ({ type, strength, trezorEntropy, hostEntropy, commitment, xpubs, }: VerifyEntropyOptions) => Promise<{
|
|
12
|
+
success: true;
|
|
13
|
+
error?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
success: false;
|
|
16
|
+
error: any;
|
|
17
|
+
}>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=verifyEntropy.d.ts.map
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.verifyEntropy = exports.generateEntropy = void 0;
|
|
4
|
+
const crypto_1 = require("@noble/hashes/crypto");
|
|
5
|
+
const hmac_1 = require("@noble/hashes/hmac");
|
|
6
|
+
const sha256_1 = require("@noble/hashes/sha256");
|
|
7
|
+
const utils_1 = require("@noble/hashes/utils");
|
|
8
|
+
const bip39_1 = require("@scure/bip39");
|
|
9
|
+
const crypto_utils_1 = require("@trezor/crypto-utils");
|
|
10
|
+
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
11
|
+
const constants_1 = require("../../constants");
|
|
12
|
+
const generateEntropy = (len) => {
|
|
13
|
+
try {
|
|
14
|
+
return Buffer.from((0, utils_1.randomBytes)(len));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw new Error('generateEntropy: Environment does not support crypto random');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.generateEntropy = generateEntropy;
|
|
21
|
+
const BASE_ITERATION_COUNT = 10000;
|
|
22
|
+
const ROUND_COUNT = 4;
|
|
23
|
+
const roundFunction = async (i, passphrase, e, salt, r) => {
|
|
24
|
+
const data = Buffer.concat([Buffer.from([i]), passphrase]);
|
|
25
|
+
const iterations = Math.floor((BASE_ITERATION_COUNT << e) / ROUND_COUNT);
|
|
26
|
+
const { subtle } = crypto_1.crypto;
|
|
27
|
+
const key = await subtle.importKey('raw', data, 'PBKDF2', false, ['deriveBits']);
|
|
28
|
+
const bits = await subtle.deriveBits({
|
|
29
|
+
name: 'PBKDF2',
|
|
30
|
+
hash: 'SHA-256',
|
|
31
|
+
salt: Buffer.concat([salt, r]),
|
|
32
|
+
iterations,
|
|
33
|
+
}, key, r.length * 8);
|
|
34
|
+
return Buffer.from(bits);
|
|
35
|
+
};
|
|
36
|
+
const xor = (a, b) => {
|
|
37
|
+
if (a.length !== b.length) {
|
|
38
|
+
throw new Error('Buffers must be of equal length to XOR.');
|
|
39
|
+
}
|
|
40
|
+
const result = Buffer.alloc(a.length);
|
|
41
|
+
for (let i = 0; i < a.length; i++) {
|
|
42
|
+
result[i] = a[i] ^ b[i];
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
const entropyToSeedSlip39 = async (encryptedSecret) => {
|
|
47
|
+
const iterationExponent = 1;
|
|
48
|
+
const passphrase = Buffer.from('', 'utf-8');
|
|
49
|
+
const salt = Buffer.alloc(0);
|
|
50
|
+
const half = Math.floor(encryptedSecret.length / 2);
|
|
51
|
+
let l = encryptedSecret.subarray(0, half);
|
|
52
|
+
let r = encryptedSecret.subarray(half);
|
|
53
|
+
for (let round = ROUND_COUNT - 1; round >= 0; round--) {
|
|
54
|
+
const f = await roundFunction(round, passphrase, iterationExponent, salt, r);
|
|
55
|
+
const rr = xor(l, f);
|
|
56
|
+
l = r;
|
|
57
|
+
r = rr;
|
|
58
|
+
}
|
|
59
|
+
return Buffer.concat([r, l]);
|
|
60
|
+
};
|
|
61
|
+
const getEntropy = (trezorEntropy, hostEntropy, strength) => {
|
|
62
|
+
const data = Buffer.concat([
|
|
63
|
+
Buffer.from(trezorEntropy, 'hex'),
|
|
64
|
+
Buffer.from(hostEntropy, 'hex'),
|
|
65
|
+
]);
|
|
66
|
+
const entropy = (0, sha256_1.sha256)(data);
|
|
67
|
+
return Buffer.from(entropy.subarray(0, Math.floor(strength / 8)));
|
|
68
|
+
};
|
|
69
|
+
const computeSeed = (type, secret) => {
|
|
70
|
+
const BackupType = constants_1.PROTO.Enum_BackupType;
|
|
71
|
+
if (type &&
|
|
72
|
+
[
|
|
73
|
+
BackupType.Slip39_Basic,
|
|
74
|
+
BackupType.Slip39_Advanced,
|
|
75
|
+
BackupType.Slip39_Single_Extendable,
|
|
76
|
+
BackupType.Slip39_Basic_Extendable,
|
|
77
|
+
BackupType.Slip39_Advanced_Extendable,
|
|
78
|
+
].includes(type)) {
|
|
79
|
+
return entropyToSeedSlip39(secret);
|
|
80
|
+
}
|
|
81
|
+
return (0, bip39_1.mnemonicToSeed)((0, bip39_1.entropyToMnemonic)(secret, [...crypto_utils_1.bip39])).then(seed => Buffer.from(seed));
|
|
82
|
+
};
|
|
83
|
+
const verifyCommitment = (entropy, commitment) => {
|
|
84
|
+
const hmacDigest = (0, hmac_1.hmac)(sha256_1.sha256, Buffer.from(entropy, 'hex'), Buffer.alloc(0));
|
|
85
|
+
if (!Buffer.from(hmacDigest).equals(Buffer.from(commitment, 'hex'))) {
|
|
86
|
+
throw new Error('Invalid entropy commitment');
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const verifyEntropy = async ({ type, strength, trezorEntropy, hostEntropy, commitment, xpubs, }) => {
|
|
90
|
+
try {
|
|
91
|
+
if (!trezorEntropy || !commitment || !strength || Object.keys(xpubs).length < 1) {
|
|
92
|
+
throw new Error('Missing verifyEntropy data');
|
|
93
|
+
}
|
|
94
|
+
verifyCommitment(trezorEntropy, commitment);
|
|
95
|
+
const secret = getEntropy(trezorEntropy, hostEntropy, strength);
|
|
96
|
+
const seed = await computeSeed(type, secret);
|
|
97
|
+
const node = utxo_lib_1.bip32.fromSeed(seed);
|
|
98
|
+
Object.keys(xpubs).forEach(path => {
|
|
99
|
+
const pubKey = node.derivePath(path);
|
|
100
|
+
const xpub = pubKey.neutered().toBase58();
|
|
101
|
+
if (xpub !== xpubs[path]) {
|
|
102
|
+
throw new Error('verifyEntropy xpub mismatch');
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return { success: true };
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return { success: false, error: error.message };
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.verifyEntropy = verifyEntropy;
|
|
112
|
+
//# sourceMappingURL=verifyEntropy.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const
|
|
7
|
-
const accountUtils_1 = require("../utils/accountUtils");
|
|
6
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
8
7
|
const coinInfo_1 = require("../data/coinInfo");
|
|
9
|
-
const constants_1 = require("../constants");
|
|
10
8
|
const events_1 = require("../events");
|
|
11
9
|
const types_1 = require("../types");
|
|
12
10
|
const getAccountDescriptor_1 = require("../types/api/getAccountDescriptor");
|
|
11
|
+
const accountUtils_1 = require("../utils/accountUtils");
|
|
12
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
13
13
|
class GetAccountDescriptor extends AbstractMethod_1.AbstractMethod {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { AccountInfo, AccountUtxo, CoinInfo } from '../types';
|
|
2
3
|
import { Discovery } from './common/Discovery';
|
|
3
|
-
import type { CoinInfo, AccountInfo, AccountUtxo } from '../types';
|
|
4
4
|
import type { GetAccountInfo as GetAccountInfoParams } from '../types/api/getAccountInfo';
|
|
5
5
|
type Request = GetAccountInfoParams & {
|
|
6
6
|
address_n: number[];
|
|
@@ -56,9 +56,19 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
|
|
|
56
56
|
isActive: boolean;
|
|
57
57
|
rewards: string;
|
|
58
58
|
poolId: string | null;
|
|
59
|
+
drep: {
|
|
60
|
+
drep_id: string;
|
|
61
|
+
hex: string;
|
|
62
|
+
amount: string;
|
|
63
|
+
active: boolean;
|
|
64
|
+
active_epoch: number | null;
|
|
65
|
+
has_script: boolean;
|
|
66
|
+
} | null;
|
|
59
67
|
};
|
|
60
68
|
owner?: string;
|
|
61
69
|
rent?: number;
|
|
70
|
+
solStakingAccounts?: import("@trezor/blockchain-link-types/lib/solana").SolanaStakingAccount[];
|
|
71
|
+
solEpoch?: number;
|
|
62
72
|
};
|
|
63
73
|
page?: {
|
|
64
74
|
index: number;
|
|
@@ -102,9 +112,19 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
|
|
|
102
112
|
isActive: boolean;
|
|
103
113
|
rewards: string;
|
|
104
114
|
poolId: string | null;
|
|
115
|
+
drep: {
|
|
116
|
+
drep_id: string;
|
|
117
|
+
hex: string;
|
|
118
|
+
amount: string;
|
|
119
|
+
active: boolean;
|
|
120
|
+
active_epoch: number | null;
|
|
121
|
+
has_script: boolean;
|
|
122
|
+
} | null;
|
|
105
123
|
};
|
|
106
124
|
owner?: string;
|
|
107
125
|
rent?: number;
|
|
126
|
+
solStakingAccounts?: import("@trezor/blockchain-link-types/lib/solana").SolanaStakingAccount[];
|
|
127
|
+
solEpoch?: number;
|
|
108
128
|
};
|
|
109
129
|
page?: {
|
|
110
130
|
index: number;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const resolveAfter_1 = require("@trezor/utils/lib/resolveAfter");
|
|
4
|
+
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
3
6
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
7
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
8
|
+
const events_1 = require("../events");
|
|
4
9
|
const Discovery_1 = require("./common/Discovery");
|
|
5
10
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
11
|
const accountUtils_1 = require("../utils/accountUtils");
|
|
8
|
-
const
|
|
9
|
-
const coinInfo_1 = require("../data/coinInfo");
|
|
10
|
-
const constants_1 = require("../constants");
|
|
11
|
-
const events_1 = require("../events");
|
|
12
|
-
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
12
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
13
13
|
class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
@@ -283,7 +283,7 @@ class GetAccountInfo extends AbstractMethod_1.AbstractMethod {
|
|
|
283
283
|
discovery.stop();
|
|
284
284
|
const account = discovery.accounts[uiResp.payload];
|
|
285
285
|
if (!discovery.completed) {
|
|
286
|
-
await (0,
|
|
286
|
+
await (0, resolveAfter_1.resolveAfter)(501).promise;
|
|
287
287
|
}
|
|
288
288
|
const info = await blockchain.getAccountInfo({
|
|
289
289
|
descriptor: account.descriptor,
|
package/lib/api/getAddress.d.ts
CHANGED
package/lib/api/getAddress.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const
|
|
6
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
7
7
|
const coinInfo_1 = require("../data/coinInfo");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
8
|
const events_1 = require("../events");
|
|
10
9
|
const types_1 = require("../types");
|
|
11
10
|
const getAddress_1 = require("../types/api/getAddress");
|
|
11
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
12
12
|
class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
package/lib/api/getCoinInfo.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
24
24
|
T3B1: string | false;
|
|
25
25
|
T3T1: string | false;
|
|
26
26
|
T3W1: string | false;
|
|
27
|
+
UNKNOWN: string | false;
|
|
27
28
|
connect: boolean;
|
|
28
29
|
};
|
|
29
30
|
decimals: number;
|
|
@@ -82,6 +83,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
82
83
|
T3B1: string | false;
|
|
83
84
|
T3T1: string | false;
|
|
84
85
|
T3W1: string | false;
|
|
86
|
+
UNKNOWN: string | false;
|
|
85
87
|
connect: boolean;
|
|
86
88
|
};
|
|
87
89
|
decimals: number;
|
|
@@ -115,6 +117,7 @@ export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
|
|
|
115
117
|
T3B1: string | false;
|
|
116
118
|
T3T1: string | false;
|
|
117
119
|
T3W1: string | false;
|
|
120
|
+
UNKNOWN: string | false;
|
|
118
121
|
connect: boolean;
|
|
119
122
|
};
|
|
120
123
|
decimals: number;
|
package/lib/api/getCoinInfo.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
6
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
7
7
|
const types_1 = require("../types");
|
|
8
8
|
class GetCoinInfo extends AbstractMethod_1.AbstractMethod {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
3
|
const constants_1 = require("../constants");
|
|
4
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
5
|
class GetDeviceState extends AbstractMethod_1.AbstractMethod {
|
|
6
6
|
init() {
|
|
7
7
|
this.requiredPermissions = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class GetFirmwareHash extends AbstractMethod<'getFirmwareHash', PROTO.GetFirmwareHash> {
|
|
4
4
|
init(): void;
|
|
5
5
|
run(): Promise<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
6
6
|
const events_1 = require("../events");
|
|
7
7
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
8
8
|
class GetFirmwareHash extends AbstractMethod_1.AbstractMethod {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class GetOwnershipId extends AbstractMethod<'getOwnershipId', PROTO.GetOwnershipId[]> {
|
|
4
4
|
hasBundle?: boolean;
|
|
5
5
|
init(): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
4
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
7
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
8
7
|
const events_1 = require("../events");
|
|
9
8
|
const exports_1 = require("../exports");
|
|
10
9
|
const getOwnershipId_1 = require("../types/api/getOwnershipId");
|
|
10
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
11
11
|
class GetOwnershipId extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
this.requiredPermissions = ['read'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class GetOwnershipProof extends AbstractMethod<'getOwnershipProof', PROTO.GetOwnershipProof[]> {
|
|
4
4
|
hasBundle?: boolean;
|
|
5
5
|
init(): void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
4
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
7
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
8
7
|
const events_1 = require("../events");
|
|
9
8
|
const exports_1 = require("../exports");
|
|
10
9
|
const getOwnershipProof_1 = require("../types/api/getOwnershipProof");
|
|
10
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
11
11
|
class GetOwnershipProof extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
this.requiredPermissions = ['read'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { PROTO } from '../constants';
|
|
1
2
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
3
|
import type { BitcoinNetworkInfo } from '../types';
|
|
3
|
-
import type { PROTO } from '../constants';
|
|
4
4
|
type Params = PROTO.GetPublicKey & {
|
|
5
5
|
coinInfo?: BitcoinNetworkInfo;
|
|
6
6
|
suppressBackupWarning?: boolean;
|
package/lib/api/getPublicKey.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
|
-
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
-
const pathUtils_1 = require("../utils/pathUtils");
|
|
7
|
-
const events_1 = require("../events");
|
|
8
5
|
const coinInfo_1 = require("../data/coinInfo");
|
|
9
|
-
const
|
|
6
|
+
const events_1 = require("../events");
|
|
10
7
|
const types_1 = require("../types");
|
|
8
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
11
9
|
const getPublicKey_1 = require("../types/api/getPublicKey");
|
|
10
|
+
const accountUtils_1 = require("../utils/accountUtils");
|
|
11
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
12
12
|
class GetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
13
13
|
init() {
|
|
14
14
|
this.requiredPermissions = ['read'];
|
package/lib/api/loadDevice.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class LoadDevice extends AbstractMethod<'loadDevice', PROTO.LoadDevice> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
package/lib/api/loadDevice.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
+
const constants_1 = require("../constants");
|
|
4
5
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
6
|
const events_1 = require("../events");
|
|
6
7
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
7
|
-
const constants_1 = require("../constants");
|
|
8
8
|
class LoadDevice extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.allowDeviceMode = [events_1.UI.INITIALIZE];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
+
const constants_1 = require("../../../constants");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
-
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
-
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
|
-
const constants_1 = require("../../../constants");
|
|
9
7
|
const events_1 = require("../../../events");
|
|
10
8
|
const types_1 = require("../../../types");
|
|
11
9
|
const getAddress_1 = require("../../../types/api/getAddress");
|
|
10
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
11
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
12
12
|
const MAINNET = 0x68;
|
|
13
13
|
const TESTNET = 0x98;
|
|
14
14
|
const MIJIN = 0x60;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
1
|
import type { PROTO } from '../../../constants';
|
|
2
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
3
3
|
export default class NEMSignTransaction extends AbstractMethod<'nemSignTransaction', PROTO.NEMSignTx> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
6
|
-
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
7
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const nem_1 = require("../../../types/api/nem");
|
|
8
8
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
9
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
9
10
|
const helper = tslib_1.__importStar(require("../nemSignTx"));
|
|
10
|
-
const nem_1 = require("../../../types/api/nem");
|
|
11
11
|
class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
var _a;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
+
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
4
6
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
7
|
const coinInfo_1 = require("../data/coinInfo");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
|
-
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
8
8
|
const pushTransaction_1 = require("../types/api/pushTransaction");
|
|
9
9
|
class PushTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import type { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class RecoveryDevice extends AbstractMethod<'recoveryDevice', PROTO.RecoveryDevice> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get confirmation(): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import type { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class RequestLogin extends AbstractMethod<'requestLogin', PROTO.SignIdentity> {
|
|
4
4
|
asyncChallenge?: boolean;
|
|
5
5
|
init(): void;
|
package/lib/api/requestLogin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
|
-
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
4
|
const constants_1 = require("../constants");
|
|
5
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
7
6
|
const events_1 = require("../events");
|
|
7
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
8
8
|
const DataManager_1 = require("../data/DataManager");
|
|
9
9
|
const requestLogin_1 = require("../types/api/requestLogin");
|
|
10
10
|
class RequestLogin extends AbstractMethod_1.AbstractMethod {
|
package/lib/api/resetDevice.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
1
|
import { PROTO } from '../constants';
|
|
2
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
3
3
|
export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.ResetDevice> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
@@ -7,6 +7,8 @@ export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.Res
|
|
|
7
7
|
view: "device-management";
|
|
8
8
|
label: string;
|
|
9
9
|
};
|
|
10
|
+
private getEntropyData;
|
|
11
|
+
private entropyCheck;
|
|
10
12
|
run(): Promise<{
|
|
11
13
|
message: string;
|
|
12
14
|
}>;
|