@onekeyfe/hd-core 0.2.15 → 0.2.17
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/dist/api/FirmwareUpdateV2.d.ts +2 -1
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/cardano/helper/cardanoInputs.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBoardloader.d.ts +15 -0
- package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -0
- package/dist/api/filecoin/FilecoinGetAddress.d.ts +17 -0
- package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -0
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts +19 -0
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +2 -1
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/index.d.ts +41 -4
- package/dist/index.js +472 -277
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/cardano.d.ts.map +1 -1
- package/dist/types/api/deviceRebootToBoardloader.d.ts +5 -0
- package/dist/types/api/deviceRebootToBoardloader.d.ts.map +1 -0
- package/dist/types/api/export.d.ts +2 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/filecoinGetAddress.d.ts +14 -0
- package/dist/types/api/filecoinGetAddress.d.ts.map +1 -0
- package/dist/types/api/filecoinSignTransaction.d.ts +14 -0
- package/dist/types/api/filecoinSignTransaction.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdate.d.ts +7 -0
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +8 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/settings.d.ts +1 -0
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV2.ts +25 -2
- package/src/api/device/DeviceRebootToBoardloader.ts +28 -0
- package/src/api/filecoin/FilecoinGetAddress.ts +71 -0
- package/src/api/filecoin/FilecoinSignTransaction.ts +54 -0
- package/src/api/firmware/getBinary.ts +12 -2
- package/src/api/index.ts +4 -0
- package/src/data/messages/messages.json +463 -419
- package/src/data-manager/DataManager.ts +17 -5
- package/src/inject.ts +7 -0
- package/src/types/api/cardano.ts +0 -1
- package/src/types/api/deviceRebootToBoardloader.ts +6 -0
- package/src/types/api/export.ts +3 -0
- package/src/types/api/filecoinGetAddress.ts +23 -0
- package/src/types/api/filecoinSignTransaction.ts +23 -0
- package/src/types/api/firmwareUpdate.ts +12 -0
- package/src/types/api/index.ts +13 -2
- package/src/types/settings.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
|
48
48
|
deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
|
|
49
49
|
deviceChangePin: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceChangePin' })),
|
|
50
50
|
deviceFlags: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceFlags' })),
|
|
51
|
+
deviceRebootToBoardloader: connectId => call({ connectId, method: 'deviceRebootToBoardloader' }),
|
|
51
52
|
deviceRebootToBootloader: connectId => call({ connectId, method: 'deviceRebootToBootloader' }),
|
|
52
53
|
deviceRecovery: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceRecovery' })),
|
|
53
54
|
deviceReset: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceReset' })),
|
|
@@ -111,6 +112,8 @@ const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
|
111
112
|
cardanoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetAddress' })),
|
|
112
113
|
cardanoGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetPublicKey' })),
|
|
113
114
|
cardanoSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoSignTransaction' })),
|
|
115
|
+
filecoinGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinGetAddress' })),
|
|
116
|
+
filecoinSignTransaction: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'filecoinSignTransaction' })),
|
|
114
117
|
};
|
|
115
118
|
return api;
|
|
116
119
|
};
|
|
@@ -2532,6 +2535,12 @@ var nested = {
|
|
|
2532
2535
|
POLICY_ID: 2
|
|
2533
2536
|
}
|
|
2534
2537
|
},
|
|
2538
|
+
CardanoTxOutputSerializationFormat: {
|
|
2539
|
+
values: {
|
|
2540
|
+
ARRAY_LEGACY: 0,
|
|
2541
|
+
MAP_BABBAGE: 1
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2535
2544
|
CardanoCertificateType: {
|
|
2536
2545
|
values: {
|
|
2537
2546
|
STAKE_REGISTRATION: 0,
|
|
@@ -2550,14 +2559,21 @@ var nested = {
|
|
|
2550
2559
|
CardanoTxAuxiliaryDataSupplementType: {
|
|
2551
2560
|
values: {
|
|
2552
2561
|
NONE: 0,
|
|
2553
|
-
|
|
2562
|
+
GOVERNANCE_REGISTRATION_SIGNATURE: 1
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
CardanoGovernanceRegistrationFormat: {
|
|
2566
|
+
values: {
|
|
2567
|
+
CIP15: 0,
|
|
2568
|
+
CIP36: 1
|
|
2554
2569
|
}
|
|
2555
2570
|
},
|
|
2556
2571
|
CardanoTxSigningMode: {
|
|
2557
2572
|
values: {
|
|
2558
2573
|
ORDINARY_TRANSACTION: 0,
|
|
2559
2574
|
POOL_REGISTRATION_AS_OWNER: 1,
|
|
2560
|
-
MULTISIG_TRANSACTION: 2
|
|
2575
|
+
MULTISIG_TRANSACTION: 2,
|
|
2576
|
+
PLUTUS_TRANSACTION: 3
|
|
2561
2577
|
}
|
|
2562
2578
|
},
|
|
2563
2579
|
CardanoTxWitnessType: {
|
|
@@ -2911,6 +2927,31 @@ var nested = {
|
|
|
2911
2927
|
rule: "required",
|
|
2912
2928
|
type: "uint32",
|
|
2913
2929
|
id: 4
|
|
2930
|
+
},
|
|
2931
|
+
datum_hash: {
|
|
2932
|
+
type: "bytes",
|
|
2933
|
+
id: 5
|
|
2934
|
+
},
|
|
2935
|
+
format: {
|
|
2936
|
+
type: "CardanoTxOutputSerializationFormat",
|
|
2937
|
+
id: 6,
|
|
2938
|
+
options: {
|
|
2939
|
+
"default": "ARRAY_LEGACY"
|
|
2940
|
+
}
|
|
2941
|
+
},
|
|
2942
|
+
inline_datum_size: {
|
|
2943
|
+
type: "uint32",
|
|
2944
|
+
id: 7,
|
|
2945
|
+
options: {
|
|
2946
|
+
"default": 0
|
|
2947
|
+
}
|
|
2948
|
+
},
|
|
2949
|
+
reference_script_size: {
|
|
2950
|
+
type: "uint32",
|
|
2951
|
+
id: 8,
|
|
2952
|
+
options: {
|
|
2953
|
+
"default": 0
|
|
2954
|
+
}
|
|
2914
2955
|
}
|
|
2915
2956
|
}
|
|
2916
2957
|
},
|
|
@@ -2945,6 +2986,24 @@ var nested = {
|
|
|
2945
2986
|
}
|
|
2946
2987
|
}
|
|
2947
2988
|
},
|
|
2989
|
+
CardanoTxInlineDatumChunk: {
|
|
2990
|
+
fields: {
|
|
2991
|
+
data: {
|
|
2992
|
+
rule: "required",
|
|
2993
|
+
type: "bytes",
|
|
2994
|
+
id: 1
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
},
|
|
2998
|
+
CardanoTxReferenceScriptChunk: {
|
|
2999
|
+
fields: {
|
|
3000
|
+
data: {
|
|
3001
|
+
rule: "required",
|
|
3002
|
+
type: "bytes",
|
|
3003
|
+
id: 1
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
},
|
|
2948
3007
|
CardanoPoolOwner: {
|
|
2949
3008
|
fields: {
|
|
2950
3009
|
staking_key_path: {
|
|
@@ -3037,22 +3096,6 @@ var nested = {
|
|
|
3037
3096
|
type: "string",
|
|
3038
3097
|
id: 7
|
|
3039
3098
|
},
|
|
3040
|
-
owners: {
|
|
3041
|
-
rule: "repeated",
|
|
3042
|
-
type: "CardanoPoolOwner",
|
|
3043
|
-
id: 8,
|
|
3044
|
-
options: {
|
|
3045
|
-
deprecated: true
|
|
3046
|
-
}
|
|
3047
|
-
},
|
|
3048
|
-
relays: {
|
|
3049
|
-
rule: "repeated",
|
|
3050
|
-
type: "CardanoPoolRelayParameters",
|
|
3051
|
-
id: 9,
|
|
3052
|
-
options: {
|
|
3053
|
-
deprecated: true
|
|
3054
|
-
}
|
|
3055
|
-
},
|
|
3056
3099
|
metadata: {
|
|
3057
3100
|
type: "CardanoPoolMetadataType",
|
|
3058
3101
|
id: 10
|
|
@@ -3095,6 +3138,10 @@ var nested = {
|
|
|
3095
3138
|
script_hash: {
|
|
3096
3139
|
type: "bytes",
|
|
3097
3140
|
id: 5
|
|
3141
|
+
},
|
|
3142
|
+
key_hash: {
|
|
3143
|
+
type: "bytes",
|
|
3144
|
+
id: 6
|
|
3098
3145
|
}
|
|
3099
3146
|
}
|
|
3100
3147
|
},
|
|
@@ -3116,16 +3163,33 @@ var nested = {
|
|
|
3116
3163
|
script_hash: {
|
|
3117
3164
|
type: "bytes",
|
|
3118
3165
|
id: 3
|
|
3166
|
+
},
|
|
3167
|
+
key_hash: {
|
|
3168
|
+
type: "bytes",
|
|
3169
|
+
id: 4
|
|
3119
3170
|
}
|
|
3120
3171
|
}
|
|
3121
3172
|
},
|
|
3122
|
-
|
|
3173
|
+
CardanoGovernanceRegistrationDelegation: {
|
|
3123
3174
|
fields: {
|
|
3124
3175
|
voting_public_key: {
|
|
3125
3176
|
rule: "required",
|
|
3126
3177
|
type: "bytes",
|
|
3127
3178
|
id: 1
|
|
3128
3179
|
},
|
|
3180
|
+
weight: {
|
|
3181
|
+
rule: "required",
|
|
3182
|
+
type: "uint32",
|
|
3183
|
+
id: 2
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
},
|
|
3187
|
+
CardanoGovernanceRegistrationParametersType: {
|
|
3188
|
+
fields: {
|
|
3189
|
+
voting_public_key: {
|
|
3190
|
+
type: "bytes",
|
|
3191
|
+
id: 1
|
|
3192
|
+
},
|
|
3129
3193
|
staking_path: {
|
|
3130
3194
|
rule: "repeated",
|
|
3131
3195
|
type: "uint32",
|
|
@@ -3143,13 +3207,29 @@ var nested = {
|
|
|
3143
3207
|
rule: "required",
|
|
3144
3208
|
type: "uint64",
|
|
3145
3209
|
id: 4
|
|
3210
|
+
},
|
|
3211
|
+
format: {
|
|
3212
|
+
type: "CardanoGovernanceRegistrationFormat",
|
|
3213
|
+
id: 5,
|
|
3214
|
+
options: {
|
|
3215
|
+
"default": "CIP15"
|
|
3216
|
+
}
|
|
3217
|
+
},
|
|
3218
|
+
delegations: {
|
|
3219
|
+
rule: "repeated",
|
|
3220
|
+
type: "CardanoGovernanceRegistrationDelegation",
|
|
3221
|
+
id: 6
|
|
3222
|
+
},
|
|
3223
|
+
voting_purpose: {
|
|
3224
|
+
type: "uint64",
|
|
3225
|
+
id: 7
|
|
3146
3226
|
}
|
|
3147
3227
|
}
|
|
3148
3228
|
},
|
|
3149
3229
|
CardanoTxAuxiliaryData: {
|
|
3150
3230
|
fields: {
|
|
3151
|
-
|
|
3152
|
-
type: "
|
|
3231
|
+
governance_registration_parameters: {
|
|
3232
|
+
type: "CardanoGovernanceRegistrationParametersType",
|
|
3153
3233
|
id: 1
|
|
3154
3234
|
},
|
|
3155
3235
|
hash: {
|
|
@@ -3167,6 +3247,50 @@ var nested = {
|
|
|
3167
3247
|
}
|
|
3168
3248
|
}
|
|
3169
3249
|
},
|
|
3250
|
+
CardanoTxCollateralInput: {
|
|
3251
|
+
fields: {
|
|
3252
|
+
prev_hash: {
|
|
3253
|
+
rule: "required",
|
|
3254
|
+
type: "bytes",
|
|
3255
|
+
id: 1
|
|
3256
|
+
},
|
|
3257
|
+
prev_index: {
|
|
3258
|
+
rule: "required",
|
|
3259
|
+
type: "uint32",
|
|
3260
|
+
id: 2
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
},
|
|
3264
|
+
CardanoTxRequiredSigner: {
|
|
3265
|
+
fields: {
|
|
3266
|
+
key_hash: {
|
|
3267
|
+
type: "bytes",
|
|
3268
|
+
id: 1
|
|
3269
|
+
},
|
|
3270
|
+
key_path: {
|
|
3271
|
+
rule: "repeated",
|
|
3272
|
+
type: "uint32",
|
|
3273
|
+
id: 2,
|
|
3274
|
+
options: {
|
|
3275
|
+
packed: false
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
}
|
|
3279
|
+
},
|
|
3280
|
+
CardanoTxReferenceInput: {
|
|
3281
|
+
fields: {
|
|
3282
|
+
prev_hash: {
|
|
3283
|
+
rule: "required",
|
|
3284
|
+
type: "bytes",
|
|
3285
|
+
id: 1
|
|
3286
|
+
},
|
|
3287
|
+
prev_index: {
|
|
3288
|
+
rule: "required",
|
|
3289
|
+
type: "uint32",
|
|
3290
|
+
id: 2
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
},
|
|
3170
3294
|
CardanoTxItemAck: {
|
|
3171
3295
|
fields: {
|
|
3172
3296
|
}
|
|
@@ -3182,7 +3306,7 @@ var nested = {
|
|
|
3182
3306
|
type: "bytes",
|
|
3183
3307
|
id: 2
|
|
3184
3308
|
},
|
|
3185
|
-
|
|
3309
|
+
governance_signature: {
|
|
3186
3310
|
type: "bytes",
|
|
3187
3311
|
id: 3
|
|
3188
3312
|
}
|
|
@@ -3240,259 +3364,42 @@ var nested = {
|
|
|
3240
3364
|
fields: {
|
|
3241
3365
|
}
|
|
3242
3366
|
},
|
|
3243
|
-
|
|
3244
|
-
options: {
|
|
3245
|
-
deprecated: true
|
|
3246
|
-
},
|
|
3367
|
+
CardanoSignMessage: {
|
|
3247
3368
|
fields: {
|
|
3248
|
-
|
|
3249
|
-
rule: "repeated",
|
|
3250
|
-
type: "CardanoTxInputType",
|
|
3251
|
-
id: 1
|
|
3252
|
-
},
|
|
3253
|
-
outputs: {
|
|
3369
|
+
address_n: {
|
|
3254
3370
|
rule: "repeated",
|
|
3255
|
-
type: "CardanoTxOutputType",
|
|
3256
|
-
id: 2
|
|
3257
|
-
},
|
|
3258
|
-
protocol_magic: {
|
|
3259
|
-
rule: "required",
|
|
3260
3371
|
type: "uint32",
|
|
3261
|
-
id:
|
|
3372
|
+
id: 1,
|
|
3373
|
+
options: {
|
|
3374
|
+
packed: false
|
|
3375
|
+
}
|
|
3262
3376
|
},
|
|
3263
|
-
|
|
3377
|
+
message: {
|
|
3264
3378
|
rule: "required",
|
|
3265
|
-
type: "
|
|
3266
|
-
id:
|
|
3379
|
+
type: "bytes",
|
|
3380
|
+
id: 2
|
|
3267
3381
|
},
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3382
|
+
derivation_type: {
|
|
3383
|
+
rule: "required",
|
|
3384
|
+
type: "CardanoDerivationType",
|
|
3385
|
+
id: 3
|
|
3271
3386
|
},
|
|
3272
3387
|
network_id: {
|
|
3273
3388
|
rule: "required",
|
|
3274
3389
|
type: "uint32",
|
|
3275
|
-
id:
|
|
3276
|
-
}
|
|
3277
|
-
certificates: {
|
|
3278
|
-
rule: "repeated",
|
|
3279
|
-
type: "CardanoTxCertificateType",
|
|
3280
|
-
id: 9
|
|
3281
|
-
},
|
|
3282
|
-
withdrawals: {
|
|
3283
|
-
rule: "repeated",
|
|
3284
|
-
type: "CardanoTxWithdrawalType",
|
|
3285
|
-
id: 10
|
|
3286
|
-
},
|
|
3287
|
-
validity_interval_start: {
|
|
3288
|
-
type: "uint64",
|
|
3289
|
-
id: 12
|
|
3290
|
-
},
|
|
3291
|
-
auxiliary_data: {
|
|
3292
|
-
type: "CardanoTxAuxiliaryDataType",
|
|
3293
|
-
id: 13
|
|
3294
|
-
}
|
|
3295
|
-
},
|
|
3296
|
-
nested: {
|
|
3297
|
-
CardanoTxInputType: {
|
|
3298
|
-
fields: {
|
|
3299
|
-
address_n: {
|
|
3300
|
-
rule: "repeated",
|
|
3301
|
-
type: "uint32",
|
|
3302
|
-
id: 1,
|
|
3303
|
-
options: {
|
|
3304
|
-
packed: false
|
|
3305
|
-
}
|
|
3306
|
-
},
|
|
3307
|
-
prev_hash: {
|
|
3308
|
-
rule: "required",
|
|
3309
|
-
type: "bytes",
|
|
3310
|
-
id: 2
|
|
3311
|
-
},
|
|
3312
|
-
prev_index: {
|
|
3313
|
-
rule: "required",
|
|
3314
|
-
type: "uint32",
|
|
3315
|
-
id: 3
|
|
3316
|
-
}
|
|
3317
|
-
}
|
|
3318
|
-
},
|
|
3319
|
-
CardanoTxOutputType: {
|
|
3320
|
-
fields: {
|
|
3321
|
-
address: {
|
|
3322
|
-
type: "string",
|
|
3323
|
-
id: 1
|
|
3324
|
-
},
|
|
3325
|
-
amount: {
|
|
3326
|
-
rule: "required",
|
|
3327
|
-
type: "uint64",
|
|
3328
|
-
id: 3
|
|
3329
|
-
},
|
|
3330
|
-
address_parameters: {
|
|
3331
|
-
type: "CardanoAddressParametersType",
|
|
3332
|
-
id: 4
|
|
3333
|
-
},
|
|
3334
|
-
token_bundle: {
|
|
3335
|
-
rule: "repeated",
|
|
3336
|
-
type: "CardanoAssetGroupType",
|
|
3337
|
-
id: 5
|
|
3338
|
-
}
|
|
3339
|
-
}
|
|
3340
|
-
},
|
|
3341
|
-
CardanoAssetGroupType: {
|
|
3342
|
-
fields: {
|
|
3343
|
-
policy_id: {
|
|
3344
|
-
rule: "required",
|
|
3345
|
-
type: "bytes",
|
|
3346
|
-
id: 1
|
|
3347
|
-
},
|
|
3348
|
-
tokens: {
|
|
3349
|
-
rule: "repeated",
|
|
3350
|
-
type: "CardanoTokenType",
|
|
3351
|
-
id: 2
|
|
3352
|
-
}
|
|
3353
|
-
}
|
|
3354
|
-
},
|
|
3355
|
-
CardanoTokenType: {
|
|
3356
|
-
fields: {
|
|
3357
|
-
asset_name_bytes: {
|
|
3358
|
-
rule: "required",
|
|
3359
|
-
type: "bytes",
|
|
3360
|
-
id: 1
|
|
3361
|
-
},
|
|
3362
|
-
amount: {
|
|
3363
|
-
rule: "required",
|
|
3364
|
-
type: "uint64",
|
|
3365
|
-
id: 2
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
},
|
|
3369
|
-
CardanoPoolOwnerType: {
|
|
3370
|
-
fields: {
|
|
3371
|
-
staking_key_path: {
|
|
3372
|
-
rule: "repeated",
|
|
3373
|
-
type: "uint32",
|
|
3374
|
-
id: 1,
|
|
3375
|
-
options: {
|
|
3376
|
-
packed: false
|
|
3377
|
-
}
|
|
3378
|
-
},
|
|
3379
|
-
staking_key_hash: {
|
|
3380
|
-
type: "bytes",
|
|
3381
|
-
id: 2
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3384
|
-
},
|
|
3385
|
-
CardanoPoolRelayParametersType: {
|
|
3386
|
-
fields: {
|
|
3387
|
-
type: {
|
|
3388
|
-
rule: "required",
|
|
3389
|
-
type: "CardanoPoolRelayType",
|
|
3390
|
-
id: 1
|
|
3391
|
-
},
|
|
3392
|
-
ipv4_address: {
|
|
3393
|
-
type: "bytes",
|
|
3394
|
-
id: 2
|
|
3395
|
-
},
|
|
3396
|
-
ipv6_address: {
|
|
3397
|
-
type: "bytes",
|
|
3398
|
-
id: 3
|
|
3399
|
-
},
|
|
3400
|
-
host_name: {
|
|
3401
|
-
type: "string",
|
|
3402
|
-
id: 4
|
|
3403
|
-
},
|
|
3404
|
-
port: {
|
|
3405
|
-
type: "uint32",
|
|
3406
|
-
id: 5
|
|
3407
|
-
}
|
|
3408
|
-
}
|
|
3409
|
-
},
|
|
3410
|
-
CardanoTxCertificateType: {
|
|
3411
|
-
fields: {
|
|
3412
|
-
type: {
|
|
3413
|
-
rule: "required",
|
|
3414
|
-
type: "CardanoCertificateType",
|
|
3415
|
-
id: 1
|
|
3416
|
-
},
|
|
3417
|
-
path: {
|
|
3418
|
-
rule: "repeated",
|
|
3419
|
-
type: "uint32",
|
|
3420
|
-
id: 2,
|
|
3421
|
-
options: {
|
|
3422
|
-
packed: false
|
|
3423
|
-
}
|
|
3424
|
-
},
|
|
3425
|
-
pool: {
|
|
3426
|
-
type: "bytes",
|
|
3427
|
-
id: 3
|
|
3428
|
-
},
|
|
3429
|
-
pool_parameters: {
|
|
3430
|
-
type: "CardanoPoolParametersType",
|
|
3431
|
-
id: 4
|
|
3432
|
-
}
|
|
3433
|
-
}
|
|
3434
|
-
},
|
|
3435
|
-
CardanoTxWithdrawalType: {
|
|
3436
|
-
fields: {
|
|
3437
|
-
path: {
|
|
3438
|
-
rule: "repeated",
|
|
3439
|
-
type: "uint32",
|
|
3440
|
-
id: 1,
|
|
3441
|
-
options: {
|
|
3442
|
-
packed: false
|
|
3443
|
-
}
|
|
3444
|
-
},
|
|
3445
|
-
amount: {
|
|
3446
|
-
rule: "required",
|
|
3447
|
-
type: "uint64",
|
|
3448
|
-
id: 2
|
|
3449
|
-
}
|
|
3450
|
-
}
|
|
3451
|
-
},
|
|
3452
|
-
CardanoTxAuxiliaryDataType: {
|
|
3453
|
-
fields: {
|
|
3454
|
-
blob: {
|
|
3455
|
-
type: "bytes",
|
|
3456
|
-
id: 1
|
|
3457
|
-
},
|
|
3458
|
-
catalyst_registration_parameters: {
|
|
3459
|
-
type: "CardanoCatalystRegistrationParametersType",
|
|
3460
|
-
id: 2
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
},
|
|
3466
|
-
CardanoSignedTxChunk: {
|
|
3467
|
-
options: {
|
|
3468
|
-
deprecated: true
|
|
3469
|
-
},
|
|
3470
|
-
fields: {
|
|
3471
|
-
signed_tx_chunk: {
|
|
3472
|
-
rule: "required",
|
|
3473
|
-
type: "bytes",
|
|
3474
|
-
id: 1
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
},
|
|
3478
|
-
CardanoSignedTxChunkAck: {
|
|
3479
|
-
options: {
|
|
3480
|
-
deprecated: true
|
|
3481
|
-
},
|
|
3482
|
-
fields: {
|
|
3390
|
+
id: 4
|
|
3391
|
+
}
|
|
3483
3392
|
}
|
|
3484
3393
|
},
|
|
3485
|
-
|
|
3486
|
-
options: {
|
|
3487
|
-
deprecated: true
|
|
3488
|
-
},
|
|
3394
|
+
CardanoMessageSignature: {
|
|
3489
3395
|
fields: {
|
|
3490
|
-
|
|
3396
|
+
signature: {
|
|
3491
3397
|
rule: "required",
|
|
3492
3398
|
type: "bytes",
|
|
3493
3399
|
id: 1
|
|
3494
3400
|
},
|
|
3495
|
-
|
|
3401
|
+
key: {
|
|
3402
|
+
rule: "required",
|
|
3496
3403
|
type: "bytes",
|
|
3497
3404
|
id: 2
|
|
3498
3405
|
}
|
|
@@ -4932,6 +4839,10 @@ var nested = {
|
|
|
4932
4839
|
options: {
|
|
4933
4840
|
"default": true
|
|
4934
4841
|
}
|
|
4842
|
+
},
|
|
4843
|
+
chain_id: {
|
|
4844
|
+
type: "uint64",
|
|
4845
|
+
id: 4
|
|
4935
4846
|
}
|
|
4936
4847
|
}
|
|
4937
4848
|
},
|
|
@@ -5036,6 +4947,10 @@ var nested = {
|
|
|
5036
4947
|
show_display: {
|
|
5037
4948
|
type: "bool",
|
|
5038
4949
|
id: 2
|
|
4950
|
+
},
|
|
4951
|
+
chain_id: {
|
|
4952
|
+
type: "uint64",
|
|
4953
|
+
id: 3
|
|
5039
4954
|
}
|
|
5040
4955
|
}
|
|
5041
4956
|
},
|
|
@@ -5066,6 +4981,10 @@ var nested = {
|
|
|
5066
4981
|
show_display: {
|
|
5067
4982
|
type: "bool",
|
|
5068
4983
|
id: 2
|
|
4984
|
+
},
|
|
4985
|
+
chain_id: {
|
|
4986
|
+
type: "uint64",
|
|
4987
|
+
id: 3
|
|
5069
4988
|
}
|
|
5070
4989
|
}
|
|
5071
4990
|
},
|
|
@@ -5275,6 +5194,10 @@ var nested = {
|
|
|
5275
5194
|
rule: "required",
|
|
5276
5195
|
type: "bytes",
|
|
5277
5196
|
id: 2
|
|
5197
|
+
},
|
|
5198
|
+
chain_id: {
|
|
5199
|
+
type: "uint64",
|
|
5200
|
+
id: 3
|
|
5278
5201
|
}
|
|
5279
5202
|
}
|
|
5280
5203
|
},
|
|
@@ -5308,6 +5231,10 @@ var nested = {
|
|
|
5308
5231
|
rule: "required",
|
|
5309
5232
|
type: "string",
|
|
5310
5233
|
id: 4
|
|
5234
|
+
},
|
|
5235
|
+
chain_id: {
|
|
5236
|
+
type: "uint64",
|
|
5237
|
+
id: 5
|
|
5311
5238
|
}
|
|
5312
5239
|
}
|
|
5313
5240
|
},
|
|
@@ -5349,6 +5276,10 @@ var nested = {
|
|
|
5349
5276
|
message_hash: {
|
|
5350
5277
|
type: "bytes",
|
|
5351
5278
|
id: 3
|
|
5279
|
+
},
|
|
5280
|
+
chain_id: {
|
|
5281
|
+
type: "uint64",
|
|
5282
|
+
id: 4
|
|
5352
5283
|
}
|
|
5353
5284
|
}
|
|
5354
5285
|
},
|
|
@@ -5366,6 +5297,56 @@ var nested = {
|
|
|
5366
5297
|
}
|
|
5367
5298
|
}
|
|
5368
5299
|
},
|
|
5300
|
+
FilecoinGetAddress: {
|
|
5301
|
+
fields: {
|
|
5302
|
+
address_n: {
|
|
5303
|
+
rule: "repeated",
|
|
5304
|
+
type: "uint32",
|
|
5305
|
+
id: 1,
|
|
5306
|
+
options: {
|
|
5307
|
+
packed: false
|
|
5308
|
+
}
|
|
5309
|
+
},
|
|
5310
|
+
show_display: {
|
|
5311
|
+
type: "bool",
|
|
5312
|
+
id: 2
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
},
|
|
5316
|
+
FilecoinAddress: {
|
|
5317
|
+
fields: {
|
|
5318
|
+
address: {
|
|
5319
|
+
type: "string",
|
|
5320
|
+
id: 1
|
|
5321
|
+
}
|
|
5322
|
+
}
|
|
5323
|
+
},
|
|
5324
|
+
FilecoinSignTx: {
|
|
5325
|
+
fields: {
|
|
5326
|
+
address_n: {
|
|
5327
|
+
rule: "repeated",
|
|
5328
|
+
type: "uint32",
|
|
5329
|
+
id: 1,
|
|
5330
|
+
options: {
|
|
5331
|
+
packed: false
|
|
5332
|
+
}
|
|
5333
|
+
},
|
|
5334
|
+
raw_tx: {
|
|
5335
|
+
rule: "required",
|
|
5336
|
+
type: "bytes",
|
|
5337
|
+
id: 2
|
|
5338
|
+
}
|
|
5339
|
+
}
|
|
5340
|
+
},
|
|
5341
|
+
FilecoinSignedTx: {
|
|
5342
|
+
fields: {
|
|
5343
|
+
signature: {
|
|
5344
|
+
rule: "required",
|
|
5345
|
+
type: "bytes",
|
|
5346
|
+
id: 1
|
|
5347
|
+
}
|
|
5348
|
+
}
|
|
5349
|
+
},
|
|
5369
5350
|
BackupType: {
|
|
5370
5351
|
values: {
|
|
5371
5352
|
Bip39: 0,
|
|
@@ -6402,14 +6383,18 @@ var nested = {
|
|
|
6402
6383
|
type: "ResourceType",
|
|
6403
6384
|
id: 3
|
|
6404
6385
|
},
|
|
6386
|
+
nft_meta_data: {
|
|
6387
|
+
type: "bytes",
|
|
6388
|
+
id: 4
|
|
6389
|
+
},
|
|
6405
6390
|
zoom_data_length: {
|
|
6406
6391
|
rule: "required",
|
|
6407
6392
|
type: "uint32",
|
|
6408
6393
|
id: 5
|
|
6409
6394
|
},
|
|
6410
|
-
|
|
6411
|
-
type: "
|
|
6412
|
-
id:
|
|
6395
|
+
file_name_no_ext: {
|
|
6396
|
+
type: "string",
|
|
6397
|
+
id: 6
|
|
6413
6398
|
}
|
|
6414
6399
|
},
|
|
6415
6400
|
nested: {
|
|
@@ -7941,6 +7926,56 @@ var nested = {
|
|
|
7941
7926
|
}
|
|
7942
7927
|
}
|
|
7943
7928
|
},
|
|
7929
|
+
PolkadotGetAddress: {
|
|
7930
|
+
fields: {
|
|
7931
|
+
address_n: {
|
|
7932
|
+
rule: "repeated",
|
|
7933
|
+
type: "uint32",
|
|
7934
|
+
id: 1,
|
|
7935
|
+
options: {
|
|
7936
|
+
packed: false
|
|
7937
|
+
}
|
|
7938
|
+
},
|
|
7939
|
+
show_display: {
|
|
7940
|
+
type: "bool",
|
|
7941
|
+
id: 3
|
|
7942
|
+
}
|
|
7943
|
+
}
|
|
7944
|
+
},
|
|
7945
|
+
PolkadotAddress: {
|
|
7946
|
+
fields: {
|
|
7947
|
+
address: {
|
|
7948
|
+
type: "string",
|
|
7949
|
+
id: 1
|
|
7950
|
+
}
|
|
7951
|
+
}
|
|
7952
|
+
},
|
|
7953
|
+
PolkadotSignTx: {
|
|
7954
|
+
fields: {
|
|
7955
|
+
address_n: {
|
|
7956
|
+
rule: "repeated",
|
|
7957
|
+
type: "uint32",
|
|
7958
|
+
id: 1,
|
|
7959
|
+
options: {
|
|
7960
|
+
packed: false
|
|
7961
|
+
}
|
|
7962
|
+
},
|
|
7963
|
+
raw_tx: {
|
|
7964
|
+
rule: "required",
|
|
7965
|
+
type: "bytes",
|
|
7966
|
+
id: 2
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7969
|
+
},
|
|
7970
|
+
PolkadotSignedTx: {
|
|
7971
|
+
fields: {
|
|
7972
|
+
signature: {
|
|
7973
|
+
rule: "required",
|
|
7974
|
+
type: "bytes",
|
|
7975
|
+
id: 1
|
|
7976
|
+
}
|
|
7977
|
+
}
|
|
7978
|
+
},
|
|
7944
7979
|
RippleGetAddress: {
|
|
7945
7980
|
fields: {
|
|
7946
7981
|
address_n: {
|
|
@@ -9623,14 +9658,10 @@ var nested = {
|
|
|
9623
9658
|
MessageType_StellarManageBuyOfferOp: 222,
|
|
9624
9659
|
MessageType_StellarPathPaymentStrictSendOp: 223,
|
|
9625
9660
|
MessageType_StellarSignedTx: 230,
|
|
9626
|
-
MessageType_CardanoSignTx: 303,
|
|
9627
9661
|
MessageType_CardanoGetPublicKey: 305,
|
|
9628
9662
|
MessageType_CardanoPublicKey: 306,
|
|
9629
9663
|
MessageType_CardanoGetAddress: 307,
|
|
9630
9664
|
MessageType_CardanoAddress: 308,
|
|
9631
|
-
MessageType_CardanoSignedTx: 310,
|
|
9632
|
-
MessageType_CardanoSignedTxChunk: 311,
|
|
9633
|
-
MessageType_CardanoSignedTxChunkAck: 312,
|
|
9634
9665
|
MessageType_CardanoTxItemAck: 313,
|
|
9635
9666
|
MessageType_CardanoTxAuxiliaryDataSupplement: 314,
|
|
9636
9667
|
MessageType_CardanoTxWitnessRequest: 315,
|
|
@@ -9651,6 +9682,13 @@ var nested = {
|
|
|
9651
9682
|
MessageType_CardanoGetNativeScriptHash: 330,
|
|
9652
9683
|
MessageType_CardanoNativeScriptHash: 331,
|
|
9653
9684
|
MessageType_CardanoTxMint: 332,
|
|
9685
|
+
MessageType_CardanoTxCollateralInput: 333,
|
|
9686
|
+
MessageType_CardanoTxRequiredSigner: 334,
|
|
9687
|
+
MessageType_CardanoTxInlineDatumChunk: 335,
|
|
9688
|
+
MessageType_CardanoTxReferenceScriptChunk: 336,
|
|
9689
|
+
MessageType_CardanoTxReferenceInput: 337,
|
|
9690
|
+
MessageType_CardanoSignMessage: 350,
|
|
9691
|
+
MessageType_CardanoMessageSignature: 351,
|
|
9654
9692
|
MessageType_RippleGetAddress: 400,
|
|
9655
9693
|
MessageType_RippleAddress: 401,
|
|
9656
9694
|
MessageType_RippleSignTx: 402,
|
|
@@ -9776,10 +9814,18 @@ var nested = {
|
|
|
9776
9814
|
MessageType_AlgorandAddress: 10901,
|
|
9777
9815
|
MessageType_AlgorandSignTx: 10902,
|
|
9778
9816
|
MessageType_AlgorandSignedTx: 10903,
|
|
9817
|
+
MessageType_PolkadotGetAddress: 11000,
|
|
9818
|
+
MessageType_PolkadotAddress: 11001,
|
|
9819
|
+
MessageType_PolkadotSignTx: 11002,
|
|
9820
|
+
MessageType_PolkadotSignedTx: 11003,
|
|
9779
9821
|
MessageType_SuiGetAddress: 11100,
|
|
9780
9822
|
MessageType_SuiAddress: 11101,
|
|
9781
9823
|
MessageType_SuiSignTx: 11102,
|
|
9782
9824
|
MessageType_SuiSignedTx: 11103,
|
|
9825
|
+
MessageType_FilecoinGetAddress: 11200,
|
|
9826
|
+
MessageType_FilecoinAddress: 11201,
|
|
9827
|
+
MessageType_FilecoinSignTx: 11202,
|
|
9828
|
+
MessageType_FilecoinSignedTx: 11203,
|
|
9783
9829
|
MessageType_DeviceBackToBoot: 903,
|
|
9784
9830
|
MessageType_DeviceInfoSettings: 10001,
|
|
9785
9831
|
MessageType_GetDeviceInfo: 10002,
|
|
@@ -11116,6 +11162,7 @@ DataManager.assets = null;
|
|
|
11116
11162
|
DataManager.messages = {
|
|
11117
11163
|
default: MessagesJSON,
|
|
11118
11164
|
};
|
|
11165
|
+
DataManager.getFirmwareUpdateField = (deviceType) => deviceType === 'touch' ? 'firmware-v2' : 'firmware';
|
|
11119
11166
|
DataManager.getFirmwareStatus = (features) => {
|
|
11120
11167
|
var _b, _c;
|
|
11121
11168
|
const deviceType = getDeviceType(features);
|
|
@@ -11126,7 +11173,8 @@ DataManager.getFirmwareStatus = (features) => {
|
|
|
11126
11173
|
if (deviceType === 'classic' && features.bootloader_mode) {
|
|
11127
11174
|
return 'unknown';
|
|
11128
11175
|
}
|
|
11129
|
-
const
|
|
11176
|
+
const firmwareUpdateField = _a.getFirmwareUpdateField(deviceType);
|
|
11177
|
+
const targetDeviceConfigList = (_c = (_b = _a.deviceMap[deviceType]) === null || _b === void 0 ? void 0 : _b[firmwareUpdateField]) !== null && _c !== void 0 ? _c : [];
|
|
11130
11178
|
const currentVersion = deviceFirmwareVersion.join('.');
|
|
11131
11179
|
return getReleaseStatus(targetDeviceConfigList, currentVersion);
|
|
11132
11180
|
};
|
|
@@ -11136,7 +11184,8 @@ DataManager.getSysResourcesLatestRelease = (features, forcedUpdateRes) => {
|
|
|
11136
11184
|
const deviceFirmwareVersion = getDeviceFirmwareVersion(features);
|
|
11137
11185
|
if (deviceType !== 'pro' && deviceType !== 'touch')
|
|
11138
11186
|
return undefined;
|
|
11139
|
-
const
|
|
11187
|
+
const firmwareUpdateField = _a.getFirmwareUpdateField(deviceType);
|
|
11188
|
+
const targetDeviceConfigList = (_c = (_b = _a.deviceMap[deviceType]) === null || _b === void 0 ? void 0 : _b[firmwareUpdateField]) !== null && _c !== void 0 ? _c : [];
|
|
11140
11189
|
const currentVersion = deviceFirmwareVersion.join('.');
|
|
11141
11190
|
const targetDeviceConfig = targetDeviceConfigList.filter(item => forcedUpdateRes
|
|
11142
11191
|
? !!item.resource
|
|
@@ -11148,7 +11197,8 @@ DataManager.getSysFullResource = (features) => {
|
|
|
11148
11197
|
const deviceType = getDeviceType(features);
|
|
11149
11198
|
if (deviceType !== 'pro' && deviceType !== 'touch')
|
|
11150
11199
|
return undefined;
|
|
11151
|
-
const
|
|
11200
|
+
const firmwareUpdateField = _a.getFirmwareUpdateField(deviceType);
|
|
11201
|
+
const targetDeviceConfigList = (_c = (_b = _a.deviceMap[deviceType]) === null || _b === void 0 ? void 0 : _b[firmwareUpdateField]) !== null && _c !== void 0 ? _c : [];
|
|
11152
11202
|
const targetDeviceConfig = targetDeviceConfigList.filter(item => !!item.fullResource);
|
|
11153
11203
|
return (_d = findLatestRelease(targetDeviceConfig)) === null || _d === void 0 ? void 0 : _d.fullResource;
|
|
11154
11204
|
};
|
|
@@ -11160,14 +11210,16 @@ DataManager.getFirmwareChangelog = (features) => {
|
|
|
11160
11210
|
(deviceType === 'classic' && features.bootloader_mode)) {
|
|
11161
11211
|
return [];
|
|
11162
11212
|
}
|
|
11163
|
-
const
|
|
11213
|
+
const firmwareUpdateField = _a.getFirmwareUpdateField(deviceType);
|
|
11214
|
+
const targetDeviceConfigList = (_c = (_b = _a.deviceMap[deviceType]) === null || _b === void 0 ? void 0 : _b[firmwareUpdateField]) !== null && _c !== void 0 ? _c : [];
|
|
11164
11215
|
const currentVersion = deviceFirmwareVersion.join('.');
|
|
11165
11216
|
return getReleaseChangelog(targetDeviceConfigList, currentVersion);
|
|
11166
11217
|
};
|
|
11167
11218
|
DataManager.getFirmwareLatestRelease = (features) => {
|
|
11168
11219
|
var _b, _c;
|
|
11169
11220
|
const deviceType = getDeviceType(features);
|
|
11170
|
-
const
|
|
11221
|
+
const firmwareUpdateField = _a.getFirmwareUpdateField(deviceType);
|
|
11222
|
+
const targetDeviceConfigList = (_c = (_b = _a.deviceMap[deviceType]) === null || _b === void 0 ? void 0 : _b[firmwareUpdateField]) !== null && _c !== void 0 ? _c : [];
|
|
11171
11223
|
const target = findLatestRelease(targetDeviceConfigList);
|
|
11172
11224
|
if (!target)
|
|
11173
11225
|
return target;
|
|
@@ -12784,6 +12836,28 @@ class DeviceRebootToBootloader extends BaseMethod {
|
|
|
12784
12836
|
}
|
|
12785
12837
|
}
|
|
12786
12838
|
|
|
12839
|
+
class DeviceRebootToBoardloader extends BaseMethod {
|
|
12840
|
+
init() {
|
|
12841
|
+
this.useDevicePassphraseState = false;
|
|
12842
|
+
}
|
|
12843
|
+
getVersionRange() {
|
|
12844
|
+
return {
|
|
12845
|
+
classic: {
|
|
12846
|
+
min: '2.1.11',
|
|
12847
|
+
},
|
|
12848
|
+
mini: {
|
|
12849
|
+
min: '2.1.11',
|
|
12850
|
+
},
|
|
12851
|
+
};
|
|
12852
|
+
}
|
|
12853
|
+
run() {
|
|
12854
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12855
|
+
const res = yield this.device.commands.typedCall('BixinOutMessageSE', 'Success');
|
|
12856
|
+
return Promise.resolve(res.message);
|
|
12857
|
+
});
|
|
12858
|
+
}
|
|
12859
|
+
}
|
|
12860
|
+
|
|
12787
12861
|
class DeviceRecovery extends BaseMethod {
|
|
12788
12862
|
init() {
|
|
12789
12863
|
this.useDevicePassphraseState = false;
|
|
@@ -13075,11 +13149,18 @@ const getSysResourceBinary = (url) => __awaiter(void 0, void 0, void 0, function
|
|
|
13075
13149
|
binary: fw,
|
|
13076
13150
|
};
|
|
13077
13151
|
});
|
|
13152
|
+
const getFirmwareUpdateField = (deviceType, updateType) => {
|
|
13153
|
+
if (updateType === 'ble') {
|
|
13154
|
+
return 'ble';
|
|
13155
|
+
}
|
|
13156
|
+
return deviceType === 'touch' ? 'firmware-v2' : 'firmware';
|
|
13157
|
+
};
|
|
13078
13158
|
const getInfo = ({ features, updateType }) => {
|
|
13079
13159
|
var _a, _b;
|
|
13080
13160
|
const deviceType = getDeviceType(features);
|
|
13081
13161
|
const { deviceMap } = DataManager;
|
|
13082
|
-
const
|
|
13162
|
+
const firmwareUpdateField = getFirmwareUpdateField(deviceType, updateType);
|
|
13163
|
+
const releaseInfo = (_b = (_a = deviceMap === null || deviceMap === void 0 ? void 0 : deviceMap[deviceType]) === null || _a === void 0 ? void 0 : _a[firmwareUpdateField]) !== null && _b !== void 0 ? _b : [];
|
|
13083
13164
|
return findLatestRelease(releaseInfo);
|
|
13084
13165
|
};
|
|
13085
13166
|
|
|
@@ -13244,7 +13325,7 @@ class DeviceFullyUploadResource extends BaseMethod {
|
|
|
13244
13325
|
}
|
|
13245
13326
|
}
|
|
13246
13327
|
|
|
13247
|
-
class FirmwareUpdate
|
|
13328
|
+
class FirmwareUpdate extends BaseMethod {
|
|
13248
13329
|
init() {
|
|
13249
13330
|
this.allowDeviceMode = [UI_REQUEST.BOOTLOADER, UI_REQUEST.INITIALIZE];
|
|
13250
13331
|
this.requireDeviceMode = [UI_REQUEST.BOOTLOADER];
|
|
@@ -13295,7 +13376,7 @@ class FirmwareUpdate$1 extends BaseMethod {
|
|
|
13295
13376
|
}
|
|
13296
13377
|
|
|
13297
13378
|
const Log$3 = getLogger(exports.LoggerNames.Method);
|
|
13298
|
-
class
|
|
13379
|
+
class FirmwareUpdateV2 extends BaseMethod {
|
|
13299
13380
|
constructor() {
|
|
13300
13381
|
super(...arguments);
|
|
13301
13382
|
this.checkPromise = null;
|
|
@@ -13317,6 +13398,7 @@ class FirmwareUpdate extends BaseMethod {
|
|
|
13317
13398
|
{ name: 'version', type: 'array' },
|
|
13318
13399
|
{ name: 'binary', type: 'buffer' },
|
|
13319
13400
|
{ name: 'forcedUpdateRes', type: 'boolean' },
|
|
13401
|
+
{ name: 'platform', type: 'string', required: true },
|
|
13320
13402
|
]);
|
|
13321
13403
|
if (!payload.updateType) {
|
|
13322
13404
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'updateType is required');
|
|
@@ -13379,14 +13461,29 @@ class FirmwareUpdate extends BaseMethod {
|
|
|
13379
13461
|
const currentVersion = getDeviceFirmwareVersion(features).join('.');
|
|
13380
13462
|
return isTouchMode && semver__default["default"].gte(currentVersion, '3.2.0');
|
|
13381
13463
|
}
|
|
13464
|
+
checkVersionForCopyTouchResource(features) {
|
|
13465
|
+
var _a;
|
|
13466
|
+
const deviceType = getDeviceType(features);
|
|
13467
|
+
const currentVersion = getDeviceFirmwareVersion(features).join('.');
|
|
13468
|
+
const targetVersion = (_a = this.params.version) === null || _a === void 0 ? void 0 : _a.join('.');
|
|
13469
|
+
const { updateType } = this.params;
|
|
13470
|
+
if (deviceType === 'touch' && updateType === 'firmware' && targetVersion) {
|
|
13471
|
+
if (semver__default["default"].lt(currentVersion, '3.5.0') &&
|
|
13472
|
+
semver__default["default"].gte(targetVersion, '3.5.0') &&
|
|
13473
|
+
this.payload.platform !== 'desktop') {
|
|
13474
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.UseDesktopToUpdateFirmware);
|
|
13475
|
+
}
|
|
13476
|
+
}
|
|
13477
|
+
}
|
|
13382
13478
|
run() {
|
|
13383
13479
|
var _a, _b;
|
|
13384
13480
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13385
13481
|
const { device, params } = this;
|
|
13386
13482
|
const { features, commands } = device;
|
|
13483
|
+
const deviceType = getDeviceType(features);
|
|
13484
|
+
this.checkVersionForCopyTouchResource(features);
|
|
13387
13485
|
if (!(features === null || features === void 0 ? void 0 : features.bootloader_mode) && features) {
|
|
13388
13486
|
const uuid = getDeviceUUID(features);
|
|
13389
|
-
const deviceType = getDeviceType(features);
|
|
13390
13487
|
if (this.isEnteredManuallyBoot(features)) {
|
|
13391
13488
|
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateManuallyEnterBoot));
|
|
13392
13489
|
}
|
|
@@ -17560,6 +17657,101 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17560
17657
|
}
|
|
17561
17658
|
}
|
|
17562
17659
|
|
|
17660
|
+
class FilecoinGetAddress extends BaseMethod {
|
|
17661
|
+
constructor() {
|
|
17662
|
+
super(...arguments);
|
|
17663
|
+
this.hasBundle = false;
|
|
17664
|
+
}
|
|
17665
|
+
init() {
|
|
17666
|
+
var _a;
|
|
17667
|
+
this.checkDeviceId = true;
|
|
17668
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17669
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17670
|
+
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17671
|
+
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17672
|
+
this.params = [];
|
|
17673
|
+
payload.bundle.forEach((batch) => {
|
|
17674
|
+
var _a;
|
|
17675
|
+
const addressN = validatePath(batch.path, 3);
|
|
17676
|
+
validateParams(batch, [
|
|
17677
|
+
{ name: 'path', required: true },
|
|
17678
|
+
{ name: 'showOnOneKey', type: 'boolean' },
|
|
17679
|
+
]);
|
|
17680
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
17681
|
+
this.params.push({
|
|
17682
|
+
address_n: addressN,
|
|
17683
|
+
show_display: showOnOneKey,
|
|
17684
|
+
});
|
|
17685
|
+
});
|
|
17686
|
+
}
|
|
17687
|
+
getVersionRange() {
|
|
17688
|
+
return {
|
|
17689
|
+
model_mini: {
|
|
17690
|
+
min: '2.10.0',
|
|
17691
|
+
},
|
|
17692
|
+
model_touch: {
|
|
17693
|
+
min: '3.5.0',
|
|
17694
|
+
},
|
|
17695
|
+
};
|
|
17696
|
+
}
|
|
17697
|
+
run() {
|
|
17698
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17699
|
+
const responses = [];
|
|
17700
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
17701
|
+
const param = this.params[i];
|
|
17702
|
+
const res = yield this.device.commands.typedCall('FilecoinGetAddress', 'FilecoinAddress', Object.assign({}, param));
|
|
17703
|
+
const { address } = res.message;
|
|
17704
|
+
responses.push({
|
|
17705
|
+
path: serializedPath(param.address_n),
|
|
17706
|
+
address,
|
|
17707
|
+
});
|
|
17708
|
+
}
|
|
17709
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
17710
|
+
});
|
|
17711
|
+
}
|
|
17712
|
+
}
|
|
17713
|
+
|
|
17714
|
+
class FilecoinSignTransaction extends BaseMethod {
|
|
17715
|
+
constructor() {
|
|
17716
|
+
super(...arguments);
|
|
17717
|
+
this.hasBundle = false;
|
|
17718
|
+
}
|
|
17719
|
+
init() {
|
|
17720
|
+
this.checkDeviceId = true;
|
|
17721
|
+
this.allowDeviceMode = [...this.allowDeviceMode];
|
|
17722
|
+
validateParams(this.payload, [
|
|
17723
|
+
{ name: 'path', required: true },
|
|
17724
|
+
{ name: 'rawTx', type: 'hexString', required: true },
|
|
17725
|
+
]);
|
|
17726
|
+
const { path, rawTx } = this.payload;
|
|
17727
|
+
const addressN = validatePath(path, 3);
|
|
17728
|
+
this.params = {
|
|
17729
|
+
address_n: addressN,
|
|
17730
|
+
raw_tx: formatAnyHex(rawTx),
|
|
17731
|
+
};
|
|
17732
|
+
}
|
|
17733
|
+
getVersionRange() {
|
|
17734
|
+
return {
|
|
17735
|
+
model_mini: {
|
|
17736
|
+
min: '2.10.0',
|
|
17737
|
+
},
|
|
17738
|
+
model_touch: {
|
|
17739
|
+
min: '3.5.0',
|
|
17740
|
+
},
|
|
17741
|
+
};
|
|
17742
|
+
}
|
|
17743
|
+
run() {
|
|
17744
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17745
|
+
const res = yield this.device.commands.typedCall('FilecoinSignTx', 'FilecoinSignedTx', Object.assign({}, this.params));
|
|
17746
|
+
const { signature } = res.message;
|
|
17747
|
+
return {
|
|
17748
|
+
path: serializedPath(this.params.address_n),
|
|
17749
|
+
signature,
|
|
17750
|
+
};
|
|
17751
|
+
});
|
|
17752
|
+
}
|
|
17753
|
+
}
|
|
17754
|
+
|
|
17563
17755
|
var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
17564
17756
|
__proto__: null,
|
|
17565
17757
|
searchDevices: SearchDevices,
|
|
@@ -17574,6 +17766,7 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
17574
17766
|
deviceChangePin: DeviceChangePin,
|
|
17575
17767
|
deviceFlags: DeviceFlags,
|
|
17576
17768
|
deviceRebootToBootloader: DeviceRebootToBootloader,
|
|
17769
|
+
deviceRebootToBoardloader: DeviceRebootToBoardloader,
|
|
17577
17770
|
deviceRecovery: DeviceRecovery,
|
|
17578
17771
|
deviceReset: DeviceReset,
|
|
17579
17772
|
deviceSettings: DeviceSettings,
|
|
@@ -17583,8 +17776,8 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
17583
17776
|
deviceVerify: DeviceVerify,
|
|
17584
17777
|
deviceWipe: DeviceWipe,
|
|
17585
17778
|
deviceFullyUploadResource: DeviceFullyUploadResource,
|
|
17586
|
-
firmwareUpdate: FirmwareUpdate
|
|
17587
|
-
firmwareUpdateV2:
|
|
17779
|
+
firmwareUpdate: FirmwareUpdate,
|
|
17780
|
+
firmwareUpdateV2: FirmwareUpdateV2,
|
|
17588
17781
|
requestWebUsbDevice: RequestWebUsbDevice,
|
|
17589
17782
|
cipherKeyValue: CipherKeyValue,
|
|
17590
17783
|
btcGetAddress: BTCGetAddress,
|
|
@@ -17635,7 +17828,9 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
17635
17828
|
suiSignTransaction: SuiSignTransaction,
|
|
17636
17829
|
cardanoGetAddress: CardanoGetAddress,
|
|
17637
17830
|
cardanoGetPublicKey: CardanoGetPublicKey,
|
|
17638
|
-
cardanoSignTransaction: CardanoSignTransaction
|
|
17831
|
+
cardanoSignTransaction: CardanoSignTransaction,
|
|
17832
|
+
filecoinGetAddress: FilecoinGetAddress,
|
|
17833
|
+
filecoinSignTransaction: FilecoinSignTransaction
|
|
17639
17834
|
});
|
|
17640
17835
|
|
|
17641
17836
|
function findMethod(message) {
|