@bitboxswiss/bitbox-api 0.1.0 → 0.1.1

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.
Files changed (157) hide show
  1. package/dist/index.d.ts +334 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +451 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/internal/connect-simulator.d.ts +2 -0
  6. package/dist/internal/connect-simulator.d.ts.map +1 -0
  7. package/dist/internal/connect-simulator.js +25 -0
  8. package/dist/internal/connect-simulator.js.map +1 -0
  9. package/dist/internal/connect.d.ts +2 -0
  10. package/dist/internal/connect.d.ts.map +1 -0
  11. package/dist/internal/connect.js +54 -0
  12. package/dist/internal/connect.js.map +1 -0
  13. package/dist/internal/constants.d.ts +2 -0
  14. package/dist/internal/constants.d.ts.map +1 -0
  15. package/dist/internal/constants.js +16 -0
  16. package/dist/internal/constants.js.map +1 -0
  17. package/dist/internal/device.d.ts +5 -0
  18. package/dist/internal/device.d.ts.map +1 -0
  19. package/dist/internal/device.js +40 -0
  20. package/dist/internal/device.js.map +1 -0
  21. package/dist/internal/errors.d.ts +2 -0
  22. package/dist/internal/errors.d.ts.map +1 -0
  23. package/dist/internal/errors.js +220 -0
  24. package/dist/internal/errors.js.map +1 -0
  25. package/dist/internal/eth/antiklepto.d.ts +5 -0
  26. package/dist/internal/eth/antiklepto.d.ts.map +1 -0
  27. package/dist/internal/eth/antiklepto.js +59 -0
  28. package/dist/internal/eth/antiklepto.js.map +1 -0
  29. package/dist/internal/eth/eip712.d.ts +25 -0
  30. package/dist/internal/eth/eip712.d.ts.map +1 -0
  31. package/dist/internal/eth/eip712.js +303 -0
  32. package/dist/internal/eth/eip712.js.map +1 -0
  33. package/dist/internal/eth/keypath.d.ts +4 -0
  34. package/dist/internal/eth/keypath.d.ts.map +1 -0
  35. package/dist/internal/eth/keypath.js +47 -0
  36. package/dist/internal/eth/keypath.js.map +1 -0
  37. package/dist/internal/eth/methods.d.ts +10 -0
  38. package/dist/internal/eth/methods.d.ts.map +1 -0
  39. package/dist/internal/eth/methods.js +250 -0
  40. package/dist/internal/eth/methods.js.map +1 -0
  41. package/dist/internal/eth/query.d.ts +7 -0
  42. package/dist/internal/eth/query.d.ts.map +1 -0
  43. package/dist/internal/eth/query.js +43 -0
  44. package/dist/internal/eth/query.js.map +1 -0
  45. package/dist/internal/eth/streaming.d.ts +4 -0
  46. package/dist/internal/eth/streaming.d.ts.map +1 -0
  47. package/dist/internal/eth/streaming.js +21 -0
  48. package/dist/internal/eth/streaming.js.map +1 -0
  49. package/dist/internal/eth/version.d.ts +9 -0
  50. package/dist/internal/eth/version.d.ts.map +1 -0
  51. package/dist/internal/eth/version.js +10 -0
  52. package/dist/internal/eth/version.js.map +1 -0
  53. package/dist/internal/hww.d.ts +2 -0
  54. package/dist/internal/hww.d.ts.map +1 -0
  55. package/dist/internal/hww.js +236 -0
  56. package/dist/internal/hww.js.map +1 -0
  57. package/dist/internal/message-queue.d.ts +2 -0
  58. package/dist/internal/message-queue.d.ts.map +1 -0
  59. package/dist/internal/message-queue.js +29 -0
  60. package/dist/internal/message-queue.js.map +1 -0
  61. package/dist/internal/noise-config.d.ts +2 -0
  62. package/dist/internal/noise-config.d.ts.map +1 -0
  63. package/dist/internal/noise-config.js +160 -0
  64. package/dist/internal/noise-config.js.map +1 -0
  65. package/dist/internal/noise.d.ts +2 -0
  66. package/dist/internal/noise.d.ts.map +1 -0
  67. package/dist/internal/noise.js +270 -0
  68. package/dist/internal/noise.js.map +1 -0
  69. package/dist/internal/pairing.d.ts +2 -0
  70. package/dist/internal/pairing.d.ts.map +1 -0
  71. package/dist/internal/pairing.js +130 -0
  72. package/dist/internal/pairing.js.map +1 -0
  73. package/dist/internal/read-write.d.ts +2 -0
  74. package/dist/internal/read-write.d.ts.map +1 -0
  75. package/dist/internal/read-write.js +40 -0
  76. package/dist/internal/read-write.js.map +1 -0
  77. package/dist/internal/restore.d.ts +3 -0
  78. package/dist/internal/restore.d.ts.map +1 -0
  79. package/dist/internal/restore.js +27 -0
  80. package/dist/internal/restore.js.map +1 -0
  81. package/dist/internal/transport-bridge.d.ts +2 -0
  82. package/dist/internal/transport-bridge.d.ts.map +1 -0
  83. package/dist/internal/transport-bridge.js +97 -0
  84. package/dist/internal/transport-bridge.js.map +1 -0
  85. package/dist/internal/transport-simulator.d.ts +2 -0
  86. package/dist/internal/transport-simulator.d.ts.map +1 -0
  87. package/dist/internal/transport-simulator.js +83 -0
  88. package/dist/internal/transport-simulator.js.map +1 -0
  89. package/dist/internal/transport-webhid.d.ts +2 -0
  90. package/dist/internal/transport-webhid.d.ts.map +1 -0
  91. package/dist/internal/transport-webhid.js +69 -0
  92. package/dist/internal/transport-webhid.js.map +1 -0
  93. package/dist/internal/u2f-framing.d.ts +2 -0
  94. package/dist/internal/u2f-framing.d.ts.map +1 -0
  95. package/dist/internal/u2f-framing.js +155 -0
  96. package/dist/internal/u2f-framing.js.map +1 -0
  97. package/dist/internal/utils.d.ts +2 -0
  98. package/dist/internal/utils.d.ts.map +1 -0
  99. package/dist/internal/utils.js +71 -0
  100. package/dist/internal/utils.js.map +1 -0
  101. package/dist/proto/gen/antiklepto_pb.d.ts +49 -0
  102. package/dist/proto/gen/antiklepto_pb.d.ts.map +1 -0
  103. package/dist/proto/gen/antiklepto_pb.js +22 -0
  104. package/dist/proto/gen/antiklepto_pb.js.map +1 -0
  105. package/dist/proto/gen/backup_commands_pb.d.ts +124 -0
  106. package/dist/proto/gen/backup_commands_pb.d.ts.map +1 -0
  107. package/dist/proto/gen/backup_commands_pb.js +42 -0
  108. package/dist/proto/gen/backup_commands_pb.js.map +1 -0
  109. package/dist/proto/gen/backup_pb.d.ts +150 -0
  110. package/dist/proto/gen/backup_pb.d.ts.map +1 -0
  111. package/dist/proto/gen/backup_pb.js +46 -0
  112. package/dist/proto/gen/backup_pb.js.map +1 -0
  113. package/dist/proto/gen/bitbox02_system_pb.d.ts +207 -0
  114. package/dist/proto/gen/bitbox02_system_pb.d.ts.map +1 -0
  115. package/dist/proto/gen/bitbox02_system_pb.js +80 -0
  116. package/dist/proto/gen/bitbox02_system_pb.js.map +1 -0
  117. package/dist/proto/gen/bluetooth_pb.d.ts +135 -0
  118. package/dist/proto/gen/bluetooth_pb.d.ts.map +1 -0
  119. package/dist/proto/gen/bluetooth_pb.js +42 -0
  120. package/dist/proto/gen/bluetooth_pb.js.map +1 -0
  121. package/dist/proto/gen/btc_pb.d.ts +1166 -0
  122. package/dist/proto/gen/btc_pb.d.ts.map +1 -0
  123. package/dist/proto/gen/btc_pb.js +442 -0
  124. package/dist/proto/gen/btc_pb.js.map +1 -0
  125. package/dist/proto/gen/cardano_pb.d.ts +504 -0
  126. package/dist/proto/gen/cardano_pb.d.ts.map +1 -0
  127. package/dist/proto/gen/cardano_pb.js +142 -0
  128. package/dist/proto/gen/cardano_pb.js.map +1 -0
  129. package/dist/proto/gen/common_pb.d.ts +129 -0
  130. package/dist/proto/gen/common_pb.d.ts.map +1 -0
  131. package/dist/proto/gen/common_pb.js +42 -0
  132. package/dist/proto/gen/common_pb.js.map +1 -0
  133. package/dist/proto/gen/eth_pb.d.ts +662 -0
  134. package/dist/proto/gen/eth_pb.d.ts.map +1 -0
  135. package/dist/proto/gen/eth_pb.js +221 -0
  136. package/dist/proto/gen/eth_pb.js.map +1 -0
  137. package/dist/proto/gen/hww_pb.d.ts +349 -0
  138. package/dist/proto/gen/hww_pb.d.ts.map +1 -0
  139. package/dist/proto/gen/hww_pb.js +38 -0
  140. package/dist/proto/gen/hww_pb.js.map +1 -0
  141. package/dist/proto/gen/keystore_pb.d.ts +108 -0
  142. package/dist/proto/gen/keystore_pb.d.ts.map +1 -0
  143. package/dist/proto/gen/keystore_pb.js +33 -0
  144. package/dist/proto/gen/keystore_pb.js.map +1 -0
  145. package/dist/proto/gen/mnemonic_pb.d.ts +48 -0
  146. package/dist/proto/gen/mnemonic_pb.d.ts.map +1 -0
  147. package/dist/proto/gen/mnemonic_pb.js +22 -0
  148. package/dist/proto/gen/mnemonic_pb.js.map +1 -0
  149. package/dist/proto/gen/perform_attestation_pb.d.ts +57 -0
  150. package/dist/proto/gen/perform_attestation_pb.d.ts.map +1 -0
  151. package/dist/proto/gen/perform_attestation_pb.js +17 -0
  152. package/dist/proto/gen/perform_attestation_pb.js.map +1 -0
  153. package/dist/proto/gen/system_pb.d.ts +38 -0
  154. package/dist/proto/gen/system_pb.d.ts.map +1 -0
  155. package/dist/proto/gen/system_pb.js +30 -0
  156. package/dist/proto/gen/system_pb.js.map +1 -0
  157. package/package.json +2 -1
@@ -0,0 +1,334 @@
1
+ export type OnCloseCb = undefined | (() => void);
2
+ export type Product = 'unknown' | 'bitbox02-multi' | 'bitbox02-btconly' | 'bitbox02-nova-multi' | 'bitbox02-nova-btconly';
3
+ export type BtcCoin = 'btc' | 'tbtc' | 'ltc' | 'tltc' | 'rbtc';
4
+ export type BtcFormatUnit = 'default' | 'sat';
5
+ export type XPubType = 'tpub' | 'xpub' | 'ypub' | 'zpub' | 'vpub' | 'upub' | 'Vpub' | 'Zpub' | 'Upub' | 'Ypub';
6
+ export type BtcXPubsType = 'tpub' | 'xpub';
7
+ export type Keypath = string | number[];
8
+ export type XPub = string;
9
+ export type DeviceInfo = {
10
+ name: string;
11
+ initialized: boolean;
12
+ version: string;
13
+ mnemonicPassphraseEnabled: boolean;
14
+ securechipModel: string;
15
+ monotonicIncrementsRemaining: number;
16
+ };
17
+ export type BtcSimpleType = 'p2wpkhP2sh' | 'p2wpkh' | 'p2tr';
18
+ export type KeyOriginInfo = {
19
+ rootFingerprint?: string;
20
+ keypath?: Keypath;
21
+ xpub: XPub;
22
+ };
23
+ export type BtcRegisterXPubType = 'autoElectrum' | 'autoXpubTpub';
24
+ export type BtcMultisigScriptType = 'p2wsh' | 'p2wshP2sh';
25
+ export type BtcMultisig = {
26
+ threshold: number;
27
+ xpubs: XPub[];
28
+ ourXpubIndex: number;
29
+ scriptType: BtcMultisigScriptType;
30
+ };
31
+ export type BtcPolicy = {
32
+ policy: string;
33
+ keys: KeyOriginInfo[];
34
+ };
35
+ export type BtcScriptConfig = {
36
+ simpleType: BtcSimpleType;
37
+ } | {
38
+ multisig: BtcMultisig;
39
+ } | {
40
+ policy: BtcPolicy;
41
+ };
42
+ export type BtcScriptConfigWithKeypath = {
43
+ scriptConfig: BtcScriptConfig;
44
+ keypath: Keypath;
45
+ };
46
+ export type BtcSignMessageSignature = {
47
+ sig: number[];
48
+ recid: number;
49
+ electrumSig65: number[];
50
+ };
51
+ export type BtcXpubs = string[];
52
+ /** Legacy Ethereum transaction fields as unsigned big-endian bytes. */
53
+ export type EthTransaction = {
54
+ nonce: Uint8Array;
55
+ gasPrice: Uint8Array;
56
+ gasLimit: Uint8Array;
57
+ recipient: Uint8Array;
58
+ value: Uint8Array;
59
+ data: Uint8Array;
60
+ };
61
+ /** EIP-1559 transaction fields as unsigned big-endian bytes. */
62
+ export type Eth1559Transaction = {
63
+ chainId: number | bigint;
64
+ nonce: Uint8Array;
65
+ maxPriorityFeePerGas: Uint8Array;
66
+ maxFeePerGas: Uint8Array;
67
+ gasLimit: Uint8Array;
68
+ recipient: Uint8Array;
69
+ value: Uint8Array;
70
+ data: Uint8Array;
71
+ };
72
+ /** Ethereum signature split into R, S, and V byte arrays. */
73
+ export type EthSignature = {
74
+ r: number[];
75
+ s: number[];
76
+ v: number[];
77
+ };
78
+ export type EthAddressCase = 'upper' | 'lower' | 'mixed';
79
+ export type CardanoXpub = number[];
80
+ export type CardanoXpubs = CardanoXpub[];
81
+ export type CardanoNetwork = 'mainnet' | 'testnet';
82
+ export type CardanoScriptConfig = {
83
+ pkhSkh: {
84
+ keypathPayment: Keypath;
85
+ keypathStake: Keypath;
86
+ };
87
+ };
88
+ export type CardanoInput = {
89
+ keypath: Keypath;
90
+ prevOutHash: Uint8Array;
91
+ prevOutIndex: number;
92
+ };
93
+ export type CardanoAssetGroupToken = {
94
+ assetName: Uint8Array;
95
+ value: bigint;
96
+ };
97
+ export type CardanoAssetGroup = {
98
+ policyId: Uint8Array;
99
+ tokens: CardanoAssetGroupToken[];
100
+ };
101
+ export type CardanoOutput = {
102
+ encodedAddress: string;
103
+ value: bigint;
104
+ scriptConfig?: CardanoScriptConfig;
105
+ assetGroups?: CardanoAssetGroup[];
106
+ };
107
+ export type CardanoDrepType = 'keyHash' | 'scriptHash' | 'alwaysAbstain' | 'alwaysNoConfidence';
108
+ export type CardanoCertificate = {
109
+ stakeRegistration: {
110
+ keypath: Keypath;
111
+ };
112
+ } | {
113
+ stakeDeregistration: {
114
+ keypath: Keypath;
115
+ };
116
+ } | {
117
+ stakeDelegation: {
118
+ keypath: Keypath;
119
+ poolKeyhash: Uint8Array;
120
+ };
121
+ } | {
122
+ voteDelegation: {
123
+ keypath: Keypath;
124
+ type: CardanoDrepType;
125
+ drepCredhash?: Uint8Array;
126
+ };
127
+ };
128
+ export type CardanoWithdrawal = {
129
+ keypath: Keypath;
130
+ value: bigint;
131
+ };
132
+ export type CardanoTransaction = {
133
+ network: CardanoNetwork;
134
+ inputs: CardanoInput[];
135
+ outputs: CardanoOutput[];
136
+ fee: bigint;
137
+ ttl: bigint;
138
+ certificates: CardanoCertificate[];
139
+ withdrawals: CardanoWithdrawal[];
140
+ validityIntervalStart: bigint;
141
+ allowZeroTTL: boolean;
142
+ tagCborSets: boolean;
143
+ };
144
+ export type CardanoShelleyWitness = {
145
+ signature: number[];
146
+ publicKey: number[];
147
+ };
148
+ export type CardanoSignTransactionResult = {
149
+ shelleyWitnesses: CardanoShelleyWitness[];
150
+ };
151
+ /** Typed error returned by public API helpers. */
152
+ export type Error = {
153
+ code: string;
154
+ message: string;
155
+ err?: any;
156
+ };
157
+ /**
158
+ * Connect to a BitBox02 using WebHID.
159
+ *
160
+ * WebHID is available in Chromium-based browsers in secure contexts. Call this
161
+ * from a user action so the browser can show the device chooser.
162
+ */
163
+ export declare function bitbox02ConnectWebHID(onCloseCb?: OnCloseCb): Promise<BitBox>;
164
+ /**
165
+ * Connect to a BitBox02 through the local BitBoxBridge service.
166
+ */
167
+ export declare function bitbox02ConnectBridge(onCloseCb?: OnCloseCb): Promise<BitBox>;
168
+ /**
169
+ * Connect to a BitBox02 using WebHID when available, otherwise BitBoxBridge.
170
+ */
171
+ export declare function bitbox02ConnectAuto(onCloseCb?: OnCloseCb): Promise<BitBox>;
172
+ /**
173
+ * Normalize any thrown value to the public typed error shape.
174
+ *
175
+ * If the input already looks like a typed `{ code: string, message: string }`, it is returned
176
+ * as-is. Otherwise it is wrapped as `{ code: 'unknown-js', message: 'Unknown Javascript error',
177
+ * err: <original> }`.
178
+ */
179
+ export declare function ensureError(err: any): Error;
180
+ /** Returns true if the user cancelled an operation. */
181
+ export declare function isUserAbort(err: Error): boolean;
182
+ /**
183
+ * Identifies the case of the recipient address given as hexadecimal string.
184
+ * Returns 'upper' if every alphabetic char is uppercase, 'lower' if every
185
+ * alphabetic char is lowercase, 'mixed' otherwise. Non-alphabetic characters
186
+ * are ignored.
187
+ */
188
+ export declare function ethIdentifyCase(recipientAddress: string): EthAddressCase;
189
+ /**
190
+ * Unpaired BitBox client.
191
+ *
192
+ * Create initialized instances with `bitbox02ConnectAuto()`, `bitbox02ConnectWebHID()`, or
193
+ * `bitbox02ConnectBridge()`. Direct constructors are retained for compatibility and create an
194
+ * inert object whose methods throw `code: 'invalid-state'`.
195
+ */
196
+ export declare class BitBox {
197
+ #private;
198
+ /** No-op; retained for ABI compatibility with the wasm-bindgen output. */
199
+ free(): void;
200
+ /**
201
+ * Invokes the device unlock and pairing. After this, stop using this instance and continue
202
+ * with the returned instance of type `PairingBitBox`.
203
+ *
204
+ * This consumes the `BitBox` synchronously. A second call, including a concurrent call while
205
+ * the first is still running, rejects with `code: 'invalid-state'`. If pairing setup fails, the
206
+ * transport is closed and callers must reconnect before retrying.
207
+ */
208
+ unlockAndPair(): Promise<PairingBitBox>;
209
+ }
210
+ /**
211
+ * BitBox in the pairing state. Use `getPairingCode()` to display the pairing code to the user and
212
+ * `waitConfirm()` to proceed to the paired state. Direct constructors create an inert object.
213
+ */
214
+ export declare class PairingBitBox {
215
+ #private;
216
+ /** No-op; retained for ABI compatibility with the wasm-bindgen output. */
217
+ free(): void;
218
+ /**
219
+ * If a pairing code confirmation is required, this returns the pairing code. You must display
220
+ * it to the user and then call `waitConfirm()` to wait until the user confirms the code on
221
+ * the BitBox.
222
+ *
223
+ * If the BitBox was paired before and the pairing was persisted, the pairing step is
224
+ * skipped. In this case, `undefined` is returned. Also in this case, call `waitConfirm()` to
225
+ * establish the encrypted connection.
226
+ *
227
+ * Call this before `waitConfirm()`, because `waitConfirm()` consumes the pairing object.
228
+ */
229
+ getPairingCode(): string | undefined;
230
+ /**
231
+ * Proceed to the paired state. After this, stop using this instance and continue with the
232
+ * returned instance of type `PairedBitBox`.
233
+ *
234
+ * This consumes the `PairingBitBox` synchronously. A second call, including a concurrent call
235
+ * while the first is still running, rejects with `code: 'invalid-state'`. If confirmation fails,
236
+ * the transport is closed and callers must reconnect before retrying.
237
+ */
238
+ waitConfirm(): Promise<PairedBitBox>;
239
+ }
240
+ /**
241
+ * Paired BitBox. This is where you can invoke most API functions like getting xpubs, displaying
242
+ * receive addresses, and signing transactions. Direct constructors create an inert object.
243
+ */
244
+ export declare class PairedBitBox {
245
+ #private;
246
+ /** No-op; retained for ABI compatibility with the wasm-bindgen output. */
247
+ free(): void;
248
+ /**
249
+ * Closes the BitBox connection. This also invokes the `on_close_cb` callback which was
250
+ * provided to the connect method creating the connection. Idempotent: calling close() on an
251
+ * already-closed or uninitialized instance is a no-op.
252
+ *
253
+ * After `close()`, all other methods throw `code: 'invalid-state'`.
254
+ */
255
+ close(): void;
256
+ /** Query device metadata. */
257
+ deviceInfo(): Promise<DeviceInfo>;
258
+ /** Returns which product we are connected to. */
259
+ product(): Product;
260
+ /** Returns the firmware version, e.g. "9.18.0". */
261
+ version(): string;
262
+ /** Returns the hex-encoded 4-byte root fingerprint. */
263
+ rootFingerprint(): Promise<string>;
264
+ /** Not implemented in this TypeScript iteration. */
265
+ showMnemonic(): Promise<void>;
266
+ /** Not implemented in this TypeScript iteration. */
267
+ changePassword(): Promise<void>;
268
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
269
+ btcXpub(_coin: BtcCoin, _keypath: Keypath, _xpub_type: XPubType, _display: boolean): Promise<string>;
270
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
271
+ btcXpubs(_coin: BtcCoin, _keypaths: Keypath[], _xpub_type: BtcXPubsType): Promise<BtcXpubs>;
272
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
273
+ btcIsScriptConfigRegistered(_coin: BtcCoin, _script_config: BtcScriptConfig, _keypath_account?: Keypath): Promise<boolean>;
274
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
275
+ btcRegisterScriptConfig(_coin: BtcCoin, _script_config: BtcScriptConfig, _keypath_account: Keypath | undefined, _xpub_type: BtcRegisterXPubType, _name?: string): Promise<void>;
276
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
277
+ btcAddress(_coin: BtcCoin, _keypath: Keypath, _script_config: BtcScriptConfig, _display: boolean): Promise<string>;
278
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
279
+ btcSignPSBT(_coin: BtcCoin, _psbt: string, _force_script_config: BtcScriptConfigWithKeypath | undefined, _format_unit: BtcFormatUnit): Promise<string>;
280
+ /** Compatibility stub: Bitcoin support is not implemented in this TypeScript iteration. */
281
+ btcSignMessage(_coin: BtcCoin, _script_config: BtcScriptConfigWithKeypath, _msg: Uint8Array): Promise<BtcSignMessageSignature>;
282
+ /** Does this device support ETH functionality? Currently this means BitBox02 Multi or Nova Multi. */
283
+ ethSupported(): boolean;
284
+ /** Query the device for an Ethereum account xpub. */
285
+ ethXpub(keypath: Keypath): Promise<string>;
286
+ /**
287
+ * Query the device for an Ethereum address.
288
+ *
289
+ * Set `display` to `true` to require on-device confirmation.
290
+ */
291
+ ethAddress(chain_id: bigint, keypath: Keypath, display: boolean): Promise<string>;
292
+ /**
293
+ * Sign a legacy Ethereum transaction.
294
+ *
295
+ * Transaction fields are unsigned big-endian byte arrays. The returned `v` includes the EIP-155
296
+ * chain ID offset.
297
+ */
298
+ ethSignTransaction(chain_id: bigint, keypath: Keypath, tx: EthTransaction, address_case?: EthAddressCase): Promise<EthSignature>;
299
+ /**
300
+ * Sign an EIP-1559 type 2 Ethereum transaction.
301
+ *
302
+ * Transaction fields are unsigned big-endian byte arrays. The returned `v` is the recovery ID.
303
+ */
304
+ ethSign1559Transaction(keypath: Keypath, tx: Eth1559Transaction, address_case?: EthAddressCase): Promise<EthSignature>;
305
+ /**
306
+ * Sign an Ethereum personal message.
307
+ *
308
+ * The device applies the standard Ethereum message prefix before signing. The returned `v`
309
+ * includes the +27 offset.
310
+ */
311
+ ethSignMessage(chain_id: bigint, keypath: Keypath, msg: Uint8Array): Promise<EthSignature>;
312
+ /**
313
+ * Sign an EIP-712 typed message.
314
+ *
315
+ * `use_antiklepto` defaults to `true` when omitted.
316
+ */
317
+ ethSignTypedMessage(chain_id: bigint, keypath: Keypath, msg: any, use_antiklepto?: boolean): Promise<EthSignature>;
318
+ /** Cardano support is not implemented in this TypeScript iteration. */
319
+ cardanoSupported(): boolean;
320
+ /** Compatibility stub: Cardano support is not implemented in this TypeScript iteration. */
321
+ cardanoXpubs(_keypaths: Keypath[]): Promise<CardanoXpubs>;
322
+ /** Compatibility stub: Cardano support is not implemented in this TypeScript iteration. */
323
+ cardanoAddress(_network: CardanoNetwork, _script_config: CardanoScriptConfig, _display: boolean): Promise<string>;
324
+ /** Compatibility stub: Cardano support is not implemented in this TypeScript iteration. */
325
+ cardanoSignTransaction(_transaction: CardanoTransaction): Promise<CardanoSignTransactionResult>;
326
+ /**
327
+ * Invokes the BIP85-BIP39 workflow on the device, letting the user select the number of words
328
+ * (12, 18, 24) and an index and display a derived BIP-39 mnemonic.
329
+ *
330
+ * Compatibility stub: BIP85 support is not implemented in this TypeScript iteration.
331
+ */
332
+ bip85AppBip39(): Promise<void>;
333
+ }
334
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA2DA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAEjD,MAAM,MAAM,OAAO,GACf,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,GACrB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,KAAK,CAAC;AAC9C,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AACxC,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB,EAAE,OAAO,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,4BAA4B,EAAE,MAAM,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,M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