@onekeyfe/hd-core 0.2.16 → 0.2.18
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/cardano/helper/cardanoInputs.d.ts.map +1 -1
- package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
- package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
- package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
- 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/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/index.d.ts +34 -3
- package/dist/index.js +433 -276
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/cardano.d.ts.map +1 -1
- package/dist/types/api/evmGetAddress.d.ts +1 -0
- package/dist/types/api/evmGetAddress.d.ts.map +1 -1
- package/dist/types/api/evmGetPublicKey.d.ts +1 -0
- package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/evmSignMessage.d.ts +1 -0
- package/dist/types/api/evmSignMessage.d.ts.map +1 -1
- package/dist/types/api/evmSignTypedData.d.ts +1 -0
- package/dist/types/api/evmSignTypedData.d.ts.map +1 -1
- package/dist/types/api/evmVerifyMessage.d.ts +1 -0
- package/dist/types/api/evmVerifyMessage.d.ts.map +1 -1
- 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/index.d.ts +4 -0
- package/dist/types/api/index.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/device/DeviceUploadResource.ts +6 -0
- package/src/api/evm/EVMGetAddress.ts +2 -0
- package/src/api/evm/EVMGetPublicKey.ts +2 -0
- package/src/api/evm/EVMSignMessage.ts +3 -1
- package/src/api/evm/EVMSignTypedData.ts +8 -3
- package/src/api/evm/EVMVerifyMessage.ts +2 -0
- package/src/api/filecoin/FilecoinGetAddress.ts +71 -0
- package/src/api/filecoin/FilecoinSignTransaction.ts +54 -0
- package/src/api/helpers/stringUtils.ts +1 -1
- package/src/api/index.ts +3 -0
- package/src/api/stellar/StellarSignTransaction.ts +5 -2
- package/src/api/xrp/XrpGetAddress.ts +1 -1
- package/src/api/xrp/XrpSignTransaction.ts +1 -1
- package/src/data/messages/messages.json +463 -419
- package/src/inject.ts +5 -0
- package/src/types/api/cardano.ts +0 -1
- package/src/types/api/evmGetAddress.ts +1 -0
- package/src/types/api/evmGetPublicKey.ts +1 -0
- package/src/types/api/evmSignMessage.ts +1 -0
- package/src/types/api/evmSignTypedData.ts +1 -0
- package/src/types/api/evmVerifyMessage.ts +1 -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/index.ts +9 -0
- package/src/types/api/nearSignTransaction.ts +1 -1
- package/src/types/api/tronGetAddress.ts +2 -2
- package/src/types/api/tronSignTransaction.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -112,6 +112,8 @@ const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
|
112
112
|
cardanoGetAddress: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetAddress' })),
|
|
113
113
|
cardanoGetPublicKey: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cardanoGetPublicKey' })),
|
|
114
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' })),
|
|
115
117
|
};
|
|
116
118
|
return api;
|
|
117
119
|
};
|
|
@@ -2533,6 +2535,12 @@ var nested = {
|
|
|
2533
2535
|
POLICY_ID: 2
|
|
2534
2536
|
}
|
|
2535
2537
|
},
|
|
2538
|
+
CardanoTxOutputSerializationFormat: {
|
|
2539
|
+
values: {
|
|
2540
|
+
ARRAY_LEGACY: 0,
|
|
2541
|
+
MAP_BABBAGE: 1
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2536
2544
|
CardanoCertificateType: {
|
|
2537
2545
|
values: {
|
|
2538
2546
|
STAKE_REGISTRATION: 0,
|
|
@@ -2551,14 +2559,21 @@ var nested = {
|
|
|
2551
2559
|
CardanoTxAuxiliaryDataSupplementType: {
|
|
2552
2560
|
values: {
|
|
2553
2561
|
NONE: 0,
|
|
2554
|
-
|
|
2562
|
+
GOVERNANCE_REGISTRATION_SIGNATURE: 1
|
|
2563
|
+
}
|
|
2564
|
+
},
|
|
2565
|
+
CardanoGovernanceRegistrationFormat: {
|
|
2566
|
+
values: {
|
|
2567
|
+
CIP15: 0,
|
|
2568
|
+
CIP36: 1
|
|
2555
2569
|
}
|
|
2556
2570
|
},
|
|
2557
2571
|
CardanoTxSigningMode: {
|
|
2558
2572
|
values: {
|
|
2559
2573
|
ORDINARY_TRANSACTION: 0,
|
|
2560
2574
|
POOL_REGISTRATION_AS_OWNER: 1,
|
|
2561
|
-
MULTISIG_TRANSACTION: 2
|
|
2575
|
+
MULTISIG_TRANSACTION: 2,
|
|
2576
|
+
PLUTUS_TRANSACTION: 3
|
|
2562
2577
|
}
|
|
2563
2578
|
},
|
|
2564
2579
|
CardanoTxWitnessType: {
|
|
@@ -2912,6 +2927,31 @@ var nested = {
|
|
|
2912
2927
|
rule: "required",
|
|
2913
2928
|
type: "uint32",
|
|
2914
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
|
+
}
|
|
2915
2955
|
}
|
|
2916
2956
|
}
|
|
2917
2957
|
},
|
|
@@ -2946,6 +2986,24 @@ var nested = {
|
|
|
2946
2986
|
}
|
|
2947
2987
|
}
|
|
2948
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
|
+
},
|
|
2949
3007
|
CardanoPoolOwner: {
|
|
2950
3008
|
fields: {
|
|
2951
3009
|
staking_key_path: {
|
|
@@ -3038,22 +3096,6 @@ var nested = {
|
|
|
3038
3096
|
type: "string",
|
|
3039
3097
|
id: 7
|
|
3040
3098
|
},
|
|
3041
|
-
owners: {
|
|
3042
|
-
rule: "repeated",
|
|
3043
|
-
type: "CardanoPoolOwner",
|
|
3044
|
-
id: 8,
|
|
3045
|
-
options: {
|
|
3046
|
-
deprecated: true
|
|
3047
|
-
}
|
|
3048
|
-
},
|
|
3049
|
-
relays: {
|
|
3050
|
-
rule: "repeated",
|
|
3051
|
-
type: "CardanoPoolRelayParameters",
|
|
3052
|
-
id: 9,
|
|
3053
|
-
options: {
|
|
3054
|
-
deprecated: true
|
|
3055
|
-
}
|
|
3056
|
-
},
|
|
3057
3099
|
metadata: {
|
|
3058
3100
|
type: "CardanoPoolMetadataType",
|
|
3059
3101
|
id: 10
|
|
@@ -3096,6 +3138,10 @@ var nested = {
|
|
|
3096
3138
|
script_hash: {
|
|
3097
3139
|
type: "bytes",
|
|
3098
3140
|
id: 5
|
|
3141
|
+
},
|
|
3142
|
+
key_hash: {
|
|
3143
|
+
type: "bytes",
|
|
3144
|
+
id: 6
|
|
3099
3145
|
}
|
|
3100
3146
|
}
|
|
3101
3147
|
},
|
|
@@ -3117,16 +3163,33 @@ var nested = {
|
|
|
3117
3163
|
script_hash: {
|
|
3118
3164
|
type: "bytes",
|
|
3119
3165
|
id: 3
|
|
3166
|
+
},
|
|
3167
|
+
key_hash: {
|
|
3168
|
+
type: "bytes",
|
|
3169
|
+
id: 4
|
|
3120
3170
|
}
|
|
3121
3171
|
}
|
|
3122
3172
|
},
|
|
3123
|
-
|
|
3173
|
+
CardanoGovernanceRegistrationDelegation: {
|
|
3124
3174
|
fields: {
|
|
3125
3175
|
voting_public_key: {
|
|
3126
3176
|
rule: "required",
|
|
3127
3177
|
type: "bytes",
|
|
3128
3178
|
id: 1
|
|
3129
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
|
+
},
|
|
3130
3193
|
staking_path: {
|
|
3131
3194
|
rule: "repeated",
|
|
3132
3195
|
type: "uint32",
|
|
@@ -3144,13 +3207,29 @@ var nested = {
|
|
|
3144
3207
|
rule: "required",
|
|
3145
3208
|
type: "uint64",
|
|
3146
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
|
|
3147
3226
|
}
|
|
3148
3227
|
}
|
|
3149
3228
|
},
|
|
3150
3229
|
CardanoTxAuxiliaryData: {
|
|
3151
3230
|
fields: {
|
|
3152
|
-
|
|
3153
|
-
type: "
|
|
3231
|
+
governance_registration_parameters: {
|
|
3232
|
+
type: "CardanoGovernanceRegistrationParametersType",
|
|
3154
3233
|
id: 1
|
|
3155
3234
|
},
|
|
3156
3235
|
hash: {
|
|
@@ -3168,6 +3247,50 @@ var nested = {
|
|
|
3168
3247
|
}
|
|
3169
3248
|
}
|
|
3170
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
|
+
},
|
|
3171
3294
|
CardanoTxItemAck: {
|
|
3172
3295
|
fields: {
|
|
3173
3296
|
}
|
|
@@ -3183,7 +3306,7 @@ var nested = {
|
|
|
3183
3306
|
type: "bytes",
|
|
3184
3307
|
id: 2
|
|
3185
3308
|
},
|
|
3186
|
-
|
|
3309
|
+
governance_signature: {
|
|
3187
3310
|
type: "bytes",
|
|
3188
3311
|
id: 3
|
|
3189
3312
|
}
|
|
@@ -3241,259 +3364,42 @@ var nested = {
|
|
|
3241
3364
|
fields: {
|
|
3242
3365
|
}
|
|
3243
3366
|
},
|
|
3244
|
-
|
|
3245
|
-
options: {
|
|
3246
|
-
deprecated: true
|
|
3247
|
-
},
|
|
3367
|
+
CardanoSignMessage: {
|
|
3248
3368
|
fields: {
|
|
3249
|
-
|
|
3250
|
-
rule: "repeated",
|
|
3251
|
-
type: "CardanoTxInputType",
|
|
3252
|
-
id: 1
|
|
3253
|
-
},
|
|
3254
|
-
outputs: {
|
|
3369
|
+
address_n: {
|
|
3255
3370
|
rule: "repeated",
|
|
3256
|
-
type: "CardanoTxOutputType",
|
|
3257
|
-
id: 2
|
|
3258
|
-
},
|
|
3259
|
-
protocol_magic: {
|
|
3260
|
-
rule: "required",
|
|
3261
3371
|
type: "uint32",
|
|
3262
|
-
id:
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
},
|
|
3269
|
-
ttl: {
|
|
3270
|
-
type: "uint64",
|
|
3271
|
-
id: 7
|
|
3272
|
-
},
|
|
3273
|
-
network_id: {
|
|
3274
|
-
rule: "required",
|
|
3275
|
-
type: "uint32",
|
|
3276
|
-
id: 8
|
|
3277
|
-
},
|
|
3278
|
-
certificates: {
|
|
3279
|
-
rule: "repeated",
|
|
3280
|
-
type: "CardanoTxCertificateType",
|
|
3281
|
-
id: 9
|
|
3282
|
-
},
|
|
3283
|
-
withdrawals: {
|
|
3284
|
-
rule: "repeated",
|
|
3285
|
-
type: "CardanoTxWithdrawalType",
|
|
3286
|
-
id: 10
|
|
3287
|
-
},
|
|
3288
|
-
validity_interval_start: {
|
|
3289
|
-
type: "uint64",
|
|
3290
|
-
id: 12
|
|
3291
|
-
},
|
|
3292
|
-
auxiliary_data: {
|
|
3293
|
-
type: "CardanoTxAuxiliaryDataType",
|
|
3294
|
-
id: 13
|
|
3295
|
-
}
|
|
3296
|
-
},
|
|
3297
|
-
nested: {
|
|
3298
|
-
CardanoTxInputType: {
|
|
3299
|
-
fields: {
|
|
3300
|
-
address_n: {
|
|
3301
|
-
rule: "repeated",
|
|
3302
|
-
type: "uint32",
|
|
3303
|
-
id: 1,
|
|
3304
|
-
options: {
|
|
3305
|
-
packed: false
|
|
3306
|
-
}
|
|
3307
|
-
},
|
|
3308
|
-
prev_hash: {
|
|
3309
|
-
rule: "required",
|
|
3310
|
-
type: "bytes",
|
|
3311
|
-
id: 2
|
|
3312
|
-
},
|
|
3313
|
-
prev_index: {
|
|
3314
|
-
rule: "required",
|
|
3315
|
-
type: "uint32",
|
|
3316
|
-
id: 3
|
|
3317
|
-
}
|
|
3318
|
-
}
|
|
3319
|
-
},
|
|
3320
|
-
CardanoTxOutputType: {
|
|
3321
|
-
fields: {
|
|
3322
|
-
address: {
|
|
3323
|
-
type: "string",
|
|
3324
|
-
id: 1
|
|
3325
|
-
},
|
|
3326
|
-
amount: {
|
|
3327
|
-
rule: "required",
|
|
3328
|
-
type: "uint64",
|
|
3329
|
-
id: 3
|
|
3330
|
-
},
|
|
3331
|
-
address_parameters: {
|
|
3332
|
-
type: "CardanoAddressParametersType",
|
|
3333
|
-
id: 4
|
|
3334
|
-
},
|
|
3335
|
-
token_bundle: {
|
|
3336
|
-
rule: "repeated",
|
|
3337
|
-
type: "CardanoAssetGroupType",
|
|
3338
|
-
id: 5
|
|
3339
|
-
}
|
|
3340
|
-
}
|
|
3341
|
-
},
|
|
3342
|
-
CardanoAssetGroupType: {
|
|
3343
|
-
fields: {
|
|
3344
|
-
policy_id: {
|
|
3345
|
-
rule: "required",
|
|
3346
|
-
type: "bytes",
|
|
3347
|
-
id: 1
|
|
3348
|
-
},
|
|
3349
|
-
tokens: {
|
|
3350
|
-
rule: "repeated",
|
|
3351
|
-
type: "CardanoTokenType",
|
|
3352
|
-
id: 2
|
|
3353
|
-
}
|
|
3354
|
-
}
|
|
3355
|
-
},
|
|
3356
|
-
CardanoTokenType: {
|
|
3357
|
-
fields: {
|
|
3358
|
-
asset_name_bytes: {
|
|
3359
|
-
rule: "required",
|
|
3360
|
-
type: "bytes",
|
|
3361
|
-
id: 1
|
|
3362
|
-
},
|
|
3363
|
-
amount: {
|
|
3364
|
-
rule: "required",
|
|
3365
|
-
type: "uint64",
|
|
3366
|
-
id: 2
|
|
3367
|
-
}
|
|
3368
|
-
}
|
|
3369
|
-
},
|
|
3370
|
-
CardanoPoolOwnerType: {
|
|
3371
|
-
fields: {
|
|
3372
|
-
staking_key_path: {
|
|
3373
|
-
rule: "repeated",
|
|
3374
|
-
type: "uint32",
|
|
3375
|
-
id: 1,
|
|
3376
|
-
options: {
|
|
3377
|
-
packed: false
|
|
3378
|
-
}
|
|
3379
|
-
},
|
|
3380
|
-
staking_key_hash: {
|
|
3381
|
-
type: "bytes",
|
|
3382
|
-
id: 2
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
},
|
|
3386
|
-
CardanoPoolRelayParametersType: {
|
|
3387
|
-
fields: {
|
|
3388
|
-
type: {
|
|
3389
|
-
rule: "required",
|
|
3390
|
-
type: "CardanoPoolRelayType",
|
|
3391
|
-
id: 1
|
|
3392
|
-
},
|
|
3393
|
-
ipv4_address: {
|
|
3394
|
-
type: "bytes",
|
|
3395
|
-
id: 2
|
|
3396
|
-
},
|
|
3397
|
-
ipv6_address: {
|
|
3398
|
-
type: "bytes",
|
|
3399
|
-
id: 3
|
|
3400
|
-
},
|
|
3401
|
-
host_name: {
|
|
3402
|
-
type: "string",
|
|
3403
|
-
id: 4
|
|
3404
|
-
},
|
|
3405
|
-
port: {
|
|
3406
|
-
type: "uint32",
|
|
3407
|
-
id: 5
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3410
|
-
},
|
|
3411
|
-
CardanoTxCertificateType: {
|
|
3412
|
-
fields: {
|
|
3413
|
-
type: {
|
|
3414
|
-
rule: "required",
|
|
3415
|
-
type: "CardanoCertificateType",
|
|
3416
|
-
id: 1
|
|
3417
|
-
},
|
|
3418
|
-
path: {
|
|
3419
|
-
rule: "repeated",
|
|
3420
|
-
type: "uint32",
|
|
3421
|
-
id: 2,
|
|
3422
|
-
options: {
|
|
3423
|
-
packed: false
|
|
3424
|
-
}
|
|
3425
|
-
},
|
|
3426
|
-
pool: {
|
|
3427
|
-
type: "bytes",
|
|
3428
|
-
id: 3
|
|
3429
|
-
},
|
|
3430
|
-
pool_parameters: {
|
|
3431
|
-
type: "CardanoPoolParametersType",
|
|
3432
|
-
id: 4
|
|
3433
|
-
}
|
|
3434
|
-
}
|
|
3435
|
-
},
|
|
3436
|
-
CardanoTxWithdrawalType: {
|
|
3437
|
-
fields: {
|
|
3438
|
-
path: {
|
|
3439
|
-
rule: "repeated",
|
|
3440
|
-
type: "uint32",
|
|
3441
|
-
id: 1,
|
|
3442
|
-
options: {
|
|
3443
|
-
packed: false
|
|
3444
|
-
}
|
|
3445
|
-
},
|
|
3446
|
-
amount: {
|
|
3447
|
-
rule: "required",
|
|
3448
|
-
type: "uint64",
|
|
3449
|
-
id: 2
|
|
3450
|
-
}
|
|
3451
|
-
}
|
|
3452
|
-
},
|
|
3453
|
-
CardanoTxAuxiliaryDataType: {
|
|
3454
|
-
fields: {
|
|
3455
|
-
blob: {
|
|
3456
|
-
type: "bytes",
|
|
3457
|
-
id: 1
|
|
3458
|
-
},
|
|
3459
|
-
catalyst_registration_parameters: {
|
|
3460
|
-
type: "CardanoCatalystRegistrationParametersType",
|
|
3461
|
-
id: 2
|
|
3462
|
-
}
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3465
|
-
}
|
|
3466
|
-
},
|
|
3467
|
-
CardanoSignedTxChunk: {
|
|
3468
|
-
options: {
|
|
3469
|
-
deprecated: true
|
|
3470
|
-
},
|
|
3471
|
-
fields: {
|
|
3472
|
-
signed_tx_chunk: {
|
|
3372
|
+
id: 1,
|
|
3373
|
+
options: {
|
|
3374
|
+
packed: false
|
|
3375
|
+
}
|
|
3376
|
+
},
|
|
3377
|
+
message: {
|
|
3473
3378
|
rule: "required",
|
|
3474
3379
|
type: "bytes",
|
|
3475
|
-
id:
|
|
3380
|
+
id: 2
|
|
3381
|
+
},
|
|
3382
|
+
derivation_type: {
|
|
3383
|
+
rule: "required",
|
|
3384
|
+
type: "CardanoDerivationType",
|
|
3385
|
+
id: 3
|
|
3386
|
+
},
|
|
3387
|
+
network_id: {
|
|
3388
|
+
rule: "required",
|
|
3389
|
+
type: "uint32",
|
|
3390
|
+
id: 4
|
|
3476
3391
|
}
|
|
3477
3392
|
}
|
|
3478
3393
|
},
|
|
3479
|
-
|
|
3480
|
-
options: {
|
|
3481
|
-
deprecated: true
|
|
3482
|
-
},
|
|
3483
|
-
fields: {
|
|
3484
|
-
}
|
|
3485
|
-
},
|
|
3486
|
-
CardanoSignedTx: {
|
|
3487
|
-
options: {
|
|
3488
|
-
deprecated: true
|
|
3489
|
-
},
|
|
3394
|
+
CardanoMessageSignature: {
|
|
3490
3395
|
fields: {
|
|
3491
|
-
|
|
3396
|
+
signature: {
|
|
3492
3397
|
rule: "required",
|
|
3493
3398
|
type: "bytes",
|
|
3494
3399
|
id: 1
|
|
3495
3400
|
},
|
|
3496
|
-
|
|
3401
|
+
key: {
|
|
3402
|
+
rule: "required",
|
|
3497
3403
|
type: "bytes",
|
|
3498
3404
|
id: 2
|
|
3499
3405
|
}
|
|
@@ -4933,6 +4839,10 @@ var nested = {
|
|
|
4933
4839
|
options: {
|
|
4934
4840
|
"default": true
|
|
4935
4841
|
}
|
|
4842
|
+
},
|
|
4843
|
+
chain_id: {
|
|
4844
|
+
type: "uint64",
|
|
4845
|
+
id: 4
|
|
4936
4846
|
}
|
|
4937
4847
|
}
|
|
4938
4848
|
},
|
|
@@ -5037,6 +4947,10 @@ var nested = {
|
|
|
5037
4947
|
show_display: {
|
|
5038
4948
|
type: "bool",
|
|
5039
4949
|
id: 2
|
|
4950
|
+
},
|
|
4951
|
+
chain_id: {
|
|
4952
|
+
type: "uint64",
|
|
4953
|
+
id: 3
|
|
5040
4954
|
}
|
|
5041
4955
|
}
|
|
5042
4956
|
},
|
|
@@ -5067,6 +4981,10 @@ var nested = {
|
|
|
5067
4981
|
show_display: {
|
|
5068
4982
|
type: "bool",
|
|
5069
4983
|
id: 2
|
|
4984
|
+
},
|
|
4985
|
+
chain_id: {
|
|
4986
|
+
type: "uint64",
|
|
4987
|
+
id: 3
|
|
5070
4988
|
}
|
|
5071
4989
|
}
|
|
5072
4990
|
},
|
|
@@ -5276,6 +5194,10 @@ var nested = {
|
|
|
5276
5194
|
rule: "required",
|
|
5277
5195
|
type: "bytes",
|
|
5278
5196
|
id: 2
|
|
5197
|
+
},
|
|
5198
|
+
chain_id: {
|
|
5199
|
+
type: "uint64",
|
|
5200
|
+
id: 3
|
|
5279
5201
|
}
|
|
5280
5202
|
}
|
|
5281
5203
|
},
|
|
@@ -5309,6 +5231,10 @@ var nested = {
|
|
|
5309
5231
|
rule: "required",
|
|
5310
5232
|
type: "string",
|
|
5311
5233
|
id: 4
|
|
5234
|
+
},
|
|
5235
|
+
chain_id: {
|
|
5236
|
+
type: "uint64",
|
|
5237
|
+
id: 5
|
|
5312
5238
|
}
|
|
5313
5239
|
}
|
|
5314
5240
|
},
|
|
@@ -5350,6 +5276,10 @@ var nested = {
|
|
|
5350
5276
|
message_hash: {
|
|
5351
5277
|
type: "bytes",
|
|
5352
5278
|
id: 3
|
|
5279
|
+
},
|
|
5280
|
+
chain_id: {
|
|
5281
|
+
type: "uint64",
|
|
5282
|
+
id: 4
|
|
5353
5283
|
}
|
|
5354
5284
|
}
|
|
5355
5285
|
},
|
|
@@ -5367,6 +5297,56 @@ var nested = {
|
|
|
5367
5297
|
}
|
|
5368
5298
|
}
|
|
5369
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
|
+
},
|
|
5370
5350
|
BackupType: {
|
|
5371
5351
|
values: {
|
|
5372
5352
|
Bip39: 0,
|
|
@@ -6403,14 +6383,18 @@ var nested = {
|
|
|
6403
6383
|
type: "ResourceType",
|
|
6404
6384
|
id: 3
|
|
6405
6385
|
},
|
|
6386
|
+
nft_meta_data: {
|
|
6387
|
+
type: "bytes",
|
|
6388
|
+
id: 4
|
|
6389
|
+
},
|
|
6406
6390
|
zoom_data_length: {
|
|
6407
6391
|
rule: "required",
|
|
6408
6392
|
type: "uint32",
|
|
6409
6393
|
id: 5
|
|
6410
6394
|
},
|
|
6411
|
-
|
|
6412
|
-
type: "
|
|
6413
|
-
id:
|
|
6395
|
+
file_name_no_ext: {
|
|
6396
|
+
type: "string",
|
|
6397
|
+
id: 6
|
|
6414
6398
|
}
|
|
6415
6399
|
},
|
|
6416
6400
|
nested: {
|
|
@@ -7942,6 +7926,56 @@ var nested = {
|
|
|
7942
7926
|
}
|
|
7943
7927
|
}
|
|
7944
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
|
+
},
|
|
7945
7979
|
RippleGetAddress: {
|
|
7946
7980
|
fields: {
|
|
7947
7981
|
address_n: {
|
|
@@ -9624,14 +9658,10 @@ var nested = {
|
|
|
9624
9658
|
MessageType_StellarManageBuyOfferOp: 222,
|
|
9625
9659
|
MessageType_StellarPathPaymentStrictSendOp: 223,
|
|
9626
9660
|
MessageType_StellarSignedTx: 230,
|
|
9627
|
-
MessageType_CardanoSignTx: 303,
|
|
9628
9661
|
MessageType_CardanoGetPublicKey: 305,
|
|
9629
9662
|
MessageType_CardanoPublicKey: 306,
|
|
9630
9663
|
MessageType_CardanoGetAddress: 307,
|
|
9631
9664
|
MessageType_CardanoAddress: 308,
|
|
9632
|
-
MessageType_CardanoSignedTx: 310,
|
|
9633
|
-
MessageType_CardanoSignedTxChunk: 311,
|
|
9634
|
-
MessageType_CardanoSignedTxChunkAck: 312,
|
|
9635
9665
|
MessageType_CardanoTxItemAck: 313,
|
|
9636
9666
|
MessageType_CardanoTxAuxiliaryDataSupplement: 314,
|
|
9637
9667
|
MessageType_CardanoTxWitnessRequest: 315,
|
|
@@ -9652,6 +9682,13 @@ var nested = {
|
|
|
9652
9682
|
MessageType_CardanoGetNativeScriptHash: 330,
|
|
9653
9683
|
MessageType_CardanoNativeScriptHash: 331,
|
|
9654
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,
|
|
9655
9692
|
MessageType_RippleGetAddress: 400,
|
|
9656
9693
|
MessageType_RippleAddress: 401,
|
|
9657
9694
|
MessageType_RippleSignTx: 402,
|
|
@@ -9777,10 +9814,18 @@ var nested = {
|
|
|
9777
9814
|
MessageType_AlgorandAddress: 10901,
|
|
9778
9815
|
MessageType_AlgorandSignTx: 10902,
|
|
9779
9816
|
MessageType_AlgorandSignedTx: 10903,
|
|
9817
|
+
MessageType_PolkadotGetAddress: 11000,
|
|
9818
|
+
MessageType_PolkadotAddress: 11001,
|
|
9819
|
+
MessageType_PolkadotSignTx: 11002,
|
|
9820
|
+
MessageType_PolkadotSignedTx: 11003,
|
|
9780
9821
|
MessageType_SuiGetAddress: 11100,
|
|
9781
9822
|
MessageType_SuiAddress: 11101,
|
|
9782
9823
|
MessageType_SuiSignTx: 11102,
|
|
9783
9824
|
MessageType_SuiSignedTx: 11103,
|
|
9825
|
+
MessageType_FilecoinGetAddress: 11200,
|
|
9826
|
+
MessageType_FilecoinAddress: 11201,
|
|
9827
|
+
MessageType_FilecoinSignTx: 11202,
|
|
9828
|
+
MessageType_FilecoinSignedTx: 11203,
|
|
9784
9829
|
MessageType_DeviceBackToBoot: 903,
|
|
9785
9830
|
MessageType_DeviceInfoSettings: 10001,
|
|
9786
9831
|
MessageType_GetDeviceInfo: 10002,
|
|
@@ -12995,12 +13040,15 @@ class DeviceUploadResource extends BaseMethod {
|
|
|
12995
13040
|
data: hexToBytes(dataHex),
|
|
12996
13041
|
thumbnailData: hexToBytes(thumbnailDataHex),
|
|
12997
13042
|
};
|
|
13043
|
+
const fileHash = utils.bytesToHex(blake2s.blake2s(this.payload.dataHex)).slice(0, 8);
|
|
13044
|
+
const file_name_no_ext = `${resType === 0 ? 'wp' : 'nft'}-${fileHash}-${Math.floor(Date.now() / 1000)}`;
|
|
12998
13045
|
this.params = {
|
|
12999
13046
|
extension: suffix,
|
|
13000
13047
|
data_length: this.paramsData.data.byteLength,
|
|
13001
13048
|
zoom_data_length: this.paramsData.thumbnailData.byteLength,
|
|
13002
13049
|
res_type: resType,
|
|
13003
13050
|
nft_meta_data: nftMetaData,
|
|
13051
|
+
file_name_no_ext,
|
|
13004
13052
|
};
|
|
13005
13053
|
}
|
|
13006
13054
|
run() {
|
|
@@ -14577,11 +14625,13 @@ class EvmGetAddress extends BaseMethod {
|
|
|
14577
14625
|
validateParams(batch, [
|
|
14578
14626
|
{ name: 'path', required: true },
|
|
14579
14627
|
{ name: 'showOnOneKey', type: 'boolean' },
|
|
14628
|
+
{ name: 'chainId', type: 'number' },
|
|
14580
14629
|
]);
|
|
14581
14630
|
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
14582
14631
|
this.params.push({
|
|
14583
14632
|
address_n: addressN,
|
|
14584
14633
|
show_display: showOnOneKey,
|
|
14634
|
+
chain_id: batch.chainId,
|
|
14585
14635
|
});
|
|
14586
14636
|
});
|
|
14587
14637
|
}
|
|
@@ -14621,11 +14671,13 @@ class EVMGetPublicKey extends BaseMethod {
|
|
|
14621
14671
|
validateParams(batch, [
|
|
14622
14672
|
{ name: 'path', required: true },
|
|
14623
14673
|
{ name: 'showOnOneKey', type: 'boolean' },
|
|
14674
|
+
{ name: 'chainId', type: 'number' },
|
|
14624
14675
|
]);
|
|
14625
14676
|
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
14626
14677
|
this.params.push({
|
|
14627
14678
|
address_n: addressN,
|
|
14628
14679
|
show_display: showOnOneKey,
|
|
14680
|
+
chain_id: batch.chainId,
|
|
14629
14681
|
});
|
|
14630
14682
|
});
|
|
14631
14683
|
}
|
|
@@ -14649,12 +14701,14 @@ class EVMSignMessage$2 extends BaseMethod {
|
|
|
14649
14701
|
validateParams(this.payload, [
|
|
14650
14702
|
{ name: 'path', required: true },
|
|
14651
14703
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
14704
|
+
{ name: 'chainId', type: 'number' },
|
|
14652
14705
|
]);
|
|
14653
|
-
const { path, messageHex } = this.payload;
|
|
14706
|
+
const { path, messageHex, chainId } = this.payload;
|
|
14654
14707
|
const addressN = validatePath(path, 3);
|
|
14655
14708
|
this.params = {
|
|
14656
14709
|
address_n: addressN,
|
|
14657
14710
|
message: formatAnyHex(messageHex),
|
|
14711
|
+
chain_id: chainId,
|
|
14658
14712
|
};
|
|
14659
14713
|
}
|
|
14660
14714
|
run() {
|
|
@@ -14947,13 +15001,15 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
14947
15001
|
{ name: 'data', type: 'object' },
|
|
14948
15002
|
{ name: 'domainHash', type: 'hexString' },
|
|
14949
15003
|
{ name: 'messageHash', type: 'hexString' },
|
|
15004
|
+
{ name: 'chainId', type: 'number' },
|
|
14950
15005
|
]);
|
|
14951
|
-
const { path, data, metamaskV4Compat, domainHash, messageHash } = this.payload;
|
|
15006
|
+
const { path, data, metamaskV4Compat, domainHash, messageHash, chainId } = this.payload;
|
|
14952
15007
|
const addressN = validatePath(path, 3);
|
|
14953
15008
|
this.params = {
|
|
14954
15009
|
addressN,
|
|
14955
15010
|
metamaskV4Compat,
|
|
14956
15011
|
data,
|
|
15012
|
+
chainId,
|
|
14957
15013
|
};
|
|
14958
15014
|
if (domainHash) {
|
|
14959
15015
|
this.params.domainHash = formatAnyHex(domainHash);
|
|
@@ -14968,7 +15024,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
14968
15024
|
signTypedData() {
|
|
14969
15025
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14970
15026
|
const { commands } = this.device;
|
|
14971
|
-
const { addressN, data, metamaskV4Compat } = this.params;
|
|
15027
|
+
const { addressN, data, metamaskV4Compat, chainId } = this.params;
|
|
14972
15028
|
const { types, primaryType, domain, message, } = data;
|
|
14973
15029
|
let response = yield commands.typedCall('EthereumSignTypedData', [
|
|
14974
15030
|
'EthereumTypedDataStructRequest',
|
|
@@ -14978,6 +15034,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
14978
15034
|
address_n: addressN,
|
|
14979
15035
|
primary_type: primaryType,
|
|
14980
15036
|
metamask_v4_compat: metamaskV4Compat,
|
|
15037
|
+
chain_id: chainId,
|
|
14981
15038
|
});
|
|
14982
15039
|
while (response.type === 'EthereumTypedDataStructRequest') {
|
|
14983
15040
|
const { name: typeDefinitionName } = response.message;
|
|
@@ -15070,7 +15127,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
15070
15127
|
if (!this.device.features) {
|
|
15071
15128
|
throw hdShared.ERRORS.TypedError('Device_InitializeFailed', 'Device initialization failed. Please try again.');
|
|
15072
15129
|
}
|
|
15073
|
-
const { addressN } = this.params;
|
|
15130
|
+
const { addressN, chainId } = this.params;
|
|
15074
15131
|
const deviceType = getDeviceType(this.device.features);
|
|
15075
15132
|
if (deviceType === 'classic' || deviceType === 'mini') {
|
|
15076
15133
|
validateParams(this.params, [
|
|
@@ -15084,6 +15141,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
15084
15141
|
address_n: addressN,
|
|
15085
15142
|
domain_separator_hash: domainHash !== null && domainHash !== void 0 ? domainHash : '',
|
|
15086
15143
|
message_hash: messageHash,
|
|
15144
|
+
chain_id: chainId,
|
|
15087
15145
|
});
|
|
15088
15146
|
}
|
|
15089
15147
|
else {
|
|
@@ -15108,12 +15166,14 @@ class EVMSignMessage$1 extends BaseMethod {
|
|
|
15108
15166
|
{ name: 'address', type: 'string', required: true },
|
|
15109
15167
|
{ name: 'messageHex', type: 'hexString', required: true },
|
|
15110
15168
|
{ name: 'signature', type: 'hexString', required: true },
|
|
15169
|
+
{ name: 'chainId', type: 'number' },
|
|
15111
15170
|
]);
|
|
15112
15171
|
const { address, messageHex, signature } = formatAnyHex(this.payload);
|
|
15113
15172
|
this.params = {
|
|
15114
15173
|
address,
|
|
15115
15174
|
message: messageHex,
|
|
15116
15175
|
signature,
|
|
15176
|
+
chain_id: this.payload.chainId,
|
|
15117
15177
|
};
|
|
15118
15178
|
}
|
|
15119
15179
|
run() {
|
|
@@ -16529,7 +16589,7 @@ class XrpGetAddress$1 extends BaseMethod {
|
|
|
16529
16589
|
getVersionRange() {
|
|
16530
16590
|
return {
|
|
16531
16591
|
model_mini: {
|
|
16532
|
-
min: '2.
|
|
16592
|
+
min: '2.9.0',
|
|
16533
16593
|
},
|
|
16534
16594
|
};
|
|
16535
16595
|
}
|
|
@@ -16611,7 +16671,7 @@ class XrpGetAddress extends BaseMethod {
|
|
|
16611
16671
|
getVersionRange() {
|
|
16612
16672
|
return {
|
|
16613
16673
|
model_mini: {
|
|
16614
|
-
min: '2.
|
|
16674
|
+
min: '2.9.0',
|
|
16615
16675
|
},
|
|
16616
16676
|
};
|
|
16617
16677
|
}
|
|
@@ -17612,6 +17672,101 @@ class CardanoSignTransaction extends BaseMethod {
|
|
|
17612
17672
|
}
|
|
17613
17673
|
}
|
|
17614
17674
|
|
|
17675
|
+
class FilecoinGetAddress extends BaseMethod {
|
|
17676
|
+
constructor() {
|
|
17677
|
+
super(...arguments);
|
|
17678
|
+
this.hasBundle = false;
|
|
17679
|
+
}
|
|
17680
|
+
init() {
|
|
17681
|
+
var _a;
|
|
17682
|
+
this.checkDeviceId = true;
|
|
17683
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
17684
|
+
this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
|
|
17685
|
+
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
17686
|
+
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
17687
|
+
this.params = [];
|
|
17688
|
+
payload.bundle.forEach((batch) => {
|
|
17689
|
+
var _a;
|
|
17690
|
+
const addressN = validatePath(batch.path, 3);
|
|
17691
|
+
validateParams(batch, [
|
|
17692
|
+
{ name: 'path', required: true },
|
|
17693
|
+
{ name: 'showOnOneKey', type: 'boolean' },
|
|
17694
|
+
]);
|
|
17695
|
+
const showOnOneKey = (_a = batch.showOnOneKey) !== null && _a !== void 0 ? _a : true;
|
|
17696
|
+
this.params.push({
|
|
17697
|
+
address_n: addressN,
|
|
17698
|
+
show_display: showOnOneKey,
|
|
17699
|
+
});
|
|
17700
|
+
});
|
|
17701
|
+
}
|
|
17702
|
+
getVersionRange() {
|
|
17703
|
+
return {
|
|
17704
|
+
model_mini: {
|
|
17705
|
+
min: '2.10.0',
|
|
17706
|
+
},
|
|
17707
|
+
model_touch: {
|
|
17708
|
+
min: '3.5.0',
|
|
17709
|
+
},
|
|
17710
|
+
};
|
|
17711
|
+
}
|
|
17712
|
+
run() {
|
|
17713
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17714
|
+
const responses = [];
|
|
17715
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
17716
|
+
const param = this.params[i];
|
|
17717
|
+
const res = yield this.device.commands.typedCall('FilecoinGetAddress', 'FilecoinAddress', Object.assign({}, param));
|
|
17718
|
+
const { address } = res.message;
|
|
17719
|
+
responses.push({
|
|
17720
|
+
path: serializedPath(param.address_n),
|
|
17721
|
+
address,
|
|
17722
|
+
});
|
|
17723
|
+
}
|
|
17724
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
17725
|
+
});
|
|
17726
|
+
}
|
|
17727
|
+
}
|
|
17728
|
+
|
|
17729
|
+
class FilecoinSignTransaction extends BaseMethod {
|
|
17730
|
+
constructor() {
|
|
17731
|
+
super(...arguments);
|
|
17732
|
+
this.hasBundle = false;
|
|
17733
|
+
}
|
|
17734
|
+
init() {
|
|
17735
|
+
this.checkDeviceId = true;
|
|
17736
|
+
this.allowDeviceMode = [...this.allowDeviceMode];
|
|
17737
|
+
validateParams(this.payload, [
|
|
17738
|
+
{ name: 'path', required: true },
|
|
17739
|
+
{ name: 'rawTx', type: 'hexString', required: true },
|
|
17740
|
+
]);
|
|
17741
|
+
const { path, rawTx } = this.payload;
|
|
17742
|
+
const addressN = validatePath(path, 3);
|
|
17743
|
+
this.params = {
|
|
17744
|
+
address_n: addressN,
|
|
17745
|
+
raw_tx: formatAnyHex(rawTx),
|
|
17746
|
+
};
|
|
17747
|
+
}
|
|
17748
|
+
getVersionRange() {
|
|
17749
|
+
return {
|
|
17750
|
+
model_mini: {
|
|
17751
|
+
min: '2.10.0',
|
|
17752
|
+
},
|
|
17753
|
+
model_touch: {
|
|
17754
|
+
min: '3.5.0',
|
|
17755
|
+
},
|
|
17756
|
+
};
|
|
17757
|
+
}
|
|
17758
|
+
run() {
|
|
17759
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17760
|
+
const res = yield this.device.commands.typedCall('FilecoinSignTx', 'FilecoinSignedTx', Object.assign({}, this.params));
|
|
17761
|
+
const { signature } = res.message;
|
|
17762
|
+
return {
|
|
17763
|
+
path: serializedPath(this.params.address_n),
|
|
17764
|
+
signature,
|
|
17765
|
+
};
|
|
17766
|
+
});
|
|
17767
|
+
}
|
|
17768
|
+
}
|
|
17769
|
+
|
|
17615
17770
|
var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
17616
17771
|
__proto__: null,
|
|
17617
17772
|
searchDevices: SearchDevices,
|
|
@@ -17688,7 +17843,9 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
17688
17843
|
suiSignTransaction: SuiSignTransaction,
|
|
17689
17844
|
cardanoGetAddress: CardanoGetAddress,
|
|
17690
17845
|
cardanoGetPublicKey: CardanoGetPublicKey,
|
|
17691
|
-
cardanoSignTransaction: CardanoSignTransaction
|
|
17846
|
+
cardanoSignTransaction: CardanoSignTransaction,
|
|
17847
|
+
filecoinGetAddress: FilecoinGetAddress,
|
|
17848
|
+
filecoinSignTransaction: FilecoinSignTransaction
|
|
17692
17849
|
});
|
|
17693
17850
|
|
|
17694
17851
|
function findMethod(message) {
|