@onekeyfe/hd-core 1.1.27-alpha.33 → 1.1.27-alpha.35
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/__tests__/protocol-v2.test.ts +183 -45
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/GetDeviceInfo.d.ts +9 -0
- package/dist/api/GetDeviceInfo.d.ts.map +1 -0
- package/dist/api/GetFeatures.d.ts +1 -1
- package/dist/api/GetPassphraseState.d.ts +2 -2
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumGetAddress.d.ts +2 -6
- package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignMessage.d.ts +2 -5
- package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignTransaction.d.ts +2 -5
- package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetAddress.d.ts +2 -9
- package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetPublicKey.d.ts +2 -9
- package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignMessage.d.ts +2 -8
- package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignTransaction.d.ts +2 -8
- package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts +1 -11
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts +1 -11
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts +1 -15
- package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
- package/dist/api/btc/BTCSignTransaction.d.ts +1 -11
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts +1 -11
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
- package/dist/api/btc/helpers/versionLimit.d.ts +2 -11
- package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -8
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
- package/dist/api/evm/latest/signTypedData.d.ts +1 -1
- package/dist/api/evm/latest/signTypedData.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/signTypedData.d.ts +1 -1
- package/dist/api/evm/legacyV1/signTypedData.d.ts.map +1 -1
- package/dist/api/helpers/batchGetPublickeys.d.ts.map +1 -1
- package/dist/api/helpers/deviceInfo.d.ts +15 -0
- package/dist/api/helpers/deviceInfo.d.ts.map +1 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/neo/NeoGetAddress.d.ts +2 -8
- package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
- package/dist/api/neo/NeoSignTransaction.d.ts +2 -8
- package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
- package/dist/api/nervos/NervosGetAddress.d.ts +2 -9
- package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
- package/dist/api/nervos/NervosSignTransaction.d.ts +2 -9
- package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
- package/dist/api/nexa/NexaGetAddress.d.ts +2 -8
- package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
- package/dist/api/nexa/NexaSignTransaction.d.ts +2 -9
- package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
- package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +10 -0
- package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +1 -0
- package/dist/api/scdo/ScdoGetAddress.d.ts +2 -6
- package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignMessage.d.ts +2 -5
- package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignTransaction.d.ts +2 -5
- package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts +2 -1
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +2 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +2 -2
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
- package/dist/index.d.ts +95 -5
- package/dist/index.js +411 -70
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/features.d.ts +20 -3
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
- package/dist/types/api/getDeviceInfo.d.ts +84 -0
- package/dist/types/api/getDeviceInfo.d.ts.map +1 -0
- package/dist/types/api/getPassphraseState.d.ts +1 -1
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +5 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +4 -0
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts +5 -1
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +1 -1
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +5 -10
- package/src/api/GetDeviceInfo.ts +153 -0
- package/src/api/GetPassphraseState.ts +7 -14
- package/src/api/alephium/AlephiumGetAddress.ts +6 -2
- package/src/api/alephium/AlephiumSignMessage.ts +6 -1
- package/src/api/alephium/AlephiumSignTransaction.ts +6 -2
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +13 -20
- package/src/api/benfen/BenfenGetAddress.ts +6 -2
- package/src/api/benfen/BenfenGetPublicKey.ts +6 -2
- package/src/api/benfen/BenfenSignMessage.ts +6 -1
- package/src/api/benfen/BenfenSignTransaction.ts +6 -1
- package/src/api/btc/helpers/versionLimit.ts +7 -1
- package/src/api/evm/EVMSignMessageEIP712.ts +14 -1
- package/src/api/helpers/batchGetPublickeys.ts +2 -4
- package/src/api/helpers/deviceInfo.ts +205 -0
- package/src/api/index.ts +2 -0
- package/src/api/neo/NeoGetAddress.ts +6 -1
- package/src/api/neo/NeoSignTransaction.ts +6 -1
- package/src/api/nervos/NervosGetAddress.ts +6 -2
- package/src/api/nervos/NervosSignTransaction.ts +6 -2
- package/src/api/nexa/NexaGetAddress.ts +6 -2
- package/src/api/nexa/NexaSignTransaction.ts +6 -2
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +17 -1
- package/src/api/protocol-v2/FilesystemDiskControl.ts +34 -0
- package/src/api/scdo/ScdoGetAddress.ts +6 -2
- package/src/api/scdo/ScdoSignMessage.ts +6 -1
- package/src/api/scdo/ScdoSignTransaction.ts +6 -2
- package/src/api/stellar/StellarGetAddress.ts +10 -1
- package/src/api/stellar/StellarSignTransaction.ts +14 -1
- package/src/api/sui/SuiSignTransaction.ts +12 -9
- package/src/core/index.ts +7 -7
- package/src/data/messages/messages-protocol-v2.json +10 -0
- package/src/inject.ts +3 -0
- package/src/protocols/protocol-v2/features.ts +35 -21
- package/src/types/api/getDeviceInfo.ts +97 -0
- package/src/types/api/getPassphraseState.ts +6 -8
- package/src/types/api/index.ts +16 -0
- package/src/types/api/protocolV2.ts +5 -0
- package/src/types/device.ts +30 -1
- package/src/utils/deviceFeaturesUtils.ts +9 -2
- package/src/utils/deviceInfoUtils.ts +5 -7
- package/src/utils/index.ts +1 -1
|
@@ -10,18 +10,23 @@ import FileRead from '../src/api/FileRead';
|
|
|
10
10
|
import FileWrite from '../src/api/FileWrite';
|
|
11
11
|
import DeviceFirmwareUpdate from '../src/api/protocol-v2/DeviceFirmwareUpdate';
|
|
12
12
|
import DeviceGetOnboardingStatus from '../src/api/protocol-v2/DeviceGetOnboardingStatus';
|
|
13
|
+
import EVMSignMessageEIP712 from '../src/api/evm/EVMSignMessageEIP712';
|
|
13
14
|
import FirmwareUpdateV3 from '../src/api/FirmwareUpdateV3';
|
|
14
15
|
import FirmwareUpdateV4 from '../src/api/FirmwareUpdateV4';
|
|
16
|
+
import GetPassphraseState from '../src/api/GetPassphraseState';
|
|
15
17
|
import GetOnekeyFeatures from '../src/api/GetOnekeyFeatures';
|
|
16
18
|
import { batchGetPublickeys } from '../src/api/helpers/batchGetPublickeys';
|
|
17
|
-
import
|
|
19
|
+
import SuiSignTransaction from '../src/api/sui/SuiSignTransaction';
|
|
18
20
|
import TronSignMessage from '../src/api/tron/TronSignMessage';
|
|
19
21
|
import XrpSignTransaction from '../src/api/xrp/XrpSignTransaction';
|
|
22
|
+
import StellarGetAddress from '../src/api/stellar/StellarGetAddress';
|
|
23
|
+
import BenfenSignMessage from '../src/api/benfen/BenfenSignMessage';
|
|
24
|
+
import { getBitcoinForkVersionRange } from '../src/api/btc/helpers/versionLimit';
|
|
20
25
|
import { DataManager } from '../src/data-manager';
|
|
21
26
|
import { Device } from '../src/device/Device';
|
|
22
27
|
import { UI_REQUEST } from '../src/events/ui-request';
|
|
23
28
|
import { getProtocolV2Features, normalizeProtocolV2Features } from '../src/protocols/protocol-v2';
|
|
24
|
-
import {
|
|
29
|
+
import { getMethodVersionRange, isMethodVersionRangeUnsupported } from '../src/utils';
|
|
25
30
|
import {
|
|
26
31
|
getPassphraseState,
|
|
27
32
|
getPassphraseStateWithRefreshDeviceInfo,
|
|
@@ -42,6 +47,7 @@ const descriptor = {
|
|
|
42
47
|
describe('Protocol V2 feature adapter', () => {
|
|
43
48
|
test('normalizes Protocol V2 DeviceInfo into existing Features fields', () => {
|
|
44
49
|
const features = normalizeProtocolV2Features(descriptor as any, {
|
|
50
|
+
protocol_version: 1,
|
|
45
51
|
hw: {
|
|
46
52
|
serial_no: 'PR2SERIAL',
|
|
47
53
|
},
|
|
@@ -97,6 +103,7 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
97
103
|
expect(features.serial_no).toBe('PR2SERIAL');
|
|
98
104
|
expect(features.onekey_serial_no).toBe('PR2SERIAL');
|
|
99
105
|
expect(features.onekey_device_type).toBe('pro2');
|
|
106
|
+
expect(features.protocol_version).toBe(1);
|
|
100
107
|
expect(features.major_version).toBe(1);
|
|
101
108
|
expect(features.minor_version).toBe(2);
|
|
102
109
|
expect(features.patch_version).toBe(3);
|
|
@@ -158,6 +165,51 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
158
165
|
});
|
|
159
166
|
});
|
|
160
167
|
|
|
168
|
+
test('returns unified GetPassphraseState object payload for existing Pro devices', async () => {
|
|
169
|
+
const features = {
|
|
170
|
+
device_id: 'pro-device-id',
|
|
171
|
+
onekey_device_type: 'PRO',
|
|
172
|
+
onekey_firmware_version: '4.15.0',
|
|
173
|
+
passphrase_protection: true,
|
|
174
|
+
session_id: 'feature-session',
|
|
175
|
+
unlocked_attach_pin: true,
|
|
176
|
+
};
|
|
177
|
+
const typedCall = jest.fn().mockResolvedValue({
|
|
178
|
+
type: 'PassphraseState',
|
|
179
|
+
message: {
|
|
180
|
+
passphrase_state: 'state-pro',
|
|
181
|
+
session_id: 'session-pro',
|
|
182
|
+
unlocked_attach_pin: false,
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
const updateInternalState = jest.fn();
|
|
186
|
+
const method = new GetPassphraseState({
|
|
187
|
+
payload: {
|
|
188
|
+
method: 'getPassphraseState',
|
|
189
|
+
connectId: 'connect-id',
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
method.device = {
|
|
193
|
+
features,
|
|
194
|
+
commands: { typedCall },
|
|
195
|
+
updateInternalState,
|
|
196
|
+
} as any;
|
|
197
|
+
|
|
198
|
+
await expect(method.run()).resolves.toEqual({
|
|
199
|
+
passphrase_state: 'state-pro',
|
|
200
|
+
session_id: 'session-pro',
|
|
201
|
+
unlocked_attach_pin: false,
|
|
202
|
+
passphrase_protection: true,
|
|
203
|
+
});
|
|
204
|
+
expect(updateInternalState).toHaveBeenCalledWith(
|
|
205
|
+
true,
|
|
206
|
+
'state-pro',
|
|
207
|
+
'pro-device-id',
|
|
208
|
+
'session-pro',
|
|
209
|
+
'feature-session'
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
|
|
161
213
|
test('stores Pro2 passphrase sessions without selecting them implicitly', async () => {
|
|
162
214
|
const device = Device.fromDescriptor({ ...descriptor, protocolType: 'V2' } as any);
|
|
163
215
|
const typedCall = jest.fn().mockResolvedValue({
|
|
@@ -240,16 +292,6 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
240
292
|
expect(features.firmware_present).toBe(false);
|
|
241
293
|
});
|
|
242
294
|
|
|
243
|
-
test('bypasses legacy method support checks for Protocol V2 fallback features', () => {
|
|
244
|
-
const features = normalizeProtocolV2Features({
|
|
245
|
-
...descriptor,
|
|
246
|
-
protocolType: 'V2',
|
|
247
|
-
} as any);
|
|
248
|
-
|
|
249
|
-
expect(shouldSkipMethodSupportCheck(features, 'V2')).toBe(true);
|
|
250
|
-
expect(shouldSkipMethodSupportCheck(features)).toBe(true);
|
|
251
|
-
});
|
|
252
|
-
|
|
253
295
|
test('initializes Protocol V2 features from DeviceGetDeviceInfo after Ping', async () => {
|
|
254
296
|
const commands = {
|
|
255
297
|
typedCall: jest
|
|
@@ -282,8 +324,7 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
282
324
|
});
|
|
283
325
|
});
|
|
284
326
|
|
|
285
|
-
test('
|
|
286
|
-
const onDeviceInfoError = jest.fn();
|
|
327
|
+
test('fails initialization when Protocol V2 DeviceGetDeviceInfo fails', async () => {
|
|
287
328
|
const commands = {
|
|
288
329
|
typedCall: jest
|
|
289
330
|
.fn()
|
|
@@ -291,48 +332,67 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
291
332
|
.mockRejectedValueOnce(new Error('DeviceInfo not supported')),
|
|
292
333
|
};
|
|
293
334
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
335
|
+
await expect(
|
|
336
|
+
getProtocolV2Features({
|
|
337
|
+
commands: commands as unknown as DeviceCommands,
|
|
338
|
+
descriptor: descriptor as any,
|
|
339
|
+
})
|
|
340
|
+
).rejects.toThrow('DeviceInfo not supported');
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
test('does not inherit Pro or Pro model fallback ranges for Protocol V2 devices', () => {
|
|
344
|
+
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any);
|
|
345
|
+
const checkedTypes: string[] = [];
|
|
346
|
+
|
|
347
|
+
const versionRange = getMethodVersionRange(features, type => {
|
|
348
|
+
checkedTypes.push(type);
|
|
349
|
+
if (type === 'pro' || type === 'model_touch') {
|
|
350
|
+
return { min: '4.10.0' };
|
|
351
|
+
}
|
|
352
|
+
return undefined;
|
|
298
353
|
});
|
|
299
354
|
|
|
300
|
-
expect(
|
|
301
|
-
expect(
|
|
302
|
-
expect(onDeviceInfoError).toHaveBeenCalledWith(expect.any(Error));
|
|
355
|
+
expect(versionRange).toBeUndefined();
|
|
356
|
+
expect(checkedTypes).toEqual(['pro2']);
|
|
303
357
|
});
|
|
304
358
|
|
|
305
|
-
test('
|
|
306
|
-
const
|
|
359
|
+
test('marks known unsupported public-chain methods as unsupported on Protocol V2', () => {
|
|
360
|
+
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any, {
|
|
361
|
+
fw: {
|
|
362
|
+
app: {
|
|
363
|
+
version: '9.9.9',
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
const stellar = new StellarGetAddress({
|
|
307
368
|
id: 1,
|
|
308
369
|
payload: {
|
|
309
|
-
method: '
|
|
310
|
-
path: "m/44'/
|
|
311
|
-
prefix: 'kaspa',
|
|
312
|
-
showOnOneKey: false,
|
|
313
|
-
useTweak: false,
|
|
370
|
+
method: 'stellarGetAddress',
|
|
371
|
+
path: "m/44'/148'/0'",
|
|
314
372
|
},
|
|
315
373
|
});
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
374
|
+
const benfen = new BenfenSignMessage({
|
|
375
|
+
id: 1,
|
|
376
|
+
payload: {
|
|
377
|
+
method: 'benfenSignMessage',
|
|
378
|
+
path: "m/44'/728'/0'/0'/0'",
|
|
379
|
+
messageHex: '0x1234',
|
|
320
380
|
},
|
|
321
381
|
});
|
|
322
382
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
(method as any).device = {
|
|
326
|
-
originalDescriptor: { protocolType: 'V2' },
|
|
327
|
-
features: normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any),
|
|
328
|
-
commands: { typedCall },
|
|
329
|
-
toMessageObject: jest.fn(() => ({})),
|
|
330
|
-
};
|
|
383
|
+
stellar.init();
|
|
384
|
+
benfen.init();
|
|
331
385
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
386
|
+
const stellarRange = getMethodVersionRange(features, type => stellar.getVersionRange()[type]);
|
|
387
|
+
const benfenRange = getMethodVersionRange(features, type => benfen.getVersionRange()[type]);
|
|
388
|
+
const neuraiRange = getMethodVersionRange(
|
|
389
|
+
features,
|
|
390
|
+
type => getBitcoinForkVersionRange(['Neurai'])[type]
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
expect(isMethodVersionRangeUnsupported(stellarRange)).toBe(true);
|
|
394
|
+
expect(isMethodVersionRangeUnsupported(benfenRange)).toBe(true);
|
|
395
|
+
expect(isMethodVersionRangeUnsupported(neuraiRange)).toBe(true);
|
|
336
396
|
});
|
|
337
397
|
|
|
338
398
|
test('does not block legacy batch public key support checks on Protocol V2', async () => {
|
|
@@ -347,7 +407,13 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
347
407
|
});
|
|
348
408
|
const device = {
|
|
349
409
|
originalDescriptor: { protocolType: 'V2' },
|
|
350
|
-
features: normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any
|
|
410
|
+
features: normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any, {
|
|
411
|
+
fw: {
|
|
412
|
+
app: {
|
|
413
|
+
version: '4.14.0',
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
}),
|
|
351
417
|
commands: { typedCall },
|
|
352
418
|
};
|
|
353
419
|
|
|
@@ -450,6 +516,34 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
450
516
|
});
|
|
451
517
|
|
|
452
518
|
describe('API compatibility handling', () => {
|
|
519
|
+
test('returns a typed unsupported error for deprecated EIP712 message signing on Protocol V2', async () => {
|
|
520
|
+
const method = new EVMSignMessageEIP712({
|
|
521
|
+
id: 1,
|
|
522
|
+
payload: {
|
|
523
|
+
method: 'evmSignMessageEIP712',
|
|
524
|
+
path: "m/44'/60'/0'/0/0",
|
|
525
|
+
domainHash: '0x'.concat('11'.repeat(32)),
|
|
526
|
+
messageHash: '0x'.concat('22'.repeat(32)),
|
|
527
|
+
},
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
method.init();
|
|
531
|
+
(method as any).device = {
|
|
532
|
+
features: {
|
|
533
|
+
onekey_device_type: 'pro2',
|
|
534
|
+
},
|
|
535
|
+
originalDescriptor: {
|
|
536
|
+
protocolType: 'V2',
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
await expect(method.run()).rejects.toEqual(
|
|
541
|
+
expect.objectContaining({
|
|
542
|
+
errorCode: HardwareErrorCode.DeviceNotSupportMethod,
|
|
543
|
+
})
|
|
544
|
+
);
|
|
545
|
+
});
|
|
546
|
+
|
|
453
547
|
test('returns a typed unsupported error for Tron sign message V1 before device binding', () => {
|
|
454
548
|
const method = new TronSignMessage({
|
|
455
549
|
id: 1,
|
|
@@ -468,6 +562,50 @@ describe('API compatibility handling', () => {
|
|
|
468
562
|
);
|
|
469
563
|
});
|
|
470
564
|
|
|
565
|
+
test('uses chunk transfer for large Sui transactions on Protocol V2', async () => {
|
|
566
|
+
const rawTx = '0x'.concat('ab'.repeat(5000));
|
|
567
|
+
const typedCall = jest.fn(() => ({
|
|
568
|
+
type: 'SuiSignedTx',
|
|
569
|
+
message: {
|
|
570
|
+
public_key: '',
|
|
571
|
+
signature: '',
|
|
572
|
+
},
|
|
573
|
+
}));
|
|
574
|
+
const method = new SuiSignTransaction({
|
|
575
|
+
id: 1,
|
|
576
|
+
payload: {
|
|
577
|
+
method: 'suiSignTransaction',
|
|
578
|
+
path: "m/44'/784'/0'/0'/0'",
|
|
579
|
+
rawTx,
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
method.init();
|
|
584
|
+
(method as any).device = {
|
|
585
|
+
features: {
|
|
586
|
+
onekey_device_type: 'pro2',
|
|
587
|
+
},
|
|
588
|
+
originalDescriptor: {
|
|
589
|
+
protocolType: 'V2',
|
|
590
|
+
},
|
|
591
|
+
getCommands: () => ({
|
|
592
|
+
typedCall,
|
|
593
|
+
}),
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
await method.run();
|
|
597
|
+
|
|
598
|
+
expect(typedCall).toHaveBeenCalledTimes(1);
|
|
599
|
+
const [, , params] = typedCall.mock.calls[0];
|
|
600
|
+
expect(params).toEqual(
|
|
601
|
+
expect.objectContaining({
|
|
602
|
+
raw_tx: '',
|
|
603
|
+
data_length: 5000,
|
|
604
|
+
})
|
|
605
|
+
);
|
|
606
|
+
expect(params.data_initial_chunk).toHaveLength(2048);
|
|
607
|
+
});
|
|
608
|
+
|
|
471
609
|
test('accepts string XRP payment amount values', () => {
|
|
472
610
|
const method = new XrpSignTransaction({
|
|
473
611
|
id: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAG,MAAM,CAAC;IAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,cAAc,CAAC,EAAE,cAAc,CAAC;IAKhC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAMnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAO7B,wBAAwB,UAAS;IAGjC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,EAAE,WAAW,CAAC;gBAEV,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,UAAU,CAAC,OAAO,EAAE,WAAW;IAQ/B,SAAS,CAAC,MAAM,EAAE,MAAM;IA2BxB,oBAAoB;IAmBpB,yBAAyB;IAczB,SAAS,CAAC,wBAAwB,CAChC,cAAc,EAAE,MAAM,OAAO,EAC7B,eAAe,EAAE,MAAM,mBAAmB,EAC1C,OAAO,CAAC,EAAE;QACR,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACpC;
|
|
1
|
+
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,eAAe,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAI3C,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAG,MAAM,CAAC;IAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,cAAc,CAAC,EAAE,cAAc,CAAC;IAKhC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAMnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAO7B,wBAAwB,UAAS;IAGjC,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,EAAE,WAAW,CAAC;gBAEV,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,UAAU,CAAC,OAAO,EAAE,WAAW;IAQ/B,SAAS,CAAC,MAAM,EAAE,MAAM;IA2BxB,oBAAoB;IAmBpB,yBAAyB;IAczB,SAAS,CAAC,wBAAwB,CAChC,cAAc,EAAE,MAAM,OAAO,EAC7B,eAAe,EAAE,MAAM,mBAAmB,EAC1C,OAAO,CAAC,EAAE;QACR,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACpC;IAsCG,yBAAyB;IAiB/B,OAAO;IAGP,0BAA0B,SAAU;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UAOrE;CACH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { GetDeviceInfoParams } from '../types/api/getDeviceInfo';
|
|
3
|
+
export default class GetDeviceInfo extends BaseMethod<GetDeviceInfoParams> {
|
|
4
|
+
init(): void;
|
|
5
|
+
run(): Promise<import("../types").UnifiedDeviceInfo>;
|
|
6
|
+
private runProtocolV2;
|
|
7
|
+
private runProtocolV1;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=GetDeviceInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetDeviceInfo.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceInfo.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AA0DpC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IACxE,IAAI;IAeE,GAAG;YAOK,aAAa;YA2Bb,aAAa;CA2B5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseMethod } from './BaseMethod';
|
|
2
2
|
export default class GetFeatures extends BaseMethod {
|
|
3
3
|
init(): void;
|
|
4
|
-
run(): Promise<import("
|
|
4
|
+
run(): Promise<import("..").Features | undefined>;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=GetFeatures.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BaseMethod } from './BaseMethod';
|
|
2
2
|
export default class GetPassphraseState extends BaseMethod {
|
|
3
3
|
init(): void;
|
|
4
|
-
run(): Promise<
|
|
4
|
+
run(): Promise<{
|
|
5
5
|
passphrase_state: string | undefined;
|
|
6
6
|
session_id: string | undefined;
|
|
7
7
|
unlocked_attach_pin: boolean | undefined;
|
|
8
8
|
passphrase_protection: boolean | null;
|
|
9
|
-
}
|
|
9
|
+
}>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=GetPassphraseState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetPassphraseState.d.ts","sourceRoot":"","sources":["../../src/api/GetPassphraseState.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,IAAI;IAKE,GAAG;;;;;;
|
|
1
|
+
{"version":3,"file":"GetPassphraseState.d.ts","sourceRoot":"","sources":["../../src/api/GetPassphraseState.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,IAAI;IAKE,GAAG;;;;;;CAuBV"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
import type { AlephiumGetAddress as HardwareAlephiumGetAddress } from '@onekeyfe/hd-transport';
|
|
3
|
-
import type { AlephiumAddress } from '../../types';
|
|
3
|
+
import type { AlephiumAddress, DeviceFirmwareRange } from '../../types';
|
|
4
4
|
export default class AlephiumGetAddress extends BaseMethod<HardwareAlephiumGetAddress[]> {
|
|
5
5
|
hasBundle: boolean;
|
|
6
6
|
init(): void;
|
|
7
|
-
getVersionRange():
|
|
8
|
-
model_touch: {
|
|
9
|
-
min: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
7
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
12
8
|
run(): Promise<AlephiumAddress | AlephiumAddress[]>;
|
|
13
9
|
}
|
|
14
10
|
//# sourceMappingURL=AlephiumGetAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlephiumGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAA4B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"AlephiumGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAA4B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElG,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IAkCJ,eAAe,IAAI,mBAAmB;IAYhC,GAAG;CA8BV"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
import type { AlephiumSignMessage as HardwareAlephiumSignMessage } from '@onekeyfe/hd-transport';
|
|
3
|
+
import type { DeviceFirmwareRange } from '../../types';
|
|
3
4
|
export default class AlephiumSignMessage extends BaseMethod<HardwareAlephiumSignMessage> {
|
|
4
5
|
init(): void;
|
|
5
|
-
getVersionRange():
|
|
6
|
-
model_touch: {
|
|
7
|
-
min: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
6
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
10
7
|
run(): Promise<import("@onekeyfe/hd-transport").AlephiumMessageSignature>;
|
|
11
8
|
}
|
|
12
9
|
//# sourceMappingURL=AlephiumSignMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlephiumSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,mBAAmB,IAAI,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"AlephiumSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,mBAAmB,IAAI,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IACtF,IAAI;IAsBJ,eAAe,IAAI,mBAAmB;IAYhC,GAAG;CAWV"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { BaseMethod } from '../BaseMethod';
|
|
3
3
|
import type { AlephiumSignedTx, AlephiumSignTx as HardwareAlephiumSignTx, TypedCall } from '@onekeyfe/hd-transport';
|
|
4
|
+
import type { DeviceFirmwareRange } from '../../types';
|
|
4
5
|
import type { TypedResponseMessage } from '../../device/DeviceCommands';
|
|
5
6
|
export default class AlephiumSignTransaction extends BaseMethod<HardwareAlephiumSignTx> {
|
|
6
7
|
init(): void;
|
|
7
|
-
getVersionRange():
|
|
8
|
-
model_touch: {
|
|
9
|
-
min: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
8
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
12
9
|
chunkByteSize: number;
|
|
13
10
|
processTxRequest: (typedCall: TypedCall, res: TypedResponseMessage<'AlephiumSignedTx'> | TypedResponseMessage<'AlephiumTxRequest'> | TypedResponseMessage<'AlephiumBytecodeRequest'>, data: Buffer, scriptOpt?: Buffer, dataOffset?: number) => Promise<AlephiumSignedTx>;
|
|
14
11
|
run(): Promise<AlephiumSignedTx>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlephiumSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumSignTransaction.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,IAAI,sBAAsB,EACxC,SAAS,EACV,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"AlephiumSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/alephium/AlephiumSignTransaction.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,IAAI,sBAAsB,EACxC,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAiC,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IACrF,IAAI;IAuBJ,eAAe,IAAI,mBAAmB;IAYtC,aAAa,SAAQ;IAErB,gBAAgB,cACH,SAAS,OAEhB,qBAAqB,kBAAkB,CAAC,GACxC,qBAAqB,mBAAmB,CAAC,GACzC,qBAAqB,yBAAyB,CAAC,QAC7C,MAAM,cACA,MAAM,0BAEjB,QAAQ,gBAAgB,CAAC,CAoD1B;IAEI,GAAG;CAsBV"}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import type { BenfenAddress } from '../../types';
|
|
2
|
+
import type { BenfenAddress, DeviceFirmwareRange } from '../../types';
|
|
3
3
|
import type { BenfenGetAddress as HardwareBenfenGetAddress } from '@onekeyfe/hd-transport';
|
|
4
4
|
export default class BenfenGetAddress extends BaseMethod<HardwareBenfenGetAddress[]> {
|
|
5
5
|
hasBundle: boolean;
|
|
6
6
|
shouldConfirm: boolean;
|
|
7
7
|
strictCheckDeviceSupport: boolean;
|
|
8
8
|
init(): void;
|
|
9
|
-
getVersionRange():
|
|
10
|
-
pro: {
|
|
11
|
-
min: string;
|
|
12
|
-
};
|
|
13
|
-
model_classic1s: {
|
|
14
|
-
min: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
9
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
17
10
|
run(): Promise<BenfenAddress | BenfenAddress[]>;
|
|
18
11
|
}
|
|
19
12
|
//# sourceMappingURL=BenfenGetAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BenfenGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,KAAK,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BenfenGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,OAAO,KAAK,EAAE,aAAa,EAA0B,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,KAAK,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAE3F,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,aAAa,UAAS;IAEtB,wBAAwB,UAAQ;IAEhC,IAAI;IA+BJ,eAAe,IAAI,mBAAmB;IAehC,GAAG;CA6DV"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
|
-
import type { BenfenPublicKey } from '../../types';
|
|
2
|
+
import type { BenfenPublicKey, DeviceFirmwareRange } from '../../types';
|
|
3
3
|
export default class BenfenGetPublicKey extends BaseMethod<any> {
|
|
4
4
|
hasBundle: boolean;
|
|
5
5
|
strictCheckDeviceSupport: boolean;
|
|
6
6
|
init(): void;
|
|
7
|
-
getVersionRange():
|
|
8
|
-
pro: {
|
|
9
|
-
min: string;
|
|
10
|
-
};
|
|
11
|
-
model_classic1s: {
|
|
12
|
-
min: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
7
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
15
8
|
run(): Promise<BenfenPublicKey | BenfenPublicKey[]>;
|
|
16
9
|
}
|
|
17
10
|
//# sourceMappingURL=BenfenGetPublicKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BenfenGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,KAAK,EAA4B,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BenfenGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,KAAK,EAA4B,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElG,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC7D,SAAS,UAAS;IAElB,wBAAwB,UAAQ;IAEhC,IAAI;IA2BJ,eAAe,IAAI,mBAAmB;IAehC,GAAG;CAgBV"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
import type { BenfenSignMessage as HardwareBenfenSignMessage } from '@onekeyfe/hd-transport';
|
|
3
|
+
import type { DeviceFirmwareRange } from '../../types';
|
|
3
4
|
export default class BenfenSignMessage extends BaseMethod<HardwareBenfenSignMessage> {
|
|
4
5
|
init(): void;
|
|
5
|
-
getVersionRange():
|
|
6
|
-
pro: {
|
|
7
|
-
min: string;
|
|
8
|
-
};
|
|
9
|
-
model_classic1s: {
|
|
10
|
-
min: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
6
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
13
7
|
run(): Promise<import("@onekeyfe/hd-transport").BenfenMessageSignature>;
|
|
14
8
|
}
|
|
15
9
|
//# sourceMappingURL=BenfenSignMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BenfenSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"BenfenSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IAClF,IAAI;IAkBJ,eAAe,IAAI,mBAAmB;IAehC,GAAG;CAWV"}
|
|
@@ -2,16 +2,10 @@
|
|
|
2
2
|
import { BaseMethod } from '../BaseMethod';
|
|
3
3
|
import type { BenfenSignTx, BenfenSignedTx, TypedCall } from '@onekeyfe/hd-transport';
|
|
4
4
|
import type { TypedResponseMessage } from '../../device/DeviceCommands';
|
|
5
|
+
import type { DeviceFirmwareRange } from '../../types';
|
|
5
6
|
export default class BenfenSignTransaction extends BaseMethod<BenfenSignTx> {
|
|
6
7
|
init(): void;
|
|
7
|
-
getVersionRange():
|
|
8
|
-
pro: {
|
|
9
|
-
min: string;
|
|
10
|
-
};
|
|
11
|
-
model_classic1s: {
|
|
12
|
-
min: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
8
|
+
getVersionRange(): DeviceFirmwareRange;
|
|
15
9
|
chunkByteSize: number;
|
|
16
10
|
processTxRequest: (typedCall: TypedCall, res: TypedResponseMessage<'BenfenSignedTx'> | TypedResponseMessage<'BenfenTxRequest'>, data: Buffer, offset?: number) => Promise<BenfenSignedTx>;
|
|
17
11
|
run(): Promise<BenfenSignedTx>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BenfenSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenSignTransaction.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAe,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"BenfenSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/benfen/BenfenSignTransaction.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAe,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,YAAY,CAAC;IACzE,IAAI;IAsBJ,eAAe,IAAI,mBAAmB;IAetC,aAAa,SAAQ;IAErB,gBAAgB,cACH,SAAS,OACf,qBAAqB,gBAAgB,CAAC,GAAG,qBAAqB,iBAAiB,CAAC,QAC/E,MAAM,sBAEX,QAAQ,cAAc,CAAC,CAgCxB;IAEI,GAAG;CAkBV"}
|
|
@@ -4,17 +4,7 @@ import type { GetAddress } from '@onekeyfe/hd-transport';
|
|
|
4
4
|
export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
|
|
5
5
|
hasBundle: boolean;
|
|
6
6
|
init(): void;
|
|
7
|
-
getVersionRange():
|
|
8
|
-
model_mini: {
|
|
9
|
-
min: string;
|
|
10
|
-
};
|
|
11
|
-
model_touch: {
|
|
12
|
-
min: string;
|
|
13
|
-
};
|
|
14
|
-
} | {
|
|
15
|
-
model_mini?: undefined;
|
|
16
|
-
model_touch?: undefined;
|
|
17
|
-
};
|
|
7
|
+
getVersionRange(): import("../..").DeviceFirmwareRange;
|
|
18
8
|
run(): Promise<BTCAddress | BTCAddress[]>;
|
|
19
9
|
}
|
|
20
10
|
//# sourceMappingURL=BTCGetAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA6CJ,eAAe
|
|
1
|
+
{"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA6CJ,eAAe;IAIT,GAAG;CA4BV"}
|
|
@@ -5,17 +5,7 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
|
|
|
5
5
|
hasBundle: boolean;
|
|
6
6
|
init(): void;
|
|
7
7
|
private isBtcNetwork;
|
|
8
|
-
getVersionRange():
|
|
9
|
-
model_mini: {
|
|
10
|
-
min: string;
|
|
11
|
-
};
|
|
12
|
-
model_touch: {
|
|
13
|
-
min: string;
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
model_mini?: undefined;
|
|
17
|
-
model_touch?: undefined;
|
|
18
|
-
};
|
|
8
|
+
getVersionRange(): import("../..").DeviceFirmwareRange;
|
|
19
9
|
run(): Promise<BTCPublicKey | BTCPublicKey[]>;
|
|
20
10
|
}
|
|
21
11
|
//# sourceMappingURL=BTCGetPublicKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BTCGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetPublicKey.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,YAAY,EAAE,CAAC;IACrE,SAAS,UAAS;IAElB,IAAI;IA4CJ,OAAO,CAAC,YAAY;IAIpB,eAAe
|
|
1
|
+
{"version":3,"file":"BTCGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetPublicKey.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,YAAY,EAAE,CAAC;IACrE,SAAS,UAAS;IAElB,IAAI;IA4CJ,OAAO,CAAC,YAAY;IAIpB,eAAe;IAIT,GAAG;CAuGV"}
|
|
@@ -2,21 +2,7 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
2
2
|
import type { SignMessage } from '@onekeyfe/hd-transport';
|
|
3
3
|
export default class BTCSignMessage extends BaseMethod<SignMessage> {
|
|
4
4
|
init(): void;
|
|
5
|
-
getVersionRange():
|
|
6
|
-
model_mini: {
|
|
7
|
-
min: string;
|
|
8
|
-
};
|
|
9
|
-
model_touch: {
|
|
10
|
-
min: string;
|
|
11
|
-
};
|
|
12
|
-
} | {
|
|
13
|
-
model_mini?: undefined;
|
|
14
|
-
model_touch?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
pro: {
|
|
17
|
-
min: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
5
|
+
getVersionRange(): import("../..").DeviceFirmwareRange;
|
|
20
6
|
run(): Promise<import("@onekeyfe/hd-transport").MessageSignature>;
|
|
21
7
|
}
|
|
22
8
|
//# sourceMappingURL=BTCSignMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BTCSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,WAAW,CAAC;IACjE,IAAI;IA2CJ,eAAe
|
|
1
|
+
{"version":3,"file":"BTCSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,WAAW,CAAC;IACjE,IAAI;IA2CJ,eAAe;IAWT,GAAG;CAOV"}
|
|
@@ -11,17 +11,7 @@ type Params = {
|
|
|
11
11
|
};
|
|
12
12
|
export default class BTCSignTransaction extends BaseMethod<Params> {
|
|
13
13
|
init(): void;
|
|
14
|
-
getVersionRange():
|
|
15
|
-
model_mini: {
|
|
16
|
-
min: string;
|
|
17
|
-
};
|
|
18
|
-
model_touch: {
|
|
19
|
-
min: string;
|
|
20
|
-
};
|
|
21
|
-
} | {
|
|
22
|
-
model_mini?: undefined;
|
|
23
|
-
model_touch?: undefined;
|
|
24
|
-
};
|
|
14
|
+
getVersionRange(): import("../..").DeviceFirmwareRange;
|
|
25
15
|
run(): Promise<import("../../types/api/btcSignTransaction").SignedTransaction>;
|
|
26
16
|
}
|
|
27
17
|
export {};
|