@trezor/connect 9.1.5 → 9.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/README.md +1 -1
- package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +4 -4
- package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +10 -7
- 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} +3 -2
- package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +8 -6
- package/lib/api/binance/api/index.d.ts +4 -0
- package/lib/api/binance/api/index.js +13 -0
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/binance/binanceSignTx.js +2 -1
- 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} +4 -4
- package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +11 -8
- 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} +19 -8
- package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +33 -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/common/paramsValidator.js +5 -3
- 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} +7 -5
- package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +3 -2
- package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +8 -6
- package/lib/api/eos/api/index.d.ts +3 -0
- package/lib/api/eos/api/index.js +11 -0
- package/lib/api/eos/eosSignTx.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +2 -1
- package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +5 -5
- package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +13 -10
- 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} +12 -9
- package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +38 -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 +4 -2
- package/lib/api/ethereum/ethereumSignTx.js +19 -3
- 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/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +4 -1
- 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} +4 -4
- package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +10 -7
- package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
- package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +7 -6
- package/lib/api/nem/nemSignTx.d.ts +1 -1
- package/lib/api/nem/nemSignTx.js +2 -1
- 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} +4 -4
- package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +10 -7
- package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
- package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +7 -5
- package/lib/api/signTransaction.js +2 -0
- package/lib/api/solana/additionalInfo.d.ts +10 -0
- package/lib/api/solana/additionalInfo.js +33 -0
- 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 +133 -0
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
- package/lib/api/solana/api/solanaGetPublicKey.js +83 -0
- package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
- package/lib/api/solana/api/solanaSignTransaction.js +34 -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} +4 -4
- package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +10 -7
- 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} +4 -4
- package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +10 -7
- package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
- package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +7 -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/api/tezos/tezosSignTx.d.ts +1 -1
- package/lib/api/tezos/tezosSignTx.js +2 -1
- package/lib/backend/Blockchain.js +3 -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/AbstractMethod.js +3 -0
- 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 +22 -0
- package/lib/data/config.d.ts +22 -0
- package/lib/data/config.js +12 -1
- package/lib/data/connectSettings.js +4 -0
- package/lib/data/defaultFeeLevels.js +9 -0
- package/lib/data/deviceAuthenticityConfig.js +4 -1
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/firmwareInfo.js +4 -1
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +3 -1
- package/lib/device/Device.js +23 -4
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +19 -3
- package/lib/device/DeviceList.js +4 -1
- package/lib/events/popup.d.ts +19 -3
- package/lib/events/popup.js +3 -0
- package/lib/events/ui-request.d.ts +1 -1
- package/lib/factory.js +5 -0
- package/lib/types/api/binance/index.d.ts +1 -0
- package/lib/types/api/bitcoin/index.d.ts +2 -0
- package/lib/types/api/cardano/index.d.ts +2 -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/eos/index.d.ts +1 -0
- package/lib/types/api/ethereum/index.d.ts +2 -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/nem/index.d.ts +1 -0
- package/lib/types/api/ripple/index.d.ts +1 -0
- package/lib/types/api/solana/index.d.ts +22 -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/api/tezos/index.d.ts +1 -0
- package/lib/types/coinInfo.d.ts +5 -16
- package/lib/types/device.d.ts +1 -1
- 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/params.d.ts +3 -0
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/debug.d.ts +6 -3
- package/lib/utils/debug.js +13 -7
- package/lib/utils/deviceFeaturesUtils.js +8 -5
- 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 -19
- package/lib/api/eosGetPublicKey.d.ts +0 -11
- package/lib/api/ethereumGetPublicKey.d.ts +0 -16
|
@@ -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/getAddress.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class GetAddress extends AbstractMethod<'getAddress', Params[]> {
|
|
|
19
19
|
} | undefined;
|
|
20
20
|
confirmation(): Promise<boolean>;
|
|
21
21
|
noBackupConfirmation(): Promise<boolean>;
|
|
22
|
-
_call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath }: Params): Promise<{
|
|
22
|
+
_call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath, chunkify, }: Params): Promise<{
|
|
23
23
|
path: number[];
|
|
24
24
|
serializedPath: string;
|
|
25
25
|
address: string;
|
package/lib/api/getAddress.js
CHANGED
|
@@ -30,6 +30,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
30
30
|
{ name: 'multisig', type: 'object' },
|
|
31
31
|
{ name: 'scriptType', type: 'string' },
|
|
32
32
|
{ name: 'unlockPath', type: 'object' },
|
|
33
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
33
34
|
]);
|
|
34
35
|
if (batch.unlockPath) {
|
|
35
36
|
(0, paramsValidator_1.validateParams)(batch.unlockPath, [
|
|
@@ -63,6 +64,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
63
64
|
script_type: batch.scriptType,
|
|
64
65
|
coinInfo,
|
|
65
66
|
unlockPath: batch.unlockPath,
|
|
67
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
66
68
|
};
|
|
67
69
|
});
|
|
68
70
|
const useEventListener = payload.useEventListener &&
|
|
@@ -114,7 +116,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
114
116
|
const uiResp = await uiPromise.promise;
|
|
115
117
|
return uiResp.payload;
|
|
116
118
|
}
|
|
117
|
-
async _call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath }) {
|
|
119
|
+
async _call({ address_n, show_display, multisig, script_type, coinInfo, unlockPath, chunkify, }) {
|
|
118
120
|
const cmd = this.device.getCommands();
|
|
119
121
|
if (unlockPath) {
|
|
120
122
|
await cmd.unlockPath(unlockPath);
|
|
@@ -124,6 +126,7 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
124
126
|
show_display,
|
|
125
127
|
multisig,
|
|
126
128
|
script_type,
|
|
129
|
+
chunkify,
|
|
127
130
|
}, coinInfo);
|
|
128
131
|
}
|
|
129
132
|
async run() {
|
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
|
};
|
|
@@ -16,8 +16,8 @@ export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Param
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, network, show_display }: Params): Promise<PROTO.NEMAddress>;
|
|
20
|
-
run(): Promise<import("
|
|
19
|
+
_call({ address_n, network, show_display, chunkify }: Params): Promise<PROTO.NEMAddress>;
|
|
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;
|
|
@@ -31,6 +31,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
31
31
|
{ name: 'address', type: 'string' },
|
|
32
32
|
{ name: 'network', type: 'number' },
|
|
33
33
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
34
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
34
35
|
]);
|
|
35
36
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
36
37
|
return {
|
|
@@ -38,6 +39,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
38
39
|
network: batch.network || MAINNET,
|
|
39
40
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
40
41
|
address: batch.address,
|
|
42
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
const useEventListener = payload.useEventListener &&
|
|
@@ -96,12 +98,13 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
96
98
|
const uiResp = await uiPromise.promise;
|
|
97
99
|
return uiResp.payload;
|
|
98
100
|
}
|
|
99
|
-
async _call({ address_n, network, show_display }) {
|
|
101
|
+
async _call({ address_n, network, show_display, chunkify }) {
|
|
100
102
|
const cmd = this.device.getCommands();
|
|
101
103
|
const response = await cmd.typedCall('NEMGetAddress', 'NEMAddress', {
|
|
102
104
|
address_n,
|
|
103
105
|
network,
|
|
104
106
|
show_display,
|
|
107
|
+
chunkify,
|
|
105
108
|
});
|
|
106
109
|
return response.message;
|
|
107
110
|
}
|
|
@@ -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;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const AbstractMethod_1 = require("
|
|
5
|
-
const paramsValidator_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const pathUtils_1 = require("
|
|
8
|
-
const helper = tslib_1.__importStar(require("
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
|
+
const helper = tslib_1.__importStar(require("../nemSignTx"));
|
|
9
9
|
class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
11
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -14,9 +14,10 @@ class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
14
14
|
(0, paramsValidator_1.validateParams)(payload, [
|
|
15
15
|
{ name: 'path', required: true },
|
|
16
16
|
{ name: 'transaction', required: true },
|
|
17
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
17
18
|
]);
|
|
18
19
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
19
|
-
this.params = helper.createTx(payload.transaction, path);
|
|
20
|
+
this.params = helper.createTx(payload.transaction, path, payload.chunkify);
|
|
20
21
|
}
|
|
21
22
|
get info() {
|
|
22
23
|
return 'Sign NEM transaction';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PROTO } from '../../constants';
|
|
2
2
|
import * as $T from '../../types/api/nem';
|
|
3
|
-
export declare const createTx: (tx: $T.NEMTransaction, address_n: number[]) => PROTO.NEMSignTx;
|
|
3
|
+
export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => PROTO.NEMSignTx;
|
|
4
4
|
//# sourceMappingURL=nemSignTx.d.ts.map
|
package/lib/api/nem/nemSignTx.js
CHANGED
|
@@ -92,9 +92,10 @@ const supplyChangeMessage = (tx) => ({
|
|
|
92
92
|
type: tx.supplyType,
|
|
93
93
|
delta: tx.delta,
|
|
94
94
|
});
|
|
95
|
-
const createTx = (tx, address_n) => {
|
|
95
|
+
const createTx = (tx, address_n, chunkify) => {
|
|
96
96
|
let transaction = tx;
|
|
97
97
|
const message = {
|
|
98
|
+
chunkify: typeof chunkify === 'boolean' ? chunkify : false,
|
|
98
99
|
transaction: getCommon(tx, address_n),
|
|
99
100
|
transfer: undefined,
|
|
100
101
|
importance_transfer: undefined,
|
|
@@ -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.rippleSignTransaction = exports.rippleGetAddress = void 0;
|
|
7
|
+
var rippleGetAddress_1 = require("./rippleGetAddress");
|
|
8
|
+
Object.defineProperty(exports, "rippleGetAddress", { enumerable: true, get: function () { return __importDefault(rippleGetAddress_1).default; } });
|
|
9
|
+
var rippleSignTransaction_1 = require("./rippleSignTransaction");
|
|
10
|
+
Object.defineProperty(exports, "rippleSignTransaction", { enumerable: true, get: function () { return __importDefault(rippleSignTransaction_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.RippleGetAddress & {
|
|
4
4
|
address?: string;
|
|
5
5
|
};
|
|
@@ -16,8 +16,8 @@ export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress',
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display }: Params): Promise<PROTO.RippleAddress>;
|
|
20
|
-
run(): Promise<import("
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<PROTO.RippleAddress>;
|
|
20
|
+
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=rippleGetAddress.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
|
class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
@@ -27,12 +27,14 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
27
27
|
{ name: 'path', required: true },
|
|
28
28
|
{ name: 'address', type: 'string' },
|
|
29
29
|
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
+
{ name: 'chunkify', type: 'boolean' },
|
|
30
31
|
]);
|
|
31
32
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
32
33
|
return {
|
|
33
34
|
address_n: path,
|
|
34
35
|
address: batch.address,
|
|
35
36
|
show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
|
|
37
|
+
chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
|
|
36
38
|
};
|
|
37
39
|
});
|
|
38
40
|
const useEventListener = payload.useEventListener &&
|
|
@@ -79,11 +81,12 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
79
81
|
const uiResp = await uiPromise.promise;
|
|
80
82
|
return uiResp.payload;
|
|
81
83
|
}
|
|
82
|
-
async _call({ address_n, show_display }) {
|
|
84
|
+
async _call({ address_n, show_display, chunkify }) {
|
|
83
85
|
const cmd = this.device.getCommands();
|
|
84
86
|
const response = await cmd.typedCall('RippleGetAddress', 'RippleAddress', {
|
|
85
87
|
address_n,
|
|
86
88
|
show_display,
|
|
89
|
+
chunkify,
|
|
87
90
|
});
|
|
88
91
|
return response.message;
|
|
89
92
|
}
|
|
@@ -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 RippleSignTransaction extends AbstractMethod<'rippleSignTransaction', PROTO.RippleSignTx> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|