@trezor/connect 9.2.3 → 9.2.4-beta.1
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 +43 -5
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +8 -1
- package/lib/api/applyFlags.js +3 -8
- package/lib/api/applySettings.d.ts +8 -1
- package/lib/api/applySettings.js +3 -8
- package/lib/api/backupDevice.d.ts +10 -2
- package/lib/api/backupDevice.js +12 -9
- package/lib/api/binance/api/binanceGetAddress.d.ts +4 -3
- package/lib/api/binance/api/binanceGetAddress.js +8 -22
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +4 -2
- package/lib/api/binance/api/binanceGetPublicKey.js +6 -18
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -3
- package/lib/api/cardano/api/cardanoGetAddress.js +8 -22
- package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +4 -3
- package/lib/api/cardano/api/cardanoGetPublicKey.js +9 -31
- package/lib/api/changeLanguage.d.ts +8 -1
- package/lib/api/changeLanguage.js +3 -7
- package/lib/api/eos/api/eosGetPublicKey.d.ts +4 -2
- package/lib/api/eos/api/eosGetPublicKey.js +6 -18
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +4 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -20
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +4 -2
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -10
- package/lib/api/firmware/index.d.ts +2 -0
- package/lib/api/firmware/index.js +5 -1
- package/lib/api/firmware/parseFirmwareHeaders.d.ts +5 -0
- package/lib/api/firmware/parseFirmwareHeaders.js +35 -0
- package/lib/api/firmware/uploadFirmware.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.js +9 -1
- package/lib/api/getAccountDescriptor.d.ts +5 -3
- package/lib/api/getAccountDescriptor.js +8 -21
- package/lib/api/getAccountInfo.d.ts +23 -7
- package/lib/api/getAccountInfo.js +12 -25
- package/lib/api/getAddress.d.ts +4 -3
- package/lib/api/getAddress.js +8 -22
- package/lib/api/getFeatures.d.ts +1 -0
- package/lib/api/getOwnershipId.d.ts +4 -2
- package/lib/api/getOwnershipId.js +4 -15
- package/lib/api/getOwnershipProof.d.ts +4 -2
- package/lib/api/getOwnershipProof.js +4 -15
- package/lib/api/getPublicKey.d.ts +5 -4
- package/lib/api/getPublicKey.js +12 -35
- package/lib/api/index.d.ts +0 -1
- package/lib/api/index.js +1 -3
- package/lib/api/nem/api/nemGetAddress.d.ts +4 -3
- package/lib/api/nem/api/nemGetAddress.js +4 -20
- package/lib/api/rebootToBootloader.d.ts +8 -2
- package/lib/api/rebootToBootloader.js +3 -10
- package/lib/api/recoveryDevice.d.ts +8 -1
- package/lib/api/recoveryDevice.js +3 -7
- package/lib/api/resetDevice.d.ts +4 -2
- package/lib/api/resetDevice.js +3 -10
- package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -3
- package/lib/api/ripple/api/rippleGetAddress.js +4 -20
- package/lib/api/solana/api/solanaGetAddress.d.ts +4 -3
- package/lib/api/solana/api/solanaGetAddress.js +7 -28
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +4 -3
- package/lib/api/solana/api/solanaGetPublicKey.js +7 -27
- package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -3
- package/lib/api/stellar/api/stellarGetAddress.js +4 -20
- package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -3
- package/lib/api/tezos/api/tezosGetAddress.js +4 -20
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +4 -2
- package/lib/api/tezos/api/tezosGetPublicKey.js +6 -18
- package/lib/api/wipeDevice.d.ts +8 -2
- package/lib/api/wipeDevice.js +3 -10
- package/lib/constants/errors.d.ts +1 -0
- package/lib/constants/errors.js +1 -0
- package/lib/core/AbstractMethod.d.ts +4 -8
- package/lib/core/AbstractMethod.js +6 -28
- package/lib/core/index.d.ts +2 -1
- package/lib/core/index.js +254 -225
- package/lib/core/onCallFirmwareUpdate.d.ts +31 -0
- package/lib/core/onCallFirmwareUpdate.js +259 -0
- package/lib/data/analyticsInfo.d.ts +2 -2
- package/lib/data/analyticsInfo.js +6 -7
- package/lib/data/deviceAuthenticityConfig.js +8 -4
- package/lib/data/firmwareInfo.js +1 -1
- 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 +2 -2
- package/lib/device/DeviceCommands.d.ts +2 -14
- package/lib/device/DeviceCommands.js +1 -43
- package/lib/device/DeviceList.d.ts +1 -1
- package/lib/device/DeviceList.js +20 -15
- package/lib/events/index.d.ts +1 -0
- package/lib/events/ui-request.d.ts +13 -1
- package/lib/events/ui-request.js +1 -0
- package/lib/index.js +2 -2
- package/lib/types/api/backupDevice.d.ts +2 -2
- package/lib/types/api/dispose.d.ts +1 -1
- package/lib/types/api/firmwareUpdate.d.ts +7 -6
- package/lib/types/api/firmwareUpdate.js +1 -3
- package/lib/utils/popupPromiseManager.d.ts +8 -0
- package/lib/utils/popupPromiseManager.js +21 -0
- package/lib/utils/uiPromiseManager.d.ts +38 -0
- package/lib/utils/uiPromiseManager.js +47 -0
- package/lib/workers/workers-browser.d.ts +3 -1
- package/lib/workers/workers-browser.js +2 -2
- package/package.json +6 -6
- package/lib/api/firmwareUpdate.d.ts +0 -19
- package/lib/api/firmwareUpdate.js +0 -78
|
@@ -6,7 +6,6 @@ type Params = PROTO.NEMGetAddress & {
|
|
|
6
6
|
export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Params[]> {
|
|
7
7
|
hasBundle?: boolean;
|
|
8
8
|
progress: number;
|
|
9
|
-
confirmed?: boolean;
|
|
10
9
|
init(): void;
|
|
11
10
|
get info(): string;
|
|
12
11
|
getButtonRequestData(code: string): {
|
|
@@ -14,8 +13,10 @@ export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Param
|
|
|
14
13
|
serializedPath: string;
|
|
15
14
|
address: string;
|
|
16
15
|
} | undefined;
|
|
17
|
-
confirmation():
|
|
18
|
-
|
|
16
|
+
get confirmation(): {
|
|
17
|
+
view: "export-address";
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
19
20
|
_call({ address_n, network, show_display, chunkify }: Params): Promise<{
|
|
20
21
|
address: string;
|
|
21
22
|
}>;
|
|
@@ -18,6 +18,7 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
18
|
this.progress = 0;
|
|
19
19
|
}
|
|
20
20
|
init() {
|
|
21
|
+
this.noBackupConfirmationMode = 'always';
|
|
21
22
|
this.requiredPermissions = ['read'];
|
|
22
23
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
|
|
23
24
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -39,7 +40,6 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
39
40
|
this.params.length === 1 &&
|
|
40
41
|
typeof this.params[0].address === 'string' &&
|
|
41
42
|
this.params[0].show_display;
|
|
42
|
-
this.confirmed = useEventListener;
|
|
43
43
|
this.useUi = !useEventListener;
|
|
44
44
|
}
|
|
45
45
|
get info() {
|
|
@@ -69,27 +69,11 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return true;
|
|
75
|
-
await this.getPopupPromise().promise;
|
|
76
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
77
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
72
|
+
get confirmation() {
|
|
73
|
+
return {
|
|
78
74
|
view: 'export-address',
|
|
79
75
|
label: this.info,
|
|
80
|
-
}
|
|
81
|
-
const uiResp = await uiPromise.promise;
|
|
82
|
-
this.confirmed = uiResp.payload;
|
|
83
|
-
return this.confirmed;
|
|
84
|
-
}
|
|
85
|
-
async noBackupConfirmation() {
|
|
86
|
-
await this.getPopupPromise().promise;
|
|
87
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
88
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
89
|
-
view: 'no-backup',
|
|
90
|
-
}));
|
|
91
|
-
const uiResp = await uiPromise.promise;
|
|
92
|
-
return uiResp.payload;
|
|
76
|
+
};
|
|
93
77
|
}
|
|
94
78
|
async _call({ address_n, network, show_display, chunkify }) {
|
|
95
79
|
const cmd = this.device.getCommands();
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
2
|
import { PROTO } from '../constants';
|
|
3
3
|
export default class RebootToBootloader extends AbstractMethod<'rebootToBootloader', PROTO.RebootToBootloader> {
|
|
4
|
-
confirmed?: boolean;
|
|
5
4
|
init(): void;
|
|
6
5
|
get info(): string;
|
|
7
|
-
confirmation():
|
|
6
|
+
get confirmation(): {
|
|
7
|
+
view: "device-management";
|
|
8
|
+
customConfirmButton: {
|
|
9
|
+
className: string;
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
8
14
|
run(): Promise<{
|
|
9
15
|
message: string;
|
|
10
16
|
}>;
|
|
@@ -24,22 +24,15 @@ class RebootToBootloader extends AbstractMethod_1.AbstractMethod {
|
|
|
24
24
|
get info() {
|
|
25
25
|
return 'Reboot to bootloader';
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return true;
|
|
30
|
-
await this.getPopupPromise().promise;
|
|
31
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
32
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
27
|
+
get confirmation() {
|
|
28
|
+
return {
|
|
33
29
|
view: 'device-management',
|
|
34
30
|
customConfirmButton: {
|
|
35
31
|
className: 'confirm',
|
|
36
32
|
label: `Reboot`,
|
|
37
33
|
},
|
|
38
34
|
label: 'Are you sure you want to reboot to bootloader?',
|
|
39
|
-
}
|
|
40
|
-
const uiResp = await uiPromise.promise;
|
|
41
|
-
this.confirmed = uiResp.payload;
|
|
42
|
-
return this.confirmed;
|
|
35
|
+
};
|
|
43
36
|
}
|
|
44
37
|
async run() {
|
|
45
38
|
const cmd = this.device.getCommands();
|
|
@@ -2,7 +2,14 @@ import { AbstractMethod } from '../core/AbstractMethod';
|
|
|
2
2
|
import type { PROTO } from '../constants';
|
|
3
3
|
export default class RecoveryDevice extends AbstractMethod<'recoveryDevice', PROTO.RecoveryDevice> {
|
|
4
4
|
init(): void;
|
|
5
|
-
confirmation():
|
|
5
|
+
get confirmation(): {
|
|
6
|
+
view: "device-management";
|
|
7
|
+
customConfirmButton: {
|
|
8
|
+
className: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
6
13
|
run(): Promise<{
|
|
7
14
|
message: string;
|
|
8
15
|
}>;
|
|
@@ -24,19 +24,15 @@ class RecoveryDevice extends AbstractMethod_1.AbstractMethod {
|
|
|
24
24
|
this.allowDeviceMode = [...this.allowDeviceMode, events_1.UI.INITIALIZE];
|
|
25
25
|
this.useDeviceState = false;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
30
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
27
|
+
get confirmation() {
|
|
28
|
+
return {
|
|
31
29
|
view: 'device-management',
|
|
32
30
|
customConfirmButton: {
|
|
33
31
|
className: 'confirm',
|
|
34
32
|
label: 'Proceed',
|
|
35
33
|
},
|
|
36
34
|
label: 'Do you want to recover device from seed?',
|
|
37
|
-
}
|
|
38
|
-
const uiResp = await uiPromise.promise;
|
|
39
|
-
return uiResp.payload;
|
|
35
|
+
};
|
|
40
36
|
}
|
|
41
37
|
async run() {
|
|
42
38
|
const cmd = this.device.getCommands();
|
package/lib/api/resetDevice.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
2
|
import { PROTO } from '../constants';
|
|
3
3
|
export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.ResetDevice> {
|
|
4
|
-
confirmed?: boolean;
|
|
5
4
|
init(): void;
|
|
6
5
|
get info(): string;
|
|
7
|
-
confirmation():
|
|
6
|
+
get confirmation(): {
|
|
7
|
+
view: "device-management";
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
8
10
|
run(): Promise<{
|
|
9
11
|
message: string;
|
|
10
12
|
}>;
|
package/lib/api/resetDevice.js
CHANGED
|
@@ -29,18 +29,11 @@ class ResetDevice extends AbstractMethod_1.AbstractMethod {
|
|
|
29
29
|
get info() {
|
|
30
30
|
return 'Setup device';
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return true;
|
|
35
|
-
await this.getPopupPromise().promise;
|
|
36
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
37
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
32
|
+
get confirmation() {
|
|
33
|
+
return {
|
|
38
34
|
view: 'device-management',
|
|
39
35
|
label: 'Do you really you want to create a new wallet?',
|
|
40
|
-
}
|
|
41
|
-
const uiResp = await uiPromise.promise;
|
|
42
|
-
this.confirmed = uiResp.payload;
|
|
43
|
-
return this.confirmed;
|
|
36
|
+
};
|
|
44
37
|
}
|
|
45
38
|
async run() {
|
|
46
39
|
const cmd = this.device.getCommands();
|
|
@@ -6,7 +6,6 @@ type Params = PROTO.RippleGetAddress & {
|
|
|
6
6
|
export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress', Params[]> {
|
|
7
7
|
hasBundle?: boolean;
|
|
8
8
|
progress: number;
|
|
9
|
-
confirmed?: boolean;
|
|
10
9
|
init(): void;
|
|
11
10
|
get info(): string;
|
|
12
11
|
getButtonRequestData(code: string): {
|
|
@@ -14,8 +13,10 @@ export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress',
|
|
|
14
13
|
serializedPath: string;
|
|
15
14
|
address: string;
|
|
16
15
|
} | undefined;
|
|
17
|
-
confirmation():
|
|
18
|
-
|
|
16
|
+
get confirmation(): {
|
|
17
|
+
view: "export-address";
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
19
20
|
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
21
|
address: string;
|
|
21
22
|
}>;
|
|
@@ -15,6 +15,7 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
15
15
|
this.progress = 0;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
+
this.noBackupConfirmationMode = 'always';
|
|
18
19
|
this.requiredPermissions = ['read'];
|
|
19
20
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Ripple'), this.firmwareRange);
|
|
20
21
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -35,7 +36,6 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
35
36
|
this.params.length === 1 &&
|
|
36
37
|
typeof this.params[0].address === 'string' &&
|
|
37
38
|
this.params[0].show_display;
|
|
38
|
-
this.confirmed = useEventListener;
|
|
39
39
|
this.useUi = !useEventListener;
|
|
40
40
|
}
|
|
41
41
|
get info() {
|
|
@@ -53,27 +53,11 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return true;
|
|
59
|
-
await this.getPopupPromise().promise;
|
|
60
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
61
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
56
|
+
get confirmation() {
|
|
57
|
+
return {
|
|
62
58
|
view: 'export-address',
|
|
63
59
|
label: this.info,
|
|
64
|
-
}
|
|
65
|
-
const uiResp = await uiPromise.promise;
|
|
66
|
-
this.confirmed = uiResp.payload;
|
|
67
|
-
return this.confirmed;
|
|
68
|
-
}
|
|
69
|
-
async noBackupConfirmation() {
|
|
70
|
-
await this.getPopupPromise().promise;
|
|
71
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
72
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
73
|
-
view: 'no-backup',
|
|
74
|
-
}));
|
|
75
|
-
const uiResp = await uiPromise.promise;
|
|
76
|
-
return uiResp.payload;
|
|
60
|
+
};
|
|
77
61
|
}
|
|
78
62
|
async _call({ address_n, show_display, chunkify }) {
|
|
79
63
|
const cmd = this.device.getCommands();
|
|
@@ -6,7 +6,6 @@ type Params = PROTO.SolanaGetAddress & {
|
|
|
6
6
|
export default class SolanaGetAddress extends AbstractMethod<'solanaGetAddress', Params[]> {
|
|
7
7
|
hasBundle?: boolean;
|
|
8
8
|
progress: number;
|
|
9
|
-
confirmed?: boolean;
|
|
10
9
|
init(): void;
|
|
11
10
|
get info(): "Export solana address" | "Export multiple Solana addresses";
|
|
12
11
|
getButtonRequestData(code: string): {
|
|
@@ -14,8 +13,10 @@ export default class SolanaGetAddress extends AbstractMethod<'solanaGetAddress',
|
|
|
14
13
|
serializedPath: string;
|
|
15
14
|
address: string;
|
|
16
15
|
} | undefined;
|
|
17
|
-
confirmation():
|
|
18
|
-
|
|
16
|
+
get confirmation(): {
|
|
17
|
+
view: "export-address";
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
19
20
|
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
21
|
address: string;
|
|
21
22
|
}>;
|
|
@@ -15,6 +15,7 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
15
15
|
this.progress = 0;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
+
this.noBackupConfirmationMode = 'always';
|
|
18
19
|
this.requiredPermissions = ['read'];
|
|
19
20
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
20
21
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -35,7 +36,6 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
35
36
|
this.params.length === 1 &&
|
|
36
37
|
typeof this.params[0].address === 'string' &&
|
|
37
38
|
this.params[0].show_display;
|
|
38
|
-
this.confirmed = useEventListener;
|
|
39
39
|
this.useUi = !useEventListener;
|
|
40
40
|
}
|
|
41
41
|
get info() {
|
|
@@ -53,34 +53,13 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return true;
|
|
59
|
-
await this.getPopupPromise().promise;
|
|
60
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
61
|
-
let label;
|
|
62
|
-
if (this.params.length > 1) {
|
|
63
|
-
label = 'Export multiple Solana addresses';
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
label = `Export Solana address for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
|
|
67
|
-
}
|
|
68
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
56
|
+
get confirmation() {
|
|
57
|
+
return {
|
|
69
58
|
view: 'export-address',
|
|
70
|
-
label
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return this.confirmed;
|
|
75
|
-
}
|
|
76
|
-
async noBackupConfirmation() {
|
|
77
|
-
await this.getPopupPromise().promise;
|
|
78
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
79
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
80
|
-
view: 'no-backup',
|
|
81
|
-
}));
|
|
82
|
-
const uiResp = await uiPromise.promise;
|
|
83
|
-
return uiResp.payload;
|
|
59
|
+
label: this.params.length > 1
|
|
60
|
+
? 'Export multiple Solana addresses'
|
|
61
|
+
: `Export Solana address for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`,
|
|
62
|
+
};
|
|
84
63
|
}
|
|
85
64
|
async _call({ address_n, show_display, chunkify }) {
|
|
86
65
|
const cmd = this.device.getCommands();
|
|
@@ -2,11 +2,12 @@ import { PROTO } from '../../../constants';
|
|
|
2
2
|
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
3
3
|
export default class SolanaGetPublicKey extends AbstractMethod<'solanaGetPublicKey', PROTO.SolanaGetPublicKey[]> {
|
|
4
4
|
hasBundle?: boolean;
|
|
5
|
-
confirmed?: boolean;
|
|
6
5
|
init(): void;
|
|
7
6
|
get info(): string;
|
|
8
|
-
confirmation():
|
|
9
|
-
|
|
7
|
+
get confirmation(): {
|
|
8
|
+
view: "export-xpub";
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
10
11
|
run(): Promise<({
|
|
11
12
|
path: number[];
|
|
12
13
|
publicKey: string;
|
|
@@ -9,6 +9,7 @@ const schema_utils_1 = require("@trezor/schema-utils");
|
|
|
9
9
|
const types_1 = require("../../../types");
|
|
10
10
|
class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
init() {
|
|
12
|
+
this.noBackupConfirmationMode = 'always';
|
|
12
13
|
this.requiredPermissions = ['read'];
|
|
13
14
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
14
15
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -27,34 +28,13 @@ class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
|
27
28
|
get info() {
|
|
28
29
|
return 'Export Solana public key';
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return true;
|
|
33
|
-
await this.getPopupPromise().promise;
|
|
34
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
35
|
-
let label;
|
|
36
|
-
if (this.params.length > 1) {
|
|
37
|
-
label = 'Export multiple Solana public keys';
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
label = `Export Solana public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
|
|
41
|
-
}
|
|
42
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
31
|
+
get confirmation() {
|
|
32
|
+
return {
|
|
43
33
|
view: 'export-xpub',
|
|
44
|
-
label
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return this.confirmed;
|
|
49
|
-
}
|
|
50
|
-
async noBackupConfirmation() {
|
|
51
|
-
await this.getPopupPromise().promise;
|
|
52
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
53
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
54
|
-
view: 'no-backup',
|
|
55
|
-
}));
|
|
56
|
-
const uiResp = await uiPromise.promise;
|
|
57
|
-
return uiResp.payload;
|
|
34
|
+
label: this.params.length > 1
|
|
35
|
+
? 'Export multiple Solana public keys'
|
|
36
|
+
: `Export Solana public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`,
|
|
37
|
+
};
|
|
58
38
|
}
|
|
59
39
|
async run() {
|
|
60
40
|
const responses = [];
|
|
@@ -6,7 +6,6 @@ type Params = PROTO.StellarGetAddress & {
|
|
|
6
6
|
export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress', Params[]> {
|
|
7
7
|
hasBundle?: boolean;
|
|
8
8
|
progress: number;
|
|
9
|
-
confirmed?: boolean;
|
|
10
9
|
init(): void;
|
|
11
10
|
get info(): string;
|
|
12
11
|
getButtonRequestData(code: string): {
|
|
@@ -14,8 +13,10 @@ export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress
|
|
|
14
13
|
serializedPath: string;
|
|
15
14
|
address: string;
|
|
16
15
|
} | undefined;
|
|
17
|
-
confirmation():
|
|
18
|
-
|
|
16
|
+
get confirmation(): {
|
|
17
|
+
view: "export-address";
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
19
20
|
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
21
|
address: string;
|
|
21
22
|
}>;
|
|
@@ -15,6 +15,7 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
15
15
|
this.progress = 0;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
+
this.noBackupConfirmationMode = 'always';
|
|
18
19
|
this.requiredPermissions = ['read'];
|
|
19
20
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Stellar'), this.firmwareRange);
|
|
20
21
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -35,7 +36,6 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
35
36
|
this.params.length === 1 &&
|
|
36
37
|
typeof this.params[0].address === 'string' &&
|
|
37
38
|
this.params[0].show_display;
|
|
38
|
-
this.confirmed = useEventListener;
|
|
39
39
|
this.useUi = !useEventListener;
|
|
40
40
|
}
|
|
41
41
|
get info() {
|
|
@@ -53,27 +53,11 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return true;
|
|
59
|
-
await this.getPopupPromise().promise;
|
|
60
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
61
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
56
|
+
get confirmation() {
|
|
57
|
+
return {
|
|
62
58
|
view: 'export-address',
|
|
63
59
|
label: this.info,
|
|
64
|
-
}
|
|
65
|
-
const uiResp = await uiPromise.promise;
|
|
66
|
-
this.confirmed = uiResp.payload;
|
|
67
|
-
return this.confirmed;
|
|
68
|
-
}
|
|
69
|
-
async noBackupConfirmation() {
|
|
70
|
-
await this.getPopupPromise().promise;
|
|
71
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
72
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
73
|
-
view: 'no-backup',
|
|
74
|
-
}));
|
|
75
|
-
const uiResp = await uiPromise.promise;
|
|
76
|
-
return uiResp.payload;
|
|
60
|
+
};
|
|
77
61
|
}
|
|
78
62
|
async _call({ address_n, show_display, chunkify }) {
|
|
79
63
|
const cmd = this.device.getCommands();
|
|
@@ -6,7 +6,6 @@ type Params = PROTO.TezosGetAddress & {
|
|
|
6
6
|
export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', Params[]> {
|
|
7
7
|
hasBundle?: boolean;
|
|
8
8
|
progress: number;
|
|
9
|
-
confirmed?: boolean;
|
|
10
9
|
init(): void;
|
|
11
10
|
get info(): string;
|
|
12
11
|
getButtonRequestData(code: string): {
|
|
@@ -14,8 +13,10 @@ export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', P
|
|
|
14
13
|
serializedPath: string;
|
|
15
14
|
address: string;
|
|
16
15
|
} | undefined;
|
|
17
|
-
confirmation():
|
|
18
|
-
|
|
16
|
+
get confirmation(): {
|
|
17
|
+
view: "export-address";
|
|
18
|
+
label: string;
|
|
19
|
+
};
|
|
19
20
|
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
21
|
address: string;
|
|
21
22
|
}>;
|
|
@@ -15,6 +15,7 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
15
15
|
this.progress = 0;
|
|
16
16
|
}
|
|
17
17
|
init() {
|
|
18
|
+
this.noBackupConfirmationMode = 'always';
|
|
18
19
|
this.requiredPermissions = ['read'];
|
|
19
20
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Tezos'), this.firmwareRange);
|
|
20
21
|
this.hasBundle = !!this.payload.bundle;
|
|
@@ -35,7 +36,6 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
35
36
|
this.params.length === 1 &&
|
|
36
37
|
typeof this.params[0].address === 'string' &&
|
|
37
38
|
this.params[0].show_display;
|
|
38
|
-
this.confirmed = useEventListener;
|
|
39
39
|
this.useUi = !useEventListener;
|
|
40
40
|
}
|
|
41
41
|
get info() {
|
|
@@ -53,27 +53,11 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return true;
|
|
59
|
-
await this.getPopupPromise().promise;
|
|
60
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
61
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
56
|
+
get confirmation() {
|
|
57
|
+
return {
|
|
62
58
|
view: 'export-address',
|
|
63
59
|
label: this.info,
|
|
64
|
-
}
|
|
65
|
-
const uiResp = await uiPromise.promise;
|
|
66
|
-
this.confirmed = uiResp.payload;
|
|
67
|
-
return this.confirmed;
|
|
68
|
-
}
|
|
69
|
-
async noBackupConfirmation() {
|
|
70
|
-
await this.getPopupPromise().promise;
|
|
71
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
72
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
73
|
-
view: 'no-backup',
|
|
74
|
-
}));
|
|
75
|
-
const uiResp = await uiPromise.promise;
|
|
76
|
-
return uiResp.payload;
|
|
60
|
+
};
|
|
77
61
|
}
|
|
78
62
|
async _call({ address_n, show_display, chunkify }) {
|
|
79
63
|
const cmd = this.device.getCommands();
|
|
@@ -2,10 +2,12 @@ import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
|
2
2
|
import type { PROTO } from '../../../constants';
|
|
3
3
|
export default class TezosGetPublicKey extends AbstractMethod<'tezosGetPublicKey', PROTO.TezosGetPublicKey[]> {
|
|
4
4
|
hasBundle?: boolean;
|
|
5
|
-
confirmed?: boolean;
|
|
6
5
|
init(): void;
|
|
7
6
|
get info(): string;
|
|
8
|
-
confirmation():
|
|
7
|
+
get confirmation(): {
|
|
8
|
+
view: "export-address";
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
9
11
|
run(): Promise<{
|
|
10
12
|
path: number[];
|
|
11
13
|
publicKey: string;
|
|
@@ -28,25 +28,13 @@ class TezosGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
|
28
28
|
get info() {
|
|
29
29
|
return 'Export Tezos public key';
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return true;
|
|
34
|
-
await this.getPopupPromise().promise;
|
|
35
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
36
|
-
let label;
|
|
37
|
-
if (this.params.length > 1) {
|
|
38
|
-
label = 'Export multiple Tezos public keys';
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
label = `Export Tezos public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
|
|
42
|
-
}
|
|
43
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
31
|
+
get confirmation() {
|
|
32
|
+
return {
|
|
44
33
|
view: 'export-address',
|
|
45
|
-
label
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return this.confirmed;
|
|
34
|
+
label: this.params.length > 1
|
|
35
|
+
? 'Export multiple Tezos public keys'
|
|
36
|
+
: `Export Tezos public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`,
|
|
37
|
+
};
|
|
50
38
|
}
|
|
51
39
|
async run() {
|
|
52
40
|
const responses = [];
|
package/lib/api/wipeDevice.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { AbstractMethod } from '../core/AbstractMethod';
|
|
2
2
|
export default class WipeDevice extends AbstractMethod<'wipeDevice'> {
|
|
3
|
-
confirmed?: boolean;
|
|
4
3
|
init(): void;
|
|
5
|
-
confirmation():
|
|
4
|
+
get confirmation(): {
|
|
5
|
+
view: "device-management";
|
|
6
|
+
customConfirmButton: {
|
|
7
|
+
className: string;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
6
12
|
get info(): string;
|
|
7
13
|
run(): Promise<{
|
|
8
14
|
message: string;
|
package/lib/api/wipeDevice.js
CHANGED
|
@@ -10,22 +10,15 @@ class WipeDevice extends AbstractMethod_1.AbstractMethod {
|
|
|
10
10
|
this.requiredPermissions = ['management'];
|
|
11
11
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return true;
|
|
16
|
-
await this.getPopupPromise().promise;
|
|
17
|
-
const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
|
|
18
|
-
this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
|
|
13
|
+
get confirmation() {
|
|
14
|
+
return {
|
|
19
15
|
view: 'device-management',
|
|
20
16
|
customConfirmButton: {
|
|
21
17
|
className: 'wipe',
|
|
22
18
|
label: `Wipe ${this.device.toMessageObject().label}`,
|
|
23
19
|
},
|
|
24
20
|
label: 'Are you sure you want to wipe your device?',
|
|
25
|
-
}
|
|
26
|
-
const uiResp = await uiPromise.promise;
|
|
27
|
-
this.confirmed = uiResp.payload;
|
|
28
|
-
return this.confirmed;
|
|
21
|
+
};
|
|
29
22
|
}
|
|
30
23
|
get info() {
|
|
31
24
|
return 'Wipe device';
|
package/lib/constants/errors.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.ERROR_CODES = {
|
|
|
36
36
|
Device_UsedElsewhere: 'Device is used in another window',
|
|
37
37
|
Device_InvalidState: 'Passphrase is incorrect',
|
|
38
38
|
Device_CallInProgress: 'Device call in progress',
|
|
39
|
+
Device_MultipleNotSupported: 'Multiple devices are not supported',
|
|
39
40
|
};
|
|
40
41
|
class TrezorError extends Error {
|
|
41
42
|
constructor(code, message) {
|