@onekeyfe/hwk-adapter-core 1.2.6-alpha.0 → 1.2.6-alpha.2
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/{chunk-H7BZ2C6J.js → chunk-BAGEFFFY.js} +13 -45
- package/dist/chunk-BAGEFFFY.js.map +1 -0
- package/dist/{chunk-T5HIQPNG.js → chunk-SZZF623R.js} +55 -155
- package/dist/chunk-SZZF623R.js.map +1 -0
- package/dist/{chunk-AYA6FQES.mjs → chunk-U63HTLGJ.mjs} +12 -44
- package/dist/chunk-U63HTLGJ.mjs.map +1 -0
- package/dist/{chunk-KTRQZ5AJ.mjs → chunk-YA4BWFTZ.mjs} +55 -155
- package/dist/chunk-YA4BWFTZ.mjs.map +1 -0
- package/dist/errors.d.mts +207 -1
- package/dist/errors.d.ts +207 -1
- package/dist/errors.js +2 -8
- package/dist/errors.js.map +1 -1
- package/dist/errors.mjs +3 -9
- package/dist/index.d.mts +104 -583
- package/dist/index.d.ts +104 -583
- package/dist/index.js +85 -642
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +76 -633
- package/dist/index.mjs.map +1 -1
- package/dist/{ui-events-DdttFKj9.d.ts → ui-events-Cb7haAeE.d.mts} +3 -37
- package/dist/{ui-events-DdttFKj9.d.mts → ui-events-Cb7haAeE.d.ts} +3 -37
- package/dist/ui-events.d.mts +1 -1
- package/dist/ui-events.d.ts +1 -1
- package/dist/ui-events.js +2 -3
- package/dist/ui-events.js.map +1 -1
- package/dist/ui-events.mjs +1 -2
- package/package.json +2 -2
- package/dist/chunk-AYA6FQES.mjs.map +0 -1
- package/dist/chunk-DB4JOPZO.mjs +0 -74
- package/dist/chunk-DB4JOPZO.mjs.map +0 -1
- package/dist/chunk-H7BZ2C6J.js.map +0 -1
- package/dist/chunk-KTRQZ5AJ.mjs.map +0 -1
- package/dist/chunk-T5HIQPNG.js.map +0 -1
- package/dist/chunk-YLCHSNXO.js +0 -74
- package/dist/chunk-YLCHSNXO.js.map +0 -1
- package/dist/errors-BgJ4kzRx.d.mts +0 -276
- package/dist/errors-BgJ4kzRx.d.ts +0 -276
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { U as UiResponseEvent, a as
|
|
4
|
-
export { D as DevicePermissionDeniedReason,
|
|
1
|
+
import { HardwareErrorCode } from './errors.js';
|
|
2
|
+
export { HwkError, IHwkErrorPayload, ORPHAN_ELIGIBLE_ERROR_CODES, createHwkError, enrichErrorMessage } from './errors.js';
|
|
3
|
+
import { U as UiResponseEvent, a as UI_REQUEST, Q as QrDisplayData } from './ui-events-Cb7haAeE.js';
|
|
4
|
+
export { D as DevicePermissionDeniedReason, b as DevicePermissionResponse, c as QrResponseData, d as UI_EVENT, e as UI_REQUEST_CANCELLED_TAG, f as UI_REQUEST_DEFAULT_TIMEOUT_MS, g as UI_REQUEST_PREEMPTED_TAG, h as UI_REQUEST_TIMEOUT_TAG, i as UI_RESPONSE, j as UiRequestRegistry } from './ui-events-Cb7haAeE.js';
|
|
5
5
|
|
|
6
6
|
interface Success<T> {
|
|
7
7
|
success: true;
|
|
@@ -12,56 +12,16 @@ interface Failure {
|
|
|
12
12
|
payload: {
|
|
13
13
|
error: string;
|
|
14
14
|
code: HardwareErrorCode;
|
|
15
|
-
/** See HwkErrorOrigin, who the failure came from. Optional so an
|
|
16
|
-
* unclassified failure degrades to code-based handling, never a guess. */
|
|
17
|
-
origin?: HwkErrorOrigin;
|
|
18
|
-
/** Connection-lifecycle recovery semantics. Optional for wire compatibility
|
|
19
|
-
* with SDK versions that predate this field. SDK failure helpers populate it. */
|
|
20
|
-
recovery?: HwkRecoveryHint;
|
|
21
15
|
params?: Record<string, unknown>;
|
|
22
16
|
};
|
|
23
17
|
}
|
|
24
18
|
type Response<T> = Success<T> | Failure;
|
|
25
19
|
declare function success<T>(payload: T): Success<T>;
|
|
26
|
-
declare function failure(code: HardwareErrorCode, error: string, params?: Record<string, unknown
|
|
20
|
+
declare function failure(code: HardwareErrorCode, error: string, params?: Record<string, unknown>): Failure;
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* non-standard paths (e.g., index=100), which would interrupt wallet creation.
|
|
32
|
-
* The address is hashed into a 16-char fingerprint, not exposed directly.
|
|
33
|
-
* - EVM: cointype 60 (Ledger ETH App only supports 60)
|
|
34
|
-
* - BTC: cointype 1 (testnet)
|
|
35
|
-
* - SOL: cointype 501, standard 3-level hardened
|
|
36
|
-
*/
|
|
37
|
-
declare const CHAIN_FINGERPRINT_PATHS: Record<ChainForFingerprint, string>;
|
|
38
|
-
type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron' | 'zcash';
|
|
39
|
-
/**
|
|
40
|
-
* Parses the complete BIP32 master fingerprint wire value: 4 bytes encoded
|
|
41
|
-
* as exactly 8 hexadecimal characters. This is protocol metadata, not a
|
|
42
|
-
* collision-resistant wallet identity.
|
|
43
|
-
*/
|
|
44
|
-
declare function parseBip32MasterFingerprint(value: unknown): string | undefined;
|
|
45
|
-
/** Four zero bytes is how a missing master fingerprint is encoded; never a wallet identity. */
|
|
46
|
-
declare const MISSING_BIP32_MASTER_FINGERPRINT = "00000000";
|
|
47
|
-
/** A master fingerprint usable as a wallet identity: well-formed and not the missing marker. */
|
|
48
|
-
declare function parseWalletMasterFingerprint(value: unknown): string | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* 16-char SHA-256 fingerprint for device-identity verification.
|
|
51
|
-
* Callers must canonicalize input (e.g. EVM address → lowercase) —
|
|
52
|
-
* encoding variations otherwise cause false DeviceMismatch.
|
|
53
|
-
*/
|
|
54
|
-
declare function deriveDeviceFingerprint(value: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* Domain-separated 256-bit wallet id. Input must be one fixed, vendor-defined public source, never
|
|
57
|
-
* a variable subset of exported accounts, or one wallet would get several ids.
|
|
58
|
-
*/
|
|
59
|
-
declare function deriveWalletId(canonicalPublicMaterial: string): string;
|
|
60
|
-
|
|
61
|
-
type VendorType = 'trezor' | 'ledger' | 'keystone';
|
|
62
|
-
/** 'qr' is a virtual channel: UR payloads travel via app-rendered/scanned QR codes. */
|
|
63
|
-
type ConnectionType = 'usb' | 'ble' | 'qr';
|
|
64
|
-
type TransportType = 'usb' | 'ble' | 'hid' | 'bridge' | 'qr';
|
|
22
|
+
type VendorType = 'trezor' | 'ledger';
|
|
23
|
+
type ConnectionType = 'usb' | 'ble';
|
|
24
|
+
type TransportType = 'usb' | 'ble' | 'hid' | 'bridge';
|
|
65
25
|
/**
|
|
66
26
|
* Device capabilities — describes what a specific device/connection
|
|
67
27
|
* combination can or cannot do. Varies by vendor, model, and connection type.
|
|
@@ -71,8 +31,12 @@ type TransportType = 'usb' | 'ble' | 'hid' | 'bridge' | 'qr';
|
|
|
71
31
|
*/
|
|
72
32
|
interface DeviceCapabilities {
|
|
73
33
|
/**
|
|
74
|
-
* Whether
|
|
75
|
-
*
|
|
34
|
+
* Whether connectId/deviceId persist across sessions.
|
|
35
|
+
*
|
|
36
|
+
* - `true`: IDs are stable (e.g., OneKey USB, Trezor USB).
|
|
37
|
+
* Business logic can match devices by stored connectId/deviceId.
|
|
38
|
+
* - `false`: IDs are ephemeral, regenerated each session (e.g., Ledger WebHID).
|
|
39
|
+
* Business logic should NOT rely on stored connectId/deviceId for matching.
|
|
76
40
|
*/
|
|
77
41
|
persistentDeviceIdentity: boolean;
|
|
78
42
|
}
|
|
@@ -109,52 +73,6 @@ interface DeviceTarget {
|
|
|
109
73
|
connectId: string;
|
|
110
74
|
deviceId: string;
|
|
111
75
|
}
|
|
112
|
-
/**
|
|
113
|
-
* How long a discovery handle remains safe to use for a new connection.
|
|
114
|
-
* This is deliberately separate from post-connect device identity.
|
|
115
|
-
*/
|
|
116
|
-
type SearchTargetReusePolicy = 'current-discovery' | 'reconnectable' | 'rediscover';
|
|
117
|
-
declare function resolveSearchTargetReusePolicy(device: Pick<DeviceInfo, 'connectionType' | 'capabilities'>): SearchTargetReusePolicy;
|
|
118
|
-
/**
|
|
119
|
-
* A selectable result from hardware discovery. It may represent a physical
|
|
120
|
-
* transport endpoint or an interactive entry such as Keystone QR; it is not a
|
|
121
|
-
* physical-device or wallet identity.
|
|
122
|
-
*/
|
|
123
|
-
interface DeviceSearchTarget {
|
|
124
|
-
/** Opaque handle scoped to the adapter's current discovery state. */
|
|
125
|
-
searchTargetId: string;
|
|
126
|
-
/** Whether the handle itself may be retried; never inferred from a stored connectId. */
|
|
127
|
-
searchTargetReusePolicy?: SearchTargetReusePolicy;
|
|
128
|
-
vendor: VendorType;
|
|
129
|
-
connectionType: ConnectionType;
|
|
130
|
-
kind: 'physical' | 'interactive';
|
|
131
|
-
label?: string;
|
|
132
|
-
model?: string;
|
|
133
|
-
modelName?: string;
|
|
134
|
-
serialNumber?: string;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* @deprecated Use DeviceSearchTarget. Kept for consumers of the pre-release
|
|
138
|
-
* connection-target API.
|
|
139
|
-
*/
|
|
140
|
-
type ConnectionTarget = Omit<DeviceSearchTarget, 'searchTargetId'> & {
|
|
141
|
-
targetId: string;
|
|
142
|
-
searchTargetId?: string;
|
|
143
|
-
};
|
|
144
|
-
type WalletIdentity = {
|
|
145
|
-
vendor: 'ledger';
|
|
146
|
-
type: 'chainFingerprint';
|
|
147
|
-
chain: ChainForFingerprint;
|
|
148
|
-
value: string;
|
|
149
|
-
} | {
|
|
150
|
-
vendor: 'trezor';
|
|
151
|
-
type: 'deviceId';
|
|
152
|
-
value: string;
|
|
153
|
-
} | {
|
|
154
|
-
vendor: 'keystone';
|
|
155
|
-
type: 'walletId';
|
|
156
|
-
value: string;
|
|
157
|
-
};
|
|
158
76
|
|
|
159
77
|
/**
|
|
160
78
|
* Mixin for chain-operation params that can be pinned to a specific passphrase
|
|
@@ -215,15 +133,6 @@ interface ConnectorSession {
|
|
|
215
133
|
sessionId: string;
|
|
216
134
|
deviceInfo: DeviceInfo;
|
|
217
135
|
}
|
|
218
|
-
type ConnectorConnectTarget = {
|
|
219
|
-
type: 'default';
|
|
220
|
-
} | {
|
|
221
|
-
type: 'search-target';
|
|
222
|
-
searchTargetId: string;
|
|
223
|
-
} | {
|
|
224
|
-
type: 'expected-device-identity';
|
|
225
|
-
deviceIdentity: string;
|
|
226
|
-
};
|
|
227
136
|
/**
|
|
228
137
|
* Vendor-agnostic bag of extra error fields. Known keys are documented for
|
|
229
138
|
* discoverability; the index signature keeps it open so any connector can
|
|
@@ -344,16 +253,12 @@ interface ConnectorEventMap {
|
|
|
344
253
|
'ui-event': ConnectorUiEvent;
|
|
345
254
|
}
|
|
346
255
|
interface ConnectorSearchDevicesOptions {
|
|
347
|
-
/** Select a child transport without waking/scanning the others. */
|
|
348
|
-
transportType?: ConnectionType;
|
|
349
256
|
/**
|
|
350
257
|
* Wait for every child transport in a fused connector. Default discovery can
|
|
351
258
|
* return shortly after USB appears so BLE does not slow down USB flows;
|
|
352
259
|
* binding pickers can opt in when they need BLE candidates too.
|
|
353
260
|
*/
|
|
354
261
|
waitForAll?: boolean;
|
|
355
|
-
/** Availability probes must not invalidate user-selectable discovery targets. */
|
|
356
|
-
purpose?: 'selection' | 'availability';
|
|
357
262
|
}
|
|
358
263
|
interface ConnectorConfig {
|
|
359
264
|
/**
|
|
@@ -368,16 +273,8 @@ interface ConnectorConfig {
|
|
|
368
273
|
interface IConnector {
|
|
369
274
|
/** Physical connection type this connector uses. Fixed at construction. */
|
|
370
275
|
readonly connectionType: ConnectionType;
|
|
371
|
-
readonly availableTransports?: readonly ConnectionType[];
|
|
372
276
|
searchDevices(options?: ConnectorSearchDevicesOptions): Promise<ConnectorDevice[]>;
|
|
373
|
-
connect(deviceId?: string
|
|
374
|
-
transportType: ConnectionType;
|
|
375
|
-
}): Promise<ConnectorSession>;
|
|
376
|
-
/**
|
|
377
|
-
* Structured form for connectors where a discovery handle and a stable device identity are
|
|
378
|
-
* different concepts. The string form remains for bridge and legacy compatibility.
|
|
379
|
-
*/
|
|
380
|
-
connectTarget?(target: ConnectorConnectTarget): Promise<ConnectorSession>;
|
|
277
|
+
connect(deviceId?: string): Promise<ConnectorSession>;
|
|
381
278
|
disconnect(sessionId: string): Promise<void>;
|
|
382
279
|
call(sessionId: string, method: string, params: unknown): Promise<ConnectorCallResult>;
|
|
383
280
|
cancel(sessionId: string): Promise<void>;
|
|
@@ -402,9 +299,6 @@ interface IHardwareBridge {
|
|
|
402
299
|
connect(params: {
|
|
403
300
|
vendor: VendorType;
|
|
404
301
|
deviceId?: string;
|
|
405
|
-
options?: {
|
|
406
|
-
transportType: ConnectionType;
|
|
407
|
-
};
|
|
408
302
|
}): Promise<ConnectorSession>;
|
|
409
303
|
disconnect(params: {
|
|
410
304
|
vendor: VendorType;
|
|
@@ -687,21 +581,11 @@ interface SolSignedTx {
|
|
|
687
581
|
/** Hex-encoded Ed25519 signature (no 0x prefix) */
|
|
688
582
|
signature: string;
|
|
689
583
|
}
|
|
690
|
-
interface
|
|
584
|
+
interface SolSignMsgParams extends PassphraseStateAware {
|
|
691
585
|
path: string;
|
|
692
586
|
/** Message bytes as hex string (no 0x prefix) */
|
|
693
587
|
message: string;
|
|
694
588
|
}
|
|
695
|
-
interface SolOffchainMessageV1Params {
|
|
696
|
-
/** Finalized Solana off-chain message format. */
|
|
697
|
-
messageVersion: 1;
|
|
698
|
-
/** Complete signer set as 32-byte hex public keys. */
|
|
699
|
-
requiredSigners: string[];
|
|
700
|
-
}
|
|
701
|
-
type SolSignMsgParams = SolSignMessageBaseParams & ({
|
|
702
|
-
messageVersion?: undefined;
|
|
703
|
-
requiredSigners?: undefined;
|
|
704
|
-
} | SolOffchainMessageV1Params);
|
|
705
589
|
interface SolSignature {
|
|
706
590
|
/** Hex-encoded Ed25519 signature (no 0x prefix) */
|
|
707
591
|
signature: string;
|
|
@@ -828,12 +712,6 @@ interface TronSignMsgParams extends PassphraseStateAware {
|
|
|
828
712
|
path: string;
|
|
829
713
|
/** Message hex (no 0x prefix) */
|
|
830
714
|
messageHex: string;
|
|
831
|
-
/**
|
|
832
|
-
* TRON message scheme: 'V1' = legacy signMessage (prefix + 32-byte hash),
|
|
833
|
-
* 'V2' = TIP-191 signMessageV2 (prefix + byte length + message). Adapters
|
|
834
|
-
* that only implement one scheme reject the other with MethodNotSupported.
|
|
835
|
-
*/
|
|
836
|
-
messageType?: 'V1' | 'V2';
|
|
837
715
|
}
|
|
838
716
|
interface TronSignature {
|
|
839
717
|
/** 65-byte hex-encoded signature (no 0x prefix) */
|
|
@@ -845,167 +723,100 @@ interface ITronMethods {
|
|
|
845
723
|
tronSignMessage(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<TronSignMsgParams>>): Promise<Response<TronSignature>>;
|
|
846
724
|
}
|
|
847
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Fixed derivation paths used to generate chain fingerprints.
|
|
728
|
+
* Uses standard index 0 — Ledger firmware shows device confirmation for
|
|
729
|
+
* non-standard paths (e.g., index=100), which would interrupt wallet creation.
|
|
730
|
+
* The address is hashed into a 16-char fingerprint, not exposed directly.
|
|
731
|
+
* - EVM: cointype 60 (Ledger ETH App only supports 60)
|
|
732
|
+
* - BTC: cointype 1 (testnet)
|
|
733
|
+
* - SOL: cointype 501, standard 3-level hardened
|
|
734
|
+
*/
|
|
735
|
+
declare const CHAIN_FINGERPRINT_PATHS: Record<ChainForFingerprint, string>;
|
|
736
|
+
type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron';
|
|
737
|
+
/**
|
|
738
|
+
* 16-char SHA-256 fingerprint for device-identity verification.
|
|
739
|
+
* Callers must canonicalize input (e.g. EVM address → lowercase) —
|
|
740
|
+
* encoding variations otherwise cause false DeviceMismatch.
|
|
741
|
+
*/
|
|
742
|
+
declare function deriveDeviceFingerprint(value: string): string;
|
|
743
|
+
|
|
848
744
|
/** Events generated by SDK internal detection (not from hardware directly). */
|
|
849
745
|
declare const SDK: {
|
|
850
746
|
readonly DEVICE_STUCK: "device-stuck";
|
|
851
747
|
readonly DEVICE_UNRESPONSIVE: "device-unresponsive";
|
|
852
748
|
readonly DEVICE_RECOVERED: "device-recovered";
|
|
853
749
|
readonly DEVICE_INTERACTION: "device-interaction";
|
|
854
|
-
readonly OPERATION_ENDED: "operation-ended";
|
|
855
750
|
};
|
|
856
751
|
|
|
857
|
-
declare const OPERATION_DEFAULT_TTL_MS = 600000;
|
|
858
|
-
type OperationEndReason = 'explicit' | 'disconnect' | 'timeout' | 'runtime-reset';
|
|
859
|
-
type HardwareOperation = {
|
|
860
|
-
operationId: string;
|
|
861
|
-
connectId: string;
|
|
862
|
-
device: DeviceInfo;
|
|
863
|
-
/**
|
|
864
|
-
* The channel this operation runs on, set by the adapter that picked it. Never read it off
|
|
865
|
-
* `device`: a combined connector fills that snapshot with a nominal value.
|
|
866
|
-
*/
|
|
867
|
-
connectionType: ConnectionType;
|
|
868
|
-
connectionKeys: string[];
|
|
869
|
-
createdAt: number;
|
|
870
|
-
lastActiveAt: number;
|
|
871
|
-
};
|
|
872
|
-
type OperationRegistryOptions = {
|
|
873
|
-
vendor: VendorType;
|
|
874
|
-
ttlMs?: number;
|
|
875
|
-
onEnded?: (operation: HardwareOperation, reason: OperationEndReason) => void;
|
|
876
|
-
};
|
|
877
|
-
/** Runtime-only association between a public operation id and one live target. */
|
|
878
|
-
declare class OperationRegistry {
|
|
879
|
-
private readonly _vendor;
|
|
880
|
-
private readonly _ttlMs;
|
|
881
|
-
private readonly _onEnded?;
|
|
882
|
-
private readonly _active;
|
|
883
|
-
private readonly _ended;
|
|
884
|
-
constructor(options: OperationRegistryOptions);
|
|
885
|
-
create(params: {
|
|
886
|
-
searchTargetId: string;
|
|
887
|
-
connectId: string;
|
|
888
|
-
device: DeviceInfo;
|
|
889
|
-
connectionType: ConnectionType;
|
|
890
|
-
connectionKeys?: string[];
|
|
891
|
-
}): HardwareOperation;
|
|
892
|
-
resolve(operationId: string): HardwareOperation;
|
|
893
|
-
/** Keep an operation alive while one device job is actively using it. */
|
|
894
|
-
retain(operationId: string): () => void;
|
|
895
|
-
/** Return active or tombstoned binding data without refreshing its TTL. */
|
|
896
|
-
find(operationId: string): HardwareOperation | undefined;
|
|
897
|
-
findActiveByConnectionKey(connectionKey: string): HardwareOperation | undefined;
|
|
898
|
-
/** Replace the live transport binding after the same target was reconnected. */
|
|
899
|
-
rebind(operationId: string, params: {
|
|
900
|
-
connectId: string;
|
|
901
|
-
device: DeviceInfo;
|
|
902
|
-
connectionType: ConnectionType;
|
|
903
|
-
connectionKeys?: string[];
|
|
904
|
-
}): HardwareOperation;
|
|
905
|
-
end(operationId: string, reason: OperationEndReason): HardwareOperation | undefined;
|
|
906
|
-
endByConnectionKey(connectionKey: string, reason: OperationEndReason, exceptOperationId?: string): void;
|
|
907
|
-
endAll(reason: OperationEndReason, exceptOperationId?: string): void;
|
|
908
|
-
private _touch;
|
|
909
|
-
private _createTimer;
|
|
910
|
-
private _rememberEnded;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
752
|
type HardwareMethodMetadata = {
|
|
914
753
|
chain: ChainForFingerprint;
|
|
915
754
|
allNetwork: boolean;
|
|
916
|
-
/** Whether repeating the method after an ambiguous transport failure is safe. */
|
|
917
|
-
replayAfterTransportFailure: 'safe' | 'unsafe';
|
|
918
755
|
};
|
|
919
756
|
declare const HARDWARE_METHOD_CATALOG: {
|
|
920
757
|
readonly evmGetAddress: {
|
|
921
758
|
readonly chain: "evm";
|
|
922
759
|
readonly allNetwork: true;
|
|
923
|
-
readonly replayAfterTransportFailure: "safe";
|
|
924
760
|
};
|
|
925
761
|
readonly evmSignTransaction: {
|
|
926
762
|
readonly chain: "evm";
|
|
927
763
|
readonly allNetwork: false;
|
|
928
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
929
764
|
};
|
|
930
765
|
readonly evmSignMessage: {
|
|
931
766
|
readonly chain: "evm";
|
|
932
767
|
readonly allNetwork: false;
|
|
933
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
934
768
|
};
|
|
935
769
|
readonly evmSignTypedData: {
|
|
936
770
|
readonly chain: "evm";
|
|
937
771
|
readonly allNetwork: false;
|
|
938
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
939
772
|
};
|
|
940
773
|
readonly btcGetAddress: {
|
|
941
774
|
readonly chain: "btc";
|
|
942
775
|
readonly allNetwork: true;
|
|
943
|
-
readonly replayAfterTransportFailure: "safe";
|
|
944
776
|
};
|
|
945
777
|
readonly btcGetPublicKey: {
|
|
946
778
|
readonly chain: "btc";
|
|
947
779
|
readonly allNetwork: true;
|
|
948
|
-
readonly replayAfterTransportFailure: "safe";
|
|
949
780
|
};
|
|
950
781
|
readonly btcSignTransaction: {
|
|
951
782
|
readonly chain: "btc";
|
|
952
783
|
readonly allNetwork: false;
|
|
953
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
954
784
|
};
|
|
955
785
|
readonly btcSignPsbt: {
|
|
956
786
|
readonly chain: "btc";
|
|
957
787
|
readonly allNetwork: false;
|
|
958
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
959
788
|
};
|
|
960
789
|
readonly btcSignMessage: {
|
|
961
790
|
readonly chain: "btc";
|
|
962
791
|
readonly allNetwork: false;
|
|
963
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
964
792
|
};
|
|
965
793
|
readonly btcGetMasterFingerprint: {
|
|
966
794
|
readonly chain: "btc";
|
|
967
795
|
readonly allNetwork: false;
|
|
968
|
-
readonly replayAfterTransportFailure: "safe";
|
|
969
796
|
};
|
|
970
797
|
readonly solGetAddress: {
|
|
971
798
|
readonly chain: "sol";
|
|
972
799
|
readonly allNetwork: true;
|
|
973
|
-
readonly replayAfterTransportFailure: "safe";
|
|
974
800
|
};
|
|
975
801
|
readonly solSignTransaction: {
|
|
976
802
|
readonly chain: "sol";
|
|
977
803
|
readonly allNetwork: false;
|
|
978
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
979
804
|
};
|
|
980
805
|
readonly solSignMessage: {
|
|
981
806
|
readonly chain: "sol";
|
|
982
807
|
readonly allNetwork: false;
|
|
983
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
984
808
|
};
|
|
985
809
|
readonly tronGetAddress: {
|
|
986
810
|
readonly chain: "tron";
|
|
987
811
|
readonly allNetwork: true;
|
|
988
|
-
readonly replayAfterTransportFailure: "safe";
|
|
989
812
|
};
|
|
990
813
|
readonly tronSignTransaction: {
|
|
991
814
|
readonly chain: "tron";
|
|
992
815
|
readonly allNetwork: false;
|
|
993
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
994
816
|
};
|
|
995
817
|
readonly tronSignMessage: {
|
|
996
818
|
readonly chain: "tron";
|
|
997
819
|
readonly allNetwork: false;
|
|
998
|
-
readonly replayAfterTransportFailure: "unsafe";
|
|
999
|
-
};
|
|
1000
|
-
readonly zcashGetFullViewingKey: {
|
|
1001
|
-
readonly chain: "zcash";
|
|
1002
|
-
readonly allNetwork: false;
|
|
1003
|
-
readonly replayAfterTransportFailure: "safe";
|
|
1004
|
-
};
|
|
1005
|
-
readonly zcashGetShieldedAddress: {
|
|
1006
|
-
readonly chain: "zcash";
|
|
1007
|
-
readonly allNetwork: false;
|
|
1008
|
-
readonly replayAfterTransportFailure: "safe";
|
|
1009
820
|
};
|
|
1010
821
|
};
|
|
1011
822
|
type HardwareMethodName = keyof typeof HARDWARE_METHOD_CATALOG;
|
|
@@ -1014,11 +825,6 @@ type AllNetworkMethodName = {
|
|
|
1014
825
|
}[HardwareMethodName];
|
|
1015
826
|
declare const ALL_NETWORK_METHOD_NAMES: AllNetworkMethodName[];
|
|
1016
827
|
declare function getHardwareMethodMetadata(method: string): HardwareMethodMetadata | undefined;
|
|
1017
|
-
/**
|
|
1018
|
-
* Conservative replay gate used only after a call may have reached hardware.
|
|
1019
|
-
* Unknown methods and device mutations are unsafe by default.
|
|
1020
|
-
*/
|
|
1021
|
-
declare function canReplayHardwareMethodAfterTransportFailure(method: string): boolean;
|
|
1022
828
|
declare function isAllNetworkMethodName(method: string): method is AllNetworkMethodName;
|
|
1023
829
|
declare function getAllNetworkMethodChain(method: AllNetworkMethodName): ChainForFingerprint;
|
|
1024
830
|
|
|
@@ -1037,7 +843,7 @@ type HardwareUiEvent = Exclude<ConnectorUiEvent, {
|
|
|
1037
843
|
progress: number;
|
|
1038
844
|
};
|
|
1039
845
|
};
|
|
1040
|
-
type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron'
|
|
846
|
+
type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron';
|
|
1041
847
|
type TrezorDisplayRotation = 'North' | 'East' | 'South' | 'West';
|
|
1042
848
|
type TrezorSafetyCheckLevel = 'Strict' | 'PromptAlways' | 'PromptTemporarily';
|
|
1043
849
|
type TrezorDeviceSettingsParams = {
|
|
@@ -1108,77 +914,19 @@ type DeviceAuthenticityResult = {
|
|
|
1108
914
|
};
|
|
1109
915
|
};
|
|
1110
916
|
};
|
|
1111
|
-
/** Persisted connection hints, never proof of device or wallet identity. */
|
|
1112
|
-
type KnownDeviceConnection = {
|
|
1113
|
-
transport: 'usb' | 'ble';
|
|
1114
|
-
connectId: string;
|
|
1115
|
-
} | {
|
|
1116
|
-
transport: 'qr';
|
|
1117
|
-
};
|
|
1118
|
-
/** Opaque host lookup identifiers. Never forward these to firmware or logs. */
|
|
1119
|
-
type HardwareCallExtra = Readonly<Record<string, string>>;
|
|
1120
|
-
interface IHardwareConnectionContext {
|
|
1121
|
-
knownConnections?: readonly KnownDeviceConnection[];
|
|
1122
|
-
extra?: HardwareCallExtra;
|
|
1123
|
-
/** False makes discovery fail instead of asking the user to select a new endpoint. */
|
|
1124
|
-
allowDeviceSelection?: boolean;
|
|
1125
|
-
/** Transports the host's model table allows; discovery never opens others. Omitted = any. */
|
|
1126
|
-
supportedTransports?: readonly ('usb' | 'ble')[];
|
|
1127
|
-
}
|
|
1128
|
-
type DeviceSelectionContext = {
|
|
1129
|
-
kind: 'select-device';
|
|
1130
|
-
transport: 'usb';
|
|
1131
|
-
reason: 'multiple-candidates';
|
|
1132
|
-
} | {
|
|
1133
|
-
kind: 'bind-connection';
|
|
1134
|
-
transport: 'ble';
|
|
1135
|
-
reason: 'missing-binding' | 'known-connection-unavailable' | 'manual-rebind';
|
|
1136
|
-
};
|
|
1137
|
-
interface DeviceSelectionRequest extends UiRequestOperationAttribution {
|
|
1138
|
-
devices: DeviceInfo[];
|
|
1139
|
-
requestId: string;
|
|
1140
|
-
context: DeviceSelectionContext;
|
|
1141
|
-
extra?: HardwareCallExtra;
|
|
1142
|
-
/** Repeated snapshots with this requestId update one SDK-owned binding scan. */
|
|
1143
|
-
scanning?: boolean;
|
|
1144
|
-
bindingSessionId?: string;
|
|
1145
|
-
/** A candidate rejected by SDK identity verification in this binding session. */
|
|
1146
|
-
rejectedConnectId?: string;
|
|
1147
|
-
}
|
|
1148
|
-
/** The host must persist this endpoint before acknowledging. */
|
|
1149
|
-
interface SaveDeviceBindingRequest extends UiRequestOperationAttribution {
|
|
1150
|
-
requestId: string;
|
|
1151
|
-
selectionRequestId: string;
|
|
1152
|
-
connection: {
|
|
1153
|
-
transport: 'ble';
|
|
1154
|
-
connectId: string;
|
|
1155
|
-
};
|
|
1156
|
-
/** Omitted when the vendor binds the selected BLE endpoint without checking its wallet (Ledger). */
|
|
1157
|
-
identity?: Extract<WalletIdentity, {
|
|
1158
|
-
vendor: 'ledger' | 'trezor';
|
|
1159
|
-
}>;
|
|
1160
|
-
extra?: HardwareCallExtra;
|
|
1161
|
-
}
|
|
1162
|
-
type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'>;
|
|
1163
|
-
interface DeviceBindingStatus {
|
|
1164
|
-
selectionRequestId: string;
|
|
1165
|
-
status: 'verifying' | 'saved' | 'failed' | 'cancelled';
|
|
1166
|
-
}
|
|
1167
917
|
/**
|
|
1168
918
|
* Cross-chain / cross-vendor options passed alongside any chain method's
|
|
1169
919
|
* own params (the optional last argument). Holds operation-level switches
|
|
1170
920
|
* that aren't specific to one chain. Vendor-specific options can be added
|
|
1171
921
|
* as typed sub-fields here when a vendor actually needs them.
|
|
1172
922
|
*/
|
|
1173
|
-
interface ICommonCallParams
|
|
923
|
+
interface ICommonCallParams {
|
|
1174
924
|
/**
|
|
1175
925
|
* When the required device app is missing, prompt the user (UI request)
|
|
1176
926
|
* to install it, stream install progress, then retry the operation once.
|
|
1177
927
|
* Off by default — preserves the plain "app not installed" failure.
|
|
1178
928
|
*/
|
|
1179
929
|
autoInstallApp?: boolean;
|
|
1180
|
-
/** Runtime-only id from connectDevice(); when present, discovery and fallback are disabled. */
|
|
1181
|
-
operationId?: string;
|
|
1182
930
|
}
|
|
1183
931
|
type NullableCallArg<T> = T | null | undefined;
|
|
1184
932
|
interface IPassphraseCallParams {
|
|
@@ -1187,14 +935,6 @@ interface IPassphraseCallParams {
|
|
|
1187
935
|
}
|
|
1188
936
|
type IHardwareCommonCallParams = ICommonCallParams & IPassphraseCallParams;
|
|
1189
937
|
type IHardwareCallParams<T> = T & IHardwareCommonCallParams;
|
|
1190
|
-
/**
|
|
1191
|
-
* Runtime-only device-manager context, never forwarded to firmware. The expected identity lets an
|
|
1192
|
-
* adapter fail closed before replaying a read or mutation after a reconnect.
|
|
1193
|
-
*/
|
|
1194
|
-
interface IDeviceManagerOperationContext extends IHardwareConnectionContext {
|
|
1195
|
-
operationId?: string;
|
|
1196
|
-
expectedDeviceIdentity?: WalletIdentity;
|
|
1197
|
-
}
|
|
1198
938
|
interface AllNetworkAddressParams {
|
|
1199
939
|
network: string;
|
|
1200
940
|
path: string;
|
|
@@ -1205,7 +945,16 @@ interface AllNetworkAddressParams {
|
|
|
1205
945
|
interface AllNetworkGetAddressParams extends IHardwareCommonCallParams {
|
|
1206
946
|
bundle: AllNetworkAddressParams[];
|
|
1207
947
|
}
|
|
1208
|
-
type AllNetworkDeviceIdentity =
|
|
948
|
+
type AllNetworkDeviceIdentity = {
|
|
949
|
+
vendor: 'ledger';
|
|
950
|
+
type: 'chainFingerprint';
|
|
951
|
+
chain: ChainForFingerprint;
|
|
952
|
+
value: string;
|
|
953
|
+
} | {
|
|
954
|
+
vendor: 'trezor';
|
|
955
|
+
type: 'deviceId';
|
|
956
|
+
value: string;
|
|
957
|
+
};
|
|
1209
958
|
type AllNetworkAddressResponsePayload = Record<string, unknown> & {
|
|
1210
959
|
error?: string;
|
|
1211
960
|
code?: HardwareErrorCode | number;
|
|
@@ -1213,7 +962,6 @@ type AllNetworkAddressResponsePayload = Record<string, unknown> & {
|
|
|
1213
962
|
connectId?: string;
|
|
1214
963
|
deviceId?: string;
|
|
1215
964
|
deviceIdentity?: AllNetworkDeviceIdentity;
|
|
1216
|
-
rootFingerprint?: number;
|
|
1217
965
|
chainFingerprint?: string;
|
|
1218
966
|
chainFingerprintChain?: ChainForFingerprint;
|
|
1219
967
|
params?: Record<string, unknown>;
|
|
@@ -1262,50 +1010,46 @@ type UiRequestEvent = {
|
|
|
1262
1010
|
device?: DeviceInfo;
|
|
1263
1011
|
connectId?: string;
|
|
1264
1012
|
type?: string;
|
|
1265
|
-
}
|
|
1013
|
+
};
|
|
1266
1014
|
} | {
|
|
1267
1015
|
type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
|
|
1268
1016
|
payload: {
|
|
1269
1017
|
device: DeviceInfo;
|
|
1270
|
-
}
|
|
1018
|
+
};
|
|
1271
1019
|
} | {
|
|
1272
1020
|
type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
|
|
1273
1021
|
payload: {
|
|
1274
1022
|
device: DeviceInfo;
|
|
1275
|
-
}
|
|
1023
|
+
};
|
|
1276
1024
|
} | {
|
|
1277
1025
|
type: typeof UI_REQUEST.REQUEST_BUTTON;
|
|
1278
1026
|
payload: {
|
|
1279
1027
|
device: DeviceInfo;
|
|
1280
1028
|
code?: string;
|
|
1281
|
-
}
|
|
1029
|
+
};
|
|
1282
1030
|
} | {
|
|
1283
1031
|
type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
|
|
1284
1032
|
payload: {
|
|
1285
1033
|
device: DeviceInfo;
|
|
1286
1034
|
data: QrDisplayData;
|
|
1287
|
-
}
|
|
1035
|
+
};
|
|
1288
1036
|
} | {
|
|
1289
1037
|
type: typeof UI_REQUEST.REQUEST_QR_SCAN;
|
|
1290
1038
|
payload: {
|
|
1291
1039
|
device: DeviceInfo;
|
|
1292
|
-
}
|
|
1040
|
+
};
|
|
1293
1041
|
} | {
|
|
1294
1042
|
type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
|
|
1295
1043
|
payload: {
|
|
1296
1044
|
transportType: TransportType;
|
|
1297
1045
|
connectId?: string;
|
|
1298
1046
|
deviceId?: string;
|
|
1299
|
-
}
|
|
1047
|
+
};
|
|
1300
1048
|
} | {
|
|
1301
1049
|
type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
|
|
1302
|
-
payload:
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
payload: SaveDeviceBindingRequest;
|
|
1306
|
-
} | {
|
|
1307
|
-
type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
|
|
1308
|
-
payload: DeviceBindingStatus;
|
|
1050
|
+
payload: {
|
|
1051
|
+
devices: DeviceInfo[];
|
|
1052
|
+
};
|
|
1309
1053
|
} | {
|
|
1310
1054
|
type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
|
|
1311
1055
|
payload: {
|
|
@@ -1325,13 +1069,13 @@ type UiRequestEvent = {
|
|
|
1325
1069
|
* isn't recognized.
|
|
1326
1070
|
*/
|
|
1327
1071
|
message: string;
|
|
1328
|
-
}
|
|
1072
|
+
};
|
|
1329
1073
|
} | {
|
|
1330
1074
|
type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
|
|
1331
1075
|
payload: {
|
|
1332
1076
|
vendor: string;
|
|
1333
1077
|
appName: string;
|
|
1334
|
-
}
|
|
1078
|
+
};
|
|
1335
1079
|
} | {
|
|
1336
1080
|
type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
|
|
1337
1081
|
payload: {
|
|
@@ -1339,10 +1083,10 @@ type UiRequestEvent = {
|
|
|
1339
1083
|
availableMethods: number[];
|
|
1340
1084
|
selectedMethod: number;
|
|
1341
1085
|
nfcData?: string;
|
|
1342
|
-
}
|
|
1086
|
+
};
|
|
1343
1087
|
} | {
|
|
1344
1088
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
|
|
1345
|
-
payload:
|
|
1089
|
+
payload: Record<string, never>;
|
|
1346
1090
|
};
|
|
1347
1091
|
type SdkEvent = {
|
|
1348
1092
|
type: typeof SDK.DEVICE_INTERACTION;
|
|
@@ -1365,12 +1109,6 @@ type SdkEvent = {
|
|
|
1365
1109
|
payload: {
|
|
1366
1110
|
connectId: string;
|
|
1367
1111
|
};
|
|
1368
|
-
} | {
|
|
1369
|
-
type: typeof SDK.OPERATION_ENDED;
|
|
1370
|
-
payload: {
|
|
1371
|
-
operationId: string;
|
|
1372
|
-
reason: OperationEndReason;
|
|
1373
|
-
};
|
|
1374
1112
|
};
|
|
1375
1113
|
type HardwareEvent = DeviceEvent | UiRequestEvent | SdkEvent | HardwareUiEvent;
|
|
1376
1114
|
type DeviceEventListener = (event: HardwareEvent) => void;
|
|
@@ -1381,14 +1119,6 @@ type DeviceEventListener = (event: HardwareEvent) => void;
|
|
|
1381
1119
|
* and the value is the narrowed event object the listener will receive.
|
|
1382
1120
|
*/
|
|
1383
1121
|
interface HardwareEventMap {
|
|
1384
|
-
[UI_REQUEST.DEVICE_BINDING_STATUS]: {
|
|
1385
|
-
type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
|
|
1386
|
-
payload: DeviceBindingStatus;
|
|
1387
|
-
};
|
|
1388
|
-
[UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING]: {
|
|
1389
|
-
type: typeof UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
|
|
1390
|
-
payload: SaveDeviceBindingRequest;
|
|
1391
|
-
};
|
|
1392
1122
|
'ui-event': HardwareUiEvent;
|
|
1393
1123
|
[DEVICE.CONNECT]: {
|
|
1394
1124
|
type: typeof DEVICE.CONNECT;
|
|
@@ -1429,7 +1159,7 @@ interface HardwareEventMap {
|
|
|
1429
1159
|
device?: DeviceInfo;
|
|
1430
1160
|
connectId?: string;
|
|
1431
1161
|
type?: string;
|
|
1432
|
-
}
|
|
1162
|
+
};
|
|
1433
1163
|
};
|
|
1434
1164
|
[UI_REQUEST.REQUEST_PASSPHRASE]: {
|
|
1435
1165
|
type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
|
|
@@ -1438,33 +1168,33 @@ interface HardwareEventMap {
|
|
|
1438
1168
|
connectId?: string;
|
|
1439
1169
|
passphraseState?: string;
|
|
1440
1170
|
useEmptyPassphrase?: boolean;
|
|
1441
|
-
}
|
|
1171
|
+
};
|
|
1442
1172
|
};
|
|
1443
1173
|
[UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE]: {
|
|
1444
1174
|
type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
|
|
1445
1175
|
payload: {
|
|
1446
1176
|
device: DeviceInfo;
|
|
1447
|
-
}
|
|
1177
|
+
};
|
|
1448
1178
|
};
|
|
1449
1179
|
[UI_REQUEST.REQUEST_BUTTON]: {
|
|
1450
1180
|
type: typeof UI_REQUEST.REQUEST_BUTTON;
|
|
1451
1181
|
payload: {
|
|
1452
1182
|
device: DeviceInfo;
|
|
1453
1183
|
code?: string;
|
|
1454
|
-
}
|
|
1184
|
+
};
|
|
1455
1185
|
};
|
|
1456
1186
|
[UI_REQUEST.REQUEST_QR_DISPLAY]: {
|
|
1457
1187
|
type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
|
|
1458
1188
|
payload: {
|
|
1459
1189
|
device: DeviceInfo;
|
|
1460
1190
|
data: QrDisplayData;
|
|
1461
|
-
}
|
|
1191
|
+
};
|
|
1462
1192
|
};
|
|
1463
1193
|
[UI_REQUEST.REQUEST_QR_SCAN]: {
|
|
1464
1194
|
type: typeof UI_REQUEST.REQUEST_QR_SCAN;
|
|
1465
1195
|
payload: {
|
|
1466
1196
|
device: DeviceInfo;
|
|
1467
|
-
}
|
|
1197
|
+
};
|
|
1468
1198
|
};
|
|
1469
1199
|
[UI_REQUEST.REQUEST_DEVICE_PERMISSION]: {
|
|
1470
1200
|
type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
|
|
@@ -1472,11 +1202,13 @@ interface HardwareEventMap {
|
|
|
1472
1202
|
transportType: TransportType;
|
|
1473
1203
|
connectId?: string;
|
|
1474
1204
|
deviceId?: string;
|
|
1475
|
-
}
|
|
1205
|
+
};
|
|
1476
1206
|
};
|
|
1477
1207
|
[UI_REQUEST.REQUEST_SELECT_DEVICE]: {
|
|
1478
1208
|
type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
|
|
1479
|
-
payload:
|
|
1209
|
+
payload: {
|
|
1210
|
+
devices: DeviceInfo[];
|
|
1211
|
+
};
|
|
1480
1212
|
};
|
|
1481
1213
|
[UI_REQUEST.REQUEST_DEVICE_CONNECT]: {
|
|
1482
1214
|
type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
|
|
@@ -1484,7 +1216,7 @@ interface HardwareEventMap {
|
|
|
1484
1216
|
vendor: string;
|
|
1485
1217
|
reason: string;
|
|
1486
1218
|
message: string;
|
|
1487
|
-
}
|
|
1219
|
+
};
|
|
1488
1220
|
};
|
|
1489
1221
|
[UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM]: {
|
|
1490
1222
|
type: typeof UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM;
|
|
@@ -1492,14 +1224,14 @@ interface HardwareEventMap {
|
|
|
1492
1224
|
vendor: string;
|
|
1493
1225
|
path: string;
|
|
1494
1226
|
accountIndex: number;
|
|
1495
|
-
}
|
|
1227
|
+
};
|
|
1496
1228
|
};
|
|
1497
1229
|
[UI_REQUEST.REQUEST_INSTALL_APP]: {
|
|
1498
1230
|
type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
|
|
1499
1231
|
payload: {
|
|
1500
1232
|
vendor: string;
|
|
1501
1233
|
appName: string;
|
|
1502
|
-
}
|
|
1234
|
+
};
|
|
1503
1235
|
};
|
|
1504
1236
|
[UI_REQUEST.REQUEST_TREZOR_THP_PAIRING]: {
|
|
1505
1237
|
type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
|
|
@@ -1508,11 +1240,11 @@ interface HardwareEventMap {
|
|
|
1508
1240
|
availableMethods: number[];
|
|
1509
1241
|
selectedMethod: number;
|
|
1510
1242
|
nfcData?: string;
|
|
1511
|
-
}
|
|
1243
|
+
};
|
|
1512
1244
|
};
|
|
1513
1245
|
[UI_REQUEST.CLOSE_UI_WINDOW]: {
|
|
1514
1246
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
|
|
1515
|
-
payload:
|
|
1247
|
+
payload: Record<string, never>;
|
|
1516
1248
|
};
|
|
1517
1249
|
[SDK.DEVICE_INTERACTION]: {
|
|
1518
1250
|
type: typeof SDK.DEVICE_INTERACTION;
|
|
@@ -1539,23 +1271,16 @@ interface HardwareEventMap {
|
|
|
1539
1271
|
connectId: string;
|
|
1540
1272
|
};
|
|
1541
1273
|
};
|
|
1542
|
-
[SDK.OPERATION_ENDED]: {
|
|
1543
|
-
type: typeof SDK.OPERATION_ENDED;
|
|
1544
|
-
payload: {
|
|
1545
|
-
operationId: string;
|
|
1546
|
-
reason: OperationEndReason;
|
|
1547
|
-
};
|
|
1548
|
-
};
|
|
1549
1274
|
}
|
|
1550
1275
|
interface IDeviceManagerMethods {
|
|
1551
|
-
getFeatures?(connectId: string
|
|
1552
|
-
deviceSettings?(connectId: string, params: TrezorDeviceSettingsParams
|
|
1553
|
-
setBrightness?(connectId: string, params?: TrezorBrightnessParams
|
|
1554
|
-
changePin?(connectId: string, params?: TrezorChangePinParams
|
|
1555
|
-
wipeDevice?(connectId: string
|
|
1276
|
+
getFeatures?(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
1277
|
+
deviceSettings?(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
|
|
1278
|
+
setBrightness?(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
|
|
1279
|
+
changePin?(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
|
|
1280
|
+
wipeDevice?(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
1556
1281
|
authenticateDevice?(connectId: string, params: {
|
|
1557
1282
|
challenge: string;
|
|
1558
|
-
}
|
|
1283
|
+
}): Promise<Response<Record<string, unknown>>>;
|
|
1559
1284
|
}
|
|
1560
1285
|
interface IWalletStateMethods {
|
|
1561
1286
|
/**
|
|
@@ -1582,37 +1307,20 @@ interface IWalletStateMethods {
|
|
|
1582
1307
|
* Optional: vendors without host-managed passphrase sessions (Ledger) omit
|
|
1583
1308
|
* it. Implemented by `TrezorAdapter`.
|
|
1584
1309
|
*/
|
|
1585
|
-
getPassphraseState?(connectId: string, passphraseState?: string
|
|
1310
|
+
getPassphraseState?(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
|
|
1586
1311
|
}
|
|
1587
|
-
/**
|
|
1588
|
-
* `stops-waiting`: an on-device confirmation stays up until answered or timed out.
|
|
1589
|
-
* `interrupts-device`: the command on the wire is withdrawn. No vendor reports it, so hosts
|
|
1590
|
-
* should say "stopped waiting, answer on the device", not "cancelled".
|
|
1591
|
-
*/
|
|
1592
|
-
type CancelCapability = 'interrupts-device' | 'stops-waiting';
|
|
1593
1312
|
interface IHardwareWallet<TConfig = unknown> extends IEvmMethods, IBtcMethods, ISolMethods, ITronMethods, IDeviceManagerMethods, IWalletStateMethods {
|
|
1594
1313
|
readonly vendor: string;
|
|
1595
1314
|
readonly activeTransport: TransportType | null;
|
|
1596
|
-
/** What `cancel()` reaches on this vendor. Declared, never inferred. */
|
|
1597
|
-
readonly cancelCapability: CancelCapability;
|
|
1598
1315
|
init(config: TConfig): Promise<void>;
|
|
1599
1316
|
dispose(): Promise<void>;
|
|
1600
1317
|
getAvailableTransports(): TransportType[];
|
|
1601
1318
|
switchTransport(type: TransportType): Promise<void>;
|
|
1602
1319
|
searchDevices(options?: SearchDevicesOptions): Promise<DeviceInfo[]>;
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
/** @deprecated Use searchDeviceTargets(). */
|
|
1606
|
-
listConnectionTargets(options?: SearchDevicesOptions): Promise<ConnectionTarget[]>;
|
|
1607
|
-
/** Connect or logically bind a selected search result and return a runtime-only operation id. */
|
|
1608
|
-
connectDevice(searchTargetId: string): Promise<Response<string>>;
|
|
1609
|
-
/** Device Manager rebind: verify the existing identity before replacing its BLE locator. */
|
|
1610
|
-
bindBleDevice?(params: BindBleDeviceParams): Promise<Response<string>>;
|
|
1611
|
-
/** Resolve and pin operation routing; the caller verifies wallet identity before business calls. */
|
|
1612
|
-
acquireOperation?(connectId: string, context: IHardwareConnectionContext): Promise<Response<string>>;
|
|
1613
|
-
/** Release a caller-owned operation. Disconnect events end matching operations automatically. */
|
|
1614
|
-
releaseOperation(operationId: string): Promise<void>;
|
|
1320
|
+
connectDevice(connectId: string): Promise<Response<string>>;
|
|
1321
|
+
disconnectDevice(connectId: string): Promise<void>;
|
|
1615
1322
|
getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
1323
|
+
getSupportedChains(): ChainCapability[];
|
|
1616
1324
|
/** Abort the in-flight call. Omit connectId to cancel whatever is active. */
|
|
1617
1325
|
cancel(connectId?: string): void;
|
|
1618
1326
|
allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
@@ -1649,11 +1357,6 @@ interface SearchDevicesOptions {
|
|
|
1649
1357
|
* was discovered first.
|
|
1650
1358
|
*/
|
|
1651
1359
|
waitForAllTransports?: boolean;
|
|
1652
|
-
/**
|
|
1653
|
-
* Restrict discovery to one transport. A virtual target (Keystone QR) must not start any wallet
|
|
1654
|
-
* interaction during discovery; `connectDevice()` resolves it.
|
|
1655
|
-
*/
|
|
1656
|
-
transportType?: ConnectionType;
|
|
1657
1360
|
}
|
|
1658
1361
|
|
|
1659
1362
|
interface EvmGetAddressParams extends PassphraseStateAware {
|
|
@@ -1777,11 +1480,6 @@ interface EvmSignTypedDataFull extends PassphraseStateAware {
|
|
|
1777
1480
|
primaryType: string;
|
|
1778
1481
|
message: Record<string, unknown>;
|
|
1779
1482
|
};
|
|
1780
|
-
/**
|
|
1781
|
-
* The dApp's original EIP-712 JSON, byte for byte. Serializing vendors (Keystone) must prefer it:
|
|
1782
|
-
* re-stringifying `data` rewrites integers wider than 2^53 and exponent forms.
|
|
1783
|
-
*/
|
|
1784
|
-
dataJson?: string;
|
|
1785
1483
|
metamaskV4Compat?: boolean;
|
|
1786
1484
|
showMessageHash?: boolean;
|
|
1787
1485
|
/**
|
|
@@ -1820,33 +1518,6 @@ interface IEvmMethods {
|
|
|
1820
1518
|
evmSignTypedData(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTypedDataParams>>): Promise<Response<EvmSignature>>;
|
|
1821
1519
|
}
|
|
1822
1520
|
|
|
1823
|
-
/** Which `GET_VK` encoding the Ledger Zcash app should return. */
|
|
1824
|
-
type ZcashFullViewingKeyMode = 'ufvk' | 'orchardFvk';
|
|
1825
|
-
interface ZcashGetFullViewingKeyParams extends PassphraseStateAware {
|
|
1826
|
-
/** BIP44 account path `m/44'/133'/a'`; a deeper transparent path is accepted, only `a'` is used. */
|
|
1827
|
-
path: string;
|
|
1828
|
-
/** Default `ufvk`. */
|
|
1829
|
-
mode?: ZcashFullViewingKeyMode;
|
|
1830
|
-
}
|
|
1831
|
-
interface ZcashFullViewingKey {
|
|
1832
|
-
path: string;
|
|
1833
|
-
mode: ZcashFullViewingKeyMode;
|
|
1834
|
-
/** ZIP-316 bech32m UFVK string (mode `ufvk`). */
|
|
1835
|
-
ufvk?: string;
|
|
1836
|
-
/** 96-byte raw Orchard FVK as hex (mode `orchardFvk`). */
|
|
1837
|
-
orchardFvk?: string;
|
|
1838
|
-
}
|
|
1839
|
-
interface ZcashGetShieldedAddressParams extends PassphraseStateAware {
|
|
1840
|
-
/** Full 5-level transparent path `m/44'/133'/a'/0/i`; the Orchard path is derived from it. */
|
|
1841
|
-
path: string;
|
|
1842
|
-
showOnDevice?: boolean;
|
|
1843
|
-
}
|
|
1844
|
-
interface ZcashShieldedAddress {
|
|
1845
|
-
/** Unified address with a single Orchard receiver. */
|
|
1846
|
-
address: string;
|
|
1847
|
-
path: string;
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
1521
|
/**
|
|
1851
1522
|
* Low-level device descriptor from Transport layer.
|
|
1852
1523
|
* Represents a physical device detected by USB/BLE scanning.
|
|
@@ -1892,13 +1563,14 @@ interface DeviceDisconnectEvent {
|
|
|
1892
1563
|
type DeviceChangeEvent = DeviceConnectEvent | DeviceDisconnectEvent;
|
|
1893
1564
|
|
|
1894
1565
|
/**
|
|
1895
|
-
*
|
|
1896
|
-
*
|
|
1897
|
-
*
|
|
1898
|
-
*
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
1566
|
+
* Pure FIFO job queue. Every enqueue chains onto the tail; jobs run one at
|
|
1567
|
+
* a time across all devices. The queue is intentionally passive — it does
|
|
1568
|
+
* NOT decide whether to interrupt or ask the user. Those are application-
|
|
1569
|
+
* layer concerns owned by the caller (e.g. a UI button handler that wants
|
|
1570
|
+
* to ask "device is busy, interrupt current?" before submitting). The
|
|
1571
|
+
* queue exposes inspection (`getActiveJob`) and explicit cancellation
|
|
1572
|
+
* (`cancelActive` / `cancelAll`) so callers can implement those policies
|
|
1573
|
+
* synchronously, without racing against in-flight enqueues.
|
|
1902
1574
|
*/
|
|
1903
1575
|
interface JobOptions {
|
|
1904
1576
|
label?: string;
|
|
@@ -1910,15 +1582,10 @@ interface ActiveJobInfo {
|
|
|
1910
1582
|
label?: string;
|
|
1911
1583
|
startedAt: number;
|
|
1912
1584
|
}
|
|
1913
|
-
interface CancelScopeHandle {
|
|
1914
|
-
signal: AbortSignal;
|
|
1915
|
-
release: () => void;
|
|
1916
|
-
}
|
|
1917
1585
|
declare class DeviceJobQueue {
|
|
1918
1586
|
private _tail;
|
|
1919
1587
|
private _active;
|
|
1920
1588
|
private readonly _jobs;
|
|
1921
|
-
private readonly _cancelScopes;
|
|
1922
1589
|
/** Incremented on clear() so queued-but-not-yet-running jobs detect invalidation. */
|
|
1923
1590
|
private _generation;
|
|
1924
1591
|
private readonly _generationCancelReasons;
|
|
@@ -1927,57 +1594,21 @@ declare class DeviceJobQueue {
|
|
|
1927
1594
|
* `deviceId` is a label only — used by inspection / cancellation routing.
|
|
1928
1595
|
*/
|
|
1929
1596
|
enqueue<T>(deviceId: string, job: (signal: AbortSignal) => Promise<T>, options?: JobOptions): Promise<T>;
|
|
1930
|
-
/**
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
* `cancelActiveAndPending`; this stays for a connector layer that stops only what is on the wire.
|
|
1938
|
-
*/
|
|
1939
|
-
cancelActive(deviceId?: string, reason?: Error): boolean;
|
|
1940
|
-
/**
|
|
1941
|
-
* Cancels the active job and unstarted queued jobs; returns whether anything was reached. Only
|
|
1942
|
-
* `undefined` means everything: an empty key matches nothing instead of tearing the queue down.
|
|
1943
|
-
*/
|
|
1597
|
+
/** Cancel the active job. If `deviceId` is given, only cancels when it matches. */
|
|
1598
|
+
cancelActive(deviceId?: string): boolean;
|
|
1599
|
+
/** Force cancel the active job. `reason` becomes signal.reason. */
|
|
1600
|
+
forceCancelActive(deviceId?: string, reason?: Error): boolean;
|
|
1601
|
+
/** Cancel the active job (alias for callers that previously needed multi-device cancel). */
|
|
1602
|
+
cancelAllActive(reason?: Error): void;
|
|
1603
|
+
/** Cancel the active job and invalidate queued jobs that have not started. */
|
|
1944
1604
|
cancelActiveAndPending(deviceId?: string, reason?: Error): boolean;
|
|
1945
1605
|
/** Get info about the currently active job, or null if idle. */
|
|
1946
1606
|
getActiveJob(deviceId?: string): ActiveJobInfo | null;
|
|
1607
|
+
/** True if any job is currently running. */
|
|
1608
|
+
isBusy(): boolean;
|
|
1947
1609
|
clear(reason?: Error): void;
|
|
1948
1610
|
}
|
|
1949
1611
|
|
|
1950
|
-
declare const HARDWARE_RUNTIME_ID_PREFIX = "hwk:runtime";
|
|
1951
|
-
/**
|
|
1952
|
-
* `search-target`: one device in one discovery snapshot, dead on the next search of that kind.
|
|
1953
|
-
* `link`: one open transport. `operation`: one business operation, outliving links via `rebind()`.
|
|
1954
|
-
*/
|
|
1955
|
-
type HardwareRuntimeIdKind = 'operation' | 'search-target' | 'link';
|
|
1956
|
-
type HardwareRuntimeId = {
|
|
1957
|
-
kind: HardwareRuntimeIdKind;
|
|
1958
|
-
vendor: VendorType;
|
|
1959
|
-
};
|
|
1960
|
-
/** Runtime ids are opaque and must never be persisted as device identity. */
|
|
1961
|
-
declare function createHardwareOperationId(vendor: VendorType): string;
|
|
1962
|
-
/** Search targets are valid only for the adapter's current discovery snapshot. */
|
|
1963
|
-
declare function createHardwareSearchTargetId(vendor: VendorType): string;
|
|
1964
|
-
declare function createHardwareLinkId(vendor: VendorType): string;
|
|
1965
|
-
declare function hasHardwareRuntimeIdPrefix(value: unknown): value is string;
|
|
1966
|
-
declare function parseHardwareRuntimeId(value: unknown): HardwareRuntimeId | undefined;
|
|
1967
|
-
declare function isHardwareOperationId(value: unknown): value is string;
|
|
1968
|
-
|
|
1969
|
-
interface HardwareOperationTarget {
|
|
1970
|
-
/** Effective target accepted by existing adapter/connector call paths. */
|
|
1971
|
-
targetId: string | undefined;
|
|
1972
|
-
/** Present when this operation is pinned to a live operation. */
|
|
1973
|
-
operationId: string | undefined;
|
|
1974
|
-
}
|
|
1975
|
-
/**
|
|
1976
|
-
* Normalizes the transitional positional operation id and the canonical
|
|
1977
|
-
* common-params field. All vendors must reject conflicting bindings.
|
|
1978
|
-
*/
|
|
1979
|
-
declare function resolveHardwareOperationTarget(positionalTargetId: string | null | undefined, commonOperationId: string | null | undefined, expectedVendor?: VendorType): Response<HardwareOperationTarget>;
|
|
1980
|
-
|
|
1981
1612
|
/**
|
|
1982
1613
|
* Minimal typed event emitter using Map<string, Set<listener>>.
|
|
1983
1614
|
* Each adapter uses this for device events (connect, disconnect, pin, etc.).
|
|
@@ -2004,101 +1635,6 @@ declare class TypedEventEmitter<TMap extends Record<string, any> = Record<string
|
|
|
2004
1635
|
listenerCount(event: string): number;
|
|
2005
1636
|
}
|
|
2006
1637
|
|
|
2007
|
-
/** Serializable BLE transport data shared by Electron main and renderer runtimes. */
|
|
2008
|
-
interface ElectronBleDeviceInfo {
|
|
2009
|
-
id: string;
|
|
2010
|
-
name?: string;
|
|
2011
|
-
rssi?: number;
|
|
2012
|
-
advertisedServiceUuids?: string[];
|
|
2013
|
-
}
|
|
2014
|
-
/**
|
|
2015
|
-
* IPC-safe peripheral match: advertises one of `serviceUuids`, or its local name matches every
|
|
2016
|
-
* `namePatterns` entry (case-insensitive regex sources).
|
|
2017
|
-
*/
|
|
2018
|
-
interface ElectronBleMatch {
|
|
2019
|
-
serviceUuids?: string[];
|
|
2020
|
-
namePatterns?: string[];
|
|
2021
|
-
}
|
|
2022
|
-
interface ElectronBleScanOptions {
|
|
2023
|
-
/** Opaque partition key: results and connected devices never mix across it. */
|
|
2024
|
-
vendor?: string;
|
|
2025
|
-
match?: ElectronBleMatch;
|
|
2026
|
-
/** @deprecated Superseded by `match.serviceUuids`. */
|
|
2027
|
-
serviceUuids?: string[];
|
|
2028
|
-
durationMs?: number;
|
|
2029
|
-
}
|
|
2030
|
-
/** GATT profile plus the write framing this vendor's firmware expects. */
|
|
2031
|
-
interface ElectronBleConnectOptions {
|
|
2032
|
-
vendor: string;
|
|
2033
|
-
serviceUuid: string;
|
|
2034
|
-
writeUuid: string;
|
|
2035
|
-
notifyUuid: string;
|
|
2036
|
-
/**
|
|
2037
|
-
* `padded`: fixed `chunkSize` packets, last zero-filled (Trezor firmware drops short packets).
|
|
2038
|
-
* `raw`: the buffer as given, for self-length-framed protocols (Ledger).
|
|
2039
|
-
*/
|
|
2040
|
-
write?: {
|
|
2041
|
-
mode: 'padded' | 'raw';
|
|
2042
|
-
chunkSize?: number;
|
|
2043
|
-
chunkDelayMs?: number;
|
|
2044
|
-
maxLength?: number;
|
|
2045
|
-
};
|
|
2046
|
-
}
|
|
2047
|
-
/** Native code handles GATT only; framing, identity checks and wallet calls stay in the SDK. */
|
|
2048
|
-
interface ElectronBleApi {
|
|
2049
|
-
scan(options?: ElectronBleScanOptions): Promise<ElectronBleDeviceInfo[]>;
|
|
2050
|
-
stopScan(vendor?: string): Promise<void>;
|
|
2051
|
-
connect(id: string, options?: ElectronBleConnectOptions): Promise<{
|
|
2052
|
-
id: string;
|
|
2053
|
-
name?: string;
|
|
2054
|
-
}>;
|
|
2055
|
-
disconnect(id: string): Promise<void>;
|
|
2056
|
-
subscribe(id: string): Promise<void>;
|
|
2057
|
-
unsubscribe(id: string): Promise<void>;
|
|
2058
|
-
write(id: string, hexData: string): Promise<void>;
|
|
2059
|
-
checkAvailability(): Promise<{
|
|
2060
|
-
available: boolean;
|
|
2061
|
-
state: string;
|
|
2062
|
-
initialized: boolean;
|
|
2063
|
-
}>;
|
|
2064
|
-
getDevice(id: string): Promise<ElectronBleDeviceInfo | null>;
|
|
2065
|
-
onNotification(handler: (id: string, hexData: string) => void): () => void;
|
|
2066
|
-
onDeviceDisconnected(handler: (id: string) => void): () => void;
|
|
2067
|
-
/** Abandon an in-flight connect in the main process. Optional for hosts that cannot cancel. */
|
|
2068
|
-
cancelPairing?(options?: {
|
|
2069
|
-
vendor: string;
|
|
2070
|
-
id?: string;
|
|
2071
|
-
}): Promise<void>;
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
/**
|
|
2075
|
-
* A host refusal is reported, never thrown: the device is already connected, so a lost binding
|
|
2076
|
-
* is worth a warning and a retry, not failing the user's work.
|
|
2077
|
-
*/
|
|
2078
|
-
type SaveDeviceBindingOutcome = {
|
|
2079
|
-
saved: true;
|
|
2080
|
-
} | {
|
|
2081
|
-
saved: false;
|
|
2082
|
-
reason: SaveDeviceBindingDeclineReason;
|
|
2083
|
-
};
|
|
2084
|
-
/** Persist a binding through the host. Only a user abort throws. */
|
|
2085
|
-
declare function requestSaveDeviceBinding(emitter: TypedEventEmitter<HardwareEventMap>, registry: UiRequestRegistry, binding: Omit<SaveDeviceBindingRequest, 'requestId'>, signal?: AbortSignal): Promise<SaveDeviceBindingOutcome>;
|
|
2086
|
-
|
|
2087
|
-
/** Discovery and selection share one owner; never connect until the last scan has drained. */
|
|
2088
|
-
declare function requestBleDeviceSelection({ emitter, registry, request, scan, signal, allowUsbFallback, pollIntervalMs, }: {
|
|
2089
|
-
emitter: TypedEventEmitter<HardwareEventMap>;
|
|
2090
|
-
registry: UiRequestRegistry;
|
|
2091
|
-
request: Omit<DeviceSelectionRequest, 'requestId' | 'scanning'>;
|
|
2092
|
-
scan: () => Promise<DeviceInfo[]>;
|
|
2093
|
-
signal: AbortSignal;
|
|
2094
|
-
/** The adapter must verify a returned USB candidate before dispatching any business call. */
|
|
2095
|
-
allowUsbFallback?: boolean;
|
|
2096
|
-
pollIntervalMs?: number;
|
|
2097
|
-
}): Promise<{
|
|
2098
|
-
device: DeviceInfo;
|
|
2099
|
-
requestId: string;
|
|
2100
|
-
}>;
|
|
2101
|
-
|
|
2102
1638
|
/**
|
|
2103
1639
|
* Compare two semver strings (e.g. "2.1.0" vs "2.3.1").
|
|
2104
1640
|
* Returns -1 if a < b, 0 if equal, 1 if a > b.
|
|
@@ -2119,18 +1655,7 @@ declare function hexToBytes(hex: string): Uint8Array;
|
|
|
2119
1655
|
/** Convert a Uint8Array to a hex string (no 0x prefix). */
|
|
2120
1656
|
declare function bytesToHex(bytes: Uint8Array): string;
|
|
2121
1657
|
|
|
2122
|
-
|
|
2123
|
-
message: Uint8Array;
|
|
2124
|
-
requiredSigners: readonly string[];
|
|
2125
|
-
}
|
|
2126
|
-
interface PreparedSolanaOffchainMessageV1 {
|
|
2127
|
-
messageText: string;
|
|
2128
|
-
requiredSigners: string[];
|
|
2129
|
-
serializedMessage: Uint8Array;
|
|
2130
|
-
}
|
|
2131
|
-
declare function prepareSolanaOffchainMessageV1({ message, requiredSigners, }: PrepareSolanaOffchainMessageV1Params): PreparedSolanaOffchainMessageV1;
|
|
2132
|
-
|
|
2133
|
-
type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger' | 'keystone';
|
|
1658
|
+
type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger';
|
|
2134
1659
|
type HardwareDeviceIdentityInput = {
|
|
2135
1660
|
name?: string | null;
|
|
2136
1661
|
localName?: string | null;
|
|
@@ -2193,12 +1718,8 @@ type RunAllNetworkGetAddressOptions = {
|
|
|
2193
1718
|
buildTopLevelFailure?: (response: AllNetworkAddressResponse, context: AllNetworkResponseContext) => Response<AllNetworkAddressResponse[]>;
|
|
2194
1719
|
};
|
|
2195
1720
|
declare function runAllNetworkGetAddress({ connectId, deviceId, params, getMethodChain, normalizeItem, buildUnsupportedNetworkResponse, callItem, attachIdentity, shouldAbortBundle, buildTopLevelFailure, }: RunAllNetworkGetAddressOptions): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
2196
|
-
/** An SDK-dialog cancel or on-device reject ends the bundle; the user already answered "no". */
|
|
2197
|
-
declare function isUserRefusal(code: HardwareErrorCode | number | undefined): boolean;
|
|
2198
|
-
/** The bundle's session is gone, so the remaining items have nothing to run against. */
|
|
2199
|
-
declare function isConnectionLost(code: HardwareErrorCode | number | undefined): boolean;
|
|
2200
1721
|
declare function buildUnsupportedMethodResponse(item: AllNetworkAddressParams): AllNetworkAddressResponse;
|
|
2201
1722
|
|
|
2202
1723
|
declare const DEVICE_CONNECT_RETRY_DELAY_MS = 1000;
|
|
2203
1724
|
|
|
2204
|
-
export { ALL_NETWORK_METHOD_NAMES, type ActiveJobInfo, type AllNetworkAddressParams, type AllNetworkAddressResponse, type AllNetworkAddressResponsePayload, type AllNetworkAttachIdentityContext, type AllNetworkCallItemContext, type
|
|
1725
|
+
export { ALL_NETWORK_METHOD_NAMES, type ActiveJobInfo, type AllNetworkAddressParams, type AllNetworkAddressResponse, type AllNetworkAddressResponsePayload, type AllNetworkAttachIdentityContext, type AllNetworkCallItemContext, type AllNetworkGetAddressParams, type AllNetworkMethodName, type AllNetworkResponseContext, type BtcAddress, type BtcGetAddressParams, type BtcGetPublicKeyParams, type BtcPaymentRequest, type BtcPaymentRequestMemo, type BtcPublicKey, type BtcRefTransaction, type BtcSignMsgParams, type BtcSignPsbtParams, type BtcSignTxParams, type BtcSignature, type BtcSignedPsbt, type BtcSignedTx, type BtcTxInput, type BtcTxOutput, CHAIN_FINGERPRINT_PATHS, type ChainCapability, type ChainForFingerprint, type ConnectionType, type ConnectorCallResult, type ConnectorConfig, type ConnectorDevice, type ConnectorErrorParams, type ConnectorEventMap, type ConnectorEventType, type ConnectorSerializedError, type ConnectorSession, type ConnectorUiEvent, DEVICE, DEVICE_CONNECT_RETRY_DELAY_MS, DEVICE_EVENT, type DetectableHardwareVendor, type DeviceAuthenticityParams, type DeviceAuthenticityResult, type DeviceCapabilities, type DeviceChangeEvent, type DeviceConnectEvent, type DeviceDescriptor, type DeviceDisconnectEvent, type DeviceEvent, type DeviceEventListener, type DeviceInfo, DeviceJobQueue, type DeviceTarget, EConnectorInteraction, type EIP712Domain, type EvmAddress, type EvmEthereumDefinitions, type EvmGetAddressParams, type EvmPaymentRequest, type EvmPaymentRequestMemo, type EvmSignMsgParams, type EvmSignTxLedgerParams, type EvmSignTxParams, type EvmSignTxTrezorParams, type EvmSignTypedDataFull, type EvmSignTypedDataHash, type EvmSignTypedDataParams, type EvmSignature, type EvmSignedTx, type Failure, HARDWARE_METHOD_CATALOG, type HardwareDeviceIdentityInput, HardwareErrorCode, type HardwareEvent, type HardwareEventMap, type HardwareMethodMetadata, type HardwareMethodName, type HardwareUiEvent, type IBtcMethods, type ICommonCallParams, type IConnector, type IDeviceManagerMethods, type IEvmMethods, type IHardwareBridge, type IHardwareCallParams, type IHardwareCommonCallParams, type IHardwareWallet, type IPassphraseCallParams, type ISolMethods, type ITronMethods, type IWalletStateMethods, type JobOptions, type NullableCallArg, type PassphraseResponse, type PassphraseStateAware, QrDisplayData, type Response, type RunAllNetworkGetAddressOptions, SDK, type SdkEvent, type SearchDevicesOptions, type SolAddress, type SolGetAddressParams, type SolSignMsgParams, type SolSignTxParams, type SolSignature, type SolSignedTx, type Success, type TransportType, type TrezorBrightnessParams, type TrezorChangePinParams, type TrezorDeviceSettingsParams, type TrezorDisplayRotation, type TrezorSafetyCheckLevel, type TronAddress, type TronContract, type TronFreezeBalanceV2Contract, type TronGetAddressParams, type TronResource, type TronSignMsgParams, type TronSignTxParams, type TronSignature, type TronSignedTx, type TronTransferContract, type TronTriggerSmartContract, type TronUnfreezeBalanceV2Contract, type TronVote, type TronVoteWitnessContract, type TronWithdrawExpireUnfreezeContract, TypedEventEmitter, UI_REQUEST, type UiRequestEvent, UiResponseEvent, type VendorType, batchCall, buildUnsupportedMethodResponse, bytesToHex, compareSemver, createBridgedConnector, createCombinedConnector, deriveDeviceFingerprint, detectHardwareVendorFromDescriptor, ensure0x, failure, getAllNetworkMethodChain, getHardwareMethodMetadata, hexToBytes, isAllNetworkMethodName, isKnownNonTargetHardwareVendor, padHex64, rehydrateConnectorError, runAllNetworkGetAddress, serializeConnectorError, stripHex, success };
|