@trezor/connect 9.1.5 → 9.1.6
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 +33 -0
- package/README.md +1 -1
- package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
- package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
- package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
- package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
- package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +2 -2
- package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
- package/lib/api/binance/api/index.d.ts +4 -0
- package/lib/api/binance/api/index.js +13 -0
- package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
- package/lib/api/bitcoin/TransactionComposer.js +4 -18
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/inputs.js +4 -5
- package/lib/api/bitcoin/outputs.d.ts +4 -4
- package/lib/api/bitcoin/outputs.js +14 -23
- package/lib/api/blockchainEstimateFee.d.ts +2 -2
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
- package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
- package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
- package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
- package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
- package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
- package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
- package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
- package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
- package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
- package/lib/api/cardano/api/index.d.ts +6 -0
- package/lib/api/cardano/api/index.js +17 -0
- package/lib/api/cardano/cardanoUtils.d.ts +6 -0
- package/lib/api/cardano/cardanoUtils.js +64 -1
- package/lib/api/composeTransaction.d.ts +5 -5
- package/lib/api/composeTransaction.js +14 -19
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
- package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
- package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
- package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
- package/lib/api/eos/api/index.d.ts +3 -0
- package/lib/api/eos/api/index.js +11 -0
- package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
- package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
- package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
- package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
- package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
- package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
- package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
- package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
- package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
- package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
- package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
- package/lib/api/ethereum/api/index.d.ts +7 -0
- package/lib/api/ethereum/api/index.js +19 -0
- package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
- package/lib/api/ethereum/ethereumSignTx.js +15 -1
- package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
- package/lib/api/firmware/x509certificate.d.ts +1 -0
- package/lib/api/firmware/x509certificate.js +34 -2
- package/lib/api/getAccountDescriptor.d.ts +20 -0
- package/lib/api/getAccountDescriptor.js +162 -0
- package/lib/api/getAccountInfo.d.ts +2 -0
- package/lib/api/index.d.ts +1 -24
- package/lib/api/index.js +3 -50
- package/lib/api/nem/api/index.d.ts +3 -0
- package/lib/api/nem/api/index.js +11 -0
- package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
- package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
- package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
- package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
- package/lib/api/ripple/api/index.d.ts +3 -0
- package/lib/api/ripple/api/index.js +11 -0
- package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
- package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
- package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
- package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
- package/lib/api/solana/api/index.d.ts +4 -0
- package/lib/api/solana/api/index.js +13 -0
- package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
- package/lib/api/solana/api/solanaGetAddress.js +131 -0
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
- package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
- package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
- package/lib/api/solana/api/solanaSignTransaction.js +33 -0
- package/lib/api/stellar/api/index.d.ts +3 -0
- package/lib/api/stellar/api/index.js +11 -0
- package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
- package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
- package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
- package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
- package/lib/api/tezos/api/index.d.ts +4 -0
- package/lib/api/tezos/api/index.js +13 -0
- package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
- package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
- package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
- package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
- package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
- package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
- package/lib/backend/Blockchain.js +2 -0
- package/lib/constants/cardano.js +2 -2
- package/lib/constants/nem.js +3 -3
- package/lib/constants/network.d.ts +3 -0
- package/lib/constants/network.js +13 -1
- package/lib/core/index.d.ts +3 -1
- package/lib/core/index.js +17 -4
- package/lib/core/method.d.ts +2 -2
- package/lib/core/method.js +8 -2
- package/lib/core/method.native.d.ts +5 -0
- package/lib/core/method.native.js +34 -0
- package/lib/data/DataManager.d.ts +11 -0
- package/lib/data/config.d.ts +11 -0
- package/lib/data/config.js +4 -0
- package/lib/data/connectSettings.js +4 -0
- package/lib/data/defaultFeeLevels.js +8 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +1 -1
- package/lib/device/Device.js +11 -2
- package/lib/device/DeviceCommands.js +9 -0
- package/lib/device/DeviceList.js +4 -1
- package/lib/events/popup.d.ts +19 -3
- package/lib/events/popup.js +3 -0
- package/lib/factory.js +5 -0
- package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
- package/lib/types/api/cardanoComposeTransaction.js +3 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
- package/lib/types/api/composeTransaction.d.ts +28 -54
- package/lib/types/api/ethereum/index.d.ts +1 -0
- package/lib/types/api/getAccountDescriptor.d.ts +16 -0
- package/lib/types/api/getAccountDescriptor.js +3 -0
- package/lib/types/api/index.d.ts +10 -0
- package/lib/types/api/solana/index.d.ts +12 -0
- package/lib/types/api/solana/index.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +4 -0
- package/lib/types/api/solanaGetAddress.js +3 -0
- package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
- package/lib/types/api/solanaGetPublicKey.js +3 -0
- package/lib/types/api/solanaSignTransaction.d.ts +4 -0
- package/lib/types/api/solanaSignTransaction.js +3 -0
- package/lib/types/coinInfo.d.ts +2 -13
- package/lib/types/device.js +1 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.js +1 -0
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/debug.d.ts +1 -2
- package/lib/utils/debug.js +6 -1
- package/lib/utils/deviceFeaturesUtils.js +2 -0
- package/lib/utils/formatUtils.d.ts +2 -0
- package/lib/utils/formatUtils.js +19 -1
- package/lib/workers/workers-browser.d.ts +2 -1
- package/lib/workers/workers-browser.js +3 -1
- package/lib/workers/workers-react-native.d.ts +2 -1
- package/lib/workers/workers-react-native.js +3 -1
- package/lib/workers/workers.d.ts +8 -5
- package/lib/workers/workers.js +34 -10
- package/package.json +22 -18
- package/lib/api/eosGetPublicKey.d.ts +0 -11
- package/lib/api/ethereumGetPublicKey.d.ts +0 -16
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const pathUtils_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const ethereumUtils_1 = require("
|
|
8
|
-
const constants_1 = require("
|
|
9
|
-
const ethereumSignTypedData_1 = require("
|
|
10
|
-
const formatUtils_1 = require("
|
|
11
|
-
const ethereumDefinitions_1 = require("
|
|
12
|
-
const types_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const ethereumUtils_1 = require("../../../utils/ethereumUtils");
|
|
8
|
+
const constants_1 = require("../../../constants");
|
|
9
|
+
const ethereumSignTypedData_1 = require("../ethereumSignTypedData");
|
|
10
|
+
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
11
|
+
const ethereumDefinitions_1 = require("../ethereumDefinitions");
|
|
12
|
+
const types_1 = require("../../../types");
|
|
13
13
|
class EthereumSignTypedData extends AbstractMethod_1.AbstractMethod {
|
|
14
14
|
init() {
|
|
15
15
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { PROTO } from '../../../constants';
|
|
3
3
|
export default class EthereumVerifyMessage extends AbstractMethod<'ethereumVerifyMessage', PROTO.EthereumVerifyMessage> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const formatUtils_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const formatUtils_1 = require("../../../utils/formatUtils");
|
|
6
6
|
class EthereumVerifyMessage extends AbstractMethod_1.AbstractMethod {
|
|
7
7
|
init() {
|
|
8
8
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as ethereumGetAddress } from './ethereumGetAddress';
|
|
2
|
+
export { default as ethereumGetPublicKey } from './ethereumGetPublicKey';
|
|
3
|
+
export { default as ethereumSignMessage } from './ethereumSignMessage';
|
|
4
|
+
export { default as ethereumSignTransaction } from './ethereumSignTransaction';
|
|
5
|
+
export { default as ethereumSignTypedData } from './ethereumSignTypedData';
|
|
6
|
+
export { default as ethereumVerifyMessage } from './ethereumVerifyMessage';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = void 0;
|
|
7
|
+
var ethereumGetAddress_1 = require("./ethereumGetAddress");
|
|
8
|
+
Object.defineProperty(exports, "ethereumGetAddress", { enumerable: true, get: function () { return __importDefault(ethereumGetAddress_1).default; } });
|
|
9
|
+
var ethereumGetPublicKey_1 = require("./ethereumGetPublicKey");
|
|
10
|
+
Object.defineProperty(exports, "ethereumGetPublicKey", { enumerable: true, get: function () { return __importDefault(ethereumGetPublicKey_1).default; } });
|
|
11
|
+
var ethereumSignMessage_1 = require("./ethereumSignMessage");
|
|
12
|
+
Object.defineProperty(exports, "ethereumSignMessage", { enumerable: true, get: function () { return __importDefault(ethereumSignMessage_1).default; } });
|
|
13
|
+
var ethereumSignTransaction_1 = require("./ethereumSignTransaction");
|
|
14
|
+
Object.defineProperty(exports, "ethereumSignTransaction", { enumerable: true, get: function () { return __importDefault(ethereumSignTransaction_1).default; } });
|
|
15
|
+
var ethereumSignTypedData_1 = require("./ethereumSignTypedData");
|
|
16
|
+
Object.defineProperty(exports, "ethereumSignTypedData", { enumerable: true, get: function () { return __importDefault(ethereumSignTypedData_1).default; } });
|
|
17
|
+
var ethereumVerifyMessage_1 = require("./ethereumVerifyMessage");
|
|
18
|
+
Object.defineProperty(exports, "ethereumVerifyMessage", { enumerable: true, get: function () { return __importDefault(ethereumVerifyMessage_1).default; } });
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { TxData, FeeMarketEIP1559TxData } from '@ethereumjs/tx';
|
|
1
2
|
import { EthereumDefinitions } from '@trezor/protobuf/lib/messages';
|
|
2
3
|
import type { TypedCall } from '../../device/DeviceCommands';
|
|
3
4
|
import type { EthereumAccessList } from '../../types/api/ethereum';
|
|
5
|
+
export declare const serializeEthereumTx: (txData: TxData | FeeMarketEIP1559TxData, chainId: number) => string;
|
|
4
6
|
export declare const ethereumSignTx: (typedCall: TypedCall, address_n: number[], to: string, value: string, gas_limit: string, gas_price: string, nonce: string, chain_id: number, data?: string, tx_type?: number, definitions?: EthereumDefinitions) => Promise<{
|
|
5
7
|
v: string;
|
|
6
8
|
r: string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ethereumSignTxEIP1559 = exports.ethereumSignTx = void 0;
|
|
3
|
+
exports.ethereumSignTxEIP1559 = exports.ethereumSignTx = exports.serializeEthereumTx = void 0;
|
|
4
|
+
const common_1 = require("@ethereumjs/common");
|
|
5
|
+
const tx_1 = require("@ethereumjs/tx");
|
|
4
6
|
const constants_1 = require("../../constants");
|
|
7
|
+
const formatUtils_1 = require("../../utils/formatUtils");
|
|
5
8
|
const splitString = (str, len) => {
|
|
6
9
|
if (str == null) {
|
|
7
10
|
return ['', ''];
|
|
@@ -31,6 +34,17 @@ const processTxRequest = async (typedCall, request, data, chain_id) => {
|
|
|
31
34
|
const response = await typedCall('EthereumTxAck', 'EthereumTxRequest', { data_chunk: first });
|
|
32
35
|
return processTxRequest(typedCall, response.message, rest, chain_id);
|
|
33
36
|
};
|
|
37
|
+
const deepHexPrefix = (0, formatUtils_1.deepTransform)(formatUtils_1.addHexPrefix);
|
|
38
|
+
const serializeEthereumTx = (txData, chainId) => {
|
|
39
|
+
const txOptions = chainId === 61
|
|
40
|
+
? {
|
|
41
|
+
common: common_1.Common.custom({ name: 'ethereum-classic', networkId: 1, chainId: 61 }, { baseChain: common_1.Chain.Mainnet, hardfork: common_1.Hardfork.Petersburg }),
|
|
42
|
+
}
|
|
43
|
+
: { chain: chainId };
|
|
44
|
+
const ethTx = tx_1.TransactionFactory.fromTxData(deepHexPrefix(txData), txOptions);
|
|
45
|
+
return `0x${Buffer.from(ethTx.serialize()).toString('hex')}`;
|
|
46
|
+
};
|
|
47
|
+
exports.serializeEthereumTx = serializeEthereumTx;
|
|
34
48
|
const stripLeadingZeroes = (str) => {
|
|
35
49
|
while (/^00/.test(str)) {
|
|
36
50
|
str = str.slice(2);
|
|
@@ -68,7 +68,7 @@ const verifyAuthenticityProof = async ({ certificates, signature, challenge, con
|
|
|
68
68
|
utils_1.bufferUtils.getChunkSize(challenge.length),
|
|
69
69
|
challenge,
|
|
70
70
|
]);
|
|
71
|
-
const isSignatureValid = await verifySignature(Buffer.from(deviceCert.tbsCertificate.subjectPublicKeyInfo.bits.bytes), prefixedChallenge, Buffer.from(signature, 'hex'));
|
|
71
|
+
const isSignatureValid = await verifySignature(Buffer.from(deviceCert.tbsCertificate.subjectPublicKeyInfo.bits.bytes), prefixedChallenge, (0, x509certificate_1.fixSignature)(Buffer.from(signature, 'hex')));
|
|
72
72
|
if (rootPubKey && isDeviceCertValid && isSignatureValid) {
|
|
73
73
|
if ((!isDebugRootPubKey && !caPubKeys.includes(caPubKey)) ||
|
|
74
74
|
(isDebugRootPubKey && !(debug === null || debug === void 0 ? void 0 : debug.caPubKeys.includes(caPubKey)))) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseCertificate = exports.parseName = void 0;
|
|
3
|
+
exports.parseCertificate = exports.parseName = exports.fixSignature = void 0;
|
|
4
4
|
const derToAsn1 = (byteArray) => {
|
|
5
5
|
let position = 0;
|
|
6
6
|
function getTag() {
|
|
@@ -76,13 +76,45 @@ const derBitStringValue = (byteArray) => ({
|
|
|
76
76
|
unusedBits: byteArray[0],
|
|
77
77
|
bytes: byteArray.subarray(1),
|
|
78
78
|
});
|
|
79
|
+
const fixSignature = (byteArray) => {
|
|
80
|
+
const asn1 = derToAsn1(byteArray);
|
|
81
|
+
if (asn1.cls !== 0 || asn1.tag !== 16 || !asn1.structured) {
|
|
82
|
+
throw new Error('Bad signature. Not a SEQUENCE.');
|
|
83
|
+
}
|
|
84
|
+
const items = derToAsn1List(asn1.contents);
|
|
85
|
+
let newLength = 0;
|
|
86
|
+
const fixedItems = items.map(chunk => {
|
|
87
|
+
const index = chunk.contents.findIndex(value => value > 0x00);
|
|
88
|
+
const data = chunk.contents.subarray(index);
|
|
89
|
+
const offset = data[0] >= 0x80 ? 1 : 0;
|
|
90
|
+
const chunkLength = data.length + offset;
|
|
91
|
+
const newChunk = new Uint8Array(chunkLength + 2);
|
|
92
|
+
newChunk.set([chunk.raw[0], chunkLength]);
|
|
93
|
+
if (offset > 0) {
|
|
94
|
+
newChunk.set([0], 2);
|
|
95
|
+
}
|
|
96
|
+
newChunk.set(data, 2 + offset);
|
|
97
|
+
newLength += newChunk.length;
|
|
98
|
+
return newChunk;
|
|
99
|
+
});
|
|
100
|
+
const signature = new Uint8Array(newLength + 2);
|
|
101
|
+
signature.set([byteArray[0], newLength]);
|
|
102
|
+
let signatureOffset = 2;
|
|
103
|
+
fixedItems.forEach(item => {
|
|
104
|
+
signature.set(item, signatureOffset);
|
|
105
|
+
signatureOffset += item.length;
|
|
106
|
+
});
|
|
107
|
+
return signature;
|
|
108
|
+
};
|
|
109
|
+
exports.fixSignature = fixSignature;
|
|
79
110
|
const parseSignatureValue = (asn1) => {
|
|
80
111
|
if (asn1.cls !== 0 || asn1.tag !== 3 || asn1.structured) {
|
|
81
112
|
throw new Error('Bad signature value. Not a BIT STRING.');
|
|
82
113
|
}
|
|
114
|
+
const { unusedBits, bytes } = derBitStringValue(asn1.contents);
|
|
83
115
|
return {
|
|
84
116
|
asn1,
|
|
85
|
-
bits:
|
|
117
|
+
bits: { unusedBits, bytes: (0, exports.fixSignature)(bytes) },
|
|
86
118
|
};
|
|
87
119
|
};
|
|
88
120
|
const derObjectIdentifierValue = (byteArray) => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
|
+
import type { CoinInfo } from '../types';
|
|
3
|
+
import type { GetAccountDescriptorParams, GetAccountDescriptorResponse } from '../types/api/getAccountDescriptor';
|
|
4
|
+
type Request = GetAccountDescriptorParams & {
|
|
5
|
+
address_n: number[];
|
|
6
|
+
coinInfo: CoinInfo;
|
|
7
|
+
};
|
|
8
|
+
export default class GetAccountDescriptor extends AbstractMethod<'getAccountDescriptor', Request[]> {
|
|
9
|
+
disposed: boolean;
|
|
10
|
+
hasBundle?: boolean;
|
|
11
|
+
init(): void;
|
|
12
|
+
get info(): string;
|
|
13
|
+
confirmation(): Promise<boolean>;
|
|
14
|
+
noBackupConfirmation(allowSuppression?: boolean): Promise<boolean>;
|
|
15
|
+
checkFirmwareRange(_isUsingPopup: boolean): Promise<undefined>;
|
|
16
|
+
run(): Promise<GetAccountDescriptorResponse | (GetAccountDescriptorResponse | null)[]>;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=getAccountDescriptor.d.ts.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
|
+
const accountUtils_1 = require("../utils/accountUtils");
|
|
7
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const events_1 = require("../events");
|
|
10
|
+
class GetAccountDescriptor extends AbstractMethod_1.AbstractMethod {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.disposed = false;
|
|
14
|
+
}
|
|
15
|
+
init() {
|
|
16
|
+
this.requiredPermissions = ['read'];
|
|
17
|
+
this.useDevice = true;
|
|
18
|
+
this.useUi = true;
|
|
19
|
+
this.hasBundle = !!this.payload.bundle;
|
|
20
|
+
const payload = !this.payload.bundle
|
|
21
|
+
? { ...this.payload, bundle: [this.payload] }
|
|
22
|
+
: this.payload;
|
|
23
|
+
(0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
|
|
24
|
+
this.params = payload.bundle.map(batch => {
|
|
25
|
+
(0, paramsValidator_1.validateParams)(batch, [
|
|
26
|
+
{ name: 'coin', type: 'string', required: true },
|
|
27
|
+
{ name: 'path', type: 'string', required: true },
|
|
28
|
+
{ name: 'derivationType', type: 'number' },
|
|
29
|
+
{ name: 'suppressBackupWarning', type: 'boolean' },
|
|
30
|
+
]);
|
|
31
|
+
const coinInfo = (0, coinInfo_1.getCoinInfo)(batch.coin);
|
|
32
|
+
if (!coinInfo) {
|
|
33
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
34
|
+
}
|
|
35
|
+
const address_n = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
36
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, coinInfo, this.firmwareRange);
|
|
37
|
+
return {
|
|
38
|
+
...batch,
|
|
39
|
+
address_n,
|
|
40
|
+
coinInfo,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get info() {
|
|
45
|
+
return 'Export account descriptor';
|
|
46
|
+
}
|
|
47
|
+
async confirmation() {
|
|
48
|
+
await this.getPopupPromise().promise;
|
|
49
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
50
|
+
const keys = {};
|
|
51
|
+
this.params.forEach(b => {
|
|
52
|
+
if (!keys[b.coinInfo.label]) {
|
|
53
|
+
keys[b.coinInfo.label] = {
|
|
54
|
+
coinInfo: b.coinInfo,
|
|
55
|
+
values: [],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
keys[b.coinInfo.label].values.push(b.address_n);
|
|
59
|
+
});
|
|
60
|
+
const str = [];
|
|
61
|
+
Object.keys(keys).forEach((k, _i, _a) => {
|
|
62
|
+
const details = keys[k];
|
|
63
|
+
details.values.forEach(acc => {
|
|
64
|
+
str.push('<span>');
|
|
65
|
+
str.push(k);
|
|
66
|
+
str.push(' ');
|
|
67
|
+
if (typeof acc === 'string') {
|
|
68
|
+
str.push(acc);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
str.push((0, accountUtils_1.getAccountLabel)(acc, details.coinInfo));
|
|
72
|
+
}
|
|
73
|
+
str.push('</span>');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
77
|
+
view: 'export-account-info',
|
|
78
|
+
label: `Export descriptor for: ${str.join('')}`,
|
|
79
|
+
}));
|
|
80
|
+
const uiResp = await uiPromise.promise;
|
|
81
|
+
return uiResp.payload;
|
|
82
|
+
}
|
|
83
|
+
async noBackupConfirmation(allowSuppression) {
|
|
84
|
+
if (allowSuppression && this.params.every(batch => batch.suppressBackupWarning)) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
await this.getPopupPromise().promise;
|
|
88
|
+
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
89
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
90
|
+
view: 'no-backup',
|
|
91
|
+
}));
|
|
92
|
+
const uiResp = await uiPromise.promise;
|
|
93
|
+
return uiResp.payload;
|
|
94
|
+
}
|
|
95
|
+
async checkFirmwareRange(_isUsingPopup) {
|
|
96
|
+
const invalid = [];
|
|
97
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
98
|
+
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, this.params[i].coinInfo, AbstractMethod_1.DEFAULT_FIRMWARE_RANGE);
|
|
99
|
+
const exception = await super.checkFirmwareRange(false);
|
|
100
|
+
if (exception) {
|
|
101
|
+
invalid.push({
|
|
102
|
+
index: i,
|
|
103
|
+
exception,
|
|
104
|
+
coin: this.params[i].coin,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (invalid.length > 0) {
|
|
109
|
+
throw constants_1.ERRORS.TypedError('Method_Discovery_BundleException', JSON.stringify(invalid));
|
|
110
|
+
}
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
async run() {
|
|
114
|
+
const responses = [];
|
|
115
|
+
const sendProgress = (progress, response, error) => {
|
|
116
|
+
if (!this.hasBundle || this.disposed)
|
|
117
|
+
return;
|
|
118
|
+
this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
|
|
119
|
+
progress,
|
|
120
|
+
response,
|
|
121
|
+
error,
|
|
122
|
+
}));
|
|
123
|
+
};
|
|
124
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
125
|
+
const request = this.params[i];
|
|
126
|
+
if (this.disposed)
|
|
127
|
+
break;
|
|
128
|
+
try {
|
|
129
|
+
const { descriptor, address_n, legacyXpub } = await this.device
|
|
130
|
+
.getCommands()
|
|
131
|
+
.getAccountDescriptor(request.coinInfo, request.address_n, typeof request.derivationType !== 'undefined'
|
|
132
|
+
? request.derivationType
|
|
133
|
+
: constants_1.PROTO.CardanoDerivationType.ICARUS_TREZOR);
|
|
134
|
+
const response = {
|
|
135
|
+
descriptor,
|
|
136
|
+
path: (0, pathUtils_1.getSerializedPath)(address_n),
|
|
137
|
+
legacyXpub,
|
|
138
|
+
};
|
|
139
|
+
sendProgress(i, response);
|
|
140
|
+
responses.push(response);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (this.hasBundle) {
|
|
144
|
+
responses.push(null);
|
|
145
|
+
sendProgress(i, null, error.message);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (this.disposed)
|
|
154
|
+
return new Promise(() => []);
|
|
155
|
+
return this.hasBundle ? responses : responses[0];
|
|
156
|
+
}
|
|
157
|
+
dispose() {
|
|
158
|
+
this.disposed = true;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.default = GetAccountDescriptor;
|
|
162
|
+
//# sourceMappingURL=getAccountDescriptor.js.map
|
|
@@ -43,6 +43,7 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
|
|
|
43
43
|
rewards: string;
|
|
44
44
|
poolId: string | null;
|
|
45
45
|
} | undefined;
|
|
46
|
+
owner?: string | undefined;
|
|
46
47
|
} | undefined;
|
|
47
48
|
page?: {
|
|
48
49
|
index: number;
|
|
@@ -83,6 +84,7 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
|
|
|
83
84
|
rewards: string;
|
|
84
85
|
poolId: string | null;
|
|
85
86
|
} | undefined;
|
|
87
|
+
owner?: string | undefined;
|
|
86
88
|
} | undefined;
|
|
87
89
|
page?: {
|
|
88
90
|
index: number;
|
package/lib/api/index.d.ts
CHANGED
|
@@ -5,9 +5,6 @@ export { default as authorizeCoinjoin } from './authorizeCoinjoin';
|
|
|
5
5
|
export { default as cancelCoinjoinAuthorization } from './cancelCoinjoinAuthorization';
|
|
6
6
|
export { default as showDeviceTutorial } from './showDeviceTutorial';
|
|
7
7
|
export { default as backupDevice } from './backupDevice';
|
|
8
|
-
export { default as binanceGetAddress } from './binanceGetAddress';
|
|
9
|
-
export { default as binanceGetPublicKey } from './binanceGetPublicKey';
|
|
10
|
-
export { default as binanceSignTransaction } from './binanceSignTransaction';
|
|
11
8
|
export { default as blockchainDisconnect } from './blockchainDisconnect';
|
|
12
9
|
export { default as blockchainEstimateFee } from './blockchainEstimateFee';
|
|
13
10
|
export { default as blockchainGetAccountBalanceHistory } from './blockchainGetAccountBalanceHistory';
|
|
@@ -19,22 +16,11 @@ export { default as blockchainSubscribe } from './blockchainSubscribe';
|
|
|
19
16
|
export { default as blockchainSubscribeFiatRates } from './blockchainSubscribeFiatRates';
|
|
20
17
|
export { default as blockchainUnsubscribe } from './blockchainUnsubscribe';
|
|
21
18
|
export { default as blockchainUnsubscribeFiatRates } from './blockchainUnsubscribeFiatRates';
|
|
22
|
-
export { default as cardanoGetAddress } from './cardanoGetAddress';
|
|
23
|
-
export { default as cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
|
|
24
|
-
export { default as cardanoGetPublicKey } from './cardanoGetPublicKey';
|
|
25
|
-
export { default as cardanoSignTransaction } from './cardanoSignTransaction';
|
|
26
19
|
export { default as changePin } from './changePin';
|
|
27
20
|
export { default as cipherKeyValue } from './cipherKeyValue';
|
|
28
21
|
export { default as composeTransaction } from './composeTransaction';
|
|
29
|
-
export { default as eosGetPublicKey } from './eosGetPublicKey';
|
|
30
|
-
export { default as eosSignTransaction } from './eosSignTransaction';
|
|
31
|
-
export { default as ethereumGetAddress } from './ethereumGetAddress';
|
|
32
|
-
export { default as ethereumGetPublicKey } from './ethereumGetPublicKey';
|
|
33
|
-
export { default as ethereumSignMessage } from './ethereumSignMessage';
|
|
34
|
-
export { default as ethereumSignTransaction } from './ethereumSignTransaction';
|
|
35
|
-
export { default as ethereumSignTypedData } from './ethereumSignTypedData';
|
|
36
|
-
export { default as ethereumVerifyMessage } from './ethereumVerifyMessage';
|
|
37
22
|
export { default as firmwareUpdate } from './firmwareUpdate';
|
|
23
|
+
export { default as getAccountDescriptor } from './getAccountDescriptor';
|
|
38
24
|
export { default as getAccountInfo } from './getAccountInfo';
|
|
39
25
|
export { default as getAddress } from './getAddress';
|
|
40
26
|
export { default as getCoinInfo } from './getCoinInfo';
|
|
@@ -45,24 +31,15 @@ export { default as getOwnershipId } from './getOwnershipId';
|
|
|
45
31
|
export { default as getOwnershipProof } from './getOwnershipProof';
|
|
46
32
|
export { default as getPublicKey } from './getPublicKey';
|
|
47
33
|
export { default as getSettings } from './getSettings';
|
|
48
|
-
export { default as nemGetAddress } from './nemGetAddress';
|
|
49
|
-
export { default as nemSignTransaction } from './nemSignTransaction';
|
|
50
34
|
export { default as pushTransaction } from './pushTransaction';
|
|
51
35
|
export { default as rebootToBootloader } from './rebootToBootloader';
|
|
52
36
|
export { default as recoveryDevice } from './recoveryDevice';
|
|
53
37
|
export { default as requestLogin } from './requestLogin';
|
|
54
38
|
export { default as resetDevice } from './resetDevice';
|
|
55
|
-
export { default as rippleGetAddress } from './rippleGetAddress';
|
|
56
|
-
export { default as rippleSignTransaction } from './rippleSignTransaction';
|
|
57
39
|
export { default as setBusy } from './setBusy';
|
|
58
40
|
export { default as setProxy } from './setProxy';
|
|
59
41
|
export { default as signMessage } from './signMessage';
|
|
60
42
|
export { default as signTransaction } from './signTransaction';
|
|
61
|
-
export { default as stellarGetAddress } from './stellarGetAddress';
|
|
62
|
-
export { default as stellarSignTransaction } from './stellarSignTransaction';
|
|
63
|
-
export { default as tezosGetAddress } from './tezosGetAddress';
|
|
64
|
-
export { default as tezosGetPublicKey } from './tezosGetPublicKey';
|
|
65
|
-
export { default as tezosSignTransaction } from './tezosSignTransaction';
|
|
66
43
|
export { default as unlockPath } from './unlockPath';
|
|
67
44
|
export { default as verifyMessage } from './verifyMessage';
|
|
68
45
|
export { default as wipeDevice } from './wipeDevice';
|
package/lib/api/index.js
CHANGED
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = void 0;
|
|
6
|
+
exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.unlockPath = exports.signTransaction = exports.signMessage = exports.setProxy = exports.setBusy = exports.resetDevice = exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.getAccountDescriptor = exports.firmwareUpdate = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.backupDevice = exports.showDeviceTutorial = exports.cancelCoinjoinAuthorization = exports.authorizeCoinjoin = exports.authenticateDevice = exports.applySettings = exports.applyFlags = void 0;
|
|
8
7
|
var applyFlags_1 = require("./applyFlags");
|
|
9
8
|
Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
|
|
10
9
|
var applySettings_1 = require("./applySettings");
|
|
@@ -19,12 +18,6 @@ var showDeviceTutorial_1 = require("./showDeviceTutorial");
|
|
|
19
18
|
Object.defineProperty(exports, "showDeviceTutorial", { enumerable: true, get: function () { return __importDefault(showDeviceTutorial_1).default; } });
|
|
20
19
|
var backupDevice_1 = require("./backupDevice");
|
|
21
20
|
Object.defineProperty(exports, "backupDevice", { enumerable: true, get: function () { return __importDefault(backupDevice_1).default; } });
|
|
22
|
-
var binanceGetAddress_1 = require("./binanceGetAddress");
|
|
23
|
-
Object.defineProperty(exports, "binanceGetAddress", { enumerable: true, get: function () { return __importDefault(binanceGetAddress_1).default; } });
|
|
24
|
-
var binanceGetPublicKey_1 = require("./binanceGetPublicKey");
|
|
25
|
-
Object.defineProperty(exports, "binanceGetPublicKey", { enumerable: true, get: function () { return __importDefault(binanceGetPublicKey_1).default; } });
|
|
26
|
-
var binanceSignTransaction_1 = require("./binanceSignTransaction");
|
|
27
|
-
Object.defineProperty(exports, "binanceSignTransaction", { enumerable: true, get: function () { return __importDefault(binanceSignTransaction_1).default; } });
|
|
28
21
|
var blockchainDisconnect_1 = require("./blockchainDisconnect");
|
|
29
22
|
Object.defineProperty(exports, "blockchainDisconnect", { enumerable: true, get: function () { return __importDefault(blockchainDisconnect_1).default; } });
|
|
30
23
|
var blockchainEstimateFee_1 = require("./blockchainEstimateFee");
|
|
@@ -47,38 +40,16 @@ var blockchainUnsubscribe_1 = require("./blockchainUnsubscribe");
|
|
|
47
40
|
Object.defineProperty(exports, "blockchainUnsubscribe", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribe_1).default; } });
|
|
48
41
|
var blockchainUnsubscribeFiatRates_1 = require("./blockchainUnsubscribeFiatRates");
|
|
49
42
|
Object.defineProperty(exports, "blockchainUnsubscribeFiatRates", { enumerable: true, get: function () { return __importDefault(blockchainUnsubscribeFiatRates_1).default; } });
|
|
50
|
-
var cardanoGetAddress_1 = require("./cardanoGetAddress");
|
|
51
|
-
Object.defineProperty(exports, "cardanoGetAddress", { enumerable: true, get: function () { return __importDefault(cardanoGetAddress_1).default; } });
|
|
52
|
-
var cardanoGetNativeScriptHash_1 = require("./cardanoGetNativeScriptHash");
|
|
53
|
-
Object.defineProperty(exports, "cardanoGetNativeScriptHash", { enumerable: true, get: function () { return __importDefault(cardanoGetNativeScriptHash_1).default; } });
|
|
54
|
-
var cardanoGetPublicKey_1 = require("./cardanoGetPublicKey");
|
|
55
|
-
Object.defineProperty(exports, "cardanoGetPublicKey", { enumerable: true, get: function () { return __importDefault(cardanoGetPublicKey_1).default; } });
|
|
56
|
-
var cardanoSignTransaction_1 = require("./cardanoSignTransaction");
|
|
57
|
-
Object.defineProperty(exports, "cardanoSignTransaction", { enumerable: true, get: function () { return __importDefault(cardanoSignTransaction_1).default; } });
|
|
58
43
|
var changePin_1 = require("./changePin");
|
|
59
44
|
Object.defineProperty(exports, "changePin", { enumerable: true, get: function () { return __importDefault(changePin_1).default; } });
|
|
60
45
|
var cipherKeyValue_1 = require("./cipherKeyValue");
|
|
61
46
|
Object.defineProperty(exports, "cipherKeyValue", { enumerable: true, get: function () { return __importDefault(cipherKeyValue_1).default; } });
|
|
62
47
|
var composeTransaction_1 = require("./composeTransaction");
|
|
63
48
|
Object.defineProperty(exports, "composeTransaction", { enumerable: true, get: function () { return __importDefault(composeTransaction_1).default; } });
|
|
64
|
-
var eosGetPublicKey_1 = require("./eosGetPublicKey");
|
|
65
|
-
Object.defineProperty(exports, "eosGetPublicKey", { enumerable: true, get: function () { return __importDefault(eosGetPublicKey_1).default; } });
|
|
66
|
-
var eosSignTransaction_1 = require("./eosSignTransaction");
|
|
67
|
-
Object.defineProperty(exports, "eosSignTransaction", { enumerable: true, get: function () { return __importDefault(eosSignTransaction_1).default; } });
|
|
68
|
-
var ethereumGetAddress_1 = require("./ethereumGetAddress");
|
|
69
|
-
Object.defineProperty(exports, "ethereumGetAddress", { enumerable: true, get: function () { return __importDefault(ethereumGetAddress_1).default; } });
|
|
70
|
-
var ethereumGetPublicKey_1 = require("./ethereumGetPublicKey");
|
|
71
|
-
Object.defineProperty(exports, "ethereumGetPublicKey", { enumerable: true, get: function () { return __importDefault(ethereumGetPublicKey_1).default; } });
|
|
72
|
-
var ethereumSignMessage_1 = require("./ethereumSignMessage");
|
|
73
|
-
Object.defineProperty(exports, "ethereumSignMessage", { enumerable: true, get: function () { return __importDefault(ethereumSignMessage_1).default; } });
|
|
74
|
-
var ethereumSignTransaction_1 = require("./ethereumSignTransaction");
|
|
75
|
-
Object.defineProperty(exports, "ethereumSignTransaction", { enumerable: true, get: function () { return __importDefault(ethereumSignTransaction_1).default; } });
|
|
76
|
-
var ethereumSignTypedData_1 = require("./ethereumSignTypedData");
|
|
77
|
-
Object.defineProperty(exports, "ethereumSignTypedData", { enumerable: true, get: function () { return __importDefault(ethereumSignTypedData_1).default; } });
|
|
78
|
-
var ethereumVerifyMessage_1 = require("./ethereumVerifyMessage");
|
|
79
|
-
Object.defineProperty(exports, "ethereumVerifyMessage", { enumerable: true, get: function () { return __importDefault(ethereumVerifyMessage_1).default; } });
|
|
80
49
|
var firmwareUpdate_1 = require("./firmwareUpdate");
|
|
81
50
|
Object.defineProperty(exports, "firmwareUpdate", { enumerable: true, get: function () { return __importDefault(firmwareUpdate_1).default; } });
|
|
51
|
+
var getAccountDescriptor_1 = require("./getAccountDescriptor");
|
|
52
|
+
Object.defineProperty(exports, "getAccountDescriptor", { enumerable: true, get: function () { return __importDefault(getAccountDescriptor_1).default; } });
|
|
82
53
|
var getAccountInfo_1 = require("./getAccountInfo");
|
|
83
54
|
Object.defineProperty(exports, "getAccountInfo", { enumerable: true, get: function () { return __importDefault(getAccountInfo_1).default; } });
|
|
84
55
|
var getAddress_1 = require("./getAddress");
|
|
@@ -99,10 +70,6 @@ var getPublicKey_1 = require("./getPublicKey");
|
|
|
99
70
|
Object.defineProperty(exports, "getPublicKey", { enumerable: true, get: function () { return __importDefault(getPublicKey_1).default; } });
|
|
100
71
|
var getSettings_1 = require("./getSettings");
|
|
101
72
|
Object.defineProperty(exports, "getSettings", { enumerable: true, get: function () { return __importDefault(getSettings_1).default; } });
|
|
102
|
-
var nemGetAddress_1 = require("./nemGetAddress");
|
|
103
|
-
Object.defineProperty(exports, "nemGetAddress", { enumerable: true, get: function () { return __importDefault(nemGetAddress_1).default; } });
|
|
104
|
-
var nemSignTransaction_1 = require("./nemSignTransaction");
|
|
105
|
-
Object.defineProperty(exports, "nemSignTransaction", { enumerable: true, get: function () { return __importDefault(nemSignTransaction_1).default; } });
|
|
106
73
|
var pushTransaction_1 = require("./pushTransaction");
|
|
107
74
|
Object.defineProperty(exports, "pushTransaction", { enumerable: true, get: function () { return __importDefault(pushTransaction_1).default; } });
|
|
108
75
|
var rebootToBootloader_1 = require("./rebootToBootloader");
|
|
@@ -113,10 +80,6 @@ var requestLogin_1 = require("./requestLogin");
|
|
|
113
80
|
Object.defineProperty(exports, "requestLogin", { enumerable: true, get: function () { return __importDefault(requestLogin_1).default; } });
|
|
114
81
|
var resetDevice_1 = require("./resetDevice");
|
|
115
82
|
Object.defineProperty(exports, "resetDevice", { enumerable: true, get: function () { return __importDefault(resetDevice_1).default; } });
|
|
116
|
-
var rippleGetAddress_1 = require("./rippleGetAddress");
|
|
117
|
-
Object.defineProperty(exports, "rippleGetAddress", { enumerable: true, get: function () { return __importDefault(rippleGetAddress_1).default; } });
|
|
118
|
-
var rippleSignTransaction_1 = require("./rippleSignTransaction");
|
|
119
|
-
Object.defineProperty(exports, "rippleSignTransaction", { enumerable: true, get: function () { return __importDefault(rippleSignTransaction_1).default; } });
|
|
120
83
|
var setBusy_1 = require("./setBusy");
|
|
121
84
|
Object.defineProperty(exports, "setBusy", { enumerable: true, get: function () { return __importDefault(setBusy_1).default; } });
|
|
122
85
|
var setProxy_1 = require("./setProxy");
|
|
@@ -125,16 +88,6 @@ var signMessage_1 = require("./signMessage");
|
|
|
125
88
|
Object.defineProperty(exports, "signMessage", { enumerable: true, get: function () { return __importDefault(signMessage_1).default; } });
|
|
126
89
|
var signTransaction_1 = require("./signTransaction");
|
|
127
90
|
Object.defineProperty(exports, "signTransaction", { enumerable: true, get: function () { return __importDefault(signTransaction_1).default; } });
|
|
128
|
-
var stellarGetAddress_1 = require("./stellarGetAddress");
|
|
129
|
-
Object.defineProperty(exports, "stellarGetAddress", { enumerable: true, get: function () { return __importDefault(stellarGetAddress_1).default; } });
|
|
130
|
-
var stellarSignTransaction_1 = require("./stellarSignTransaction");
|
|
131
|
-
Object.defineProperty(exports, "stellarSignTransaction", { enumerable: true, get: function () { return __importDefault(stellarSignTransaction_1).default; } });
|
|
132
|
-
var tezosGetAddress_1 = require("./tezosGetAddress");
|
|
133
|
-
Object.defineProperty(exports, "tezosGetAddress", { enumerable: true, get: function () { return __importDefault(tezosGetAddress_1).default; } });
|
|
134
|
-
var tezosGetPublicKey_1 = require("./tezosGetPublicKey");
|
|
135
|
-
Object.defineProperty(exports, "tezosGetPublicKey", { enumerable: true, get: function () { return __importDefault(tezosGetPublicKey_1).default; } });
|
|
136
|
-
var tezosSignTransaction_1 = require("./tezosSignTransaction");
|
|
137
|
-
Object.defineProperty(exports, "tezosSignTransaction", { enumerable: true, get: function () { return __importDefault(tezosSignTransaction_1).default; } });
|
|
138
91
|
var unlockPath_1 = require("./unlockPath");
|
|
139
92
|
Object.defineProperty(exports, "unlockPath", { enumerable: true, get: function () { return __importDefault(unlockPath_1).default; } });
|
|
140
93
|
var verifyMessage_1 = require("./verifyMessage");
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.nemSignTransaction = exports.nemGetAddress = void 0;
|
|
7
|
+
var nemGetAddress_1 = require("./nemGetAddress");
|
|
8
|
+
Object.defineProperty(exports, "nemGetAddress", { enumerable: true, get: function () { return __importDefault(nemGetAddress_1).default; } });
|
|
9
|
+
var nemSignTransaction_1 = require("./nemSignTransaction");
|
|
10
|
+
Object.defineProperty(exports, "nemSignTransaction", { enumerable: true, get: function () { return __importDefault(nemSignTransaction_1).default; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../../../constants';
|
|
3
3
|
type Params = PROTO.NEMGetAddress & {
|
|
4
4
|
address?: string;
|
|
5
5
|
};
|
|
@@ -17,7 +17,7 @@ export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Param
|
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
19
|
_call({ address_n, network, show_display }: Params): Promise<PROTO.NEMAddress>;
|
|
20
|
-
run(): Promise<import("
|
|
20
|
+
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=nemGetAddress.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const coinInfo_1 = require("
|
|
6
|
-
const pathUtils_1 = require("
|
|
7
|
-
const constants_1 = require("
|
|
8
|
-
const events_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const constants_1 = require("../../../constants");
|
|
8
|
+
const events_1 = require("../../../events");
|
|
9
9
|
const MAINNET = 0x68;
|
|
10
10
|
const TESTNET = 0x98;
|
|
11
11
|
const MIJIN = 0x60;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { PROTO } from '../../../constants';
|
|
3
3
|
export default class NEMSignTransaction extends AbstractMethod<'nemSignTransaction', PROTO.NEMSignTx> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|