@onekeyfe/hd-transport 1.1.27 → 1.2.0-alpha.0
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/README.md +2 -4
- package/__tests__/build-receive.test.js +6 -8
- package/__tests__/decode-features.test.js +3 -2
- package/__tests__/messages.test.js +8 -0
- package/__tests__/protocol-v2.test.js +754 -0
- package/dist/constants.d.ts +14 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +934 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +827 -84
- package/dist/protocols/index.d.ts +45 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/v1/decode.d.ts +11 -0
- package/dist/protocols/v1/decode.d.ts.map +1 -0
- package/dist/protocols/v1/encode.d.ts +11 -0
- package/dist/protocols/v1/encode.d.ts.map +1 -0
- package/dist/protocols/v1/index.d.ts +5 -0
- package/dist/protocols/v1/index.d.ts.map +1 -0
- package/dist/protocols/v1/packets.d.ts +7 -0
- package/dist/protocols/v1/packets.d.ts.map +1 -0
- package/dist/{serialization → protocols/v1}/receive.d.ts +1 -1
- package/dist/protocols/v1/receive.d.ts.map +1 -0
- package/dist/protocols/v2/constants.d.ts +7 -0
- package/dist/protocols/v2/constants.d.ts.map +1 -0
- package/dist/protocols/v2/crc8.d.ts +3 -0
- package/dist/protocols/v2/crc8.d.ts.map +1 -0
- package/dist/protocols/v2/debug.d.ts +13 -0
- package/dist/protocols/v2/debug.d.ts.map +1 -0
- package/dist/protocols/v2/decode.d.ts +8 -0
- package/dist/protocols/v2/decode.d.ts.map +1 -0
- package/dist/protocols/v2/encode.d.ts +5 -0
- package/dist/protocols/v2/encode.d.ts.map +1 -0
- package/dist/protocols/v2/frame-assembler.d.ts +12 -0
- package/dist/protocols/v2/frame-assembler.d.ts.map +1 -0
- package/dist/protocols/v2/index.d.ts +7 -0
- package/dist/protocols/v2/index.d.ts.map +1 -0
- package/dist/protocols/v2/session.d.ts +50 -0
- package/dist/protocols/v2/session.d.ts.map +1 -0
- package/dist/serialization/index.d.ts +6 -3
- package/dist/serialization/index.d.ts.map +1 -1
- package/dist/serialization/protobuf/decode.d.ts.map +1 -1
- package/dist/serialization/protobuf/messages.d.ts +1 -1
- package/dist/serialization/protobuf/messages.d.ts.map +1 -1
- package/dist/types/messages.d.ts +461 -11
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +14 -2
- package/dist/types/transport.d.ts.map +1 -1
- package/dist/utils/logBlockCommand.d.ts.map +1 -1
- package/messages-protocol-v2.json +13369 -0
- package/package.json +3 -3
- package/scripts/protobuf-build.sh +314 -20
- package/scripts/protobuf-patches/TxInputType.js +1 -0
- package/scripts/protobuf-patches/index.js +2 -0
- package/scripts/protobuf-types.js +224 -18
- package/src/constants.ts +42 -6
- package/src/index.ts +39 -11
- package/src/protocols/index.ts +144 -0
- package/src/{serialization/protocol → protocols/v1}/decode.ts +4 -4
- package/src/{serialization/protocol → protocols/v1}/encode.ts +18 -13
- package/src/protocols/v1/index.ts +4 -0
- package/src/protocols/v1/packets.ts +53 -0
- package/src/{serialization → protocols/v1}/receive.ts +5 -5
- package/src/protocols/v2/constants.ts +6 -0
- package/src/protocols/v2/crc8.ts +34 -0
- package/src/protocols/v2/debug.ts +26 -0
- package/src/protocols/v2/decode.ts +92 -0
- package/src/protocols/v2/encode.ts +116 -0
- package/src/protocols/v2/frame-assembler.ts +98 -0
- package/src/protocols/v2/index.ts +6 -0
- package/src/protocols/v2/session.ts +429 -0
- package/src/serialization/index.ts +6 -5
- package/src/serialization/protobuf/decode.ts +7 -0
- package/src/serialization/protobuf/messages.ts +8 -4
- package/src/types/messages.ts +606 -13
- package/src/types/transport.ts +26 -2
- package/src/utils/logBlockCommand.ts +9 -1
- package/dist/serialization/protocol/decode.d.ts +0 -11
- package/dist/serialization/protocol/decode.d.ts.map +0 -1
- package/dist/serialization/protocol/encode.d.ts +0 -11
- package/dist/serialization/protocol/encode.d.ts.map +0 -1
- package/dist/serialization/protocol/index.d.ts +0 -3
- package/dist/serialization/protocol/index.d.ts.map +0 -1
- package/dist/serialization/receive.d.ts.map +0 -1
- package/dist/serialization/send.d.ts +0 -7
- package/dist/serialization/send.d.ts.map +0 -1
- package/src/serialization/protocol/index.ts +0 -2
- package/src/serialization/send.ts +0 -58
package/dist/types/messages.d.ts
CHANGED
|
@@ -275,6 +275,7 @@ export type GetAddress = {
|
|
|
275
275
|
};
|
|
276
276
|
export type Address = {
|
|
277
277
|
address: string;
|
|
278
|
+
mac?: string;
|
|
278
279
|
};
|
|
279
280
|
export type GetOwnershipId = {
|
|
280
281
|
address_n: number[];
|
|
@@ -303,6 +304,13 @@ export type VerifyMessage = {
|
|
|
303
304
|
message: string;
|
|
304
305
|
coin_name?: string;
|
|
305
306
|
};
|
|
307
|
+
export type CoinJoinRequest = {
|
|
308
|
+
fee_rate: number;
|
|
309
|
+
no_fee_threshold: number;
|
|
310
|
+
min_registrable_amount: number;
|
|
311
|
+
mask_public_key: string;
|
|
312
|
+
signature: string;
|
|
313
|
+
};
|
|
306
314
|
export type SignTx = {
|
|
307
315
|
outputs_count: number;
|
|
308
316
|
inputs_count: number;
|
|
@@ -316,6 +324,8 @@ export type SignTx = {
|
|
|
316
324
|
branch_id?: number;
|
|
317
325
|
amount_unit?: AmountUnit;
|
|
318
326
|
decred_staking_ticket?: boolean;
|
|
327
|
+
serialize?: boolean;
|
|
328
|
+
coinjoin_request?: CoinJoinRequest;
|
|
319
329
|
};
|
|
320
330
|
export declare enum Enum_RequestType {
|
|
321
331
|
TXINPUT = 0,
|
|
@@ -324,7 +334,8 @@ export declare enum Enum_RequestType {
|
|
|
324
334
|
TXFINISHED = 3,
|
|
325
335
|
TXEXTRADATA = 4,
|
|
326
336
|
TXORIGINPUT = 5,
|
|
327
|
-
TXORIGOUTPUT = 6
|
|
337
|
+
TXORIGOUTPUT = 6,
|
|
338
|
+
TXPAYMENTREQ = 7
|
|
328
339
|
}
|
|
329
340
|
export type RequestType = keyof typeof Enum_RequestType;
|
|
330
341
|
export type TxRequestDetailsType = {
|
|
@@ -359,6 +370,7 @@ type CommonTxInputType = {
|
|
|
359
370
|
witness?: string;
|
|
360
371
|
ownership_proof?: string;
|
|
361
372
|
commitment_data?: string;
|
|
373
|
+
coinjoin_flags?: number;
|
|
362
374
|
};
|
|
363
375
|
export type TxInputType = (CommonTxInputType & {
|
|
364
376
|
address_n: number[];
|
|
@@ -498,12 +510,15 @@ export type OwnershipProof = {
|
|
|
498
510
|
};
|
|
499
511
|
export type AuthorizeCoinJoin = {
|
|
500
512
|
coordinator: string;
|
|
501
|
-
max_total_fee
|
|
513
|
+
max_total_fee?: number;
|
|
502
514
|
fee_per_anonymity?: number;
|
|
503
515
|
address_n: number[];
|
|
504
516
|
coin_name?: string;
|
|
505
517
|
script_type?: InputScriptType;
|
|
506
518
|
amount_unit?: AmountUnit;
|
|
519
|
+
max_rounds?: number;
|
|
520
|
+
max_coordinator_fee_rate?: number;
|
|
521
|
+
max_fee_per_kvbyte?: number;
|
|
507
522
|
};
|
|
508
523
|
export type BIP32Address = {
|
|
509
524
|
address_n: number[];
|
|
@@ -1658,7 +1673,10 @@ export type LnurlAuthResp = {
|
|
|
1658
1673
|
export declare enum Enum_BackupType {
|
|
1659
1674
|
Bip39 = 0,
|
|
1660
1675
|
Slip39_Basic = 1,
|
|
1661
|
-
Slip39_Advanced = 2
|
|
1676
|
+
Slip39_Advanced = 2,
|
|
1677
|
+
Slip39_Single_Extendable = 3,
|
|
1678
|
+
Slip39_Basic_Extendable = 4,
|
|
1679
|
+
Slip39_Advanced_Extendable = 5
|
|
1662
1680
|
}
|
|
1663
1681
|
export type BackupType = keyof typeof Enum_BackupType;
|
|
1664
1682
|
export declare enum Enum_SafetyCheckLevel {
|
|
@@ -2134,6 +2152,8 @@ export type UnLockDeviceResponse = {
|
|
|
2134
2152
|
};
|
|
2135
2153
|
export type GetPassphraseState = {
|
|
2136
2154
|
passphrase_state?: string;
|
|
2155
|
+
_only_main_pin?: boolean;
|
|
2156
|
+
allow_create_attach_pin?: boolean;
|
|
2137
2157
|
};
|
|
2138
2158
|
export type PassphraseState = {
|
|
2139
2159
|
passphrase_state?: string;
|
|
@@ -2189,7 +2209,7 @@ export type MoneroTransactionRsigData = {
|
|
|
2189
2209
|
export type MoneroGetAddress = {
|
|
2190
2210
|
address_n: number[];
|
|
2191
2211
|
show_display?: boolean;
|
|
2192
|
-
network_type?: number;
|
|
2212
|
+
network_type?: number | MoneroNetworkType;
|
|
2193
2213
|
account?: number;
|
|
2194
2214
|
minor?: number;
|
|
2195
2215
|
payment_id?: string;
|
|
@@ -2199,7 +2219,7 @@ export type MoneroAddress = {
|
|
|
2199
2219
|
};
|
|
2200
2220
|
export type MoneroGetWatchKey = {
|
|
2201
2221
|
address_n: number[];
|
|
2202
|
-
network_type?: number;
|
|
2222
|
+
network_type?: number | MoneroNetworkType;
|
|
2203
2223
|
};
|
|
2204
2224
|
export type MoneroWatchKey = {
|
|
2205
2225
|
watch_key?: string;
|
|
@@ -2225,7 +2245,7 @@ export type MoneroTransactionData = {
|
|
|
2225
2245
|
export type MoneroTransactionInitRequest = {
|
|
2226
2246
|
version?: number;
|
|
2227
2247
|
address_n: number[];
|
|
2228
|
-
network_type?: number;
|
|
2248
|
+
network_type?: number | MoneroNetworkType;
|
|
2229
2249
|
tsx_data?: MoneroTransactionData;
|
|
2230
2250
|
};
|
|
2231
2251
|
export type MoneroTransactionInitAck = {
|
|
@@ -2317,7 +2337,7 @@ export type MoneroKeyImageExportInitRequest = {
|
|
|
2317
2337
|
num?: number;
|
|
2318
2338
|
hash?: string;
|
|
2319
2339
|
address_n: number[];
|
|
2320
|
-
network_type?: number;
|
|
2340
|
+
network_type?: number | MoneroNetworkType;
|
|
2321
2341
|
subs: MoneroSubAddressIndicesList[];
|
|
2322
2342
|
};
|
|
2323
2343
|
export type MoneroKeyImageExportInitAck = {};
|
|
@@ -2345,7 +2365,7 @@ export type MoneroKeyImageSyncFinalAck = {
|
|
|
2345
2365
|
};
|
|
2346
2366
|
export type MoneroGetTxKeyRequest = {
|
|
2347
2367
|
address_n: number[];
|
|
2348
|
-
network_type?: number;
|
|
2368
|
+
network_type?: number | MoneroNetworkType;
|
|
2349
2369
|
salt1?: string;
|
|
2350
2370
|
salt2?: string;
|
|
2351
2371
|
tx_enc_keys?: string;
|
|
@@ -2360,7 +2380,7 @@ export type MoneroGetTxKeyAck = {
|
|
|
2360
2380
|
};
|
|
2361
2381
|
export type MoneroLiveRefreshStartRequest = {
|
|
2362
2382
|
address_n: number[];
|
|
2363
|
-
network_type?: number;
|
|
2383
|
+
network_type?: number | MoneroNetworkType;
|
|
2364
2384
|
};
|
|
2365
2385
|
export type MoneroLiveRefreshStartAck = {};
|
|
2366
2386
|
export type MoneroLiveRefreshStepRequest = {
|
|
@@ -3124,6 +3144,7 @@ export type TonSignedMessage = {
|
|
|
3124
3144
|
signature?: string;
|
|
3125
3145
|
signning_message?: string;
|
|
3126
3146
|
init_data_length?: number;
|
|
3147
|
+
signing_message?: string;
|
|
3127
3148
|
};
|
|
3128
3149
|
export type TonSignProof = {
|
|
3129
3150
|
address_n: number[];
|
|
@@ -3277,6 +3298,362 @@ export declare enum CommandFlags {
|
|
|
3277
3298
|
Default = 0,
|
|
3278
3299
|
Factory_Only = 1
|
|
3279
3300
|
}
|
|
3301
|
+
export type experimental_message = {};
|
|
3302
|
+
export type experimental_field = {};
|
|
3303
|
+
export type TextMemo = {
|
|
3304
|
+
text: string;
|
|
3305
|
+
};
|
|
3306
|
+
export type RefundMemo = {
|
|
3307
|
+
address: string;
|
|
3308
|
+
mac: string;
|
|
3309
|
+
};
|
|
3310
|
+
export type CoinPurchaseMemo = {
|
|
3311
|
+
coin_type: number;
|
|
3312
|
+
amount: UintType;
|
|
3313
|
+
address: string;
|
|
3314
|
+
mac: string;
|
|
3315
|
+
};
|
|
3316
|
+
export type PaymentRequestMemo = {
|
|
3317
|
+
text_memo?: TextMemo;
|
|
3318
|
+
refund_memo?: RefundMemo;
|
|
3319
|
+
coin_purchase_memo?: CoinPurchaseMemo;
|
|
3320
|
+
};
|
|
3321
|
+
export type TxAckPaymentRequest = {
|
|
3322
|
+
nonce?: string;
|
|
3323
|
+
recipient_name: string;
|
|
3324
|
+
memos?: PaymentRequestMemo[];
|
|
3325
|
+
amount?: UintType;
|
|
3326
|
+
signature: string;
|
|
3327
|
+
};
|
|
3328
|
+
export type SetBusy = {
|
|
3329
|
+
expiry_ms?: number;
|
|
3330
|
+
};
|
|
3331
|
+
export type GetFirmwareHash = {
|
|
3332
|
+
challenge?: string;
|
|
3333
|
+
};
|
|
3334
|
+
export type FirmwareHash = {
|
|
3335
|
+
hash: string;
|
|
3336
|
+
};
|
|
3337
|
+
export type GetNonce = {};
|
|
3338
|
+
export type Nonce = {
|
|
3339
|
+
nonce: string;
|
|
3340
|
+
};
|
|
3341
|
+
export type WriteSEPrivateKey = {
|
|
3342
|
+
private_key: string;
|
|
3343
|
+
};
|
|
3344
|
+
export type UnlockPath = {
|
|
3345
|
+
address_n: number[];
|
|
3346
|
+
mac?: string;
|
|
3347
|
+
};
|
|
3348
|
+
export type UnlockedPathRequest = {
|
|
3349
|
+
mac?: string;
|
|
3350
|
+
};
|
|
3351
|
+
export declare enum MoneroNetworkType {
|
|
3352
|
+
MAINNET = 0,
|
|
3353
|
+
TESTNET = 1,
|
|
3354
|
+
STAGENET = 2,
|
|
3355
|
+
FAKECHAIN = 3
|
|
3356
|
+
}
|
|
3357
|
+
export type TxDetailsAmount = {
|
|
3358
|
+
num: string;
|
|
3359
|
+
decimals: number;
|
|
3360
|
+
symbol: string;
|
|
3361
|
+
};
|
|
3362
|
+
export type TxDetailsAddress = {
|
|
3363
|
+
key: number;
|
|
3364
|
+
address: string;
|
|
3365
|
+
owner?: string;
|
|
3366
|
+
icon?: string;
|
|
3367
|
+
};
|
|
3368
|
+
export type TxDetailsNetwork = {
|
|
3369
|
+
coin_type: number;
|
|
3370
|
+
chain_id?: number;
|
|
3371
|
+
};
|
|
3372
|
+
export type TxDetailsGeneral = {
|
|
3373
|
+
key: number;
|
|
3374
|
+
value: string;
|
|
3375
|
+
is_overview: boolean;
|
|
3376
|
+
};
|
|
3377
|
+
export declare enum TxDetailsDisplayType {
|
|
3378
|
+
DISPLAY_TYPE_INFO = 0,
|
|
3379
|
+
DISPLAY_TYPE_SIGN = 1
|
|
3380
|
+
}
|
|
3381
|
+
export type TxDetailsPage = {
|
|
3382
|
+
title: string;
|
|
3383
|
+
display_type: TxDetailsDisplayType;
|
|
3384
|
+
amount?: UintType;
|
|
3385
|
+
network?: TxDetailsNetwork;
|
|
3386
|
+
address: TxDetailsAddress[];
|
|
3387
|
+
general: TxDetailsGeneral[];
|
|
3388
|
+
};
|
|
3389
|
+
export type GetProtoVersion = {};
|
|
3390
|
+
export type ProtoVersion = {
|
|
3391
|
+
proto_version: number;
|
|
3392
|
+
};
|
|
3393
|
+
export declare enum DevRebootType {
|
|
3394
|
+
Normal = 0,
|
|
3395
|
+
Boardloader = 1,
|
|
3396
|
+
Bootloader = 2
|
|
3397
|
+
}
|
|
3398
|
+
export declare enum DeviceRebootType {
|
|
3399
|
+
Normal = 0,
|
|
3400
|
+
Romloader = 1,
|
|
3401
|
+
Bootloader = 2
|
|
3402
|
+
}
|
|
3403
|
+
export type DevReboot = {
|
|
3404
|
+
reboot_type: DevRebootType;
|
|
3405
|
+
};
|
|
3406
|
+
export type DeviceReboot = {
|
|
3407
|
+
reboot_type: DeviceRebootType;
|
|
3408
|
+
};
|
|
3409
|
+
export declare enum DeviceType {
|
|
3410
|
+
CLASSIC1 = 0,
|
|
3411
|
+
CLASSIC1S = 1,
|
|
3412
|
+
MINI = 2,
|
|
3413
|
+
TOUCH = 3,
|
|
3414
|
+
PRO = 5,
|
|
3415
|
+
CLASSIC1S_PURE = 6
|
|
3416
|
+
}
|
|
3417
|
+
export declare enum DevSeType {
|
|
3418
|
+
THD89 = 0,
|
|
3419
|
+
SE608A = 1
|
|
3420
|
+
}
|
|
3421
|
+
export declare enum DevSEState {
|
|
3422
|
+
BOOT = 0,
|
|
3423
|
+
APP_FACTORY = 51,
|
|
3424
|
+
APP = 85
|
|
3425
|
+
}
|
|
3426
|
+
export type DevFirmwareImageInfo = {
|
|
3427
|
+
version?: string;
|
|
3428
|
+
build_id?: string;
|
|
3429
|
+
hash?: string;
|
|
3430
|
+
};
|
|
3431
|
+
export type DevHardwareInfo = {
|
|
3432
|
+
device_type?: DeviceType;
|
|
3433
|
+
serial_no?: string;
|
|
3434
|
+
hardware_version?: string;
|
|
3435
|
+
hardware_version_raw_adc?: number;
|
|
3436
|
+
};
|
|
3437
|
+
export type DevMainMcuInfo = {
|
|
3438
|
+
board?: DevFirmwareImageInfo;
|
|
3439
|
+
boot?: DevFirmwareImageInfo;
|
|
3440
|
+
app?: DevFirmwareImageInfo;
|
|
3441
|
+
};
|
|
3442
|
+
export type DevBluetoothInfo = {
|
|
3443
|
+
boot?: DevFirmwareImageInfo;
|
|
3444
|
+
app?: DevFirmwareImageInfo;
|
|
3445
|
+
adv_name?: string;
|
|
3446
|
+
mac?: string;
|
|
3447
|
+
};
|
|
3448
|
+
export type DevSEInfo = {
|
|
3449
|
+
boot?: DevFirmwareImageInfo;
|
|
3450
|
+
app?: DevFirmwareImageInfo;
|
|
3451
|
+
type?: DevSeType;
|
|
3452
|
+
state?: DevSEState;
|
|
3453
|
+
};
|
|
3454
|
+
export type DevInfoTargets = {
|
|
3455
|
+
hw?: boolean;
|
|
3456
|
+
fw?: boolean;
|
|
3457
|
+
bt?: boolean;
|
|
3458
|
+
se1?: boolean;
|
|
3459
|
+
se2?: boolean;
|
|
3460
|
+
se3?: boolean;
|
|
3461
|
+
se4?: boolean;
|
|
3462
|
+
status?: boolean;
|
|
3463
|
+
};
|
|
3464
|
+
export type DevInfoTypes = {
|
|
3465
|
+
version?: boolean;
|
|
3466
|
+
build_id?: boolean;
|
|
3467
|
+
hash?: boolean;
|
|
3468
|
+
specific?: boolean;
|
|
3469
|
+
};
|
|
3470
|
+
export type DevStatus = {
|
|
3471
|
+
language?: string;
|
|
3472
|
+
bt_enable?: boolean;
|
|
3473
|
+
init_states?: boolean;
|
|
3474
|
+
backup_required?: boolean;
|
|
3475
|
+
passphrase_protection?: boolean;
|
|
3476
|
+
label?: string;
|
|
3477
|
+
};
|
|
3478
|
+
export type DevGetDeviceInfo = {
|
|
3479
|
+
targets?: DevInfoTargets;
|
|
3480
|
+
types?: DevInfoTypes;
|
|
3481
|
+
};
|
|
3482
|
+
export type DeviceGetDeviceInfo = DevGetDeviceInfo;
|
|
3483
|
+
export type ProtocolV2DeviceInfo = {
|
|
3484
|
+
protocol_version: number;
|
|
3485
|
+
hw?: DevHardwareInfo;
|
|
3486
|
+
fw?: DevMainMcuInfo;
|
|
3487
|
+
bt?: DevBluetoothInfo;
|
|
3488
|
+
se1?: DevSEInfo;
|
|
3489
|
+
se2?: DevSEInfo;
|
|
3490
|
+
se3?: DevSEInfo;
|
|
3491
|
+
se4?: DevSEInfo;
|
|
3492
|
+
status?: DevStatus;
|
|
3493
|
+
};
|
|
3494
|
+
export declare enum DevFirmwareTargetType {
|
|
3495
|
+
TARGET_INVALID = 0,
|
|
3496
|
+
TARGET_ROMLOADER = 1,
|
|
3497
|
+
TARGET_BOOTLOADER = 2,
|
|
3498
|
+
TARGET_APPLICATION_P1 = 3,
|
|
3499
|
+
TARGET_APPLICATION_P2 = 4,
|
|
3500
|
+
TARGET_COPROCESSOR = 5,
|
|
3501
|
+
TARGET_SE01 = 6,
|
|
3502
|
+
TARGET_SE02 = 7,
|
|
3503
|
+
TARGET_SE03 = 8,
|
|
3504
|
+
TARGET_SE04 = 9,
|
|
3505
|
+
TARGET_RESOURCE = 10
|
|
3506
|
+
}
|
|
3507
|
+
export declare enum DeviceFirmwareTargetType {
|
|
3508
|
+
TARGET_INVALID = 0,
|
|
3509
|
+
TARGET_ROMLOADER = 1,
|
|
3510
|
+
TARGET_BOOTLOADER = 2,
|
|
3511
|
+
TARGET_APPLICATION_P1 = 3,
|
|
3512
|
+
TARGET_APPLICATION_P2 = 4,
|
|
3513
|
+
TARGET_COPROCESSOR = 5,
|
|
3514
|
+
TARGET_SE01 = 6,
|
|
3515
|
+
TARGET_SE02 = 7,
|
|
3516
|
+
TARGET_SE03 = 8,
|
|
3517
|
+
TARGET_SE04 = 9,
|
|
3518
|
+
TARGET_RESOURCE = 10
|
|
3519
|
+
}
|
|
3520
|
+
export type DevFirmwareTarget = {
|
|
3521
|
+
target_id: DevFirmwareTargetType;
|
|
3522
|
+
path: string;
|
|
3523
|
+
};
|
|
3524
|
+
export type DeviceFirmwareTarget = {
|
|
3525
|
+
target_id: DeviceFirmwareTargetType;
|
|
3526
|
+
path: string;
|
|
3527
|
+
};
|
|
3528
|
+
export type DevFirmwareUpdate = {
|
|
3529
|
+
targets: DevFirmwareTarget[];
|
|
3530
|
+
};
|
|
3531
|
+
export type DeviceFirmwareUpdate = {
|
|
3532
|
+
targets: DeviceFirmwareTarget[];
|
|
3533
|
+
max_concurrent?: number;
|
|
3534
|
+
};
|
|
3535
|
+
export type DevFirmwareInstallProgress = {
|
|
3536
|
+
target_id: DevFirmwareTargetType;
|
|
3537
|
+
progress: number;
|
|
3538
|
+
stage?: string;
|
|
3539
|
+
};
|
|
3540
|
+
export type DeviceFirmwareInstallProgress = {
|
|
3541
|
+
target_id: DeviceFirmwareTargetType;
|
|
3542
|
+
progress: number;
|
|
3543
|
+
stage?: string;
|
|
3544
|
+
};
|
|
3545
|
+
export type DevFirmwareUpdateStatusEntry = {
|
|
3546
|
+
target_id: DevFirmwareTargetType;
|
|
3547
|
+
status: number;
|
|
3548
|
+
};
|
|
3549
|
+
export type DeviceFirmwareUpdateStatusEntry = {
|
|
3550
|
+
target_id: DeviceFirmwareTargetType;
|
|
3551
|
+
status: number;
|
|
3552
|
+
};
|
|
3553
|
+
export type DevGetFirmwareUpdateStatus = {};
|
|
3554
|
+
export type DeviceGetFirmwareUpdateStatus = {};
|
|
3555
|
+
export type DevFirmwareUpdateStatus = {
|
|
3556
|
+
targets: DevFirmwareUpdateStatusEntry[];
|
|
3557
|
+
};
|
|
3558
|
+
export type DeviceFirmwareUpdateStatus = {
|
|
3559
|
+
targets: DeviceFirmwareUpdateStatusEntry[];
|
|
3560
|
+
};
|
|
3561
|
+
export type FactoryDeviceInfoSettings = {
|
|
3562
|
+
serial_no?: string;
|
|
3563
|
+
cpu_info?: string;
|
|
3564
|
+
pre_firmware?: string;
|
|
3565
|
+
};
|
|
3566
|
+
export type FactoryGetDeviceInfo = {};
|
|
3567
|
+
export type FactoryDeviceInfo = {
|
|
3568
|
+
serial_no?: string;
|
|
3569
|
+
spi_flash_info?: string;
|
|
3570
|
+
se_info?: string;
|
|
3571
|
+
nft_voucher?: string;
|
|
3572
|
+
cpu_info?: string;
|
|
3573
|
+
pre_firmware?: string;
|
|
3574
|
+
};
|
|
3575
|
+
export type FilesystemFixPermission = {};
|
|
3576
|
+
export type FilesystemPathInfo = {
|
|
3577
|
+
exist: boolean;
|
|
3578
|
+
size: number;
|
|
3579
|
+
year: number;
|
|
3580
|
+
month: number;
|
|
3581
|
+
day: number;
|
|
3582
|
+
hour: number;
|
|
3583
|
+
minute: number;
|
|
3584
|
+
second: number;
|
|
3585
|
+
readonly: boolean;
|
|
3586
|
+
hidden: boolean;
|
|
3587
|
+
system: boolean;
|
|
3588
|
+
archive: boolean;
|
|
3589
|
+
directory: boolean;
|
|
3590
|
+
};
|
|
3591
|
+
export type FilesystemPathInfoQuery = {
|
|
3592
|
+
path: string;
|
|
3593
|
+
};
|
|
3594
|
+
export type FilesystemFile = {
|
|
3595
|
+
path: string;
|
|
3596
|
+
offset: number;
|
|
3597
|
+
total_size: number;
|
|
3598
|
+
data?: Buffer | ArrayBuffer | Uint8Array | string;
|
|
3599
|
+
data_hash?: number;
|
|
3600
|
+
processed_byte?: number;
|
|
3601
|
+
};
|
|
3602
|
+
export type FilesystemFileRead = {
|
|
3603
|
+
file: FilesystemFile;
|
|
3604
|
+
chunk_len?: number;
|
|
3605
|
+
ui_percentage?: number;
|
|
3606
|
+
};
|
|
3607
|
+
export type FilesystemFileWrite = {
|
|
3608
|
+
file: FilesystemFile;
|
|
3609
|
+
overwrite: boolean;
|
|
3610
|
+
append: boolean;
|
|
3611
|
+
ui_percentage?: number;
|
|
3612
|
+
};
|
|
3613
|
+
export type FilesystemFileDelete = {
|
|
3614
|
+
path: string;
|
|
3615
|
+
};
|
|
3616
|
+
export type FilesystemDir = {
|
|
3617
|
+
path: string;
|
|
3618
|
+
child_dirs?: string;
|
|
3619
|
+
child_files?: string;
|
|
3620
|
+
};
|
|
3621
|
+
export type FilesystemDirList = {
|
|
3622
|
+
path: string;
|
|
3623
|
+
depth?: number;
|
|
3624
|
+
};
|
|
3625
|
+
export type FilesystemDirMake = {
|
|
3626
|
+
path: string;
|
|
3627
|
+
};
|
|
3628
|
+
export type FilesystemDirRemove = {
|
|
3629
|
+
path: string;
|
|
3630
|
+
};
|
|
3631
|
+
export type FilesystemFormat = {};
|
|
3632
|
+
export declare enum OnboardingStep {
|
|
3633
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
3634
|
+
ONBOARDING_STEP_DEVICE_VERIFICATION = 1,
|
|
3635
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
3636
|
+
ONBOARDING_STEP_SETUP = 3,
|
|
3637
|
+
ONBOARDING_STEP_FIRMWARE = 4
|
|
3638
|
+
}
|
|
3639
|
+
export type GetOnboardingStatus = {};
|
|
3640
|
+
export type NewDevice = {
|
|
3641
|
+
seedcard_backup?: boolean;
|
|
3642
|
+
};
|
|
3643
|
+
export type Restore = {
|
|
3644
|
+
mnemonic?: boolean;
|
|
3645
|
+
seedcard?: boolean;
|
|
3646
|
+
};
|
|
3647
|
+
export type Setup = {
|
|
3648
|
+
new_device?: NewDevice;
|
|
3649
|
+
restore?: Restore;
|
|
3650
|
+
};
|
|
3651
|
+
export type OnboardingStatus = {
|
|
3652
|
+
step: OnboardingStep;
|
|
3653
|
+
setup?: Setup;
|
|
3654
|
+
detail_code?: number;
|
|
3655
|
+
detail_str?: string;
|
|
3656
|
+
};
|
|
3280
3657
|
export type MessageType = {
|
|
3281
3658
|
AlephiumGetAddress: AlephiumGetAddress;
|
|
3282
3659
|
AlephiumAddress: AlephiumAddress;
|
|
@@ -3332,6 +3709,7 @@ export type MessageType = {
|
|
|
3332
3709
|
SignMessage: SignMessage;
|
|
3333
3710
|
MessageSignature: MessageSignature;
|
|
3334
3711
|
VerifyMessage: VerifyMessage;
|
|
3712
|
+
CoinJoinRequest: CoinJoinRequest;
|
|
3335
3713
|
SignTx: SignTx;
|
|
3336
3714
|
TxRequestDetailsType: TxRequestDetailsType;
|
|
3337
3715
|
TxRequestSerializedType: TxRequestSerializedType;
|
|
@@ -3600,7 +3978,7 @@ export type MessageType = {
|
|
|
3600
3978
|
BixinBackupDeviceAck: BixinBackupDeviceAck;
|
|
3601
3979
|
DeviceInfoSettings: DeviceInfoSettings;
|
|
3602
3980
|
GetDeviceInfo: GetDeviceInfo;
|
|
3603
|
-
DeviceInfo: DeviceInfo;
|
|
3981
|
+
DeviceInfo: DeviceInfo | ProtocolV2DeviceInfo;
|
|
3604
3982
|
ReadSEPublicKey: ReadSEPublicKey;
|
|
3605
3983
|
SEPublicKey: SEPublicKey;
|
|
3606
3984
|
WriteSEPublicCert: WriteSEPublicCert;
|
|
@@ -3832,12 +4210,84 @@ export type MessageType = {
|
|
|
3832
4210
|
TronSignMessage: TronSignMessage;
|
|
3833
4211
|
TronMessageSignature: TronMessageSignature;
|
|
3834
4212
|
facotry: facotry;
|
|
4213
|
+
experimental_message: experimental_message;
|
|
4214
|
+
experimental_field: experimental_field;
|
|
4215
|
+
TextMemo: TextMemo;
|
|
4216
|
+
RefundMemo: RefundMemo;
|
|
4217
|
+
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
4218
|
+
PaymentRequestMemo: PaymentRequestMemo;
|
|
4219
|
+
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
4220
|
+
SetBusy: SetBusy;
|
|
4221
|
+
GetFirmwareHash: GetFirmwareHash;
|
|
4222
|
+
FirmwareHash: FirmwareHash;
|
|
4223
|
+
GetNonce: GetNonce;
|
|
4224
|
+
Nonce: Nonce;
|
|
4225
|
+
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
4226
|
+
UnlockPath: UnlockPath;
|
|
4227
|
+
UnlockedPathRequest: UnlockedPathRequest;
|
|
4228
|
+
TxDetailsAmount: TxDetailsAmount;
|
|
4229
|
+
TxDetailsAddress: TxDetailsAddress;
|
|
4230
|
+
TxDetailsNetwork: TxDetailsNetwork;
|
|
4231
|
+
TxDetailsGeneral: TxDetailsGeneral;
|
|
4232
|
+
TxDetailsPage: TxDetailsPage;
|
|
4233
|
+
GetProtoVersion: GetProtoVersion;
|
|
4234
|
+
ProtoVersion: ProtoVersion;
|
|
4235
|
+
DevReboot: DevReboot;
|
|
4236
|
+
DeviceReboot: DeviceReboot;
|
|
4237
|
+
DevFirmwareImageInfo: DevFirmwareImageInfo;
|
|
4238
|
+
DevHardwareInfo: DevHardwareInfo;
|
|
4239
|
+
DevMainMcuInfo: DevMainMcuInfo;
|
|
4240
|
+
DevBluetoothInfo: DevBluetoothInfo;
|
|
4241
|
+
DevSEInfo: DevSEInfo;
|
|
4242
|
+
DevInfoTargets: DevInfoTargets;
|
|
4243
|
+
DevInfoTypes: DevInfoTypes;
|
|
4244
|
+
DevStatus: DevStatus;
|
|
4245
|
+
DevGetDeviceInfo: DevGetDeviceInfo;
|
|
4246
|
+
DeviceGetDeviceInfo: DeviceGetDeviceInfo;
|
|
4247
|
+
DevFirmwareTarget: DevFirmwareTarget;
|
|
4248
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4249
|
+
DevFirmwareUpdate: DevFirmwareUpdate;
|
|
4250
|
+
DeviceFirmwareUpdate: DeviceFirmwareUpdate;
|
|
4251
|
+
DevFirmwareInstallProgress: DevFirmwareInstallProgress;
|
|
4252
|
+
DeviceFirmwareInstallProgress: DeviceFirmwareInstallProgress;
|
|
4253
|
+
DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
|
|
4254
|
+
DeviceFirmwareUpdateStatusEntry: DeviceFirmwareUpdateStatusEntry;
|
|
4255
|
+
DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
|
|
4256
|
+
DeviceGetFirmwareUpdateStatus: DeviceGetFirmwareUpdateStatus;
|
|
4257
|
+
DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
|
|
4258
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4259
|
+
FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
|
|
4260
|
+
FactoryGetDeviceInfo: FactoryGetDeviceInfo;
|
|
4261
|
+
FactoryDeviceInfo: FactoryDeviceInfo;
|
|
4262
|
+
FilesystemFixPermission: FilesystemFixPermission;
|
|
4263
|
+
FilesystemPathInfo: FilesystemPathInfo;
|
|
4264
|
+
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
4265
|
+
FilesystemFile: FilesystemFile;
|
|
4266
|
+
FilesystemFileRead: FilesystemFileRead;
|
|
4267
|
+
FilesystemFileWrite: FilesystemFileWrite;
|
|
4268
|
+
FilesystemFileDelete: FilesystemFileDelete;
|
|
4269
|
+
FilesystemDir: FilesystemDir;
|
|
4270
|
+
FilesystemDirList: FilesystemDirList;
|
|
4271
|
+
FilesystemDirMake: FilesystemDirMake;
|
|
4272
|
+
FilesystemDirRemove: FilesystemDirRemove;
|
|
4273
|
+
FilesystemFormat: FilesystemFormat;
|
|
4274
|
+
GetOnboardingStatus: GetOnboardingStatus;
|
|
4275
|
+
NewDevice: NewDevice;
|
|
4276
|
+
Restore: Restore;
|
|
4277
|
+
Setup: Setup;
|
|
4278
|
+
OnboardingStatus: OnboardingStatus;
|
|
3835
4279
|
};
|
|
3836
4280
|
export type MessageKey = keyof MessageType;
|
|
3837
4281
|
export type MessageResponse<T extends MessageKey> = {
|
|
3838
4282
|
type: T;
|
|
3839
4283
|
message: MessageType[T];
|
|
3840
4284
|
};
|
|
3841
|
-
export type
|
|
4285
|
+
export type MessageResponseMap = {
|
|
4286
|
+
[K in MessageKey]: MessageResponse<K>;
|
|
4287
|
+
};
|
|
4288
|
+
export type TypedCall = {
|
|
4289
|
+
<T extends MessageKey, R extends readonly MessageKey[]>(type: T, resType: R, message?: MessageType[T]): Promise<MessageResponseMap[R[number]]>;
|
|
4290
|
+
<T extends MessageKey, R extends MessageKey>(type: T, resType: R, message?: MessageType[T]): Promise<MessageResponse<R>>;
|
|
4291
|
+
};
|
|
3842
4292
|
export {};
|
|
3843
4293
|
//# sourceMappingURL=messages.d.ts.map
|