@onekeyfe/hd-web-sdk 0.1.43 → 0.1.44
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/build/data/messages/messages.json +8887 -8433
- package/build/iframe.html +1 -1
- package/build/js/{iframe.8248061e325f9d6b5ebb.js → iframe.aa7e2f1305ebf0ba8c60.js} +3 -3
- package/build/js/{iframe.8248061e325f9d6b5ebb.js.LICENSE.txt → iframe.aa7e2f1305ebf0ba8c60.js.LICENSE.txt} +0 -0
- package/build/js/iframe.aa7e2f1305ebf0ba8c60.js.map +1 -0
- package/build/onekey-js-sdk.js +2193 -901
- package/build/onekey-js-sdk.js.map +1 -1
- package/build/onekey-js-sdk.min.js +1 -1
- package/build/onekey-js-sdk.min.js.map +1 -1
- package/package.json +6 -6
- package/build/js/iframe.8248061e325f9d6b5ebb.js.map +0 -1
package/build/onekey-js-sdk.js
CHANGED
|
@@ -27041,15 +27041,6 @@ var HardwareError$1 = /*#__PURE__*/Object.freeze({
|
|
|
27041
27041
|
CreateErrorByMessage: CreateErrorByMessage
|
|
27042
27042
|
});
|
|
27043
27043
|
|
|
27044
|
-
// EXTERNAL MODULE: ../../node_modules/axios/index.js
|
|
27045
|
-
var axios = __webpack_require__(9644);
|
|
27046
|
-
var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
|
|
27047
|
-
// EXTERNAL MODULE: ../../node_modules/bignumber.js/bignumber.js
|
|
27048
|
-
var bignumber = __webpack_require__(6391);
|
|
27049
|
-
var bignumber_default = /*#__PURE__*/__webpack_require__.n(bignumber);
|
|
27050
|
-
// EXTERNAL MODULE: ../../node_modules/js-sha256/src/sha256.js
|
|
27051
|
-
var sha256 = __webpack_require__(1965);
|
|
27052
|
-
var sha256_default = /*#__PURE__*/__webpack_require__.n(sha256);
|
|
27053
27044
|
// EXTERNAL MODULE: ../../node_modules/protobufjs/light.js
|
|
27054
27045
|
var light = __webpack_require__(3448);
|
|
27055
27046
|
// EXTERNAL MODULE: ../../node_modules/long/src/long.js
|
|
@@ -27611,7 +27602,6 @@ var Enum_RequestType;
|
|
|
27611
27602
|
Enum_RequestType[Enum_RequestType["TXEXTRADATA"] = 4] = "TXEXTRADATA";
|
|
27612
27603
|
Enum_RequestType[Enum_RequestType["TXORIGINPUT"] = 5] = "TXORIGINPUT";
|
|
27613
27604
|
Enum_RequestType[Enum_RequestType["TXORIGOUTPUT"] = 6] = "TXORIGOUTPUT";
|
|
27614
|
-
Enum_RequestType[Enum_RequestType["TXPAYMENTREQ"] = 7] = "TXPAYMENTREQ";
|
|
27615
27605
|
})(Enum_RequestType || (Enum_RequestType = {}));
|
|
27616
27606
|
|
|
27617
27607
|
var CardanoDerivationType;
|
|
@@ -27687,7 +27677,6 @@ var CardanoTxSigningMode;
|
|
|
27687
27677
|
CardanoTxSigningMode[CardanoTxSigningMode["ORDINARY_TRANSACTION"] = 0] = "ORDINARY_TRANSACTION";
|
|
27688
27678
|
CardanoTxSigningMode[CardanoTxSigningMode["POOL_REGISTRATION_AS_OWNER"] = 1] = "POOL_REGISTRATION_AS_OWNER";
|
|
27689
27679
|
CardanoTxSigningMode[CardanoTxSigningMode["MULTISIG_TRANSACTION"] = 2] = "MULTISIG_TRANSACTION";
|
|
27690
|
-
CardanoTxSigningMode[CardanoTxSigningMode["PLUTUS_TRANSACTION"] = 3] = "PLUTUS_TRANSACTION";
|
|
27691
27680
|
})(CardanoTxSigningMode || (CardanoTxSigningMode = {}));
|
|
27692
27681
|
|
|
27693
27682
|
var CardanoTxWitnessType;
|
|
@@ -27750,16 +27739,10 @@ var Enum_PinMatrixRequestType;
|
|
|
27750
27739
|
Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_NewSecond"] = 3] = "PinMatrixRequestType_NewSecond";
|
|
27751
27740
|
Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_WipeCodeFirst"] = 4] = "PinMatrixRequestType_WipeCodeFirst";
|
|
27752
27741
|
Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_WipeCodeSecond"] = 5] = "PinMatrixRequestType_WipeCodeSecond";
|
|
27742
|
+
Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_BackupFirst"] = 6] = "PinMatrixRequestType_BackupFirst";
|
|
27743
|
+
Enum_PinMatrixRequestType[Enum_PinMatrixRequestType["PinMatrixRequestType_BackupSecond"] = 7] = "PinMatrixRequestType_BackupSecond";
|
|
27753
27744
|
})(Enum_PinMatrixRequestType || (Enum_PinMatrixRequestType = {}));
|
|
27754
27745
|
|
|
27755
|
-
var DebugButton;
|
|
27756
|
-
|
|
27757
|
-
(function (DebugButton) {
|
|
27758
|
-
DebugButton[DebugButton["NO"] = 0] = "NO";
|
|
27759
|
-
DebugButton[DebugButton["YES"] = 1] = "YES";
|
|
27760
|
-
DebugButton[DebugButton["INFO"] = 2] = "INFO";
|
|
27761
|
-
})(DebugButton || (DebugButton = {}));
|
|
27762
|
-
|
|
27763
27746
|
var EthereumDataType;
|
|
27764
27747
|
|
|
27765
27748
|
(function (EthereumDataType) {
|
|
@@ -27811,6 +27794,14 @@ var Enum_Capability;
|
|
|
27811
27794
|
Enum_Capability[Enum_Capability["Capability_PassphraseEntry"] = 17] = "Capability_PassphraseEntry";
|
|
27812
27795
|
})(Enum_Capability || (Enum_Capability = {}));
|
|
27813
27796
|
|
|
27797
|
+
var ExportType;
|
|
27798
|
+
|
|
27799
|
+
(function (ExportType) {
|
|
27800
|
+
ExportType[ExportType["SeedEncExportType_NO"] = 0] = "SeedEncExportType_NO";
|
|
27801
|
+
ExportType[ExportType["SeedEncExportType_YES"] = 1] = "SeedEncExportType_YES";
|
|
27802
|
+
ExportType[ExportType["MnemonicPlainExportType_YES"] = 2] = "MnemonicPlainExportType_YES";
|
|
27803
|
+
})(ExportType || (ExportType = {}));
|
|
27804
|
+
|
|
27814
27805
|
var SdProtectOperationType;
|
|
27815
27806
|
|
|
27816
27807
|
(function (SdProtectOperationType) {
|
|
@@ -27834,6 +27825,22 @@ var Enum_WordRequestType;
|
|
|
27834
27825
|
Enum_WordRequestType[Enum_WordRequestType["WordRequestType_Matrix6"] = 2] = "WordRequestType_Matrix6";
|
|
27835
27826
|
})(Enum_WordRequestType || (Enum_WordRequestType = {}));
|
|
27836
27827
|
|
|
27828
|
+
var SeedRequestType;
|
|
27829
|
+
|
|
27830
|
+
(function (SeedRequestType) {
|
|
27831
|
+
SeedRequestType[SeedRequestType["SeedRequestType_Gen"] = 0] = "SeedRequestType_Gen";
|
|
27832
|
+
SeedRequestType[SeedRequestType["SeedRequestType_EncExport"] = 1] = "SeedRequestType_EncExport";
|
|
27833
|
+
SeedRequestType[SeedRequestType["SeedRequestType_EncImport"] = 2] = "SeedRequestType_EncImport";
|
|
27834
|
+
})(SeedRequestType || (SeedRequestType = {}));
|
|
27835
|
+
|
|
27836
|
+
var WL_OperationType;
|
|
27837
|
+
|
|
27838
|
+
(function (WL_OperationType) {
|
|
27839
|
+
WL_OperationType[WL_OperationType["WL_OperationType_Add"] = 0] = "WL_OperationType_Add";
|
|
27840
|
+
WL_OperationType[WL_OperationType["WL_OperationType_Delete"] = 1] = "WL_OperationType_Delete";
|
|
27841
|
+
WL_OperationType[WL_OperationType["WL_OperationType_Inquire"] = 2] = "WL_OperationType_Inquire";
|
|
27842
|
+
})(WL_OperationType || (WL_OperationType = {}));
|
|
27843
|
+
|
|
27837
27844
|
var NEMMosaicLevy;
|
|
27838
27845
|
|
|
27839
27846
|
(function (NEMMosaicLevy) {
|
|
@@ -27903,6 +27910,13 @@ var TezosBallotType;
|
|
|
27903
27910
|
TezosBallotType[TezosBallotType["Pass"] = 2] = "Pass";
|
|
27904
27911
|
})(TezosBallotType || (TezosBallotType = {}));
|
|
27905
27912
|
|
|
27913
|
+
var CommandFlags;
|
|
27914
|
+
|
|
27915
|
+
(function (CommandFlags) {
|
|
27916
|
+
CommandFlags[CommandFlags["Default"] = 0] = "Default";
|
|
27917
|
+
CommandFlags[CommandFlags["Factory_Only"] = 1] = "Factory_Only";
|
|
27918
|
+
})(CommandFlags || (CommandFlags = {}));
|
|
27919
|
+
|
|
27906
27920
|
var messages = /*#__PURE__*/Object.freeze({
|
|
27907
27921
|
__proto__: null,
|
|
27908
27922
|
|
|
@@ -27986,10 +28000,6 @@ var messages = /*#__PURE__*/Object.freeze({
|
|
|
27986
28000
|
return Enum_PinMatrixRequestType;
|
|
27987
28001
|
},
|
|
27988
28002
|
|
|
27989
|
-
get DebugButton() {
|
|
27990
|
-
return DebugButton;
|
|
27991
|
-
},
|
|
27992
|
-
|
|
27993
28003
|
get EthereumDataType() {
|
|
27994
28004
|
return EthereumDataType;
|
|
27995
28005
|
},
|
|
@@ -28006,6 +28016,10 @@ var messages = /*#__PURE__*/Object.freeze({
|
|
|
28006
28016
|
return Enum_Capability;
|
|
28007
28017
|
},
|
|
28008
28018
|
|
|
28019
|
+
get ExportType() {
|
|
28020
|
+
return ExportType;
|
|
28021
|
+
},
|
|
28022
|
+
|
|
28009
28023
|
get SdProtectOperationType() {
|
|
28010
28024
|
return SdProtectOperationType;
|
|
28011
28025
|
},
|
|
@@ -28018,6 +28032,14 @@ var messages = /*#__PURE__*/Object.freeze({
|
|
|
28018
28032
|
return Enum_WordRequestType;
|
|
28019
28033
|
},
|
|
28020
28034
|
|
|
28035
|
+
get SeedRequestType() {
|
|
28036
|
+
return SeedRequestType;
|
|
28037
|
+
},
|
|
28038
|
+
|
|
28039
|
+
get WL_OperationType() {
|
|
28040
|
+
return WL_OperationType;
|
|
28041
|
+
},
|
|
28042
|
+
|
|
28021
28043
|
get NEMMosaicLevy() {
|
|
28022
28044
|
return NEMMosaicLevy;
|
|
28023
28045
|
},
|
|
@@ -28052,6 +28074,10 @@ var messages = /*#__PURE__*/Object.freeze({
|
|
|
28052
28074
|
|
|
28053
28075
|
get TezosBallotType() {
|
|
28054
28076
|
return TezosBallotType;
|
|
28077
|
+
},
|
|
28078
|
+
|
|
28079
|
+
get CommandFlags() {
|
|
28080
|
+
return CommandFlags;
|
|
28055
28081
|
}
|
|
28056
28082
|
|
|
28057
28083
|
});
|
|
@@ -28067,6 +28093,15 @@ var index = {
|
|
|
28067
28093
|
decodeProtocol
|
|
28068
28094
|
};
|
|
28069
28095
|
|
|
28096
|
+
// EXTERNAL MODULE: ../../node_modules/axios/index.js
|
|
28097
|
+
var axios = __webpack_require__(9644);
|
|
28098
|
+
var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
|
|
28099
|
+
// EXTERNAL MODULE: ../../node_modules/bignumber.js/bignumber.js
|
|
28100
|
+
var bignumber = __webpack_require__(6391);
|
|
28101
|
+
var bignumber_default = /*#__PURE__*/__webpack_require__.n(bignumber);
|
|
28102
|
+
// EXTERNAL MODULE: ../../node_modules/js-sha256/src/sha256.js
|
|
28103
|
+
var sha256 = __webpack_require__(1965);
|
|
28104
|
+
var sha256_default = /*#__PURE__*/__webpack_require__.n(sha256);
|
|
28070
28105
|
;// CONCATENATED MODULE: ../core/dist/index.js
|
|
28071
28106
|
|
|
28072
28107
|
|
|
@@ -28297,7 +28332,62 @@ const inject = ({
|
|
|
28297
28332
|
})),
|
|
28298
28333
|
requestWebUsbDevice: () => call({
|
|
28299
28334
|
method: 'requestWebUsbDevice'
|
|
28300
|
-
})
|
|
28335
|
+
}),
|
|
28336
|
+
tronGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28337
|
+
connectId,
|
|
28338
|
+
deviceId,
|
|
28339
|
+
method: 'tronGetAddress'
|
|
28340
|
+
})),
|
|
28341
|
+
tronSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28342
|
+
connectId,
|
|
28343
|
+
deviceId,
|
|
28344
|
+
method: 'tronSignMessage'
|
|
28345
|
+
})),
|
|
28346
|
+
tronSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28347
|
+
connectId,
|
|
28348
|
+
deviceId,
|
|
28349
|
+
method: 'tronSignTransaction'
|
|
28350
|
+
})),
|
|
28351
|
+
confluxGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28352
|
+
connectId,
|
|
28353
|
+
deviceId,
|
|
28354
|
+
method: 'confluxGetAddress'
|
|
28355
|
+
})),
|
|
28356
|
+
confluxSignMessage: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28357
|
+
connectId,
|
|
28358
|
+
deviceId,
|
|
28359
|
+
method: 'confluxSignMessage'
|
|
28360
|
+
})),
|
|
28361
|
+
confluxSignMessageCIP23: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28362
|
+
connectId,
|
|
28363
|
+
deviceId,
|
|
28364
|
+
method: 'confluxSignMessageCIP23'
|
|
28365
|
+
})),
|
|
28366
|
+
confluxSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28367
|
+
connectId,
|
|
28368
|
+
deviceId,
|
|
28369
|
+
method: 'confluxSignTransaction'
|
|
28370
|
+
})),
|
|
28371
|
+
nearGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28372
|
+
connectId,
|
|
28373
|
+
deviceId,
|
|
28374
|
+
method: 'nearGetAddress'
|
|
28375
|
+
})),
|
|
28376
|
+
nearSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28377
|
+
connectId,
|
|
28378
|
+
deviceId,
|
|
28379
|
+
method: 'nearSignTransaction'
|
|
28380
|
+
})),
|
|
28381
|
+
aptosGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28382
|
+
connectId,
|
|
28383
|
+
deviceId,
|
|
28384
|
+
method: 'aptosGetAddress'
|
|
28385
|
+
})),
|
|
28386
|
+
aptosSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), {
|
|
28387
|
+
connectId,
|
|
28388
|
+
deviceId,
|
|
28389
|
+
method: 'aptosSignTransaction'
|
|
28390
|
+
}))
|
|
28301
28391
|
};
|
|
28302
28392
|
return api;
|
|
28303
28393
|
};
|
|
@@ -29014,13 +29104,15 @@ const getDeviceTypeByDeviceId = deviceId => {
|
|
|
29014
29104
|
};
|
|
29015
29105
|
|
|
29016
29106
|
const getDeviceUUID = features => {
|
|
29107
|
+
var _a, _b;
|
|
29108
|
+
|
|
29017
29109
|
const deviceType = getDeviceType(features);
|
|
29018
29110
|
|
|
29019
29111
|
if (deviceType === 'classic') {
|
|
29020
|
-
return features.onekey_serial;
|
|
29112
|
+
return (_a = features.onekey_serial) !== null && _a !== void 0 ? _a : '';
|
|
29021
29113
|
}
|
|
29022
29114
|
|
|
29023
|
-
return features.serial_no;
|
|
29115
|
+
return (_b = features.serial_no) !== null && _b !== void 0 ? _b : '';
|
|
29024
29116
|
};
|
|
29025
29117
|
|
|
29026
29118
|
const getDeviceLabel = features => {
|
|
@@ -29107,6 +29199,61 @@ const getPassphraseState = (features, commands) => dist_awaiter(void 0, void 0,
|
|
|
29107
29199
|
});
|
|
29108
29200
|
|
|
29109
29201
|
var nested = {
|
|
29202
|
+
AptosGetAddress: {
|
|
29203
|
+
fields: {
|
|
29204
|
+
address_n: {
|
|
29205
|
+
rule: "repeated",
|
|
29206
|
+
type: "uint32",
|
|
29207
|
+
id: 1,
|
|
29208
|
+
options: {
|
|
29209
|
+
packed: false
|
|
29210
|
+
}
|
|
29211
|
+
},
|
|
29212
|
+
show_display: {
|
|
29213
|
+
type: "bool",
|
|
29214
|
+
id: 2
|
|
29215
|
+
}
|
|
29216
|
+
}
|
|
29217
|
+
},
|
|
29218
|
+
AptosAddress: {
|
|
29219
|
+
fields: {
|
|
29220
|
+
address: {
|
|
29221
|
+
type: "string",
|
|
29222
|
+
id: 1
|
|
29223
|
+
}
|
|
29224
|
+
}
|
|
29225
|
+
},
|
|
29226
|
+
AptosSignTx: {
|
|
29227
|
+
fields: {
|
|
29228
|
+
address_n: {
|
|
29229
|
+
rule: "repeated",
|
|
29230
|
+
type: "uint32",
|
|
29231
|
+
id: 1,
|
|
29232
|
+
options: {
|
|
29233
|
+
packed: false
|
|
29234
|
+
}
|
|
29235
|
+
},
|
|
29236
|
+
raw_tx: {
|
|
29237
|
+
rule: "required",
|
|
29238
|
+
type: "bytes",
|
|
29239
|
+
id: 2
|
|
29240
|
+
}
|
|
29241
|
+
}
|
|
29242
|
+
},
|
|
29243
|
+
AptosSignedTx: {
|
|
29244
|
+
fields: {
|
|
29245
|
+
public_key: {
|
|
29246
|
+
rule: "required",
|
|
29247
|
+
type: "bytes",
|
|
29248
|
+
id: 1
|
|
29249
|
+
},
|
|
29250
|
+
signature: {
|
|
29251
|
+
rule: "required",
|
|
29252
|
+
type: "bytes",
|
|
29253
|
+
id: 2
|
|
29254
|
+
}
|
|
29255
|
+
}
|
|
29256
|
+
},
|
|
29110
29257
|
BinanceGetAddress: {
|
|
29111
29258
|
fields: {
|
|
29112
29259
|
address_n: {
|
|
@@ -31723,7 +31870,7 @@ var nested = {
|
|
|
31723
31870
|
BixinPinInputOnDevice: {
|
|
31724
31871
|
fields: {}
|
|
31725
31872
|
},
|
|
31726
|
-
|
|
31873
|
+
ConfluxGetAddress: {
|
|
31727
31874
|
fields: {
|
|
31728
31875
|
address_n: {
|
|
31729
31876
|
rule: "repeated",
|
|
@@ -31733,130 +31880,286 @@ var nested = {
|
|
|
31733
31880
|
packed: false
|
|
31734
31881
|
}
|
|
31735
31882
|
},
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
type: "string",
|
|
31883
|
+
show_display: {
|
|
31884
|
+
type: "bool",
|
|
31739
31885
|
id: 2
|
|
31740
31886
|
},
|
|
31741
|
-
|
|
31742
|
-
|
|
31743
|
-
type: "bytes",
|
|
31887
|
+
chain_id: {
|
|
31888
|
+
type: "uint32",
|
|
31744
31889
|
id: 3
|
|
31745
|
-
},
|
|
31746
|
-
encrypt: {
|
|
31747
|
-
type: "bool",
|
|
31748
|
-
id: 4
|
|
31749
|
-
},
|
|
31750
|
-
ask_on_encrypt: {
|
|
31751
|
-
type: "bool",
|
|
31752
|
-
id: 5
|
|
31753
|
-
},
|
|
31754
|
-
ask_on_decrypt: {
|
|
31755
|
-
type: "bool",
|
|
31756
|
-
id: 6
|
|
31757
|
-
},
|
|
31758
|
-
iv: {
|
|
31759
|
-
type: "bytes",
|
|
31760
|
-
id: 7
|
|
31761
31890
|
}
|
|
31762
31891
|
}
|
|
31763
31892
|
},
|
|
31764
|
-
|
|
31893
|
+
ConfluxAddress: {
|
|
31765
31894
|
fields: {
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
type: "bytes",
|
|
31895
|
+
address: {
|
|
31896
|
+
type: "string",
|
|
31769
31897
|
id: 1
|
|
31770
31898
|
}
|
|
31771
31899
|
}
|
|
31772
31900
|
},
|
|
31773
|
-
|
|
31901
|
+
ConfluxSignTx: {
|
|
31774
31902
|
fields: {
|
|
31775
|
-
|
|
31776
|
-
|
|
31777
|
-
|
|
31903
|
+
address_n: {
|
|
31904
|
+
rule: "repeated",
|
|
31905
|
+
type: "uint32",
|
|
31906
|
+
id: 1,
|
|
31907
|
+
options: {
|
|
31908
|
+
packed: false
|
|
31909
|
+
}
|
|
31778
31910
|
},
|
|
31779
|
-
|
|
31780
|
-
type: "
|
|
31911
|
+
nonce: {
|
|
31912
|
+
type: "bytes",
|
|
31781
31913
|
id: 2
|
|
31782
31914
|
},
|
|
31783
|
-
|
|
31784
|
-
type: "
|
|
31915
|
+
gas_price: {
|
|
31916
|
+
type: "bytes",
|
|
31785
31917
|
id: 3
|
|
31786
31918
|
},
|
|
31787
|
-
|
|
31788
|
-
type: "
|
|
31919
|
+
gas_limit: {
|
|
31920
|
+
type: "bytes",
|
|
31789
31921
|
id: 4
|
|
31790
31922
|
},
|
|
31791
|
-
|
|
31923
|
+
to: {
|
|
31792
31924
|
type: "string",
|
|
31793
31925
|
id: 5
|
|
31794
31926
|
},
|
|
31795
|
-
|
|
31796
|
-
type: "
|
|
31797
|
-
id: 6
|
|
31798
|
-
options: {
|
|
31799
|
-
"default": 0
|
|
31800
|
-
}
|
|
31801
|
-
}
|
|
31802
|
-
}
|
|
31803
|
-
},
|
|
31804
|
-
SignIdentity: {
|
|
31805
|
-
fields: {
|
|
31806
|
-
identity: {
|
|
31807
|
-
rule: "required",
|
|
31808
|
-
type: "IdentityType",
|
|
31809
|
-
id: 1
|
|
31927
|
+
value: {
|
|
31928
|
+
type: "bytes",
|
|
31929
|
+
id: 6
|
|
31810
31930
|
},
|
|
31811
|
-
|
|
31931
|
+
epoch_height: {
|
|
31812
31932
|
type: "bytes",
|
|
31813
|
-
id:
|
|
31814
|
-
options: {
|
|
31815
|
-
"default": ""
|
|
31816
|
-
}
|
|
31933
|
+
id: 7
|
|
31817
31934
|
},
|
|
31818
|
-
|
|
31819
|
-
type: "
|
|
31820
|
-
id:
|
|
31821
|
-
options: {
|
|
31822
|
-
"default": ""
|
|
31823
|
-
}
|
|
31935
|
+
storage_limit: {
|
|
31936
|
+
type: "bytes",
|
|
31937
|
+
id: 8
|
|
31824
31938
|
},
|
|
31825
|
-
|
|
31826
|
-
type: "
|
|
31827
|
-
id:
|
|
31939
|
+
data_initial_chunk: {
|
|
31940
|
+
type: "bytes",
|
|
31941
|
+
id: 9
|
|
31942
|
+
},
|
|
31943
|
+
data_length: {
|
|
31944
|
+
type: "uint32",
|
|
31945
|
+
id: 10
|
|
31946
|
+
},
|
|
31947
|
+
chain_id: {
|
|
31948
|
+
type: "uint32",
|
|
31949
|
+
id: 11
|
|
31828
31950
|
}
|
|
31829
31951
|
}
|
|
31830
31952
|
},
|
|
31831
|
-
|
|
31953
|
+
ConfluxTxRequest: {
|
|
31832
31954
|
fields: {
|
|
31833
|
-
|
|
31834
|
-
type: "
|
|
31955
|
+
data_length: {
|
|
31956
|
+
type: "uint32",
|
|
31835
31957
|
id: 1
|
|
31836
31958
|
},
|
|
31837
|
-
|
|
31838
|
-
|
|
31839
|
-
type: "bytes",
|
|
31959
|
+
signature_v: {
|
|
31960
|
+
type: "uint32",
|
|
31840
31961
|
id: 2
|
|
31841
31962
|
},
|
|
31842
|
-
|
|
31843
|
-
rule: "required",
|
|
31963
|
+
signature_r: {
|
|
31844
31964
|
type: "bytes",
|
|
31845
31965
|
id: 3
|
|
31966
|
+
},
|
|
31967
|
+
signature_s: {
|
|
31968
|
+
type: "bytes",
|
|
31969
|
+
id: 4
|
|
31846
31970
|
}
|
|
31847
31971
|
}
|
|
31848
31972
|
},
|
|
31849
|
-
|
|
31973
|
+
ConfluxTxAck: {
|
|
31850
31974
|
fields: {
|
|
31851
|
-
|
|
31852
|
-
rule: "required",
|
|
31853
|
-
type: "IdentityType",
|
|
31854
|
-
id: 1
|
|
31855
|
-
},
|
|
31856
|
-
peer_public_key: {
|
|
31857
|
-
rule: "required",
|
|
31975
|
+
data_chunk: {
|
|
31858
31976
|
type: "bytes",
|
|
31859
|
-
id:
|
|
31977
|
+
id: 1
|
|
31978
|
+
}
|
|
31979
|
+
}
|
|
31980
|
+
},
|
|
31981
|
+
ConfluxSignMessage: {
|
|
31982
|
+
fields: {
|
|
31983
|
+
address_n: {
|
|
31984
|
+
rule: "repeated",
|
|
31985
|
+
type: "uint32",
|
|
31986
|
+
id: 1,
|
|
31987
|
+
options: {
|
|
31988
|
+
packed: false
|
|
31989
|
+
}
|
|
31990
|
+
},
|
|
31991
|
+
message: {
|
|
31992
|
+
type: "bytes",
|
|
31993
|
+
id: 2
|
|
31994
|
+
}
|
|
31995
|
+
}
|
|
31996
|
+
},
|
|
31997
|
+
ConfluxMessageSignature: {
|
|
31998
|
+
fields: {
|
|
31999
|
+
signature: {
|
|
32000
|
+
type: "bytes",
|
|
32001
|
+
id: 2
|
|
32002
|
+
},
|
|
32003
|
+
address: {
|
|
32004
|
+
type: "string",
|
|
32005
|
+
id: 3
|
|
32006
|
+
}
|
|
32007
|
+
}
|
|
32008
|
+
},
|
|
32009
|
+
ConfluxSignMessageCIP23: {
|
|
32010
|
+
fields: {
|
|
32011
|
+
address_n: {
|
|
32012
|
+
rule: "repeated",
|
|
32013
|
+
type: "uint32",
|
|
32014
|
+
id: 1,
|
|
32015
|
+
options: {
|
|
32016
|
+
packed: false
|
|
32017
|
+
}
|
|
32018
|
+
},
|
|
32019
|
+
domain_hash: {
|
|
32020
|
+
type: "bytes",
|
|
32021
|
+
id: 2
|
|
32022
|
+
},
|
|
32023
|
+
message_hash: {
|
|
32024
|
+
type: "bytes",
|
|
32025
|
+
id: 3
|
|
32026
|
+
}
|
|
32027
|
+
}
|
|
32028
|
+
},
|
|
32029
|
+
CipherKeyValue: {
|
|
32030
|
+
fields: {
|
|
32031
|
+
address_n: {
|
|
32032
|
+
rule: "repeated",
|
|
32033
|
+
type: "uint32",
|
|
32034
|
+
id: 1,
|
|
32035
|
+
options: {
|
|
32036
|
+
packed: false
|
|
32037
|
+
}
|
|
32038
|
+
},
|
|
32039
|
+
key: {
|
|
32040
|
+
rule: "required",
|
|
32041
|
+
type: "string",
|
|
32042
|
+
id: 2
|
|
32043
|
+
},
|
|
32044
|
+
value: {
|
|
32045
|
+
rule: "required",
|
|
32046
|
+
type: "bytes",
|
|
32047
|
+
id: 3
|
|
32048
|
+
},
|
|
32049
|
+
encrypt: {
|
|
32050
|
+
type: "bool",
|
|
32051
|
+
id: 4
|
|
32052
|
+
},
|
|
32053
|
+
ask_on_encrypt: {
|
|
32054
|
+
type: "bool",
|
|
32055
|
+
id: 5
|
|
32056
|
+
},
|
|
32057
|
+
ask_on_decrypt: {
|
|
32058
|
+
type: "bool",
|
|
32059
|
+
id: 6
|
|
32060
|
+
},
|
|
32061
|
+
iv: {
|
|
32062
|
+
type: "bytes",
|
|
32063
|
+
id: 7
|
|
32064
|
+
}
|
|
32065
|
+
}
|
|
32066
|
+
},
|
|
32067
|
+
CipheredKeyValue: {
|
|
32068
|
+
fields: {
|
|
32069
|
+
value: {
|
|
32070
|
+
rule: "required",
|
|
32071
|
+
type: "bytes",
|
|
32072
|
+
id: 1
|
|
32073
|
+
}
|
|
32074
|
+
}
|
|
32075
|
+
},
|
|
32076
|
+
IdentityType: {
|
|
32077
|
+
fields: {
|
|
32078
|
+
proto: {
|
|
32079
|
+
type: "string",
|
|
32080
|
+
id: 1
|
|
32081
|
+
},
|
|
32082
|
+
user: {
|
|
32083
|
+
type: "string",
|
|
32084
|
+
id: 2
|
|
32085
|
+
},
|
|
32086
|
+
host: {
|
|
32087
|
+
type: "string",
|
|
32088
|
+
id: 3
|
|
32089
|
+
},
|
|
32090
|
+
port: {
|
|
32091
|
+
type: "string",
|
|
32092
|
+
id: 4
|
|
32093
|
+
},
|
|
32094
|
+
path: {
|
|
32095
|
+
type: "string",
|
|
32096
|
+
id: 5
|
|
32097
|
+
},
|
|
32098
|
+
index: {
|
|
32099
|
+
type: "uint32",
|
|
32100
|
+
id: 6,
|
|
32101
|
+
options: {
|
|
32102
|
+
"default": 0
|
|
32103
|
+
}
|
|
32104
|
+
}
|
|
32105
|
+
}
|
|
32106
|
+
},
|
|
32107
|
+
SignIdentity: {
|
|
32108
|
+
fields: {
|
|
32109
|
+
identity: {
|
|
32110
|
+
rule: "required",
|
|
32111
|
+
type: "IdentityType",
|
|
32112
|
+
id: 1
|
|
32113
|
+
},
|
|
32114
|
+
challenge_hidden: {
|
|
32115
|
+
type: "bytes",
|
|
32116
|
+
id: 2,
|
|
32117
|
+
options: {
|
|
32118
|
+
"default": ""
|
|
32119
|
+
}
|
|
32120
|
+
},
|
|
32121
|
+
challenge_visual: {
|
|
32122
|
+
type: "string",
|
|
32123
|
+
id: 3,
|
|
32124
|
+
options: {
|
|
32125
|
+
"default": ""
|
|
32126
|
+
}
|
|
32127
|
+
},
|
|
32128
|
+
ecdsa_curve_name: {
|
|
32129
|
+
type: "string",
|
|
32130
|
+
id: 4
|
|
32131
|
+
}
|
|
32132
|
+
}
|
|
32133
|
+
},
|
|
32134
|
+
SignedIdentity: {
|
|
32135
|
+
fields: {
|
|
32136
|
+
address: {
|
|
32137
|
+
type: "string",
|
|
32138
|
+
id: 1
|
|
32139
|
+
},
|
|
32140
|
+
public_key: {
|
|
32141
|
+
rule: "required",
|
|
32142
|
+
type: "bytes",
|
|
32143
|
+
id: 2
|
|
32144
|
+
},
|
|
32145
|
+
signature: {
|
|
32146
|
+
rule: "required",
|
|
32147
|
+
type: "bytes",
|
|
32148
|
+
id: 3
|
|
32149
|
+
}
|
|
32150
|
+
}
|
|
32151
|
+
},
|
|
32152
|
+
GetECDHSessionKey: {
|
|
32153
|
+
fields: {
|
|
32154
|
+
identity: {
|
|
32155
|
+
rule: "required",
|
|
32156
|
+
type: "IdentityType",
|
|
32157
|
+
id: 1
|
|
32158
|
+
},
|
|
32159
|
+
peer_public_key: {
|
|
32160
|
+
rule: "required",
|
|
32161
|
+
type: "bytes",
|
|
32162
|
+
id: 2
|
|
31860
32163
|
},
|
|
31861
32164
|
ecdsa_curve_name: {
|
|
31862
32165
|
type: "string",
|
|
@@ -33407,6 +33710,10 @@ var nested = {
|
|
|
33407
33710
|
coin_switch: {
|
|
33408
33711
|
type: "uint32",
|
|
33409
33712
|
id: 517
|
|
33713
|
+
},
|
|
33714
|
+
build_id: {
|
|
33715
|
+
type: "string",
|
|
33716
|
+
id: 518
|
|
33410
33717
|
}
|
|
33411
33718
|
},
|
|
33412
33719
|
nested: {
|
|
@@ -35095,6 +35402,55 @@ var nested = {
|
|
|
35095
35402
|
}
|
|
35096
35403
|
}
|
|
35097
35404
|
},
|
|
35405
|
+
NearGetAddress: {
|
|
35406
|
+
fields: {
|
|
35407
|
+
address_n: {
|
|
35408
|
+
rule: "repeated",
|
|
35409
|
+
type: "uint32",
|
|
35410
|
+
id: 1,
|
|
35411
|
+
options: {
|
|
35412
|
+
packed: false
|
|
35413
|
+
}
|
|
35414
|
+
},
|
|
35415
|
+
show_display: {
|
|
35416
|
+
type: "bool",
|
|
35417
|
+
id: 2
|
|
35418
|
+
}
|
|
35419
|
+
}
|
|
35420
|
+
},
|
|
35421
|
+
NearAddress: {
|
|
35422
|
+
fields: {
|
|
35423
|
+
address: {
|
|
35424
|
+
type: "string",
|
|
35425
|
+
id: 1
|
|
35426
|
+
}
|
|
35427
|
+
}
|
|
35428
|
+
},
|
|
35429
|
+
NearSignTx: {
|
|
35430
|
+
fields: {
|
|
35431
|
+
address_n: {
|
|
35432
|
+
rule: "repeated",
|
|
35433
|
+
type: "uint32",
|
|
35434
|
+
id: 1,
|
|
35435
|
+
options: {
|
|
35436
|
+
packed: false
|
|
35437
|
+
}
|
|
35438
|
+
},
|
|
35439
|
+
raw_tx: {
|
|
35440
|
+
type: "bytes",
|
|
35441
|
+
id: 2
|
|
35442
|
+
}
|
|
35443
|
+
}
|
|
35444
|
+
},
|
|
35445
|
+
NearSignedTx: {
|
|
35446
|
+
fields: {
|
|
35447
|
+
signature: {
|
|
35448
|
+
rule: "required",
|
|
35449
|
+
type: "bytes",
|
|
35450
|
+
id: 1
|
|
35451
|
+
}
|
|
35452
|
+
}
|
|
35453
|
+
},
|
|
35098
35454
|
NEMGetAddress: {
|
|
35099
35455
|
fields: {
|
|
35100
35456
|
address_n: {
|
|
@@ -35611,6 +35967,7 @@ var nested = {
|
|
|
35611
35967
|
}
|
|
35612
35968
|
},
|
|
35613
35969
|
raw_tx: {
|
|
35970
|
+
rule: "required",
|
|
35614
35971
|
type: "bytes",
|
|
35615
35972
|
id: 2
|
|
35616
35973
|
}
|
|
@@ -36647,28 +37004,193 @@ var nested = {
|
|
|
36647
37004
|
}
|
|
36648
37005
|
}
|
|
36649
37006
|
},
|
|
36650
|
-
|
|
36651
|
-
fields: {}
|
|
36652
|
-
},
|
|
36653
|
-
WebAuthnAddResidentCredential: {
|
|
37007
|
+
TronGetAddress: {
|
|
36654
37008
|
fields: {
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
37009
|
+
address_n: {
|
|
37010
|
+
rule: "repeated",
|
|
37011
|
+
type: "uint32",
|
|
37012
|
+
id: 1,
|
|
37013
|
+
options: {
|
|
37014
|
+
packed: false
|
|
37015
|
+
}
|
|
37016
|
+
},
|
|
37017
|
+
show_display: {
|
|
37018
|
+
type: "bool",
|
|
37019
|
+
id: 2
|
|
36658
37020
|
}
|
|
36659
37021
|
}
|
|
36660
37022
|
},
|
|
36661
|
-
|
|
37023
|
+
TronAddress: {
|
|
36662
37024
|
fields: {
|
|
36663
|
-
|
|
36664
|
-
type: "
|
|
37025
|
+
address: {
|
|
37026
|
+
type: "string",
|
|
36665
37027
|
id: 1
|
|
36666
37028
|
}
|
|
36667
37029
|
}
|
|
36668
37030
|
},
|
|
36669
|
-
|
|
37031
|
+
TronSignTx: {
|
|
36670
37032
|
fields: {
|
|
36671
|
-
|
|
37033
|
+
address_n: {
|
|
37034
|
+
rule: "repeated",
|
|
37035
|
+
type: "uint32",
|
|
37036
|
+
id: 1,
|
|
37037
|
+
options: {
|
|
37038
|
+
packed: false
|
|
37039
|
+
}
|
|
37040
|
+
},
|
|
37041
|
+
ref_block_bytes: {
|
|
37042
|
+
rule: "required",
|
|
37043
|
+
type: "bytes",
|
|
37044
|
+
id: 2
|
|
37045
|
+
},
|
|
37046
|
+
ref_block_hash: {
|
|
37047
|
+
rule: "required",
|
|
37048
|
+
type: "bytes",
|
|
37049
|
+
id: 3
|
|
37050
|
+
},
|
|
37051
|
+
expiration: {
|
|
37052
|
+
rule: "required",
|
|
37053
|
+
type: "uint64",
|
|
37054
|
+
id: 4
|
|
37055
|
+
},
|
|
37056
|
+
data: {
|
|
37057
|
+
type: "string",
|
|
37058
|
+
id: 5
|
|
37059
|
+
},
|
|
37060
|
+
contract: {
|
|
37061
|
+
rule: "required",
|
|
37062
|
+
type: "TronContract",
|
|
37063
|
+
id: 6
|
|
37064
|
+
},
|
|
37065
|
+
timestamp: {
|
|
37066
|
+
rule: "required",
|
|
37067
|
+
type: "uint64",
|
|
37068
|
+
id: 7
|
|
37069
|
+
},
|
|
37070
|
+
fee_limit: {
|
|
37071
|
+
type: "uint64",
|
|
37072
|
+
id: 8
|
|
37073
|
+
}
|
|
37074
|
+
},
|
|
37075
|
+
nested: {
|
|
37076
|
+
TronContract: {
|
|
37077
|
+
fields: {
|
|
37078
|
+
transfer_contract: {
|
|
37079
|
+
type: "TronTransferContract",
|
|
37080
|
+
id: 2
|
|
37081
|
+
},
|
|
37082
|
+
trigger_smart_contract: {
|
|
37083
|
+
type: "TronTriggerSmartContract",
|
|
37084
|
+
id: 31
|
|
37085
|
+
}
|
|
37086
|
+
},
|
|
37087
|
+
nested: {
|
|
37088
|
+
TronTransferContract: {
|
|
37089
|
+
fields: {
|
|
37090
|
+
to_address: {
|
|
37091
|
+
type: "string",
|
|
37092
|
+
id: 2
|
|
37093
|
+
},
|
|
37094
|
+
amount: {
|
|
37095
|
+
type: "uint64",
|
|
37096
|
+
id: 3
|
|
37097
|
+
}
|
|
37098
|
+
}
|
|
37099
|
+
},
|
|
37100
|
+
TronTriggerSmartContract: {
|
|
37101
|
+
fields: {
|
|
37102
|
+
contract_address: {
|
|
37103
|
+
type: "string",
|
|
37104
|
+
id: 2
|
|
37105
|
+
},
|
|
37106
|
+
call_value: {
|
|
37107
|
+
type: "uint64",
|
|
37108
|
+
id: 3
|
|
37109
|
+
},
|
|
37110
|
+
data: {
|
|
37111
|
+
type: "bytes",
|
|
37112
|
+
id: 4
|
|
37113
|
+
},
|
|
37114
|
+
call_token_value: {
|
|
37115
|
+
type: "uint64",
|
|
37116
|
+
id: 5
|
|
37117
|
+
},
|
|
37118
|
+
asset_id: {
|
|
37119
|
+
type: "uint64",
|
|
37120
|
+
id: 6
|
|
37121
|
+
}
|
|
37122
|
+
}
|
|
37123
|
+
}
|
|
37124
|
+
}
|
|
37125
|
+
}
|
|
37126
|
+
}
|
|
37127
|
+
},
|
|
37128
|
+
TronSignedTx: {
|
|
37129
|
+
fields: {
|
|
37130
|
+
signature: {
|
|
37131
|
+
rule: "required",
|
|
37132
|
+
type: "bytes",
|
|
37133
|
+
id: 1
|
|
37134
|
+
},
|
|
37135
|
+
serialized_tx: {
|
|
37136
|
+
type: "bytes",
|
|
37137
|
+
id: 2
|
|
37138
|
+
}
|
|
37139
|
+
}
|
|
37140
|
+
},
|
|
37141
|
+
TronSignMessage: {
|
|
37142
|
+
fields: {
|
|
37143
|
+
address_n: {
|
|
37144
|
+
rule: "repeated",
|
|
37145
|
+
type: "uint32",
|
|
37146
|
+
id: 1,
|
|
37147
|
+
options: {
|
|
37148
|
+
packed: false
|
|
37149
|
+
}
|
|
37150
|
+
},
|
|
37151
|
+
message: {
|
|
37152
|
+
rule: "required",
|
|
37153
|
+
type: "bytes",
|
|
37154
|
+
id: 2
|
|
37155
|
+
}
|
|
37156
|
+
}
|
|
37157
|
+
},
|
|
37158
|
+
TronMessageSignature: {
|
|
37159
|
+
fields: {
|
|
37160
|
+
address: {
|
|
37161
|
+
rule: "required",
|
|
37162
|
+
type: "bytes",
|
|
37163
|
+
id: 1
|
|
37164
|
+
},
|
|
37165
|
+
signature: {
|
|
37166
|
+
rule: "required",
|
|
37167
|
+
type: "bytes",
|
|
37168
|
+
id: 2
|
|
37169
|
+
}
|
|
37170
|
+
}
|
|
37171
|
+
},
|
|
37172
|
+
WebAuthnListResidentCredentials: {
|
|
37173
|
+
fields: {}
|
|
37174
|
+
},
|
|
37175
|
+
WebAuthnAddResidentCredential: {
|
|
37176
|
+
fields: {
|
|
37177
|
+
credential_id: {
|
|
37178
|
+
type: "bytes",
|
|
37179
|
+
id: 1
|
|
37180
|
+
}
|
|
37181
|
+
}
|
|
37182
|
+
},
|
|
37183
|
+
WebAuthnRemoveResidentCredential: {
|
|
37184
|
+
fields: {
|
|
37185
|
+
index: {
|
|
37186
|
+
type: "uint32",
|
|
37187
|
+
id: 1
|
|
37188
|
+
}
|
|
37189
|
+
}
|
|
37190
|
+
},
|
|
37191
|
+
WebAuthnCredentials: {
|
|
37192
|
+
fields: {
|
|
37193
|
+
credentials: {
|
|
36672
37194
|
rule: "repeated",
|
|
36673
37195
|
type: "WebAuthnCredential",
|
|
36674
37196
|
id: 1
|
|
@@ -37041,6 +37563,20 @@ var nested = {
|
|
|
37041
37563
|
MessageType_StarcoinSignMessage: 10306,
|
|
37042
37564
|
MessageType_StarcoinMessageSignature: 10307,
|
|
37043
37565
|
MessageType_StarcoinVerifyMessage: 10308,
|
|
37566
|
+
MessageType_ConfluxGetAddress: 10401,
|
|
37567
|
+
MessageType_ConfluxAddress: 10402,
|
|
37568
|
+
MessageType_ConfluxSignTx: 10403,
|
|
37569
|
+
MessageType_ConfluxTxRequest: 10404,
|
|
37570
|
+
MessageType_ConfluxTxAck: 10405,
|
|
37571
|
+
MessageType_ConfluxSignMessage: 10406,
|
|
37572
|
+
MessageType_ConfluxSignMessageCIP23: 10407,
|
|
37573
|
+
MessageType_ConfluxMessageSignature: 10408,
|
|
37574
|
+
MessageType_ConfluxVerifyMessage: 10409,
|
|
37575
|
+
MessageType_ConfluxVerifyMessageCIP23: 10410,
|
|
37576
|
+
MessageType_AptosGetAddress: 10600,
|
|
37577
|
+
MessageType_AptosAddress: 10601,
|
|
37578
|
+
MessageType_AptosSignTx: 10602,
|
|
37579
|
+
MessageType_AptosSignedTx: 10603,
|
|
37044
37580
|
MessageType_WebAuthnListResidentCredentials: 800,
|
|
37045
37581
|
MessageType_WebAuthnCredentials: 801,
|
|
37046
37582
|
MessageType_WebAuthnAddResidentCredential: 802,
|
|
@@ -37064,6 +37600,16 @@ var nested = {
|
|
|
37064
37600
|
MessageType_EthereumSignMessageEIP712: 10200,
|
|
37065
37601
|
MessageType_GetPublicKeyMultiple: 10210,
|
|
37066
37602
|
MessageType_PublicKeyMultiple: 10211,
|
|
37603
|
+
MessageType_TronGetAddress: 10501,
|
|
37604
|
+
MessageType_TronAddress: 10502,
|
|
37605
|
+
MessageType_TronSignTx: 10503,
|
|
37606
|
+
MessageType_TronSignedTx: 10504,
|
|
37607
|
+
MessageType_TronSignMessage: 10505,
|
|
37608
|
+
MessageType_TronMessageSignature: 10506,
|
|
37609
|
+
MessageType_NearGetAddress: 10701,
|
|
37610
|
+
MessageType_NearAddress: 10702,
|
|
37611
|
+
MessageType_NearSignTx: 10703,
|
|
37612
|
+
MessageType_NearSignedTx: 10704,
|
|
37067
37613
|
MessageType_DeviceInfoSettings: 10001,
|
|
37068
37614
|
MessageType_GetDeviceInfo: 10002,
|
|
37069
37615
|
MessageType_DeviceInfo: 10003,
|
|
@@ -38840,23 +39386,23 @@ class DeviceCommands {
|
|
|
38840
39386
|
} = res.message;
|
|
38841
39387
|
let error = null;
|
|
38842
39388
|
|
|
38843
|
-
if (code ===
|
|
39389
|
+
if (code === FailureType.Failure_FirmwareError && !message) {
|
|
38844
39390
|
error = HardwareError$1.TypedError(dist_HardwareErrorCode.FirmwareError);
|
|
38845
39391
|
}
|
|
38846
39392
|
|
|
38847
|
-
if (code ===
|
|
39393
|
+
if (code === FailureType.Failure_ActionCancelled) {
|
|
38848
39394
|
error = HardwareError$1.TypedError(dist_HardwareErrorCode.ActionCancelled);
|
|
38849
39395
|
}
|
|
38850
39396
|
|
|
38851
|
-
if (code ===
|
|
39397
|
+
if (code === FailureType.Failure_PinInvalid) {
|
|
38852
39398
|
error = HardwareError$1.TypedError(dist_HardwareErrorCode.PinInvalid, message);
|
|
38853
39399
|
}
|
|
38854
39400
|
|
|
38855
|
-
if (code ===
|
|
39401
|
+
if (code === FailureType.Failure_PinCancelled) {
|
|
38856
39402
|
error = HardwareError$1.TypedError(dist_HardwareErrorCode.PinCancelled);
|
|
38857
39403
|
}
|
|
38858
39404
|
|
|
38859
|
-
if (code ===
|
|
39405
|
+
if (code === FailureType.Failure_DataError && message === 'Please confirm the BlindSign enabled') {
|
|
38860
39406
|
error = HardwareError$1.TypedError(dist_HardwareErrorCode.BlindSignDisabled);
|
|
38861
39407
|
}
|
|
38862
39408
|
|
|
@@ -38945,7 +39491,7 @@ const UI_REQUEST = {
|
|
|
38945
39491
|
FIRMWARE_NOT_INSTALLED: 'ui-device_firmware_not_installed',
|
|
38946
39492
|
NOT_USE_ONEKEY_DEVICE: 'ui-device_please_use_onekey_device'
|
|
38947
39493
|
};
|
|
38948
|
-
const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${"0.1.
|
|
39494
|
+
const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${"0.1.44"}/`;
|
|
38949
39495
|
const DEFAULT_PRIORITY = 2;
|
|
38950
39496
|
const initialSettings = {
|
|
38951
39497
|
configSrc: './data/config.json',
|
|
@@ -39713,82 +40259,224 @@ class GetFeatures extends BaseMethod {
|
|
|
39713
40259
|
|
|
39714
40260
|
}
|
|
39715
40261
|
|
|
39716
|
-
|
|
40262
|
+
class GetPassphraseState extends BaseMethod {
|
|
40263
|
+
init() {
|
|
40264
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
40265
|
+
this.useDevicePassphraseState = false;
|
|
40266
|
+
}
|
|
39717
40267
|
|
|
39718
|
-
|
|
40268
|
+
run() {
|
|
40269
|
+
var _a, _b;
|
|
39719
40270
|
|
|
39720
|
-
|
|
40271
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40272
|
+
if (!this.device.features) return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.DeviceInitializeFailed));
|
|
40273
|
+
let {
|
|
40274
|
+
features
|
|
40275
|
+
} = this.device;
|
|
40276
|
+
const locked = ((_b = (_a = this.device) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.unlocked) === true;
|
|
40277
|
+
const passphraseState = yield getPassphraseState(this.device.features, this.device.commands);
|
|
40278
|
+
const isModeT = getDeviceType(features) === 'touch' || getDeviceType(features) === 'pro';
|
|
39721
40279
|
|
|
39722
|
-
|
|
39723
|
-
|
|
39724
|
-
|
|
39725
|
-
|
|
40280
|
+
if (isModeT && locked) {
|
|
40281
|
+
const {
|
|
40282
|
+
message
|
|
40283
|
+
} = yield this.device.commands.typedCall('GetFeatures', 'Features', {});
|
|
40284
|
+
features = message;
|
|
40285
|
+
}
|
|
39726
40286
|
|
|
39727
|
-
|
|
39728
|
-
|
|
40287
|
+
if (features && features.passphrase_protection === true) {
|
|
40288
|
+
return Promise.resolve(passphraseState);
|
|
40289
|
+
}
|
|
40290
|
+
|
|
40291
|
+
return Promise.resolve(undefined);
|
|
40292
|
+
});
|
|
39729
40293
|
}
|
|
39730
40294
|
|
|
39731
|
-
|
|
39732
|
-
};
|
|
40295
|
+
}
|
|
39733
40296
|
|
|
39734
|
-
|
|
39735
|
-
|
|
39736
|
-
|
|
40297
|
+
class CheckBridgeStatus$1 extends BaseMethod {
|
|
40298
|
+
init() {
|
|
40299
|
+
this.useDevice = false;
|
|
40300
|
+
this.useDevicePassphraseState = false;
|
|
39737
40301
|
}
|
|
39738
40302
|
|
|
39739
|
-
|
|
39740
|
-
|
|
40303
|
+
run() {
|
|
40304
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40305
|
+
const logs = getLog();
|
|
40306
|
+
return Promise.resolve(logs);
|
|
40307
|
+
});
|
|
40308
|
+
}
|
|
39741
40309
|
|
|
39742
|
-
|
|
40310
|
+
}
|
|
39743
40311
|
|
|
39744
|
-
|
|
39745
|
-
|
|
39746
|
-
|
|
40312
|
+
class CheckFirmwareRelease extends BaseMethod {
|
|
40313
|
+
init() {
|
|
40314
|
+
this.useDevicePassphraseState = false;
|
|
40315
|
+
}
|
|
39747
40316
|
|
|
39748
|
-
|
|
39749
|
-
|
|
40317
|
+
run() {
|
|
40318
|
+
if (this.device.features) {
|
|
40319
|
+
const releaseInfo = getFirmwareReleaseInfo(this.device.features);
|
|
40320
|
+
return Promise.resolve(releaseInfo);
|
|
39750
40321
|
}
|
|
39751
40322
|
|
|
39752
|
-
return
|
|
40323
|
+
return Promise.resolve(null);
|
|
39753
40324
|
}
|
|
39754
40325
|
|
|
39755
|
-
|
|
39756
|
-
return value.map(formatAnyHex);
|
|
39757
|
-
}
|
|
40326
|
+
}
|
|
39758
40327
|
|
|
39759
|
-
|
|
39760
|
-
|
|
40328
|
+
class CheckBLEFirmwareRelease extends BaseMethod {
|
|
40329
|
+
init() {
|
|
40330
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
40331
|
+
this.checkDeviceId = true;
|
|
40332
|
+
this.useDevicePassphraseState = false;
|
|
39761
40333
|
}
|
|
39762
40334
|
|
|
39763
|
-
|
|
39764
|
-
|
|
39765
|
-
|
|
39766
|
-
|
|
39767
|
-
|
|
39768
|
-
const validateParams = (values, fields) => {
|
|
39769
|
-
fields.forEach(field => {
|
|
39770
|
-
const existsProp = Object.prototype.hasOwnProperty.call(values, field.name);
|
|
39771
|
-
|
|
39772
|
-
if (!existsProp && field.required) {
|
|
39773
|
-
throw invalidParameter(`Missing required parameter: ${field.name}`);
|
|
40335
|
+
run() {
|
|
40336
|
+
if (this.device.features) {
|
|
40337
|
+
const releaseInfo = getBleFirmwareReleaseInfo(this.device.features);
|
|
40338
|
+
return Promise.resolve(releaseInfo);
|
|
39774
40339
|
}
|
|
39775
40340
|
|
|
39776
|
-
|
|
40341
|
+
return Promise.resolve(null);
|
|
40342
|
+
}
|
|
39777
40343
|
|
|
39778
|
-
|
|
39779
|
-
switch (field.type) {
|
|
39780
|
-
case 'array':
|
|
39781
|
-
if (!Array.isArray(value)) {
|
|
39782
|
-
throw invalidParameter(`Parameter [${field.name}] is of type invalid and should be [${field.type}].`);
|
|
39783
|
-
} else if (!field.allowEmpty && value.length < 1) {
|
|
39784
|
-
throw invalidParameter(`Parameter "${field.name}" is empty.`);
|
|
39785
|
-
}
|
|
40344
|
+
}
|
|
39786
40345
|
|
|
39787
|
-
|
|
40346
|
+
class CheckTransportRelease extends BaseMethod {
|
|
40347
|
+
init() {
|
|
40348
|
+
this.useDevice = false;
|
|
40349
|
+
this.useDevicePassphraseState = false;
|
|
40350
|
+
}
|
|
39788
40351
|
|
|
39789
|
-
|
|
39790
|
-
|
|
39791
|
-
|
|
40352
|
+
run() {
|
|
40353
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40354
|
+
const transport = TransportManager.getTransport();
|
|
40355
|
+
const localVersion = yield transport.init();
|
|
40356
|
+
const response = DataManager.getTransportStatus(localVersion);
|
|
40357
|
+
return Promise.resolve(response);
|
|
40358
|
+
});
|
|
40359
|
+
}
|
|
40360
|
+
|
|
40361
|
+
}
|
|
40362
|
+
|
|
40363
|
+
class CheckBridgeStatus extends BaseMethod {
|
|
40364
|
+
init() {
|
|
40365
|
+
this.useDevice = false;
|
|
40366
|
+
this.useDevicePassphraseState = false;
|
|
40367
|
+
}
|
|
40368
|
+
|
|
40369
|
+
run() {
|
|
40370
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40371
|
+
return new Promise((resolve, reject) => {
|
|
40372
|
+
axios_default().request({
|
|
40373
|
+
url: 'http://localhost:21320',
|
|
40374
|
+
method: 'POST',
|
|
40375
|
+
withCredentials: false,
|
|
40376
|
+
timeout: 3000
|
|
40377
|
+
}).then(() => resolve(true)).catch(e => {
|
|
40378
|
+
if (e.code === 'ECONNABORTED') {
|
|
40379
|
+
reject(HardwareError$1.TypedError(dist_HardwareErrorCode.BridgeTimeoutError));
|
|
40380
|
+
} else {
|
|
40381
|
+
resolve(false);
|
|
40382
|
+
}
|
|
40383
|
+
});
|
|
40384
|
+
});
|
|
40385
|
+
});
|
|
40386
|
+
}
|
|
40387
|
+
|
|
40388
|
+
}
|
|
40389
|
+
|
|
40390
|
+
class DeviceBackup extends BaseMethod {
|
|
40391
|
+
init() {
|
|
40392
|
+
this.useDevicePassphraseState = false;
|
|
40393
|
+
}
|
|
40394
|
+
|
|
40395
|
+
run() {
|
|
40396
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40397
|
+
const res = yield this.device.commands.typedCall('BackupDevice', 'Success');
|
|
40398
|
+
return Promise.resolve(res.message);
|
|
40399
|
+
});
|
|
40400
|
+
}
|
|
40401
|
+
|
|
40402
|
+
}
|
|
40403
|
+
|
|
40404
|
+
const hasHexPrefix = str => str.slice(0, 2).toLowerCase() === '0x';
|
|
40405
|
+
|
|
40406
|
+
const stripHexPrefix = str => hasHexPrefix(str) ? str.slice(2) : str;
|
|
40407
|
+
|
|
40408
|
+
const addHexPrefix = str => hasHexPrefix(str) ? str : `0x${str}`;
|
|
40409
|
+
|
|
40410
|
+
const isHexString = (value, length) => {
|
|
40411
|
+
if (typeof value !== 'string' || !value.match(/^(0x|0X)?[0-9A-Fa-f]*$/)) {
|
|
40412
|
+
return false;
|
|
40413
|
+
}
|
|
40414
|
+
|
|
40415
|
+
if (length && value.length !== 2 + 2 * length) {
|
|
40416
|
+
return false;
|
|
40417
|
+
}
|
|
40418
|
+
|
|
40419
|
+
return true;
|
|
40420
|
+
};
|
|
40421
|
+
|
|
40422
|
+
const stripHexStartZeroes = str => {
|
|
40423
|
+
while (/^00/.test(str)) {
|
|
40424
|
+
str = str.slice(2);
|
|
40425
|
+
}
|
|
40426
|
+
|
|
40427
|
+
return str;
|
|
40428
|
+
};
|
|
40429
|
+
|
|
40430
|
+
const modifyValues = (object, transformer) => Object.fromEntries(Object.entries(object).map(([key, value]) => [key, transformer(value, key)]));
|
|
40431
|
+
|
|
40432
|
+
const formatAnyHex = value => {
|
|
40433
|
+
if (typeof value === 'string') {
|
|
40434
|
+
let stripped = stripHexPrefix(value);
|
|
40435
|
+
|
|
40436
|
+
if (stripped.length % 2 !== 0) {
|
|
40437
|
+
stripped = `0${stripped}`;
|
|
40438
|
+
}
|
|
40439
|
+
|
|
40440
|
+
return stripped;
|
|
40441
|
+
}
|
|
40442
|
+
|
|
40443
|
+
if (Array.isArray(value)) {
|
|
40444
|
+
return value.map(formatAnyHex);
|
|
40445
|
+
}
|
|
40446
|
+
|
|
40447
|
+
if (typeof value === 'object') {
|
|
40448
|
+
return modifyValues(value, value => formatAnyHex(value));
|
|
40449
|
+
}
|
|
40450
|
+
|
|
40451
|
+
return value;
|
|
40452
|
+
};
|
|
40453
|
+
|
|
40454
|
+
const invalidParameter = message => HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, message);
|
|
40455
|
+
|
|
40456
|
+
const validateParams = (values, fields) => {
|
|
40457
|
+
fields.forEach(field => {
|
|
40458
|
+
const existsProp = Object.prototype.hasOwnProperty.call(values, field.name);
|
|
40459
|
+
|
|
40460
|
+
if (!existsProp && field.required) {
|
|
40461
|
+
throw invalidParameter(`Missing required parameter: ${field.name}`);
|
|
40462
|
+
}
|
|
40463
|
+
|
|
40464
|
+
const value = values[field.name];
|
|
40465
|
+
|
|
40466
|
+
if (value && field.type) {
|
|
40467
|
+
switch (field.type) {
|
|
40468
|
+
case 'array':
|
|
40469
|
+
if (!Array.isArray(value)) {
|
|
40470
|
+
throw invalidParameter(`Parameter [${field.name}] is of type invalid and should be [${field.type}].`);
|
|
40471
|
+
} else if (!field.allowEmpty && value.length < 1) {
|
|
40472
|
+
throw invalidParameter(`Parameter "${field.name}" is empty.`);
|
|
40473
|
+
}
|
|
40474
|
+
|
|
40475
|
+
break;
|
|
40476
|
+
|
|
40477
|
+
case 'bigNumber':
|
|
40478
|
+
if (typeof value !== 'string') {
|
|
40479
|
+
throw invalidParameter(`Parameter [${field.name}] is of type invalid and should be [string].`);
|
|
39792
40480
|
}
|
|
39793
40481
|
|
|
39794
40482
|
try {
|
|
@@ -39828,99 +40516,654 @@ const validateParams = (values, fields) => {
|
|
|
39828
40516
|
});
|
|
39829
40517
|
};
|
|
39830
40518
|
|
|
39831
|
-
class
|
|
39832
|
-
|
|
39833
|
-
|
|
39834
|
-
this.
|
|
40519
|
+
class DeviceChangePin extends BaseMethod {
|
|
40520
|
+
init() {
|
|
40521
|
+
this.useDevicePassphraseState = false;
|
|
40522
|
+
validateParams(this.payload, [{
|
|
40523
|
+
name: 'remove',
|
|
40524
|
+
type: 'boolean'
|
|
40525
|
+
}]);
|
|
40526
|
+
this.params = {
|
|
40527
|
+
remove: this.payload.remove
|
|
40528
|
+
};
|
|
39835
40529
|
}
|
|
39836
40530
|
|
|
39837
|
-
|
|
39838
|
-
|
|
40531
|
+
run() {
|
|
40532
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40533
|
+
const res = yield this.device.commands.typedCall('ChangePin', 'Success', Object.assign({}, this.params));
|
|
40534
|
+
return Promise.resolve(res.message);
|
|
40535
|
+
});
|
|
40536
|
+
}
|
|
39839
40537
|
|
|
39840
|
-
|
|
39841
|
-
|
|
39842
|
-
|
|
39843
|
-
|
|
39844
|
-
|
|
39845
|
-
|
|
39846
|
-
|
|
39847
|
-
|
|
39848
|
-
type: 'array'
|
|
40538
|
+
}
|
|
40539
|
+
|
|
40540
|
+
class DeviceFlags extends BaseMethod {
|
|
40541
|
+
init() {
|
|
40542
|
+
this.useDevicePassphraseState = false;
|
|
40543
|
+
validateParams(this.payload, [{
|
|
40544
|
+
name: 'flags',
|
|
40545
|
+
type: 'number'
|
|
39849
40546
|
}]);
|
|
39850
|
-
this.params =
|
|
39851
|
-
|
|
39852
|
-
|
|
39853
|
-
validateParams(batch, [{
|
|
39854
|
-
name: 'path',
|
|
39855
|
-
required: true
|
|
39856
|
-
}, {
|
|
39857
|
-
name: 'key',
|
|
39858
|
-
type: 'string'
|
|
39859
|
-
}, {
|
|
39860
|
-
name: 'value',
|
|
39861
|
-
type: 'hexString'
|
|
39862
|
-
}, {
|
|
39863
|
-
name: 'encrypt',
|
|
39864
|
-
type: 'boolean'
|
|
39865
|
-
}, {
|
|
39866
|
-
name: 'askOnEncrypt',
|
|
39867
|
-
type: 'boolean'
|
|
39868
|
-
}, {
|
|
39869
|
-
name: 'askOnDecrypt',
|
|
39870
|
-
type: 'boolean'
|
|
39871
|
-
}, {
|
|
39872
|
-
name: 'iv',
|
|
39873
|
-
type: 'hexString'
|
|
39874
|
-
}]);
|
|
39875
|
-
this.params.push({
|
|
39876
|
-
address_n: addressN,
|
|
39877
|
-
key: batch.key,
|
|
39878
|
-
value: formatAnyHex(batch.value),
|
|
39879
|
-
encrypt: batch.encrypt,
|
|
39880
|
-
ask_on_encrypt: batch.askOnEncrypt,
|
|
39881
|
-
ask_on_decrypt: batch.askOnDecrypt,
|
|
39882
|
-
iv: formatAnyHex(batch.iv)
|
|
39883
|
-
});
|
|
39884
|
-
});
|
|
40547
|
+
this.params = {
|
|
40548
|
+
flags: this.payload.flags
|
|
40549
|
+
};
|
|
39885
40550
|
}
|
|
39886
40551
|
|
|
39887
40552
|
run() {
|
|
39888
40553
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
39889
|
-
const
|
|
40554
|
+
const res = yield this.device.commands.typedCall('ApplyFlags', 'Success', Object.assign({}, this.params));
|
|
40555
|
+
return Promise.resolve(res.message);
|
|
40556
|
+
});
|
|
40557
|
+
}
|
|
39890
40558
|
|
|
39891
|
-
|
|
39892
|
-
|
|
39893
|
-
|
|
39894
|
-
|
|
39895
|
-
|
|
39896
|
-
|
|
40559
|
+
}
|
|
40560
|
+
|
|
40561
|
+
class DeviceRebootToBootloader extends BaseMethod {
|
|
40562
|
+
init() {
|
|
40563
|
+
this.useDevicePassphraseState = false;
|
|
40564
|
+
}
|
|
40565
|
+
|
|
40566
|
+
getVersionRange() {
|
|
40567
|
+
return {
|
|
40568
|
+
classic: {
|
|
40569
|
+
min: '2.1.11'
|
|
40570
|
+
},
|
|
40571
|
+
mini: {
|
|
40572
|
+
min: '2.1.11'
|
|
39897
40573
|
}
|
|
40574
|
+
};
|
|
40575
|
+
}
|
|
39898
40576
|
|
|
39899
|
-
|
|
40577
|
+
run() {
|
|
40578
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40579
|
+
const res = yield this.device.commands.typedCall('RebootToBootloader', 'Success');
|
|
40580
|
+
return Promise.resolve(res.message);
|
|
39900
40581
|
});
|
|
39901
40582
|
}
|
|
39902
40583
|
|
|
39903
40584
|
}
|
|
39904
40585
|
|
|
39905
|
-
|
|
39906
|
-
|
|
39907
|
-
|
|
39908
|
-
|
|
39909
|
-
|
|
39910
|
-
|
|
39911
|
-
|
|
39912
|
-
|
|
39913
|
-
|
|
39914
|
-
|
|
39915
|
-
|
|
39916
|
-
|
|
39917
|
-
}, {
|
|
39918
|
-
|
|
39919
|
-
|
|
39920
|
-
|
|
39921
|
-
|
|
39922
|
-
|
|
39923
|
-
|
|
40586
|
+
class DeviceRecovery extends BaseMethod {
|
|
40587
|
+
init() {
|
|
40588
|
+
this.useDevicePassphraseState = false;
|
|
40589
|
+
validateParams(this.payload, [{
|
|
40590
|
+
name: 'wordCount',
|
|
40591
|
+
type: 'number'
|
|
40592
|
+
}, {
|
|
40593
|
+
name: 'passphraseProtection',
|
|
40594
|
+
type: 'boolean'
|
|
40595
|
+
}, {
|
|
40596
|
+
name: 'pinProtection',
|
|
40597
|
+
type: 'boolean'
|
|
40598
|
+
}, {
|
|
40599
|
+
name: 'language',
|
|
40600
|
+
type: 'string'
|
|
40601
|
+
}, {
|
|
40602
|
+
name: 'label',
|
|
40603
|
+
type: 'string'
|
|
40604
|
+
}, {
|
|
40605
|
+
name: 'enforceWordlist',
|
|
40606
|
+
type: 'boolean'
|
|
40607
|
+
}, {
|
|
40608
|
+
name: 'type',
|
|
40609
|
+
type: 'object'
|
|
40610
|
+
}, {
|
|
40611
|
+
name: 'u2fCounter',
|
|
40612
|
+
type: 'number'
|
|
40613
|
+
}, {
|
|
40614
|
+
name: 'dryRun',
|
|
40615
|
+
type: 'boolean'
|
|
40616
|
+
}]);
|
|
40617
|
+
this.params = {
|
|
40618
|
+
word_count: this.payload.wordCount,
|
|
40619
|
+
passphrase_protection: this.payload.passphraseProtection,
|
|
40620
|
+
pin_protection: this.payload.pinProtection,
|
|
40621
|
+
language: this.payload.language,
|
|
40622
|
+
label: this.payload.label,
|
|
40623
|
+
enforce_wordlist: this.payload.enforceWordlist,
|
|
40624
|
+
type: this.payload.type,
|
|
40625
|
+
u2f_counter: this.payload.u2fCounter || Math.floor(Date.now() / 1000),
|
|
40626
|
+
dry_run: this.payload.dryRun
|
|
40627
|
+
};
|
|
40628
|
+
}
|
|
40629
|
+
|
|
40630
|
+
run() {
|
|
40631
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40632
|
+
const res = yield this.device.commands.typedCall('RecoveryDevice', 'Success', Object.assign({}, this.params));
|
|
40633
|
+
return Promise.resolve(res.message);
|
|
40634
|
+
});
|
|
40635
|
+
}
|
|
40636
|
+
|
|
40637
|
+
}
|
|
40638
|
+
|
|
40639
|
+
class DeviceReset extends BaseMethod {
|
|
40640
|
+
init() {
|
|
40641
|
+
this.useDevicePassphraseState = false;
|
|
40642
|
+
validateParams(this.payload, [{
|
|
40643
|
+
name: 'displayRandom',
|
|
40644
|
+
type: 'boolean'
|
|
40645
|
+
}, {
|
|
40646
|
+
name: 'strength',
|
|
40647
|
+
type: 'number'
|
|
40648
|
+
}, {
|
|
40649
|
+
name: 'passphraseProtection',
|
|
40650
|
+
type: 'boolean'
|
|
40651
|
+
}, {
|
|
40652
|
+
name: 'pinProtection',
|
|
40653
|
+
type: 'boolean'
|
|
40654
|
+
}, {
|
|
40655
|
+
name: 'language',
|
|
40656
|
+
type: 'string'
|
|
40657
|
+
}, {
|
|
40658
|
+
name: 'label',
|
|
40659
|
+
type: 'string'
|
|
40660
|
+
}, {
|
|
40661
|
+
name: 'u2fCounter',
|
|
40662
|
+
type: 'number'
|
|
40663
|
+
}, {
|
|
40664
|
+
name: 'skipBackup',
|
|
40665
|
+
type: 'boolean'
|
|
40666
|
+
}, {
|
|
40667
|
+
name: 'noBackup',
|
|
40668
|
+
type: 'boolean'
|
|
40669
|
+
}, {
|
|
40670
|
+
name: 'backupType'
|
|
40671
|
+
}]);
|
|
40672
|
+
this.params = {
|
|
40673
|
+
display_random: this.payload.displayRandom,
|
|
40674
|
+
strength: this.payload.strength || 256,
|
|
40675
|
+
passphrase_protection: this.payload.passphraseProtection,
|
|
40676
|
+
pin_protection: this.payload.pinProtection,
|
|
40677
|
+
language: this.payload.language,
|
|
40678
|
+
label: this.payload.label,
|
|
40679
|
+
u2f_counter: this.payload.u2fCounter || Math.floor(Date.now() / 1000),
|
|
40680
|
+
skip_backup: this.payload.skipBackup,
|
|
40681
|
+
no_backup: this.payload.noBackup,
|
|
40682
|
+
backup_type: this.payload.backupType
|
|
40683
|
+
};
|
|
40684
|
+
}
|
|
40685
|
+
|
|
40686
|
+
run() {
|
|
40687
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40688
|
+
const res = yield this.device.commands.typedCall('ResetDevice', 'Success', Object.assign({}, this.params));
|
|
40689
|
+
return Promise.resolve(res.message);
|
|
40690
|
+
});
|
|
40691
|
+
}
|
|
40692
|
+
|
|
40693
|
+
}
|
|
40694
|
+
|
|
40695
|
+
class DeviceSettings extends BaseMethod {
|
|
40696
|
+
init() {
|
|
40697
|
+
this.useDevicePassphraseState = false;
|
|
40698
|
+
validateParams(this.payload, [{
|
|
40699
|
+
name: 'language',
|
|
40700
|
+
type: 'string'
|
|
40701
|
+
}, {
|
|
40702
|
+
name: 'label',
|
|
40703
|
+
type: 'string'
|
|
40704
|
+
}, {
|
|
40705
|
+
name: 'usePassphrase',
|
|
40706
|
+
type: 'boolean'
|
|
40707
|
+
}, {
|
|
40708
|
+
name: 'homescreen',
|
|
40709
|
+
type: 'string'
|
|
40710
|
+
}, {
|
|
40711
|
+
name: 'passphraseSource',
|
|
40712
|
+
type: 'number'
|
|
40713
|
+
}, {
|
|
40714
|
+
name: 'autoLockDelayMs',
|
|
40715
|
+
type: 'number'
|
|
40716
|
+
}, {
|
|
40717
|
+
name: 'displayRotation',
|
|
40718
|
+
type: 'number'
|
|
40719
|
+
}, {
|
|
40720
|
+
name: 'passphraseAlwaysOnDevice',
|
|
40721
|
+
type: 'boolean'
|
|
40722
|
+
}, {
|
|
40723
|
+
name: 'safetyChecks',
|
|
40724
|
+
type: 'number'
|
|
40725
|
+
}, {
|
|
40726
|
+
name: 'experimentalFeatures',
|
|
40727
|
+
type: 'boolean'
|
|
40728
|
+
}]);
|
|
40729
|
+
this.params = {
|
|
40730
|
+
language: this.payload.language,
|
|
40731
|
+
label: this.payload.label,
|
|
40732
|
+
use_passphrase: this.payload.usePassphrase,
|
|
40733
|
+
homescreen: this.payload.homescreen,
|
|
40734
|
+
_passphrase_source: this.payload.passphraseSource,
|
|
40735
|
+
auto_lock_delay_ms: this.payload.autoLockDelayMs,
|
|
40736
|
+
display_rotation: this.payload.displayRotation,
|
|
40737
|
+
passphrase_always_on_device: this.payload.passphraseAlwaysOnDevice,
|
|
40738
|
+
safety_checks: this.payload.safetyChecks,
|
|
40739
|
+
experimental_features: this.payload.experimentalFeatures
|
|
40740
|
+
};
|
|
40741
|
+
}
|
|
40742
|
+
|
|
40743
|
+
getVersionRange() {
|
|
40744
|
+
if (this.payload.usePassphrase) {
|
|
40745
|
+
return {
|
|
40746
|
+
model_mini: {
|
|
40747
|
+
min: '2.4.0'
|
|
40748
|
+
}
|
|
40749
|
+
};
|
|
40750
|
+
}
|
|
40751
|
+
|
|
40752
|
+
return {};
|
|
40753
|
+
}
|
|
40754
|
+
|
|
40755
|
+
run() {
|
|
40756
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40757
|
+
const res = yield this.device.commands.typedCall('ApplySettings', 'Success', Object.assign({}, this.params));
|
|
40758
|
+
return Promise.resolve(res.message);
|
|
40759
|
+
});
|
|
40760
|
+
}
|
|
40761
|
+
|
|
40762
|
+
}
|
|
40763
|
+
|
|
40764
|
+
class DeviceUpdateReboot extends BaseMethod {
|
|
40765
|
+
init() {
|
|
40766
|
+
this.useDevicePassphraseState = false;
|
|
40767
|
+
}
|
|
40768
|
+
|
|
40769
|
+
run() {
|
|
40770
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40771
|
+
const res = yield this.device.commands.typedCall('BixinReboot', 'Success');
|
|
40772
|
+
return Promise.resolve(res.message);
|
|
40773
|
+
});
|
|
40774
|
+
}
|
|
40775
|
+
|
|
40776
|
+
}
|
|
40777
|
+
|
|
40778
|
+
class DeviceSupportFeatures extends BaseMethod {
|
|
40779
|
+
init() {
|
|
40780
|
+
this.useDevicePassphraseState = false;
|
|
40781
|
+
}
|
|
40782
|
+
|
|
40783
|
+
run() {
|
|
40784
|
+
if (!this.device.features) return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Device not initialized'));
|
|
40785
|
+
const inputPinOnSoftware = supportInputPinOnSoftware(this.device.features);
|
|
40786
|
+
return Promise.resolve({
|
|
40787
|
+
inputPinOnSoftware,
|
|
40788
|
+
device: this.device.toMessageObject()
|
|
40789
|
+
});
|
|
40790
|
+
}
|
|
40791
|
+
|
|
40792
|
+
}
|
|
40793
|
+
|
|
40794
|
+
class DeviceVerify extends BaseMethod {
|
|
40795
|
+
init() {
|
|
40796
|
+
this.useDevicePassphraseState = false;
|
|
40797
|
+
validateParams(this.payload, [{
|
|
40798
|
+
name: 'dataHex',
|
|
40799
|
+
type: 'hexString'
|
|
40800
|
+
}]);
|
|
40801
|
+
this.params = {
|
|
40802
|
+
data: formatAnyHex(this.payload.dataHex)
|
|
40803
|
+
};
|
|
40804
|
+
}
|
|
40805
|
+
|
|
40806
|
+
run() {
|
|
40807
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40808
|
+
const deviceType = getDeviceType(this.device.features);
|
|
40809
|
+
let response;
|
|
40810
|
+
|
|
40811
|
+
if (deviceType === 'classic') {
|
|
40812
|
+
const res = yield this.device.commands.typedCall('BixinVerifyDeviceRequest', 'BixinVerifyDeviceAck', Object.assign(Object.assign({}, this.params), {
|
|
40813
|
+
data: sha256_default().sha256(this.params.data)
|
|
40814
|
+
}));
|
|
40815
|
+
response = res.message;
|
|
40816
|
+
} else {
|
|
40817
|
+
const signatureRes = yield this.device.commands.typedCall('SESignMessage', 'SEMessageSignature', {
|
|
40818
|
+
message: this.params.data
|
|
40819
|
+
});
|
|
40820
|
+
const certRes = yield this.device.commands.typedCall('ReadSEPublicCert', 'SEPublicCert');
|
|
40821
|
+
response = {
|
|
40822
|
+
cert: certRes.message.public_cert,
|
|
40823
|
+
signature: signatureRes.message.signature
|
|
40824
|
+
};
|
|
40825
|
+
}
|
|
40826
|
+
|
|
40827
|
+
if (response) return Promise.resolve(response);
|
|
40828
|
+
return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Device not support verify'));
|
|
40829
|
+
});
|
|
40830
|
+
}
|
|
40831
|
+
|
|
40832
|
+
}
|
|
40833
|
+
|
|
40834
|
+
class DeviceWipe extends BaseMethod {
|
|
40835
|
+
init() {
|
|
40836
|
+
this.useDevicePassphraseState = false;
|
|
40837
|
+
}
|
|
40838
|
+
|
|
40839
|
+
run() {
|
|
40840
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40841
|
+
const res = yield this.device.commands.typedCall('WipeDevice', 'Success');
|
|
40842
|
+
return Promise.resolve(res.message);
|
|
40843
|
+
});
|
|
40844
|
+
}
|
|
40845
|
+
|
|
40846
|
+
}
|
|
40847
|
+
|
|
40848
|
+
const getBinary = ({
|
|
40849
|
+
features,
|
|
40850
|
+
updateType,
|
|
40851
|
+
version
|
|
40852
|
+
}) => dist_awaiter(void 0, void 0, void 0, function* () {
|
|
40853
|
+
const releaseInfo = getInfo({
|
|
40854
|
+
features,
|
|
40855
|
+
updateType
|
|
40856
|
+
});
|
|
40857
|
+
|
|
40858
|
+
if (!releaseInfo) {
|
|
40859
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'no firmware found for this device');
|
|
40860
|
+
}
|
|
40861
|
+
|
|
40862
|
+
if (version && !semver_default().eq(releaseInfo.version, version)) {
|
|
40863
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'firmware version mismatch');
|
|
40864
|
+
}
|
|
40865
|
+
|
|
40866
|
+
const url = updateType === 'ble' ? releaseInfo.webUpdate : releaseInfo.url;
|
|
40867
|
+
let fw;
|
|
40868
|
+
|
|
40869
|
+
try {
|
|
40870
|
+
fw = yield httpRequest(url, 'binary');
|
|
40871
|
+
} catch (_a) {
|
|
40872
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Method_FirmwareUpdate_DownloadFailed');
|
|
40873
|
+
}
|
|
40874
|
+
|
|
40875
|
+
return Object.assign(Object.assign({}, releaseInfo), {
|
|
40876
|
+
binary: fw
|
|
40877
|
+
});
|
|
40878
|
+
});
|
|
40879
|
+
|
|
40880
|
+
const getInfo = ({
|
|
40881
|
+
features,
|
|
40882
|
+
updateType
|
|
40883
|
+
}) => {
|
|
40884
|
+
var _a, _b, _c;
|
|
40885
|
+
|
|
40886
|
+
const deviceType = getDeviceType(features);
|
|
40887
|
+
const {
|
|
40888
|
+
deviceMap
|
|
40889
|
+
} = DataManager;
|
|
40890
|
+
const releaseInfo = (_c = (_b = (_a = deviceMap === null || deviceMap === void 0 ? void 0 : deviceMap[deviceType]) === null || _a === void 0 ? void 0 : _a[updateType]) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : null;
|
|
40891
|
+
return releaseInfo;
|
|
40892
|
+
};
|
|
40893
|
+
|
|
40894
|
+
const postConfirmationMessage = device => {
|
|
40895
|
+
var _a;
|
|
40896
|
+
|
|
40897
|
+
if ((_a = device.features) === null || _a === void 0 ? void 0 : _a.firmware_present) {
|
|
40898
|
+
device.emit(DEVICE.BUTTON, device, {
|
|
40899
|
+
code: 'ButtonRequest_FirmwareUpdate'
|
|
40900
|
+
});
|
|
40901
|
+
}
|
|
40902
|
+
};
|
|
40903
|
+
|
|
40904
|
+
const postProgressMessage = (device, progress, postMessage) => {
|
|
40905
|
+
postMessage(createUiMessage(UI_REQUEST$1.FIRMWARE_PROGRESS, {
|
|
40906
|
+
device: device.toMessageObject(),
|
|
40907
|
+
progress
|
|
40908
|
+
}));
|
|
40909
|
+
};
|
|
40910
|
+
|
|
40911
|
+
const uploadFirmware = (updateType, typedCall, postMessage, device, {
|
|
40912
|
+
payload
|
|
40913
|
+
}) => dist_awaiter(void 0, void 0, void 0, function* () {
|
|
40914
|
+
var _a, _b;
|
|
40915
|
+
|
|
40916
|
+
if (((_a = device.features) === null || _a === void 0 ? void 0 : _a.major_version) === 1) {
|
|
40917
|
+
postConfirmationMessage(device);
|
|
40918
|
+
const eraseCommand = updateType === 'firmware' ? 'FirmwareErase' : 'FirmwareErase_ex';
|
|
40919
|
+
yield typedCall(eraseCommand, 'Success', {});
|
|
40920
|
+
postProgressMessage(device, 0, postMessage);
|
|
40921
|
+
const {
|
|
40922
|
+
message
|
|
40923
|
+
} = yield typedCall('FirmwareUpload', 'Success', {
|
|
40924
|
+
payload
|
|
40925
|
+
});
|
|
40926
|
+
postProgressMessage(device, 100, postMessage);
|
|
40927
|
+
return message;
|
|
40928
|
+
}
|
|
40929
|
+
|
|
40930
|
+
if (((_b = device.features) === null || _b === void 0 ? void 0 : _b.major_version) === 2) {
|
|
40931
|
+
postConfirmationMessage(device);
|
|
40932
|
+
const length = payload.byteLength;
|
|
40933
|
+
let response = yield typedCall('FirmwareErase', ['FirmwareRequest', 'Success'], {
|
|
40934
|
+
length
|
|
40935
|
+
});
|
|
40936
|
+
|
|
40937
|
+
while (response.type !== 'Success') {
|
|
40938
|
+
const start = response.message.offset;
|
|
40939
|
+
const end = response.message.offset + response.message.length;
|
|
40940
|
+
const chunk = payload.slice(start, end);
|
|
40941
|
+
|
|
40942
|
+
if (start > 0) {
|
|
40943
|
+
postProgressMessage(device, Math.round(start / length * 100), postMessage);
|
|
40944
|
+
}
|
|
40945
|
+
|
|
40946
|
+
response = yield typedCall('FirmwareUpload', ['FirmwareRequest', 'Success'], {
|
|
40947
|
+
payload: chunk
|
|
40948
|
+
});
|
|
40949
|
+
}
|
|
40950
|
+
|
|
40951
|
+
postProgressMessage(device, 100, postMessage);
|
|
40952
|
+
return response.message;
|
|
40953
|
+
}
|
|
40954
|
+
|
|
40955
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'uploadFirmware: unknown major_version');
|
|
40956
|
+
});
|
|
40957
|
+
|
|
40958
|
+
class FirmwareUpdate extends BaseMethod {
|
|
40959
|
+
init() {
|
|
40960
|
+
this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
40961
|
+
this.requireDeviceMode = [UI_REQUEST.BOOTLOADER];
|
|
40962
|
+
this.useDevicePassphraseState = false;
|
|
40963
|
+
const {
|
|
40964
|
+
payload
|
|
40965
|
+
} = this;
|
|
40966
|
+
validateParams(payload, [{
|
|
40967
|
+
name: 'version',
|
|
40968
|
+
type: 'array'
|
|
40969
|
+
}, {
|
|
40970
|
+
name: 'binary',
|
|
40971
|
+
type: 'buffer'
|
|
40972
|
+
}]);
|
|
40973
|
+
|
|
40974
|
+
if (!payload.updateType) {
|
|
40975
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, 'updateType is required');
|
|
40976
|
+
}
|
|
40977
|
+
|
|
40978
|
+
this.params = {
|
|
40979
|
+
updateType: payload.updateType
|
|
40980
|
+
};
|
|
40981
|
+
|
|
40982
|
+
if ('version' in payload) {
|
|
40983
|
+
this.params = Object.assign(Object.assign({}, this.params), {
|
|
40984
|
+
version: payload.version
|
|
40985
|
+
});
|
|
40986
|
+
}
|
|
40987
|
+
|
|
40988
|
+
if ('binary' in payload) {
|
|
40989
|
+
this.params = Object.assign(Object.assign({}, this.params), {
|
|
40990
|
+
binary: payload.binary
|
|
40991
|
+
});
|
|
40992
|
+
}
|
|
40993
|
+
}
|
|
40994
|
+
|
|
40995
|
+
run() {
|
|
40996
|
+
var _a;
|
|
40997
|
+
|
|
40998
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40999
|
+
const {
|
|
41000
|
+
device,
|
|
41001
|
+
params
|
|
41002
|
+
} = this;
|
|
41003
|
+
let binary;
|
|
41004
|
+
|
|
41005
|
+
try {
|
|
41006
|
+
if (params.binary) {
|
|
41007
|
+
binary = this.params.binary;
|
|
41008
|
+
} else {
|
|
41009
|
+
if (!device.features) {
|
|
41010
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'no features found for this device');
|
|
41011
|
+
}
|
|
41012
|
+
|
|
41013
|
+
const firmware = yield getBinary({
|
|
41014
|
+
features: device.features,
|
|
41015
|
+
version: params.version,
|
|
41016
|
+
updateType: params.updateType
|
|
41017
|
+
});
|
|
41018
|
+
binary = firmware.binary;
|
|
41019
|
+
}
|
|
41020
|
+
} catch (err) {
|
|
41021
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.FirmwareUpdateDownloadFailed, (_a = err.message) !== null && _a !== void 0 ? _a : err);
|
|
41022
|
+
}
|
|
41023
|
+
|
|
41024
|
+
return uploadFirmware(params.updateType, this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, {
|
|
41025
|
+
payload: binary
|
|
41026
|
+
});
|
|
41027
|
+
});
|
|
41028
|
+
}
|
|
41029
|
+
|
|
41030
|
+
}
|
|
41031
|
+
|
|
41032
|
+
const Log$2 = getLogger(LoggerNames.Method);
|
|
41033
|
+
|
|
41034
|
+
class RequestWebUsbDevice extends BaseMethod {
|
|
41035
|
+
init() {
|
|
41036
|
+
this.useDevice = false;
|
|
41037
|
+
this.useDevicePassphraseState = false;
|
|
41038
|
+
}
|
|
41039
|
+
|
|
41040
|
+
run() {
|
|
41041
|
+
var _a, _b;
|
|
41042
|
+
|
|
41043
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41044
|
+
yield TransportManager.configure();
|
|
41045
|
+
const env = DataManager.getSettings('env');
|
|
41046
|
+
|
|
41047
|
+
if (env !== 'webusb') {
|
|
41048
|
+
return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Not webusb environment'));
|
|
41049
|
+
}
|
|
41050
|
+
|
|
41051
|
+
try {
|
|
41052
|
+
const deviceDiff = yield (_a = this.connector) === null || _a === void 0 ? void 0 : _a.enumerate();
|
|
41053
|
+
const devicesDescriptor = (_b = deviceDiff === null || deviceDiff === void 0 ? void 0 : deviceDiff.descriptors) !== null && _b !== void 0 ? _b : [];
|
|
41054
|
+
const {
|
|
41055
|
+
deviceList
|
|
41056
|
+
} = yield DevicePool.getDevices(devicesDescriptor);
|
|
41057
|
+
|
|
41058
|
+
if (deviceList.length > 0) {
|
|
41059
|
+
return {
|
|
41060
|
+
device: deviceList[0].toMessageObject()
|
|
41061
|
+
};
|
|
41062
|
+
}
|
|
41063
|
+
|
|
41064
|
+
return yield Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Please select the device to connect'));
|
|
41065
|
+
} catch (error) {
|
|
41066
|
+
Log$2.debug(error);
|
|
41067
|
+
return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Please select the device to connect'));
|
|
41068
|
+
}
|
|
41069
|
+
});
|
|
41070
|
+
}
|
|
41071
|
+
|
|
41072
|
+
}
|
|
41073
|
+
|
|
41074
|
+
class CipherKeyValue extends BaseMethod {
|
|
41075
|
+
constructor() {
|
|
41076
|
+
super(...arguments);
|
|
41077
|
+
this.hasBundle = false;
|
|
41078
|
+
}
|
|
41079
|
+
|
|
41080
|
+
init() {
|
|
41081
|
+
var _a;
|
|
41082
|
+
|
|
41083
|
+
this.checkDeviceId = true;
|
|
41084
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
41085
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
41086
|
+
const payload = this.hasBundle ? this.payload : {
|
|
41087
|
+
bundle: [this.payload]
|
|
41088
|
+
};
|
|
41089
|
+
validateParams(payload, [{
|
|
41090
|
+
name: 'bundle',
|
|
41091
|
+
type: 'array'
|
|
41092
|
+
}]);
|
|
41093
|
+
this.params = [];
|
|
41094
|
+
payload.bundle.forEach(batch => {
|
|
41095
|
+
const addressN = validatePath(batch.path);
|
|
41096
|
+
validateParams(batch, [{
|
|
41097
|
+
name: 'path',
|
|
41098
|
+
required: true
|
|
41099
|
+
}, {
|
|
41100
|
+
name: 'key',
|
|
41101
|
+
type: 'string'
|
|
41102
|
+
}, {
|
|
41103
|
+
name: 'value',
|
|
41104
|
+
type: 'hexString'
|
|
41105
|
+
}, {
|
|
41106
|
+
name: 'encrypt',
|
|
41107
|
+
type: 'boolean'
|
|
41108
|
+
}, {
|
|
41109
|
+
name: 'askOnEncrypt',
|
|
41110
|
+
type: 'boolean'
|
|
41111
|
+
}, {
|
|
41112
|
+
name: 'askOnDecrypt',
|
|
41113
|
+
type: 'boolean'
|
|
41114
|
+
}, {
|
|
41115
|
+
name: 'iv',
|
|
41116
|
+
type: 'hexString'
|
|
41117
|
+
}]);
|
|
41118
|
+
this.params.push({
|
|
41119
|
+
address_n: addressN,
|
|
41120
|
+
key: batch.key,
|
|
41121
|
+
value: formatAnyHex(batch.value),
|
|
41122
|
+
encrypt: batch.encrypt,
|
|
41123
|
+
ask_on_encrypt: batch.askOnEncrypt,
|
|
41124
|
+
ask_on_decrypt: batch.askOnDecrypt,
|
|
41125
|
+
iv: formatAnyHex(batch.iv)
|
|
41126
|
+
});
|
|
41127
|
+
});
|
|
41128
|
+
}
|
|
41129
|
+
|
|
41130
|
+
run() {
|
|
41131
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41132
|
+
const responses = [];
|
|
41133
|
+
|
|
41134
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
41135
|
+
const param = this.params[i];
|
|
41136
|
+
const res = yield this.device.commands.typedCall('CipherKeyValue', 'CipheredKeyValue', Object.assign({}, param));
|
|
41137
|
+
responses.push(Object.assign({
|
|
41138
|
+
path: serializedPath(param.address_n)
|
|
41139
|
+
}, res.message));
|
|
41140
|
+
}
|
|
41141
|
+
|
|
41142
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
41143
|
+
});
|
|
41144
|
+
}
|
|
41145
|
+
|
|
41146
|
+
}
|
|
41147
|
+
|
|
41148
|
+
var bitcoin = [{
|
|
41149
|
+
name: "Bitcoin",
|
|
41150
|
+
label: "BTC",
|
|
41151
|
+
slip44: 0
|
|
41152
|
+
}, {
|
|
41153
|
+
name: "Regtest",
|
|
41154
|
+
label: "REGTEST",
|
|
41155
|
+
slip44: 1
|
|
41156
|
+
}, {
|
|
41157
|
+
name: "Testnet",
|
|
41158
|
+
label: "TEST",
|
|
41159
|
+
slip44: 1
|
|
41160
|
+
}, {
|
|
41161
|
+
name: "Actinium",
|
|
41162
|
+
label: "ACM",
|
|
41163
|
+
slip44: 228
|
|
41164
|
+
}, {
|
|
41165
|
+
name: "Axe",
|
|
41166
|
+
label: "AXE",
|
|
39924
41167
|
slip44: 4242
|
|
39925
41168
|
}, {
|
|
39926
41169
|
name: "Bitcore",
|
|
@@ -40866,527 +42109,417 @@ class BTCSignTransaction extends BaseMethod {
|
|
|
40866
42109
|
}, {
|
|
40867
42110
|
name: 'op_return_data',
|
|
40868
42111
|
type: 'string'
|
|
40869
|
-
}, {
|
|
40870
|
-
name: 'multisig',
|
|
40871
|
-
type: 'object'
|
|
40872
|
-
}]);
|
|
40873
|
-
|
|
40874
|
-
if (Object.prototype.hasOwnProperty.call(output, 'address_n') && Object.prototype.hasOwnProperty.call(output, 'address')) {
|
|
40875
|
-
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, 'Cannot use address and address_n in one output');
|
|
40876
|
-
}
|
|
40877
|
-
|
|
40878
|
-
if (output.address_n) {
|
|
40879
|
-
const scriptType = getOutputScriptType(output.address_n);
|
|
40880
|
-
if (output.script_type !== scriptType) throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, `Output change script_type should be set to ${scriptType}`);
|
|
40881
|
-
}
|
|
40882
|
-
});
|
|
40883
|
-
const {
|
|
40884
|
-
inputs,
|
|
40885
|
-
outputs,
|
|
40886
|
-
refTxs,
|
|
40887
|
-
account,
|
|
40888
|
-
coin
|
|
40889
|
-
} = this.payload;
|
|
40890
|
-
const coinName = getCoinInfo(undefined, coin).name;
|
|
40891
|
-
this.params = {
|
|
40892
|
-
inputs,
|
|
40893
|
-
outputs,
|
|
40894
|
-
refTxs,
|
|
40895
|
-
addresses: account ? account.addresses : undefined,
|
|
40896
|
-
options: {
|
|
40897
|
-
lock_time: this.payload.locktime,
|
|
40898
|
-
timestamp: this.payload.timestamp,
|
|
40899
|
-
version: this.payload.version,
|
|
40900
|
-
expiry: this.payload.expiry,
|
|
40901
|
-
overwintered: this.payload.overwintered,
|
|
40902
|
-
version_group_id: this.payload.versionGroupId,
|
|
40903
|
-
branch_id: this.payload.branchId
|
|
40904
|
-
},
|
|
40905
|
-
coinName
|
|
40906
|
-
};
|
|
40907
|
-
}
|
|
40908
|
-
|
|
40909
|
-
run() {
|
|
40910
|
-
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40911
|
-
const {
|
|
40912
|
-
device,
|
|
40913
|
-
params
|
|
40914
|
-
} = this;
|
|
40915
|
-
const useLegacySignProcess = device.unavailableCapabilities.replaceTransaction;
|
|
40916
|
-
const {
|
|
40917
|
-
refTxs
|
|
40918
|
-
} = params;
|
|
40919
|
-
const signTxMethod = !useLegacySignProcess ? signtx : signtxLegacy;
|
|
40920
|
-
const response = yield signTxMethod(device.commands.typedCall.bind(device.commands), params.inputs, params.outputs, refTxs, params.options, params.coinName);
|
|
40921
|
-
return response;
|
|
40922
|
-
});
|
|
40923
|
-
}
|
|
40924
|
-
|
|
40925
|
-
}
|
|
40926
|
-
|
|
40927
|
-
class BTCVerifyMessage extends BaseMethod {
|
|
40928
|
-
init() {
|
|
40929
|
-
this.checkDeviceId = true;
|
|
40930
|
-
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
40931
|
-
validateParams(this.payload, [{
|
|
40932
|
-
name: 'address',
|
|
40933
|
-
type: 'string',
|
|
40934
|
-
required: true
|
|
40935
|
-
}, {
|
|
40936
|
-
name: 'messageHex',
|
|
40937
|
-
type: 'hexString',
|
|
40938
|
-
required: true
|
|
40939
|
-
}, {
|
|
40940
|
-
name: 'signature',
|
|
40941
|
-
type: 'hexString',
|
|
40942
|
-
required: true
|
|
40943
|
-
}, {
|
|
40944
|
-
name: 'coin',
|
|
40945
|
-
type: 'string',
|
|
40946
|
-
required: true
|
|
40947
|
-
}]);
|
|
40948
|
-
const {
|
|
40949
|
-
coin
|
|
40950
|
-
} = this.payload;
|
|
40951
|
-
const {
|
|
40952
|
-
address,
|
|
40953
|
-
messageHex,
|
|
40954
|
-
signature
|
|
40955
|
-
} = formatAnyHex(this.payload);
|
|
40956
|
-
const coinName = getCoinInfo(undefined, coin).name;
|
|
40957
|
-
this.params = {
|
|
40958
|
-
address,
|
|
40959
|
-
message: messageHex,
|
|
40960
|
-
signature,
|
|
40961
|
-
coin_name: coinName
|
|
40962
|
-
};
|
|
40963
|
-
}
|
|
40964
|
-
|
|
40965
|
-
run() {
|
|
40966
|
-
return dist_awaiter(this, void 0, void 0, function* () {
|
|
40967
|
-
const res = yield this.device.commands.typedCall('VerifyMessage', 'Success', Object.assign({}, this.params));
|
|
40968
|
-
return Promise.resolve(res.message);
|
|
40969
|
-
});
|
|
40970
|
-
}
|
|
40971
|
-
|
|
40972
|
-
}
|
|
40973
|
-
|
|
40974
|
-
class CheckFirmwareRelease extends BaseMethod {
|
|
40975
|
-
init() {
|
|
40976
|
-
this.useDevicePassphraseState = false;
|
|
40977
|
-
}
|
|
40978
|
-
|
|
40979
|
-
run() {
|
|
40980
|
-
if (this.device.features) {
|
|
40981
|
-
const releaseInfo = getFirmwareReleaseInfo(this.device.features);
|
|
40982
|
-
return Promise.resolve(releaseInfo);
|
|
40983
|
-
}
|
|
40984
|
-
|
|
40985
|
-
return Promise.resolve(null);
|
|
40986
|
-
}
|
|
40987
|
-
|
|
40988
|
-
}
|
|
40989
|
-
|
|
40990
|
-
class CheckBLEFirmwareRelease extends BaseMethod {
|
|
40991
|
-
init() {
|
|
40992
|
-
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
40993
|
-
this.checkDeviceId = true;
|
|
40994
|
-
this.useDevicePassphraseState = false;
|
|
40995
|
-
}
|
|
40996
|
-
|
|
40997
|
-
run() {
|
|
40998
|
-
if (this.device.features) {
|
|
40999
|
-
const releaseInfo = getBleFirmwareReleaseInfo(this.device.features);
|
|
41000
|
-
return Promise.resolve(releaseInfo);
|
|
41001
|
-
}
|
|
41002
|
-
|
|
41003
|
-
return Promise.resolve(null);
|
|
41004
|
-
}
|
|
41005
|
-
|
|
41006
|
-
}
|
|
41007
|
-
|
|
41008
|
-
class CheckTransportRelease extends BaseMethod {
|
|
41009
|
-
init() {
|
|
41010
|
-
this.useDevice = false;
|
|
41011
|
-
this.useDevicePassphraseState = false;
|
|
41012
|
-
}
|
|
41013
|
-
|
|
41014
|
-
run() {
|
|
41015
|
-
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41016
|
-
const transport = TransportManager.getTransport();
|
|
41017
|
-
const localVersion = yield transport.init();
|
|
41018
|
-
const response = DataManager.getTransportStatus(localVersion);
|
|
41019
|
-
return Promise.resolve(response);
|
|
41020
|
-
});
|
|
41021
|
-
}
|
|
41022
|
-
|
|
41023
|
-
}
|
|
41024
|
-
|
|
41025
|
-
class CheckBridgeStatus$1 extends BaseMethod {
|
|
41026
|
-
init() {
|
|
41027
|
-
this.useDevice = false;
|
|
41028
|
-
this.useDevicePassphraseState = false;
|
|
41029
|
-
}
|
|
41030
|
-
|
|
41031
|
-
run() {
|
|
41032
|
-
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41033
|
-
return new Promise((resolve, reject) => {
|
|
41034
|
-
axios_default().request({
|
|
41035
|
-
url: 'http://localhost:21320',
|
|
41036
|
-
method: 'POST',
|
|
41037
|
-
withCredentials: false,
|
|
41038
|
-
timeout: 3000
|
|
41039
|
-
}).then(() => resolve(true)).catch(e => {
|
|
41040
|
-
if (e.code === 'ECONNABORTED') {
|
|
41041
|
-
reject(HardwareError$1.TypedError(dist_HardwareErrorCode.BridgeTimeoutError));
|
|
41042
|
-
} else {
|
|
41043
|
-
resolve(false);
|
|
41044
|
-
}
|
|
41045
|
-
});
|
|
41046
|
-
});
|
|
41047
|
-
});
|
|
41048
|
-
}
|
|
41049
|
-
|
|
41050
|
-
}
|
|
41051
|
-
|
|
41052
|
-
class DeviceBackup extends BaseMethod {
|
|
41053
|
-
init() {
|
|
41054
|
-
this.useDevicePassphraseState = false;
|
|
41055
|
-
}
|
|
41056
|
-
|
|
41057
|
-
run() {
|
|
41058
|
-
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41059
|
-
const res = yield this.device.commands.typedCall('BackupDevice', 'Success');
|
|
41060
|
-
return Promise.resolve(res.message);
|
|
41061
|
-
});
|
|
41062
|
-
}
|
|
42112
|
+
}, {
|
|
42113
|
+
name: 'multisig',
|
|
42114
|
+
type: 'object'
|
|
42115
|
+
}]);
|
|
41063
42116
|
|
|
41064
|
-
|
|
42117
|
+
if (Object.prototype.hasOwnProperty.call(output, 'address_n') && Object.prototype.hasOwnProperty.call(output, 'address')) {
|
|
42118
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, 'Cannot use address and address_n in one output');
|
|
42119
|
+
}
|
|
41065
42120
|
|
|
41066
|
-
|
|
41067
|
-
|
|
41068
|
-
|
|
41069
|
-
|
|
41070
|
-
|
|
41071
|
-
|
|
41072
|
-
|
|
42121
|
+
if (output.address_n) {
|
|
42122
|
+
const scriptType = getOutputScriptType(output.address_n);
|
|
42123
|
+
if (output.script_type !== scriptType) throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, `Output change script_type should be set to ${scriptType}`);
|
|
42124
|
+
}
|
|
42125
|
+
});
|
|
42126
|
+
const {
|
|
42127
|
+
inputs,
|
|
42128
|
+
outputs,
|
|
42129
|
+
refTxs,
|
|
42130
|
+
account,
|
|
42131
|
+
coin
|
|
42132
|
+
} = this.payload;
|
|
42133
|
+
const coinName = getCoinInfo(undefined, coin).name;
|
|
41073
42134
|
this.params = {
|
|
41074
|
-
|
|
42135
|
+
inputs,
|
|
42136
|
+
outputs,
|
|
42137
|
+
refTxs,
|
|
42138
|
+
addresses: account ? account.addresses : undefined,
|
|
42139
|
+
options: {
|
|
42140
|
+
lock_time: this.payload.locktime,
|
|
42141
|
+
timestamp: this.payload.timestamp,
|
|
42142
|
+
version: this.payload.version,
|
|
42143
|
+
expiry: this.payload.expiry,
|
|
42144
|
+
overwintered: this.payload.overwintered,
|
|
42145
|
+
version_group_id: this.payload.versionGroupId,
|
|
42146
|
+
branch_id: this.payload.branchId
|
|
42147
|
+
},
|
|
42148
|
+
coinName
|
|
41075
42149
|
};
|
|
41076
42150
|
}
|
|
41077
42151
|
|
|
41078
42152
|
run() {
|
|
41079
42153
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41080
|
-
const
|
|
41081
|
-
|
|
42154
|
+
const {
|
|
42155
|
+
device,
|
|
42156
|
+
params
|
|
42157
|
+
} = this;
|
|
42158
|
+
const useLegacySignProcess = device.unavailableCapabilities.replaceTransaction;
|
|
42159
|
+
const {
|
|
42160
|
+
refTxs
|
|
42161
|
+
} = params;
|
|
42162
|
+
const signTxMethod = !useLegacySignProcess ? signtx : signtxLegacy;
|
|
42163
|
+
const response = yield signTxMethod(device.commands.typedCall.bind(device.commands), params.inputs, params.outputs, refTxs, params.options, params.coinName);
|
|
42164
|
+
return response;
|
|
41082
42165
|
});
|
|
41083
42166
|
}
|
|
41084
42167
|
|
|
41085
42168
|
}
|
|
41086
42169
|
|
|
41087
|
-
class
|
|
42170
|
+
class BTCVerifyMessage extends BaseMethod {
|
|
41088
42171
|
init() {
|
|
41089
|
-
this.
|
|
42172
|
+
this.checkDeviceId = true;
|
|
42173
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
41090
42174
|
validateParams(this.payload, [{
|
|
41091
|
-
name: '
|
|
41092
|
-
type: '
|
|
42175
|
+
name: 'address',
|
|
42176
|
+
type: 'string',
|
|
42177
|
+
required: true
|
|
42178
|
+
}, {
|
|
42179
|
+
name: 'messageHex',
|
|
42180
|
+
type: 'hexString',
|
|
42181
|
+
required: true
|
|
42182
|
+
}, {
|
|
42183
|
+
name: 'signature',
|
|
42184
|
+
type: 'hexString',
|
|
42185
|
+
required: true
|
|
42186
|
+
}, {
|
|
42187
|
+
name: 'coin',
|
|
42188
|
+
type: 'string',
|
|
42189
|
+
required: true
|
|
41093
42190
|
}]);
|
|
42191
|
+
const {
|
|
42192
|
+
coin
|
|
42193
|
+
} = this.payload;
|
|
42194
|
+
const {
|
|
42195
|
+
address,
|
|
42196
|
+
messageHex,
|
|
42197
|
+
signature
|
|
42198
|
+
} = formatAnyHex(this.payload);
|
|
42199
|
+
const coinName = getCoinInfo(undefined, coin).name;
|
|
41094
42200
|
this.params = {
|
|
41095
|
-
|
|
42201
|
+
address,
|
|
42202
|
+
message: messageHex,
|
|
42203
|
+
signature,
|
|
42204
|
+
coin_name: coinName
|
|
41096
42205
|
};
|
|
41097
42206
|
}
|
|
41098
42207
|
|
|
41099
42208
|
run() {
|
|
41100
42209
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41101
|
-
const res = yield this.device.commands.typedCall('
|
|
42210
|
+
const res = yield this.device.commands.typedCall('VerifyMessage', 'Success', Object.assign({}, this.params));
|
|
41102
42211
|
return Promise.resolve(res.message);
|
|
41103
42212
|
});
|
|
41104
42213
|
}
|
|
41105
42214
|
|
|
41106
42215
|
}
|
|
41107
42216
|
|
|
41108
|
-
class
|
|
42217
|
+
class ConfluxGetAddress extends BaseMethod {
|
|
42218
|
+
constructor() {
|
|
42219
|
+
super(...arguments);
|
|
42220
|
+
this.hasBundle = false;
|
|
42221
|
+
}
|
|
42222
|
+
|
|
41109
42223
|
init() {
|
|
41110
|
-
|
|
42224
|
+
var _a;
|
|
42225
|
+
|
|
42226
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
42227
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
42228
|
+
const payload = this.hasBundle ? this.payload : {
|
|
42229
|
+
bundle: [this.payload]
|
|
42230
|
+
};
|
|
42231
|
+
validateParams(payload, [{
|
|
42232
|
+
name: 'bundle',
|
|
42233
|
+
type: 'array'
|
|
42234
|
+
}]);
|
|
42235
|
+
this.params = [];
|
|
42236
|
+
payload.bundle.forEach(batch => {
|
|
42237
|
+
var _a;
|
|
42238
|
+
|
|
42239
|
+
const addressN = validatePath(batch.path, 3);
|
|
42240
|
+
validateParams(batch, [{
|
|
42241
|
+
name: 'path',
|
|
42242
|
+
required: true
|
|
42243
|
+
}, {
|
|
42244
|
+
name: 'chainId',
|
|
42245
|
+
type: 'number'
|
|
42246
|
+
}, {
|
|
42247
|
+
name: 'showOnOneKey',
|
|
42248
|
+
type: 'boolean'
|
|
42249
|
+
}]);
|
|
42250
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
42251
|
+
this.params.push({
|
|
42252
|
+
address_n: addressN,
|
|
42253
|
+
chain_id: batch.chainId,
|
|
42254
|
+
show_display: showOnOneKey
|
|
42255
|
+
});
|
|
42256
|
+
});
|
|
41111
42257
|
}
|
|
41112
42258
|
|
|
41113
42259
|
getVersionRange() {
|
|
41114
42260
|
return {
|
|
41115
|
-
|
|
41116
|
-
min: '2.
|
|
41117
|
-
},
|
|
41118
|
-
mini: {
|
|
41119
|
-
min: '2.1.11'
|
|
42261
|
+
model_mini: {
|
|
42262
|
+
min: '2.4.0'
|
|
41120
42263
|
}
|
|
41121
42264
|
};
|
|
41122
42265
|
}
|
|
41123
42266
|
|
|
41124
42267
|
run() {
|
|
41125
42268
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41126
|
-
const
|
|
41127
|
-
|
|
42269
|
+
const responses = [];
|
|
42270
|
+
|
|
42271
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
42272
|
+
const param = this.params[i];
|
|
42273
|
+
const res = yield this.device.commands.typedCall('ConfluxGetAddress', 'ConfluxAddress', Object.assign({}, param));
|
|
42274
|
+
responses.push(Object.assign({
|
|
42275
|
+
path: serializedPath(param.address_n)
|
|
42276
|
+
}, res.message));
|
|
42277
|
+
}
|
|
42278
|
+
|
|
42279
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
41128
42280
|
});
|
|
41129
42281
|
}
|
|
41130
42282
|
|
|
41131
42283
|
}
|
|
41132
42284
|
|
|
41133
|
-
class
|
|
42285
|
+
class ConfluxSignMessage extends BaseMethod {
|
|
41134
42286
|
init() {
|
|
41135
|
-
this.
|
|
42287
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
41136
42288
|
validateParams(this.payload, [{
|
|
41137
|
-
name: '
|
|
41138
|
-
|
|
41139
|
-
}, {
|
|
41140
|
-
name: 'passphraseProtection',
|
|
41141
|
-
type: 'boolean'
|
|
41142
|
-
}, {
|
|
41143
|
-
name: 'pinProtection',
|
|
41144
|
-
type: 'boolean'
|
|
41145
|
-
}, {
|
|
41146
|
-
name: 'language',
|
|
41147
|
-
type: 'string'
|
|
41148
|
-
}, {
|
|
41149
|
-
name: 'label',
|
|
41150
|
-
type: 'string'
|
|
41151
|
-
}, {
|
|
41152
|
-
name: 'enforceWordlist',
|
|
41153
|
-
type: 'boolean'
|
|
41154
|
-
}, {
|
|
41155
|
-
name: 'type',
|
|
41156
|
-
type: 'object'
|
|
41157
|
-
}, {
|
|
41158
|
-
name: 'u2fCounter',
|
|
41159
|
-
type: 'number'
|
|
42289
|
+
name: 'path',
|
|
42290
|
+
required: true
|
|
41160
42291
|
}, {
|
|
41161
|
-
name: '
|
|
41162
|
-
type: '
|
|
42292
|
+
name: 'messageHex',
|
|
42293
|
+
type: 'hexString',
|
|
42294
|
+
required: true
|
|
41163
42295
|
}]);
|
|
42296
|
+
const {
|
|
42297
|
+
path,
|
|
42298
|
+
messageHex
|
|
42299
|
+
} = this.payload;
|
|
42300
|
+
const addressN = validatePath(path, 3);
|
|
41164
42301
|
this.params = {
|
|
41165
|
-
|
|
41166
|
-
|
|
41167
|
-
pin_protection: this.payload.pinProtection,
|
|
41168
|
-
language: this.payload.language,
|
|
41169
|
-
label: this.payload.label,
|
|
41170
|
-
enforce_wordlist: this.payload.enforceWordlist,
|
|
41171
|
-
type: this.payload.type,
|
|
41172
|
-
u2f_counter: this.payload.u2fCounter || Math.floor(Date.now() / 1000),
|
|
41173
|
-
dry_run: this.payload.dryRun
|
|
42302
|
+
address_n: addressN,
|
|
42303
|
+
message: formatAnyHex(messageHex)
|
|
41174
42304
|
};
|
|
41175
42305
|
}
|
|
41176
42306
|
|
|
41177
|
-
|
|
41178
|
-
return
|
|
41179
|
-
|
|
41180
|
-
|
|
41181
|
-
|
|
41182
|
-
}
|
|
41183
|
-
|
|
41184
|
-
}
|
|
41185
|
-
|
|
41186
|
-
class DeviceReset extends BaseMethod {
|
|
41187
|
-
init() {
|
|
41188
|
-
this.useDevicePassphraseState = false;
|
|
41189
|
-
validateParams(this.payload, [{
|
|
41190
|
-
name: 'displayRandom',
|
|
41191
|
-
type: 'boolean'
|
|
41192
|
-
}, {
|
|
41193
|
-
name: 'strength',
|
|
41194
|
-
type: 'number'
|
|
41195
|
-
}, {
|
|
41196
|
-
name: 'passphraseProtection',
|
|
41197
|
-
type: 'boolean'
|
|
41198
|
-
}, {
|
|
41199
|
-
name: 'pinProtection',
|
|
41200
|
-
type: 'boolean'
|
|
41201
|
-
}, {
|
|
41202
|
-
name: 'language',
|
|
41203
|
-
type: 'string'
|
|
41204
|
-
}, {
|
|
41205
|
-
name: 'label',
|
|
41206
|
-
type: 'string'
|
|
41207
|
-
}, {
|
|
41208
|
-
name: 'u2fCounter',
|
|
41209
|
-
type: 'number'
|
|
41210
|
-
}, {
|
|
41211
|
-
name: 'skipBackup',
|
|
41212
|
-
type: 'boolean'
|
|
41213
|
-
}, {
|
|
41214
|
-
name: 'noBackup',
|
|
41215
|
-
type: 'boolean'
|
|
41216
|
-
}, {
|
|
41217
|
-
name: 'backupType'
|
|
41218
|
-
}]);
|
|
41219
|
-
this.params = {
|
|
41220
|
-
display_random: this.payload.displayRandom,
|
|
41221
|
-
strength: this.payload.strength || 256,
|
|
41222
|
-
passphrase_protection: this.payload.passphraseProtection,
|
|
41223
|
-
pin_protection: this.payload.pinProtection,
|
|
41224
|
-
language: this.payload.language,
|
|
41225
|
-
label: this.payload.label,
|
|
41226
|
-
u2f_counter: this.payload.u2fCounter || Math.floor(Date.now() / 1000),
|
|
41227
|
-
skip_backup: this.payload.skipBackup,
|
|
41228
|
-
no_backup: this.payload.noBackup,
|
|
41229
|
-
backup_type: this.payload.backupType
|
|
42307
|
+
getVersionRange() {
|
|
42308
|
+
return {
|
|
42309
|
+
model_mini: {
|
|
42310
|
+
min: '2.4.0'
|
|
42311
|
+
}
|
|
41230
42312
|
};
|
|
41231
42313
|
}
|
|
41232
42314
|
|
|
41233
42315
|
run() {
|
|
41234
42316
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41235
|
-
const res = yield this.device.commands.typedCall('
|
|
42317
|
+
const res = yield this.device.commands.typedCall('ConfluxSignMessage', 'ConfluxMessageSignature', Object.assign({}, this.params));
|
|
41236
42318
|
return Promise.resolve(res.message);
|
|
41237
42319
|
});
|
|
41238
42320
|
}
|
|
41239
42321
|
|
|
41240
42322
|
}
|
|
41241
42323
|
|
|
41242
|
-
class
|
|
42324
|
+
class ConfluxSignMessageCIP23 extends BaseMethod {
|
|
41243
42325
|
init() {
|
|
41244
|
-
this.
|
|
42326
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
41245
42327
|
validateParams(this.payload, [{
|
|
41246
|
-
name: '
|
|
41247
|
-
|
|
41248
|
-
}, {
|
|
41249
|
-
name: 'label',
|
|
41250
|
-
type: 'string'
|
|
41251
|
-
}, {
|
|
41252
|
-
name: 'usePassphrase',
|
|
41253
|
-
type: 'boolean'
|
|
41254
|
-
}, {
|
|
41255
|
-
name: 'homescreen',
|
|
41256
|
-
type: 'string'
|
|
41257
|
-
}, {
|
|
41258
|
-
name: 'passphraseSource',
|
|
41259
|
-
type: 'number'
|
|
41260
|
-
}, {
|
|
41261
|
-
name: 'autoLockDelayMs',
|
|
41262
|
-
type: 'number'
|
|
41263
|
-
}, {
|
|
41264
|
-
name: 'displayRotation',
|
|
41265
|
-
type: 'number'
|
|
41266
|
-
}, {
|
|
41267
|
-
name: 'passphraseAlwaysOnDevice',
|
|
41268
|
-
type: 'boolean'
|
|
42328
|
+
name: 'path',
|
|
42329
|
+
required: true
|
|
41269
42330
|
}, {
|
|
41270
|
-
name: '
|
|
41271
|
-
type: '
|
|
42331
|
+
name: 'domainHash',
|
|
42332
|
+
type: 'hexString',
|
|
42333
|
+
required: true
|
|
41272
42334
|
}, {
|
|
41273
|
-
name: '
|
|
41274
|
-
type: '
|
|
42335
|
+
name: 'messageHash',
|
|
42336
|
+
type: 'hexString',
|
|
42337
|
+
required: true
|
|
41275
42338
|
}]);
|
|
42339
|
+
const {
|
|
42340
|
+
path,
|
|
42341
|
+
domainHash,
|
|
42342
|
+
messageHash
|
|
42343
|
+
} = this.payload;
|
|
42344
|
+
const addressN = validatePath(path, 3);
|
|
41276
42345
|
this.params = {
|
|
41277
|
-
|
|
41278
|
-
|
|
41279
|
-
|
|
41280
|
-
homescreen: this.payload.homescreen,
|
|
41281
|
-
_passphrase_source: this.payload.passphraseSource,
|
|
41282
|
-
auto_lock_delay_ms: this.payload.autoLockDelayMs,
|
|
41283
|
-
display_rotation: this.payload.displayRotation,
|
|
41284
|
-
passphrase_always_on_device: this.payload.passphraseAlwaysOnDevice,
|
|
41285
|
-
safety_checks: this.payload.safetyChecks,
|
|
41286
|
-
experimental_features: this.payload.experimentalFeatures
|
|
42346
|
+
address_n: addressN,
|
|
42347
|
+
domain_hash: formatAnyHex(domainHash),
|
|
42348
|
+
message_hash: formatAnyHex(messageHash)
|
|
41287
42349
|
};
|
|
41288
42350
|
}
|
|
41289
42351
|
|
|
41290
42352
|
getVersionRange() {
|
|
41291
|
-
|
|
41292
|
-
|
|
41293
|
-
|
|
41294
|
-
|
|
41295
|
-
|
|
41296
|
-
};
|
|
41297
|
-
}
|
|
41298
|
-
|
|
41299
|
-
return {};
|
|
42353
|
+
return {
|
|
42354
|
+
model_mini: {
|
|
42355
|
+
min: '2.4.0'
|
|
42356
|
+
}
|
|
42357
|
+
};
|
|
41300
42358
|
}
|
|
41301
42359
|
|
|
41302
42360
|
run() {
|
|
41303
42361
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41304
|
-
const res = yield this.device.commands.typedCall('
|
|
42362
|
+
const res = yield this.device.commands.typedCall('ConfluxSignMessageCIP23', 'ConfluxMessageSignature', Object.assign({}, this.params));
|
|
41305
42363
|
return Promise.resolve(res.message);
|
|
41306
42364
|
});
|
|
41307
42365
|
}
|
|
41308
42366
|
|
|
41309
42367
|
}
|
|
41310
42368
|
|
|
41311
|
-
|
|
41312
|
-
|
|
41313
|
-
|
|
42369
|
+
const cutString = (str, cutLen) => {
|
|
42370
|
+
if (!str) {
|
|
42371
|
+
return ['', ''];
|
|
41314
42372
|
}
|
|
41315
42373
|
|
|
41316
|
-
|
|
41317
|
-
|
|
41318
|
-
|
|
41319
|
-
|
|
41320
|
-
});
|
|
41321
|
-
}
|
|
42374
|
+
const first = str.slice(0, cutLen);
|
|
42375
|
+
const second = str.slice(cutLen);
|
|
42376
|
+
return [first, second];
|
|
42377
|
+
};
|
|
41322
42378
|
|
|
41323
|
-
|
|
42379
|
+
class ConfluxSignTransaction extends BaseMethod {
|
|
42380
|
+
constructor() {
|
|
42381
|
+
super(...arguments);
|
|
42382
|
+
this.addressN = [];
|
|
41324
42383
|
|
|
41325
|
-
|
|
41326
|
-
|
|
41327
|
-
|
|
41328
|
-
|
|
42384
|
+
this.processTxRequest = (request, data) => dist_awaiter(this, void 0, void 0, function* () {
|
|
42385
|
+
if (!request.data_length) {
|
|
42386
|
+
const v = request.signature_v;
|
|
42387
|
+
const r = request.signature_r;
|
|
42388
|
+
const s = request.signature_s;
|
|
41329
42389
|
|
|
41330
|
-
|
|
41331
|
-
|
|
41332
|
-
|
|
41333
|
-
return Promise.resolve({
|
|
41334
|
-
inputPinOnSoftware,
|
|
41335
|
-
device: this.device.toMessageObject()
|
|
41336
|
-
});
|
|
41337
|
-
}
|
|
42390
|
+
if (v == null || r == null || s == null) {
|
|
42391
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodError, 'sign transaction failed');
|
|
42392
|
+
}
|
|
41338
42393
|
|
|
41339
|
-
|
|
42394
|
+
return Promise.resolve({
|
|
42395
|
+
v: `0x${v.toString(16)}`,
|
|
42396
|
+
r: `0x${r}`,
|
|
42397
|
+
s: `0x${s}`
|
|
42398
|
+
});
|
|
42399
|
+
}
|
|
41340
42400
|
|
|
41341
|
-
|
|
41342
|
-
|
|
41343
|
-
|
|
41344
|
-
|
|
41345
|
-
|
|
41346
|
-
|
|
41347
|
-
}]);
|
|
41348
|
-
this.params = {
|
|
41349
|
-
data: formatAnyHex(this.payload.dataHex)
|
|
41350
|
-
};
|
|
41351
|
-
}
|
|
42401
|
+
const [first, rest] = cutString(data, request.data_length * 2);
|
|
42402
|
+
const response = yield this.device.commands.typedCall('ConfluxTxAck', 'ConfluxTxRequest', {
|
|
42403
|
+
data_chunk: first
|
|
42404
|
+
});
|
|
42405
|
+
return this.processTxRequest(response.message, rest);
|
|
42406
|
+
});
|
|
41352
42407
|
|
|
41353
|
-
|
|
41354
|
-
|
|
41355
|
-
|
|
41356
|
-
|
|
42408
|
+
this.evmSignTx = (addressN, tx) => dist_awaiter(this, void 0, void 0, function* () {
|
|
42409
|
+
const {
|
|
42410
|
+
to,
|
|
42411
|
+
value,
|
|
42412
|
+
gasPrice,
|
|
42413
|
+
gasLimit,
|
|
42414
|
+
nonce,
|
|
42415
|
+
data,
|
|
42416
|
+
chainId,
|
|
42417
|
+
epochHeight,
|
|
42418
|
+
storageLimit
|
|
42419
|
+
} = tx;
|
|
42420
|
+
const length = data == null ? 0 : data.length / 2;
|
|
42421
|
+
const [first, rest] = cutString(data, 1024 * 2);
|
|
42422
|
+
let message = {
|
|
42423
|
+
address_n: addressN,
|
|
42424
|
+
nonce: stripHexStartZeroes(nonce),
|
|
42425
|
+
gas_price: stripHexStartZeroes(gasPrice),
|
|
42426
|
+
gas_limit: stripHexStartZeroes(gasLimit),
|
|
42427
|
+
to,
|
|
42428
|
+
value: stripHexStartZeroes(value),
|
|
42429
|
+
epoch_height: stripHexStartZeroes(epochHeight),
|
|
42430
|
+
storage_limit: stripHexStartZeroes(storageLimit),
|
|
42431
|
+
chain_id: chainId
|
|
42432
|
+
};
|
|
41357
42433
|
|
|
41358
|
-
if (
|
|
41359
|
-
|
|
41360
|
-
|
|
41361
|
-
|
|
41362
|
-
response = res.message;
|
|
41363
|
-
} else {
|
|
41364
|
-
const signatureRes = yield this.device.commands.typedCall('SESignMessage', 'SEMessageSignature', {
|
|
41365
|
-
message: this.params.data
|
|
42434
|
+
if (length !== 0) {
|
|
42435
|
+
message = Object.assign(Object.assign({}, message), {
|
|
42436
|
+
data_length: length,
|
|
42437
|
+
data_initial_chunk: first
|
|
41366
42438
|
});
|
|
41367
|
-
const certRes = yield this.device.commands.typedCall('ReadSEPublicCert', 'SEPublicCert');
|
|
41368
|
-
response = {
|
|
41369
|
-
cert: certRes.message.public_cert,
|
|
41370
|
-
signature: signatureRes.message.signature
|
|
41371
|
-
};
|
|
41372
42439
|
}
|
|
41373
42440
|
|
|
41374
|
-
|
|
41375
|
-
return
|
|
42441
|
+
const response = yield this.device.commands.typedCall('ConfluxSignTx', 'ConfluxTxRequest', message);
|
|
42442
|
+
return this.processTxRequest(response.message, rest);
|
|
41376
42443
|
});
|
|
41377
42444
|
}
|
|
41378
42445
|
|
|
41379
|
-
}
|
|
41380
|
-
|
|
41381
|
-
class DeviceWipe extends BaseMethod {
|
|
41382
42446
|
init() {
|
|
41383
|
-
this.
|
|
42447
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
42448
|
+
validateParams(this.payload, [{
|
|
42449
|
+
name: 'path',
|
|
42450
|
+
required: true
|
|
42451
|
+
}, {
|
|
42452
|
+
name: 'transaction',
|
|
42453
|
+
type: 'object',
|
|
42454
|
+
required: true
|
|
42455
|
+
}]);
|
|
42456
|
+
const {
|
|
42457
|
+
path,
|
|
42458
|
+
transaction
|
|
42459
|
+
} = this.payload;
|
|
42460
|
+
this.addressN = validatePath(path, 3);
|
|
42461
|
+
const tx = transaction;
|
|
42462
|
+
const schema = [{
|
|
42463
|
+
name: 'to',
|
|
42464
|
+
type: 'hexString',
|
|
42465
|
+
required: true
|
|
42466
|
+
}, {
|
|
42467
|
+
name: 'value',
|
|
42468
|
+
type: 'hexString',
|
|
42469
|
+
required: true
|
|
42470
|
+
}, {
|
|
42471
|
+
name: 'gasLimit',
|
|
42472
|
+
type: 'hexString',
|
|
42473
|
+
required: true
|
|
42474
|
+
}, {
|
|
42475
|
+
name: 'gasPrice',
|
|
42476
|
+
type: 'hexString',
|
|
42477
|
+
required: true
|
|
42478
|
+
}, {
|
|
42479
|
+
name: 'nonce',
|
|
42480
|
+
type: 'hexString',
|
|
42481
|
+
required: true
|
|
42482
|
+
}, {
|
|
42483
|
+
name: 'epochHeight',
|
|
42484
|
+
type: 'hexString',
|
|
42485
|
+
required: true
|
|
42486
|
+
}, {
|
|
42487
|
+
name: 'storageLimit',
|
|
42488
|
+
type: 'hexString',
|
|
42489
|
+
required: true
|
|
42490
|
+
}, {
|
|
42491
|
+
name: 'chainId',
|
|
42492
|
+
type: 'number',
|
|
42493
|
+
required: true
|
|
42494
|
+
}, {
|
|
42495
|
+
name: 'data',
|
|
42496
|
+
type: 'hexString'
|
|
42497
|
+
}];
|
|
42498
|
+
validateParams(tx, schema);
|
|
42499
|
+
this.formattedTx = formatAnyHex(tx);
|
|
42500
|
+
}
|
|
42501
|
+
|
|
42502
|
+
getVersionRange() {
|
|
42503
|
+
return {
|
|
42504
|
+
model_mini: {
|
|
42505
|
+
min: '2.4.0'
|
|
42506
|
+
}
|
|
42507
|
+
};
|
|
41384
42508
|
}
|
|
41385
42509
|
|
|
41386
42510
|
run() {
|
|
41387
42511
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41388
|
-
const
|
|
41389
|
-
|
|
42512
|
+
const {
|
|
42513
|
+
addressN,
|
|
42514
|
+
formattedTx
|
|
42515
|
+
} = this;
|
|
42516
|
+
|
|
42517
|
+
if (formattedTx == null) {
|
|
42518
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, 'ConfluxSignTransaction: format tx error');
|
|
42519
|
+
}
|
|
42520
|
+
|
|
42521
|
+
const signedTx = yield this.evmSignTx(addressN, formattedTx);
|
|
42522
|
+
return Promise.resolve(signedTx);
|
|
41390
42523
|
});
|
|
41391
42524
|
}
|
|
41392
42525
|
|
|
@@ -41583,20 +42716,10 @@ class EVMSignMessageEIP712 extends BaseMethod {
|
|
|
41583
42716
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
41584
42717
|
const res = yield this.device.commands.typedCall('EthereumSignMessageEIP712', 'EthereumMessageSignature', Object.assign({}, this.params));
|
|
41585
42718
|
return Promise.resolve(res.message);
|
|
41586
|
-
});
|
|
41587
|
-
}
|
|
41588
|
-
|
|
41589
|
-
}
|
|
41590
|
-
|
|
41591
|
-
const cutString = (str, cutLen) => {
|
|
41592
|
-
if (!str) {
|
|
41593
|
-
return ['', ''];
|
|
42719
|
+
});
|
|
41594
42720
|
}
|
|
41595
42721
|
|
|
41596
|
-
|
|
41597
|
-
const second = str.slice(cutLen);
|
|
41598
|
-
return [first, second];
|
|
41599
|
-
};
|
|
42722
|
+
}
|
|
41600
42723
|
|
|
41601
42724
|
class EVMSignTransaction extends BaseMethod {
|
|
41602
42725
|
constructor() {
|
|
@@ -43109,25 +44232,28 @@ class StellarSignTransaction extends BaseMethod {
|
|
|
43109
44232
|
type: 'object',
|
|
43110
44233
|
required: true
|
|
43111
44234
|
}]);
|
|
43112
|
-
const addressN = validatePath(this.payload.path, 3);
|
|
43113
44235
|
const {
|
|
43114
44236
|
transaction,
|
|
43115
44237
|
networkPassphrase
|
|
43116
44238
|
} = this.payload;
|
|
44239
|
+
|
|
44240
|
+
if (!transaction.timebounds) {
|
|
44241
|
+
throw HardwareError$1.TypedError(dist_HardwareErrorCode.CallMethodInvalidParameter, 'timebounds is required');
|
|
44242
|
+
}
|
|
44243
|
+
|
|
44244
|
+
const addressN = validatePath(this.payload.path, 3);
|
|
43117
44245
|
this.params = {
|
|
43118
44246
|
address_n: addressN,
|
|
43119
44247
|
network_passphrase: networkPassphrase,
|
|
43120
44248
|
source_account: transaction.source,
|
|
43121
44249
|
fee: transaction.fee,
|
|
43122
44250
|
sequence_number: transaction.sequence,
|
|
43123
|
-
num_operations: transaction.operations.length
|
|
44251
|
+
num_operations: transaction.operations.length,
|
|
44252
|
+
memo_type: StellarMemoType.NONE,
|
|
44253
|
+
timebounds_start: transaction.timebounds.minTime,
|
|
44254
|
+
timebounds_end: transaction.timebounds.maxTime
|
|
43124
44255
|
};
|
|
43125
44256
|
|
|
43126
|
-
if (transaction.timebounds) {
|
|
43127
|
-
this.params.timebounds_start = transaction.timebounds.minTime;
|
|
43128
|
-
this.params.timebounds_end = transaction.timebounds.maxTime;
|
|
43129
|
-
}
|
|
43130
|
-
|
|
43131
44257
|
if (transaction.memo) {
|
|
43132
44258
|
this.params.memo_type = transaction.memo.type;
|
|
43133
44259
|
this.params.memo_text = transaction.memo.text;
|
|
@@ -43155,277 +44281,416 @@ class StellarSignTransaction extends BaseMethod {
|
|
|
43155
44281
|
|
|
43156
44282
|
}
|
|
43157
44283
|
|
|
43158
|
-
|
|
43159
|
-
|
|
43160
|
-
|
|
43161
|
-
|
|
43162
|
-
}) => dist_awaiter(void 0, void 0, void 0, function* () {
|
|
43163
|
-
const releaseInfo = getInfo({
|
|
43164
|
-
features,
|
|
43165
|
-
updateType
|
|
43166
|
-
});
|
|
43167
|
-
|
|
43168
|
-
if (!releaseInfo) {
|
|
43169
|
-
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'no firmware found for this device');
|
|
44284
|
+
class TronGetAddress extends BaseMethod {
|
|
44285
|
+
constructor() {
|
|
44286
|
+
super(...arguments);
|
|
44287
|
+
this.hasBundle = false;
|
|
43170
44288
|
}
|
|
43171
44289
|
|
|
43172
|
-
|
|
43173
|
-
|
|
43174
|
-
}
|
|
44290
|
+
init() {
|
|
44291
|
+
var _a;
|
|
43175
44292
|
|
|
43176
|
-
|
|
43177
|
-
|
|
44293
|
+
this.checkDeviceId = true;
|
|
44294
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44295
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
44296
|
+
const payload = this.hasBundle ? this.payload : {
|
|
44297
|
+
bundle: [this.payload]
|
|
44298
|
+
};
|
|
44299
|
+
validateParams(payload, [{
|
|
44300
|
+
name: 'bundle',
|
|
44301
|
+
type: 'array'
|
|
44302
|
+
}]);
|
|
44303
|
+
this.params = [];
|
|
44304
|
+
payload.bundle.forEach(batch => {
|
|
44305
|
+
var _a;
|
|
43178
44306
|
|
|
43179
|
-
|
|
43180
|
-
|
|
43181
|
-
|
|
43182
|
-
|
|
44307
|
+
const addressN = validatePath(batch.path, 3);
|
|
44308
|
+
validateParams(batch, [{
|
|
44309
|
+
name: 'path',
|
|
44310
|
+
required: true
|
|
44311
|
+
}, {
|
|
44312
|
+
name: 'showOnOneKey',
|
|
44313
|
+
type: 'boolean'
|
|
44314
|
+
}]);
|
|
44315
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
44316
|
+
this.params.push({
|
|
44317
|
+
address_n: addressN,
|
|
44318
|
+
show_display: showOnOneKey
|
|
44319
|
+
});
|
|
44320
|
+
});
|
|
43183
44321
|
}
|
|
43184
44322
|
|
|
43185
|
-
|
|
43186
|
-
|
|
43187
|
-
|
|
43188
|
-
|
|
43189
|
-
|
|
43190
|
-
|
|
43191
|
-
|
|
43192
|
-
updateType
|
|
43193
|
-
}) => {
|
|
43194
|
-
var _a, _b, _c;
|
|
44323
|
+
getVersionRange() {
|
|
44324
|
+
return {
|
|
44325
|
+
model_mini: {
|
|
44326
|
+
min: '2.4.0'
|
|
44327
|
+
}
|
|
44328
|
+
};
|
|
44329
|
+
}
|
|
43195
44330
|
|
|
43196
|
-
|
|
43197
|
-
|
|
43198
|
-
|
|
43199
|
-
} = DataManager;
|
|
43200
|
-
const releaseInfo = (_c = (_b = (_a = deviceMap === null || deviceMap === void 0 ? void 0 : deviceMap[deviceType]) === null || _a === void 0 ? void 0 : _a[updateType]) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : null;
|
|
43201
|
-
return releaseInfo;
|
|
43202
|
-
};
|
|
44331
|
+
run() {
|
|
44332
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
44333
|
+
const responses = [];
|
|
43203
44334
|
|
|
43204
|
-
|
|
43205
|
-
|
|
44335
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
44336
|
+
const param = this.params[i];
|
|
44337
|
+
const res = yield this.device.commands.typedCall('TronGetAddress', 'TronAddress', Object.assign({}, param));
|
|
44338
|
+
const {
|
|
44339
|
+
address
|
|
44340
|
+
} = res.message;
|
|
44341
|
+
responses.push({
|
|
44342
|
+
path: serializedPath(param.address_n),
|
|
44343
|
+
address
|
|
44344
|
+
});
|
|
44345
|
+
}
|
|
43206
44346
|
|
|
43207
|
-
|
|
43208
|
-
device.emit(DEVICE.BUTTON, device, {
|
|
43209
|
-
code: 'ButtonRequest_FirmwareUpdate'
|
|
44347
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
43210
44348
|
});
|
|
43211
44349
|
}
|
|
43212
|
-
};
|
|
43213
|
-
|
|
43214
|
-
const postProgressMessage = (device, progress, postMessage) => {
|
|
43215
|
-
postMessage(createUiMessage(UI_REQUEST$1.FIRMWARE_PROGRESS, {
|
|
43216
|
-
device: device.toMessageObject(),
|
|
43217
|
-
progress
|
|
43218
|
-
}));
|
|
43219
|
-
};
|
|
43220
44350
|
|
|
43221
|
-
|
|
43222
|
-
payload
|
|
43223
|
-
}) => dist_awaiter(void 0, void 0, void 0, function* () {
|
|
43224
|
-
var _a, _b;
|
|
44351
|
+
}
|
|
43225
44352
|
|
|
43226
|
-
|
|
43227
|
-
|
|
43228
|
-
|
|
43229
|
-
|
|
43230
|
-
|
|
44353
|
+
class TronSignMessage extends BaseMethod {
|
|
44354
|
+
init() {
|
|
44355
|
+
this.checkDeviceId = true;
|
|
44356
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44357
|
+
validateParams(this.payload, [{
|
|
44358
|
+
name: 'path',
|
|
44359
|
+
required: true
|
|
44360
|
+
}, {
|
|
44361
|
+
name: 'messageHex',
|
|
44362
|
+
type: 'hexString',
|
|
44363
|
+
required: true
|
|
44364
|
+
}]);
|
|
43231
44365
|
const {
|
|
43232
|
-
|
|
43233
|
-
|
|
43234
|
-
|
|
43235
|
-
|
|
43236
|
-
|
|
43237
|
-
|
|
44366
|
+
path,
|
|
44367
|
+
messageHex
|
|
44368
|
+
} = this.payload;
|
|
44369
|
+
const addressN = validatePath(path, 3);
|
|
44370
|
+
this.params = {
|
|
44371
|
+
address_n: addressN,
|
|
44372
|
+
message: stripHexPrefix(messageHex)
|
|
44373
|
+
};
|
|
43238
44374
|
}
|
|
43239
44375
|
|
|
43240
|
-
|
|
43241
|
-
|
|
43242
|
-
|
|
43243
|
-
|
|
43244
|
-
|
|
44376
|
+
getVersionRange() {
|
|
44377
|
+
return {
|
|
44378
|
+
model_mini: {
|
|
44379
|
+
min: '2.4.0'
|
|
44380
|
+
}
|
|
44381
|
+
};
|
|
44382
|
+
}
|
|
44383
|
+
|
|
44384
|
+
run() {
|
|
44385
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
44386
|
+
const response = yield this.device.commands.typedCall('TronSignMessage', 'TronMessageSignature', Object.assign({}, this.params));
|
|
44387
|
+
return Promise.resolve(response.message);
|
|
43245
44388
|
});
|
|
44389
|
+
}
|
|
43246
44390
|
|
|
43247
|
-
|
|
43248
|
-
const start = response.message.offset;
|
|
43249
|
-
const end = response.message.offset + response.message.length;
|
|
43250
|
-
const chunk = payload.slice(start, end);
|
|
44391
|
+
}
|
|
43251
44392
|
|
|
43252
|
-
|
|
43253
|
-
|
|
44393
|
+
class TronSignTransaction extends BaseMethod {
|
|
44394
|
+
parseTx(tx, address_n) {
|
|
44395
|
+
const unSignTx = {
|
|
44396
|
+
address_n,
|
|
44397
|
+
data: tx.data,
|
|
44398
|
+
timestamp: tx.timestamp,
|
|
44399
|
+
fee_limit: tx.feeLimit,
|
|
44400
|
+
ref_block_bytes: tx.refBlockBytes,
|
|
44401
|
+
ref_block_hash: tx.refBlockHash,
|
|
44402
|
+
expiration: tx.expiration,
|
|
44403
|
+
contract: {}
|
|
44404
|
+
};
|
|
44405
|
+
|
|
44406
|
+
if (tx.contract) {
|
|
44407
|
+
if (tx.contract.transferContract) {
|
|
44408
|
+
unSignTx.contract = {
|
|
44409
|
+
transfer_contract: {
|
|
44410
|
+
to_address: tx.contract.transferContract.toAddress,
|
|
44411
|
+
amount: tx.contract.transferContract.amount
|
|
44412
|
+
}
|
|
44413
|
+
};
|
|
43254
44414
|
}
|
|
43255
44415
|
|
|
43256
|
-
|
|
43257
|
-
|
|
43258
|
-
|
|
44416
|
+
if (tx.contract.triggerSmartContract) {
|
|
44417
|
+
unSignTx.contract = {
|
|
44418
|
+
trigger_smart_contract: {
|
|
44419
|
+
contract_address: tx.contract.triggerSmartContract.contractAddress,
|
|
44420
|
+
call_value: tx.contract.triggerSmartContract.callValue,
|
|
44421
|
+
data: tx.contract.triggerSmartContract.data,
|
|
44422
|
+
call_token_value: tx.contract.triggerSmartContract.callTokenValue,
|
|
44423
|
+
asset_id: tx.contract.triggerSmartContract.assetId
|
|
44424
|
+
}
|
|
44425
|
+
};
|
|
44426
|
+
}
|
|
43259
44427
|
}
|
|
43260
44428
|
|
|
43261
|
-
|
|
43262
|
-
return response.message;
|
|
44429
|
+
return unSignTx;
|
|
43263
44430
|
}
|
|
43264
44431
|
|
|
43265
|
-
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'uploadFirmware: unknown major_version');
|
|
43266
|
-
});
|
|
43267
|
-
|
|
43268
|
-
class FirmwareUpdate extends BaseMethod {
|
|
43269
44432
|
init() {
|
|
43270
|
-
this.
|
|
43271
|
-
this.
|
|
43272
|
-
this.
|
|
44433
|
+
this.checkDeviceId = true;
|
|
44434
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44435
|
+
validateParams(this.payload, [{
|
|
44436
|
+
name: 'path',
|
|
44437
|
+
required: true
|
|
44438
|
+
}, {
|
|
44439
|
+
name: 'transaction',
|
|
44440
|
+
type: 'object',
|
|
44441
|
+
required: true
|
|
44442
|
+
}]);
|
|
43273
44443
|
const {
|
|
43274
|
-
|
|
43275
|
-
|
|
43276
|
-
|
|
43277
|
-
|
|
43278
|
-
|
|
44444
|
+
path,
|
|
44445
|
+
transaction
|
|
44446
|
+
} = this.payload;
|
|
44447
|
+
const addressN = validatePath(path, 3);
|
|
44448
|
+
validateParams(transaction, [{
|
|
44449
|
+
name: 'refBlockBytes',
|
|
44450
|
+
type: 'hexString',
|
|
44451
|
+
required: true
|
|
43279
44452
|
}, {
|
|
43280
|
-
name: '
|
|
43281
|
-
type: '
|
|
44453
|
+
name: 'refBlockHash',
|
|
44454
|
+
type: 'hexString',
|
|
44455
|
+
required: true
|
|
44456
|
+
}, {
|
|
44457
|
+
name: 'expiration',
|
|
44458
|
+
type: 'number',
|
|
44459
|
+
required: true
|
|
44460
|
+
}, {
|
|
44461
|
+
name: 'timestamp',
|
|
44462
|
+
type: 'number',
|
|
44463
|
+
required: true
|
|
44464
|
+
}, {
|
|
44465
|
+
name: 'contract',
|
|
44466
|
+
type: 'object',
|
|
44467
|
+
required: true
|
|
43282
44468
|
}]);
|
|
44469
|
+
this.params = this.parseTx(formatAnyHex(transaction), addressN);
|
|
44470
|
+
}
|
|
43283
44471
|
|
|
43284
|
-
|
|
43285
|
-
|
|
43286
|
-
|
|
44472
|
+
getVersionRange() {
|
|
44473
|
+
return {
|
|
44474
|
+
model_mini: {
|
|
44475
|
+
min: '2.4.0'
|
|
44476
|
+
}
|
|
44477
|
+
};
|
|
44478
|
+
}
|
|
43287
44479
|
|
|
43288
|
-
|
|
43289
|
-
|
|
44480
|
+
run() {
|
|
44481
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
44482
|
+
const response = yield this.device.commands.typedCall('TronSignTx', 'TronSignedTx', Object.assign({}, this.params));
|
|
44483
|
+
return Promise.resolve(response.message);
|
|
44484
|
+
});
|
|
44485
|
+
}
|
|
44486
|
+
|
|
44487
|
+
}
|
|
44488
|
+
|
|
44489
|
+
class NearGetAddress extends BaseMethod {
|
|
44490
|
+
constructor() {
|
|
44491
|
+
super(...arguments);
|
|
44492
|
+
this.hasBundle = false;
|
|
44493
|
+
}
|
|
44494
|
+
|
|
44495
|
+
init() {
|
|
44496
|
+
var _a;
|
|
44497
|
+
|
|
44498
|
+
this.checkDeviceId = true;
|
|
44499
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44500
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
44501
|
+
const payload = this.hasBundle ? this.payload : {
|
|
44502
|
+
bundle: [this.payload]
|
|
43290
44503
|
};
|
|
44504
|
+
validateParams(payload, [{
|
|
44505
|
+
name: 'bundle',
|
|
44506
|
+
type: 'array'
|
|
44507
|
+
}]);
|
|
44508
|
+
this.params = [];
|
|
44509
|
+
payload.bundle.forEach(batch => {
|
|
44510
|
+
var _a;
|
|
43291
44511
|
|
|
43292
|
-
|
|
43293
|
-
|
|
43294
|
-
|
|
44512
|
+
const addressN = validatePath(batch.path, 3);
|
|
44513
|
+
validateParams(batch, [{
|
|
44514
|
+
name: 'path',
|
|
44515
|
+
required: true
|
|
44516
|
+
}, {
|
|
44517
|
+
name: 'showOnOneKey',
|
|
44518
|
+
type: 'boolean'
|
|
44519
|
+
}]);
|
|
44520
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
44521
|
+
this.params.push({
|
|
44522
|
+
address_n: addressN,
|
|
44523
|
+
show_display: showOnOneKey
|
|
43295
44524
|
});
|
|
43296
|
-
}
|
|
44525
|
+
});
|
|
44526
|
+
}
|
|
43297
44527
|
|
|
43298
|
-
|
|
43299
|
-
|
|
43300
|
-
|
|
43301
|
-
|
|
43302
|
-
|
|
44528
|
+
getVersionRange() {
|
|
44529
|
+
return {
|
|
44530
|
+
model_mini: {
|
|
44531
|
+
min: '2.4.0'
|
|
44532
|
+
}
|
|
44533
|
+
};
|
|
43303
44534
|
}
|
|
43304
44535
|
|
|
43305
44536
|
run() {
|
|
43306
|
-
var _a;
|
|
43307
|
-
|
|
43308
44537
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
43309
|
-
const
|
|
43310
|
-
device,
|
|
43311
|
-
params
|
|
43312
|
-
} = this;
|
|
43313
|
-
let binary;
|
|
43314
|
-
|
|
43315
|
-
try {
|
|
43316
|
-
if (params.binary) {
|
|
43317
|
-
binary = this.params.binary;
|
|
43318
|
-
} else {
|
|
43319
|
-
if (!device.features) {
|
|
43320
|
-
throw HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'no features found for this device');
|
|
43321
|
-
}
|
|
44538
|
+
const responses = [];
|
|
43322
44539
|
|
|
43323
|
-
|
|
43324
|
-
|
|
43325
|
-
|
|
43326
|
-
|
|
43327
|
-
|
|
43328
|
-
|
|
43329
|
-
|
|
43330
|
-
|
|
43331
|
-
|
|
44540
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
44541
|
+
const param = this.params[i];
|
|
44542
|
+
const res = yield this.device.commands.typedCall('NearGetAddress', 'NearAddress', Object.assign({}, param));
|
|
44543
|
+
const {
|
|
44544
|
+
address
|
|
44545
|
+
} = res.message;
|
|
44546
|
+
responses.push({
|
|
44547
|
+
path: serializedPath(param.address_n),
|
|
44548
|
+
address
|
|
44549
|
+
});
|
|
43332
44550
|
}
|
|
43333
44551
|
|
|
43334
|
-
return
|
|
43335
|
-
payload: binary
|
|
43336
|
-
});
|
|
44552
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
43337
44553
|
});
|
|
43338
44554
|
}
|
|
43339
44555
|
|
|
43340
44556
|
}
|
|
43341
44557
|
|
|
43342
|
-
|
|
43343
|
-
|
|
43344
|
-
class RequestWebUsbDevice extends BaseMethod {
|
|
44558
|
+
class NearSignTransaction extends BaseMethod {
|
|
43345
44559
|
init() {
|
|
43346
|
-
this.
|
|
43347
|
-
this.
|
|
44560
|
+
this.checkDeviceId = true;
|
|
44561
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44562
|
+
validateParams(this.payload, [{
|
|
44563
|
+
name: 'path',
|
|
44564
|
+
required: true
|
|
44565
|
+
}, {
|
|
44566
|
+
name: 'rawTx',
|
|
44567
|
+
type: 'hexString',
|
|
44568
|
+
required: true
|
|
44569
|
+
}]);
|
|
44570
|
+
const {
|
|
44571
|
+
path,
|
|
44572
|
+
rawTx
|
|
44573
|
+
} = this.payload;
|
|
44574
|
+
const addressN = validatePath(path, 3);
|
|
44575
|
+
this.params = {
|
|
44576
|
+
address_n: addressN,
|
|
44577
|
+
raw_tx: formatAnyHex(rawTx)
|
|
44578
|
+
};
|
|
43348
44579
|
}
|
|
43349
44580
|
|
|
43350
|
-
|
|
43351
|
-
|
|
43352
|
-
|
|
43353
|
-
|
|
43354
|
-
yield TransportManager.configure();
|
|
43355
|
-
const env = DataManager.getSettings('env');
|
|
43356
|
-
|
|
43357
|
-
if (env !== 'webusb') {
|
|
43358
|
-
return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Not webusb environment'));
|
|
44581
|
+
getVersionRange() {
|
|
44582
|
+
return {
|
|
44583
|
+
model_mini: {
|
|
44584
|
+
min: '2.4.0'
|
|
43359
44585
|
}
|
|
44586
|
+
};
|
|
44587
|
+
}
|
|
43360
44588
|
|
|
43361
|
-
|
|
43362
|
-
|
|
43363
|
-
|
|
43364
|
-
|
|
43365
|
-
deviceList
|
|
43366
|
-
} = yield DevicePool.getDevices(devicesDescriptor);
|
|
43367
|
-
|
|
43368
|
-
if (deviceList.length > 0) {
|
|
43369
|
-
return {
|
|
43370
|
-
device: deviceList[0].toMessageObject()
|
|
43371
|
-
};
|
|
43372
|
-
}
|
|
43373
|
-
|
|
43374
|
-
return yield Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Please select the device to connect'));
|
|
43375
|
-
} catch (error) {
|
|
43376
|
-
Log$2.debug(error);
|
|
43377
|
-
return Promise.reject(HardwareError$1.TypedError(dist_HardwareErrorCode.RuntimeError, 'Please select the device to connect'));
|
|
43378
|
-
}
|
|
44589
|
+
run() {
|
|
44590
|
+
return dist_awaiter(this, void 0, void 0, function* () {
|
|
44591
|
+
const res = yield this.device.commands.typedCall('NearSignTx', 'NearSignedTx', Object.assign({}, this.params));
|
|
44592
|
+
return Promise.resolve(res.message);
|
|
43379
44593
|
});
|
|
43380
44594
|
}
|
|
43381
44595
|
|
|
43382
44596
|
}
|
|
43383
44597
|
|
|
43384
|
-
class
|
|
44598
|
+
class AptosGetAddress extends BaseMethod {
|
|
44599
|
+
constructor() {
|
|
44600
|
+
super(...arguments);
|
|
44601
|
+
this.hasBundle = false;
|
|
44602
|
+
}
|
|
44603
|
+
|
|
43385
44604
|
init() {
|
|
44605
|
+
var _a;
|
|
44606
|
+
|
|
44607
|
+
this.checkDeviceId = true;
|
|
43386
44608
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
43387
|
-
this.
|
|
44609
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
44610
|
+
const payload = this.hasBundle ? this.payload : {
|
|
44611
|
+
bundle: [this.payload]
|
|
44612
|
+
};
|
|
44613
|
+
validateParams(payload, [{
|
|
44614
|
+
name: 'bundle',
|
|
44615
|
+
type: 'array'
|
|
44616
|
+
}]);
|
|
44617
|
+
this.params = [];
|
|
44618
|
+
payload.bundle.forEach(batch => {
|
|
44619
|
+
var _a;
|
|
44620
|
+
|
|
44621
|
+
const addressN = validatePath(batch.path, 3);
|
|
44622
|
+
validateParams(batch, [{
|
|
44623
|
+
name: 'path',
|
|
44624
|
+
required: true
|
|
44625
|
+
}, {
|
|
44626
|
+
name: 'showOnOneKey',
|
|
44627
|
+
type: 'boolean'
|
|
44628
|
+
}]);
|
|
44629
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
44630
|
+
this.params.push({
|
|
44631
|
+
address_n: addressN,
|
|
44632
|
+
show_display: showOnOneKey
|
|
44633
|
+
});
|
|
44634
|
+
});
|
|
43388
44635
|
}
|
|
43389
44636
|
|
|
43390
44637
|
run() {
|
|
43391
|
-
var _a, _b;
|
|
43392
|
-
|
|
43393
44638
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
43394
|
-
|
|
43395
|
-
let {
|
|
43396
|
-
features
|
|
43397
|
-
} = this.device;
|
|
43398
|
-
const locked = ((_b = (_a = this.device) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.unlocked) === true;
|
|
43399
|
-
const passphraseState = yield getPassphraseState(this.device.features, this.device.commands);
|
|
43400
|
-
const isModeT = getDeviceType(features) === 'touch' || getDeviceType(features) === 'pro';
|
|
44639
|
+
const responses = [];
|
|
43401
44640
|
|
|
43402
|
-
|
|
44641
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
44642
|
+
const param = this.params[i];
|
|
44643
|
+
const res = yield this.device.commands.typedCall('AptosGetAddress', 'AptosAddress', Object.assign({}, param));
|
|
43403
44644
|
const {
|
|
43404
|
-
|
|
43405
|
-
} =
|
|
43406
|
-
|
|
43407
|
-
|
|
43408
|
-
|
|
43409
|
-
|
|
43410
|
-
return Promise.resolve(passphraseState);
|
|
44645
|
+
address
|
|
44646
|
+
} = res.message;
|
|
44647
|
+
responses.push({
|
|
44648
|
+
path: serializedPath(param.address_n),
|
|
44649
|
+
address
|
|
44650
|
+
});
|
|
43411
44651
|
}
|
|
43412
44652
|
|
|
43413
|
-
return Promise.resolve(
|
|
44653
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
43414
44654
|
});
|
|
43415
44655
|
}
|
|
43416
44656
|
|
|
43417
44657
|
}
|
|
43418
44658
|
|
|
43419
|
-
class
|
|
44659
|
+
class AptosSignTransaction extends BaseMethod {
|
|
43420
44660
|
init() {
|
|
43421
|
-
this.
|
|
43422
|
-
this.
|
|
44661
|
+
this.checkDeviceId = true;
|
|
44662
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
44663
|
+
validateParams(this.payload, [{
|
|
44664
|
+
name: 'path',
|
|
44665
|
+
required: true
|
|
44666
|
+
}, {
|
|
44667
|
+
name: 'rawTx',
|
|
44668
|
+
type: 'hexString',
|
|
44669
|
+
required: true
|
|
44670
|
+
}]);
|
|
44671
|
+
const {
|
|
44672
|
+
path,
|
|
44673
|
+
rawTx
|
|
44674
|
+
} = this.payload;
|
|
44675
|
+
const addressN = validatePath(path, 3);
|
|
44676
|
+
this.params = {
|
|
44677
|
+
address_n: addressN,
|
|
44678
|
+
raw_tx: formatAnyHex(rawTx)
|
|
44679
|
+
};
|
|
44680
|
+
}
|
|
44681
|
+
|
|
44682
|
+
getVersionRange() {
|
|
44683
|
+
return {
|
|
44684
|
+
model_mini: {
|
|
44685
|
+
min: '2.4.0'
|
|
44686
|
+
}
|
|
44687
|
+
};
|
|
43423
44688
|
}
|
|
43424
44689
|
|
|
43425
44690
|
run() {
|
|
43426
44691
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
43427
|
-
const
|
|
43428
|
-
return Promise.resolve(
|
|
44692
|
+
const res = yield this.device.commands.typedCall('AptosSignTx', 'AptosSignedTx', Object.assign({}, this.params));
|
|
44693
|
+
return Promise.resolve(res.message);
|
|
43429
44694
|
});
|
|
43430
44695
|
}
|
|
43431
44696
|
|
|
@@ -43435,16 +44700,12 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
43435
44700
|
__proto__: null,
|
|
43436
44701
|
searchDevices: SearchDevices,
|
|
43437
44702
|
getFeatures: GetFeatures,
|
|
43438
|
-
|
|
43439
|
-
|
|
43440
|
-
btcGetPublicKey: BTCGetPublicKey,
|
|
43441
|
-
btcSignMessage: BTCSignMessage,
|
|
43442
|
-
btcSignTransaction: BTCSignTransaction,
|
|
43443
|
-
btcVerifyMessage: BTCVerifyMessage,
|
|
44703
|
+
getPassphraseState: GetPassphraseState,
|
|
44704
|
+
getLogs: CheckBridgeStatus$1,
|
|
43444
44705
|
checkFirmwareRelease: CheckFirmwareRelease,
|
|
43445
44706
|
checkBLEFirmwareRelease: CheckBLEFirmwareRelease,
|
|
43446
44707
|
checkTransportRelease: CheckTransportRelease,
|
|
43447
|
-
checkBridgeStatus: CheckBridgeStatus
|
|
44708
|
+
checkBridgeStatus: CheckBridgeStatus,
|
|
43448
44709
|
deviceBackup: DeviceBackup,
|
|
43449
44710
|
deviceChangePin: DeviceChangePin,
|
|
43450
44711
|
deviceFlags: DeviceFlags,
|
|
@@ -43456,6 +44717,18 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
43456
44717
|
deviceSupportFeatures: DeviceSupportFeatures,
|
|
43457
44718
|
deviceVerify: DeviceVerify,
|
|
43458
44719
|
deviceWipe: DeviceWipe,
|
|
44720
|
+
firmwareUpdate: FirmwareUpdate,
|
|
44721
|
+
requestWebUsbDevice: RequestWebUsbDevice,
|
|
44722
|
+
cipherKeyValue: CipherKeyValue,
|
|
44723
|
+
btcGetAddress: BTCGetAddress,
|
|
44724
|
+
btcGetPublicKey: BTCGetPublicKey,
|
|
44725
|
+
btcSignMessage: BTCSignMessage,
|
|
44726
|
+
btcSignTransaction: BTCSignTransaction,
|
|
44727
|
+
btcVerifyMessage: BTCVerifyMessage,
|
|
44728
|
+
confluxGetAddress: ConfluxGetAddress,
|
|
44729
|
+
confluxSignMessage: ConfluxSignMessage,
|
|
44730
|
+
confluxSignMessageCIP23: ConfluxSignMessageCIP23,
|
|
44731
|
+
confluxSignTransaction: ConfluxSignTransaction,
|
|
43459
44732
|
evmGetAddress: EvmGetAddress,
|
|
43460
44733
|
evmGetPublicKey: EVMGetPublicKey,
|
|
43461
44734
|
evmSignMessage: EVMSignMessage$2,
|
|
@@ -43474,10 +44747,13 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
43474
44747
|
solSignTransaction: SolSignTransaction,
|
|
43475
44748
|
stellarGetAddress: StellarGetAddress,
|
|
43476
44749
|
stellarSignTransaction: StellarSignTransaction,
|
|
43477
|
-
|
|
43478
|
-
|
|
43479
|
-
|
|
43480
|
-
|
|
44750
|
+
tronGetAddress: TronGetAddress,
|
|
44751
|
+
tronSignMessage: TronSignMessage,
|
|
44752
|
+
tronSignTransaction: TronSignTransaction,
|
|
44753
|
+
nearGetAddress: NearGetAddress,
|
|
44754
|
+
nearSignTransaction: NearSignTransaction,
|
|
44755
|
+
aptosGetAddress: AptosGetAddress,
|
|
44756
|
+
aptosSignTransaction: AptosSignTransaction
|
|
43481
44757
|
});
|
|
43482
44758
|
|
|
43483
44759
|
function findMethod(message) {
|
|
@@ -44154,6 +45430,8 @@ const removeUiPromise = promise => {
|
|
|
44154
45430
|
|
|
44155
45431
|
class Core extends dist_events.exports {
|
|
44156
45432
|
handleMessage(message) {
|
|
45433
|
+
var _a, _b, _c, _d;
|
|
45434
|
+
|
|
44157
45435
|
return dist_awaiter(this, void 0, void 0, function* () {
|
|
44158
45436
|
switch (message.type) {
|
|
44159
45437
|
case UI_RESPONSE.RECEIVE_PIN:
|
|
@@ -44178,7 +45456,21 @@ class Core extends dist_events.exports {
|
|
|
44178
45456
|
case IFRAME.CALL:
|
|
44179
45457
|
{
|
|
44180
45458
|
const response = yield callAPI(message);
|
|
44181
|
-
|
|
45459
|
+
const {
|
|
45460
|
+
success,
|
|
45461
|
+
payload
|
|
45462
|
+
} = response;
|
|
45463
|
+
|
|
45464
|
+
if (success) {
|
|
45465
|
+
return response;
|
|
45466
|
+
}
|
|
45467
|
+
|
|
45468
|
+
return Object.assign(Object.assign({}, response), {
|
|
45469
|
+
payload: Object.assign(Object.assign({}, payload), {
|
|
45470
|
+
connectId: (_b = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.connectId) !== null && _b !== void 0 ? _b : '',
|
|
45471
|
+
deviceId: (_d = (_c = message.payload) === null || _c === void 0 ? void 0 : _c.deviceId) !== null && _d !== void 0 ? _d : ''
|
|
45472
|
+
})
|
|
45473
|
+
});
|
|
44182
45474
|
}
|
|
44183
45475
|
|
|
44184
45476
|
case IFRAME.CANCEL:
|
|
@@ -46688,7 +47980,7 @@ const src_init = async settings => {
|
|
|
46688
47980
|
|
|
46689
47981
|
try {
|
|
46690
47982
|
await builder_init({ ..._settings,
|
|
46691
|
-
version: "0.1.
|
|
47983
|
+
version: "0.1.44"
|
|
46692
47984
|
});
|
|
46693
47985
|
return true;
|
|
46694
47986
|
} catch (e) {
|