@onekeyfe/hd-core 1.1.22-alpha.1 → 1.1.22-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +2 -2
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +8 -6
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceConnector.d.ts +3 -2
- package/dist/device/DeviceConnector.d.ts.map +1 -1
- package/dist/index.d.ts +47 -32
- package/dist/index.js +195 -24
- package/dist/types/api/deviceSettings.d.ts +3 -0
- package/dist/types/api/deviceSettings.d.ts.map +1 -1
- package/dist/types/api/solSignTransaction.d.ts +2 -1
- package/dist/types/api/solSignTransaction.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts +29 -0
- package/dist/utils/deviceSettings.d.ts.map +1 -0
- package/dist/utils/homescreen.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- 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/device/DeviceSettings.ts +8 -0
- package/src/api/solana/SolSignTransaction.ts +5 -2
- package/src/core/index.ts +9 -0
- package/src/data/messages/messages.json +61 -0
- package/src/data/messages/messages_legacy_v1.json +12 -0
- package/src/device/Device.ts +24 -24
- package/src/device/DeviceConnector.ts +15 -3
- package/src/types/api/deviceSettings.ts +3 -0
- package/src/types/api/solSignTransaction.ts +5 -1
- package/src/utils/deviceSettings.ts +109 -0
- package/src/utils/homescreen.ts +3 -1
- package/src/utils/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -7966,6 +7966,18 @@ var nested$1 = {
|
|
|
7966
7966
|
type: "uint32",
|
|
7967
7967
|
id: 520
|
|
7968
7968
|
},
|
|
7969
|
+
brightness_prcent: {
|
|
7970
|
+
type: "uint32",
|
|
7971
|
+
id: 521
|
|
7972
|
+
},
|
|
7973
|
+
haptic_feedback: {
|
|
7974
|
+
type: "bool",
|
|
7975
|
+
id: 522
|
|
7976
|
+
},
|
|
7977
|
+
auto_shutdown_delay_ms: {
|
|
7978
|
+
type: "uint32",
|
|
7979
|
+
id: 523
|
|
7980
|
+
},
|
|
7969
7981
|
onekey_device_type: {
|
|
7970
7982
|
type: "OneKeyDeviceType",
|
|
7971
7983
|
id: 600
|
|
@@ -8364,6 +8376,18 @@ var nested$1 = {
|
|
|
8364
8376
|
fastpay_times: {
|
|
8365
8377
|
type: "uint32",
|
|
8366
8378
|
id: 106
|
|
8379
|
+
},
|
|
8380
|
+
auto_shutdown_delay_ms: {
|
|
8381
|
+
type: "uint32",
|
|
8382
|
+
id: 500
|
|
8383
|
+
},
|
|
8384
|
+
change_brightness: {
|
|
8385
|
+
type: "bool",
|
|
8386
|
+
id: 501
|
|
8387
|
+
},
|
|
8388
|
+
haptic_feedback: {
|
|
8389
|
+
type: "bool",
|
|
8390
|
+
id: 502
|
|
8367
8391
|
}
|
|
8368
8392
|
},
|
|
8369
8393
|
nested: {
|
|
@@ -11365,6 +11389,39 @@ var nested$1 = {
|
|
|
11365
11389
|
}
|
|
11366
11390
|
}
|
|
11367
11391
|
},
|
|
11392
|
+
SolanaTxATADetails: {
|
|
11393
|
+
fields: {
|
|
11394
|
+
owner_address: {
|
|
11395
|
+
rule: "required",
|
|
11396
|
+
type: "string",
|
|
11397
|
+
id: 1
|
|
11398
|
+
},
|
|
11399
|
+
program_id: {
|
|
11400
|
+
rule: "required",
|
|
11401
|
+
type: "string",
|
|
11402
|
+
id: 2
|
|
11403
|
+
},
|
|
11404
|
+
mint_address: {
|
|
11405
|
+
rule: "required",
|
|
11406
|
+
type: "string",
|
|
11407
|
+
id: 3
|
|
11408
|
+
},
|
|
11409
|
+
associated_token_address: {
|
|
11410
|
+
rule: "required",
|
|
11411
|
+
type: "string",
|
|
11412
|
+
id: 4
|
|
11413
|
+
}
|
|
11414
|
+
}
|
|
11415
|
+
},
|
|
11416
|
+
SolanaTxExtraInfo: {
|
|
11417
|
+
fields: {
|
|
11418
|
+
ata_details: {
|
|
11419
|
+
rule: "repeated",
|
|
11420
|
+
type: "SolanaTxATADetails",
|
|
11421
|
+
id: 1
|
|
11422
|
+
}
|
|
11423
|
+
}
|
|
11424
|
+
},
|
|
11368
11425
|
SolanaSignTx: {
|
|
11369
11426
|
fields: {
|
|
11370
11427
|
address_n: {
|
|
@@ -11379,6 +11436,10 @@ var nested$1 = {
|
|
|
11379
11436
|
rule: "required",
|
|
11380
11437
|
type: "bytes",
|
|
11381
11438
|
id: 2
|
|
11439
|
+
},
|
|
11440
|
+
extra_info: {
|
|
11441
|
+
type: "SolanaTxExtraInfo",
|
|
11442
|
+
id: 3
|
|
11382
11443
|
}
|
|
11383
11444
|
}
|
|
11384
11445
|
},
|
|
@@ -19758,6 +19819,18 @@ var nested = {
|
|
|
19758
19819
|
battery_level: {
|
|
19759
19820
|
type: "uint32",
|
|
19760
19821
|
id: 520
|
|
19822
|
+
},
|
|
19823
|
+
brightness_prcent: {
|
|
19824
|
+
type: "uint32",
|
|
19825
|
+
id: 521
|
|
19826
|
+
},
|
|
19827
|
+
haptic_feedback: {
|
|
19828
|
+
type: "bool",
|
|
19829
|
+
id: 522
|
|
19830
|
+
},
|
|
19831
|
+
auto_shutdown_delay_ms: {
|
|
19832
|
+
type: "uint32",
|
|
19833
|
+
id: 523
|
|
19761
19834
|
}
|
|
19762
19835
|
},
|
|
19763
19836
|
nested: {
|
|
@@ -25821,6 +25894,96 @@ function checkBootloaderLength(data) {
|
|
|
25821
25894
|
return bootloaderLength === data.byteLength;
|
|
25822
25895
|
}
|
|
25823
25896
|
|
|
25897
|
+
const LANGUAGE_LABELS = {
|
|
25898
|
+
en: 'English',
|
|
25899
|
+
zh_cn: '简体中文',
|
|
25900
|
+
zh_hk: '繁體中文',
|
|
25901
|
+
ja: '日本語',
|
|
25902
|
+
ko: '한국어',
|
|
25903
|
+
fr: 'Français',
|
|
25904
|
+
de: 'Deutsch',
|
|
25905
|
+
ru: 'Russian',
|
|
25906
|
+
es: 'Spanish',
|
|
25907
|
+
it: 'Italiano',
|
|
25908
|
+
pt_br: 'Portuguese (Brazil)',
|
|
25909
|
+
};
|
|
25910
|
+
const getLanguageConfig = (deviceType) => {
|
|
25911
|
+
let keys = [];
|
|
25912
|
+
switch (deviceType) {
|
|
25913
|
+
case hdShared.EDeviceType.Classic:
|
|
25914
|
+
case hdShared.EDeviceType.Mini:
|
|
25915
|
+
keys = ['en', 'zh_cn'];
|
|
25916
|
+
break;
|
|
25917
|
+
case hdShared.EDeviceType.Classic1s:
|
|
25918
|
+
case hdShared.EDeviceType.ClassicPure:
|
|
25919
|
+
keys = ['en', 'zh_cn', 'zh_hk', 'ja', 'pt_br', 'de', 'ko'];
|
|
25920
|
+
break;
|
|
25921
|
+
case hdShared.EDeviceType.Touch:
|
|
25922
|
+
case hdShared.EDeviceType.Pro:
|
|
25923
|
+
keys = Object.keys(LANGUAGE_LABELS);
|
|
25924
|
+
break;
|
|
25925
|
+
default:
|
|
25926
|
+
keys = [];
|
|
25927
|
+
break;
|
|
25928
|
+
}
|
|
25929
|
+
return keys.map(key => ({ code: key, label: LANGUAGE_LABELS[key] }));
|
|
25930
|
+
};
|
|
25931
|
+
const getAutoLockOptions = (_deviceType) => {
|
|
25932
|
+
switch (_deviceType) {
|
|
25933
|
+
case hdShared.EDeviceType.Mini:
|
|
25934
|
+
case hdShared.EDeviceType.Classic:
|
|
25935
|
+
case hdShared.EDeviceType.Classic1s:
|
|
25936
|
+
case hdShared.EDeviceType.ClassicPure:
|
|
25937
|
+
return [
|
|
25938
|
+
{ seconds: 0, minute: 1, hour: 0, day: 0 },
|
|
25939
|
+
{ seconds: 0, minute: 2, hour: 0, day: 0 },
|
|
25940
|
+
{ seconds: 0, minute: 5, hour: 0, day: 0 },
|
|
25941
|
+
{ seconds: 0, minute: 10, hour: 0, day: 0 },
|
|
25942
|
+
{ seconds: 0, minute: 0, hour: 0, day: 0 },
|
|
25943
|
+
];
|
|
25944
|
+
case hdShared.EDeviceType.Touch:
|
|
25945
|
+
case hdShared.EDeviceType.Pro:
|
|
25946
|
+
return [
|
|
25947
|
+
{ seconds: 30, minute: 0, hour: 0, day: 0 },
|
|
25948
|
+
{ seconds: 0, minute: 1, hour: 0, day: 0 },
|
|
25949
|
+
{ seconds: 0, minute: 2, hour: 0, day: 0 },
|
|
25950
|
+
{ seconds: 0, minute: 5, hour: 0, day: 0 },
|
|
25951
|
+
{ seconds: 0, minute: 10, hour: 0, day: 0 },
|
|
25952
|
+
{ seconds: 0, minute: 30, hour: 0, day: 0 },
|
|
25953
|
+
{ seconds: 0, minute: 0, hour: 0, day: 0 },
|
|
25954
|
+
];
|
|
25955
|
+
default:
|
|
25956
|
+
return [];
|
|
25957
|
+
}
|
|
25958
|
+
};
|
|
25959
|
+
const getAutoShutDownOptions = (_deviceType) => {
|
|
25960
|
+
switch (_deviceType) {
|
|
25961
|
+
case hdShared.EDeviceType.Mini:
|
|
25962
|
+
return [];
|
|
25963
|
+
case hdShared.EDeviceType.Classic:
|
|
25964
|
+
case hdShared.EDeviceType.Classic1s:
|
|
25965
|
+
case hdShared.EDeviceType.ClassicPure:
|
|
25966
|
+
return [
|
|
25967
|
+
{ seconds: 0, minute: 1, hour: 0, day: 0 },
|
|
25968
|
+
{ seconds: 0, minute: 3, hour: 0, day: 0 },
|
|
25969
|
+
{ seconds: 0, minute: 5, hour: 0, day: 0 },
|
|
25970
|
+
{ seconds: 0, minute: 10, hour: 0, day: 0 },
|
|
25971
|
+
{ seconds: 0, minute: 0, hour: 0, day: 0 },
|
|
25972
|
+
];
|
|
25973
|
+
case hdShared.EDeviceType.Touch:
|
|
25974
|
+
case hdShared.EDeviceType.Pro:
|
|
25975
|
+
return [
|
|
25976
|
+
{ seconds: 0, minute: 1, hour: 0, day: 0 },
|
|
25977
|
+
{ seconds: 0, minute: 2, hour: 0, day: 0 },
|
|
25978
|
+
{ seconds: 0, minute: 5, hour: 0, day: 0 },
|
|
25979
|
+
{ seconds: 0, minute: 10, hour: 0, day: 0 },
|
|
25980
|
+
{ seconds: 0, minute: 0, hour: 0, day: 0 },
|
|
25981
|
+
];
|
|
25982
|
+
default:
|
|
25983
|
+
return [];
|
|
25984
|
+
}
|
|
25985
|
+
};
|
|
25986
|
+
|
|
25824
25987
|
const getT1Data = () => ({
|
|
25825
25988
|
default: {
|
|
25826
25989
|
name: 'default',
|
|
@@ -27405,6 +27568,7 @@ class Device extends events.exports {
|
|
|
27405
27568
|
});
|
|
27406
27569
|
}
|
|
27407
27570
|
_runInner(fn, options) {
|
|
27571
|
+
var _a;
|
|
27408
27572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27409
27573
|
if (!this.isUsedHere() || this.commands.disposed) {
|
|
27410
27574
|
const env = DataManager.getSettings('env');
|
|
@@ -27447,14 +27611,10 @@ class Device extends events.exports {
|
|
|
27447
27611
|
this.runPromise.reject(e);
|
|
27448
27612
|
}
|
|
27449
27613
|
if (e instanceof hdShared.HardwareError &&
|
|
27450
|
-
(e.errorCode
|
|
27451
|
-
|
|
27452
|
-
|
|
27453
|
-
|
|
27454
|
-
e.errorCode === hdShared.HardwareErrorCode.ResponseUnexpectTypeError ||
|
|
27455
|
-
e.errorCode === hdShared.HardwareErrorCode.PinInvalid ||
|
|
27456
|
-
e.errorCode === hdShared.HardwareErrorCode.PinCancelled ||
|
|
27457
|
-
e.errorCode === hdShared.HardwareErrorCode.UnexpectPassphrase)) {
|
|
27614
|
+
hdShared.ERROR_CODES_REQUIRE_RELEASE.includes(e.errorCode)) {
|
|
27615
|
+
if (hdShared.ERROR_CODES_REQUIRE_DISCONNECT.includes(e.errorCode)) {
|
|
27616
|
+
yield ((_a = this.deviceConnector) === null || _a === void 0 ? void 0 : _a.disconnect(this.mainId));
|
|
27617
|
+
}
|
|
27458
27618
|
yield this.release();
|
|
27459
27619
|
Log$a.debug(`error code ${e.errorCode} release device, mainId: ${this.mainId}`);
|
|
27460
27620
|
}
|
|
@@ -28612,19 +28772,13 @@ class DeviceSettings extends BaseMethod {
|
|
|
28612
28772
|
{ name: 'passphraseAlwaysOnDevice', type: 'boolean' },
|
|
28613
28773
|
{ name: 'safetyChecks', type: 'number' },
|
|
28614
28774
|
{ name: 'experimentalFeatures', type: 'boolean' },
|
|
28775
|
+
{ name: 'autoShutdownDelayMs', type: 'number' },
|
|
28776
|
+
{ name: 'changeBrightness', type: 'boolean' },
|
|
28777
|
+
{ name: 'hapticFeedback', type: 'boolean' },
|
|
28615
28778
|
]);
|
|
28616
|
-
this.params = {
|
|
28617
|
-
|
|
28618
|
-
|
|
28619
|
-
use_passphrase: this.payload.usePassphrase,
|
|
28620
|
-
homescreen: this.payload.homescreen,
|
|
28621
|
-
_passphrase_source: this.payload.passphraseSource,
|
|
28622
|
-
auto_lock_delay_ms: this.payload.autoLockDelayMs,
|
|
28623
|
-
display_rotation: this.payload.displayRotation,
|
|
28624
|
-
passphrase_always_on_device: this.payload.passphraseAlwaysOnDevice,
|
|
28625
|
-
safety_checks: this.payload.safetyChecks,
|
|
28626
|
-
experimental_features: this.payload.experimentalFeatures,
|
|
28627
|
-
};
|
|
28779
|
+
this.params = Object.assign(Object.assign({ language: this.payload.language, label: this.payload.label, use_passphrase: this.payload.usePassphrase, homescreen: this.payload.homescreen, _passphrase_source: this.payload.passphraseSource, auto_lock_delay_ms: this.payload.autoLockDelayMs, display_rotation: this.payload.displayRotation, passphrase_always_on_device: this.payload.passphraseAlwaysOnDevice, safety_checks: this.payload.safetyChecks, experimental_features: this.payload.experimentalFeatures, auto_shutdown_delay_ms: this.payload.autoShutdownDelayMs }, (this.payload.changeBrightness
|
|
28780
|
+
? { change_brightness: this.payload.changeBrightness }
|
|
28781
|
+
: undefined)), { haptic_feedback: this.payload.hapticFeedback });
|
|
28628
28782
|
}
|
|
28629
28783
|
getVersionRange() {
|
|
28630
28784
|
if (this.payload.usePassphrase) {
|
|
@@ -34208,11 +34362,9 @@ class SolSignTransaction extends BaseMethod {
|
|
|
34208
34362
|
validateParams(batch, [
|
|
34209
34363
|
{ name: 'path', required: true },
|
|
34210
34364
|
{ name: 'rawTx', type: 'hexString', required: true },
|
|
34365
|
+
{ name: 'extraInfo', type: 'object' },
|
|
34211
34366
|
]);
|
|
34212
|
-
this.params.push({
|
|
34213
|
-
address_n: addressN,
|
|
34214
|
-
raw_tx: formatAnyHex(batch.rawTx),
|
|
34215
|
-
});
|
|
34367
|
+
this.params.push(Object.assign({ address_n: addressN, raw_tx: formatAnyHex(batch.rawTx) }, (batch.extraInfo ? { extra_info: batch.extraInfo } : undefined)));
|
|
34216
34368
|
});
|
|
34217
34369
|
}
|
|
34218
34370
|
getVersionRange() {
|
|
@@ -39634,6 +39786,18 @@ class DeviceConnector {
|
|
|
39634
39786
|
}
|
|
39635
39787
|
});
|
|
39636
39788
|
}
|
|
39789
|
+
disconnect(session) {
|
|
39790
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39791
|
+
try {
|
|
39792
|
+
if (this.transport.disconnect && !!session) {
|
|
39793
|
+
yield this.transport.disconnect(session);
|
|
39794
|
+
}
|
|
39795
|
+
}
|
|
39796
|
+
catch (error) {
|
|
39797
|
+
safeThrowError(error);
|
|
39798
|
+
}
|
|
39799
|
+
});
|
|
39800
|
+
}
|
|
39637
39801
|
promptDeviceAccess() {
|
|
39638
39802
|
if (!this.transport.promptDeviceAccess) {
|
|
39639
39803
|
return Promise.resolve(null);
|
|
@@ -40076,6 +40240,10 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
|
|
|
40076
40240
|
messageResponse = createResponseMessage(method.responseID, false, { error });
|
|
40077
40241
|
requestQueue.resolveRequest(method.responseID, messageResponse);
|
|
40078
40242
|
completeMethodRequestContext(method, error);
|
|
40243
|
+
if (error instanceof hdShared.HardwareError &&
|
|
40244
|
+
hdShared.ERROR_CODES_REQUIRE_RELEASE.includes(error.errorCode)) {
|
|
40245
|
+
throw error;
|
|
40246
|
+
}
|
|
40079
40247
|
}
|
|
40080
40248
|
});
|
|
40081
40249
|
Log.debug('Call API - Device Run: ', device.mainId);
|
|
@@ -40726,6 +40894,8 @@ exports.formatRequestContext = formatRequestContext;
|
|
|
40726
40894
|
exports.generateInstanceId = generateInstanceId;
|
|
40727
40895
|
exports.generateSdkInstanceId = generateSdkInstanceId;
|
|
40728
40896
|
exports.getActiveRequestsByDeviceInstance = getActiveRequestsByDeviceInstance;
|
|
40897
|
+
exports.getAutoLockOptions = getAutoLockOptions;
|
|
40898
|
+
exports.getAutoShutDownOptions = getAutoShutDownOptions;
|
|
40729
40899
|
exports.getDeviceBLEFirmwareVersion = getDeviceBLEFirmwareVersion;
|
|
40730
40900
|
exports.getDeviceBleName = getDeviceBleName;
|
|
40731
40901
|
exports.getDeviceBoardloaderVersion = getDeviceBoardloaderVersion;
|
|
@@ -40743,6 +40913,7 @@ exports.getHDPath = getHDPath;
|
|
|
40743
40913
|
exports.getHomeScreenDefaultList = getHomeScreenDefaultList;
|
|
40744
40914
|
exports.getHomeScreenHex = getHomeScreenHex;
|
|
40745
40915
|
exports.getHomeScreenSize = getHomeScreenSize;
|
|
40916
|
+
exports.getLanguageConfig = getLanguageConfig;
|
|
40746
40917
|
exports.getLog = getLog;
|
|
40747
40918
|
exports.getLogger = getLogger;
|
|
40748
40919
|
exports.getMethodVersionRange = getMethodVersionRange;
|
|
@@ -11,6 +11,9 @@ export type DeviceSettingsParams = {
|
|
|
11
11
|
passphraseAlwaysOnDevice?: boolean;
|
|
12
12
|
safetyChecks?: SafetyCheckLevel;
|
|
13
13
|
experimentalFeatures?: boolean;
|
|
14
|
+
autoShutdownDelayMs?: number;
|
|
15
|
+
changeBrightness?: boolean;
|
|
16
|
+
hapticFeedback?: boolean;
|
|
14
17
|
};
|
|
15
18
|
export declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success>;
|
|
16
19
|
//# sourceMappingURL=deviceSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceSettings.d.ts","sourceRoot":"","sources":["../../../src/types/api/deviceSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"deviceSettings.d.ts","sourceRoot":"","sources":["../../../src/types/api/deviceSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,oBAAoB,GAC1C,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaSignedTx as HardwareSolanaSignedTx } from '@onekeyfe/hd-transport';
|
|
1
|
+
import type { SolanaSignedTx as HardwareSolanaSignedTx, SolanaTxExtraInfo } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
export type SolanaSignedTx = {
|
|
4
4
|
path: string;
|
|
@@ -6,6 +6,7 @@ export type SolanaSignedTx = {
|
|
|
6
6
|
export type SolanaSignTransactionParams = {
|
|
7
7
|
path: string | number[];
|
|
8
8
|
rawTx?: string;
|
|
9
|
+
extraInfo?: SolanaTxExtraInfo;
|
|
9
10
|
};
|
|
10
11
|
export declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & SolanaSignTransactionParams): Response<SolanaSignedTx>;
|
|
11
12
|
export declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/solSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"solSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/solSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,IAAI,sBAAsB,EACxC,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,sBAAsB,CAAC;AAE3B,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,2BAA2B,GACjD,QAAQ,CAAC,cAAc,CAAC,CAAC;AAE5B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,2BAA2B,EAAE,CAAA;CAAE,GAChE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IDeviceType } from '../types';
|
|
2
|
+
export declare const LANGUAGE_LABELS: {
|
|
3
|
+
readonly en: "English";
|
|
4
|
+
readonly zh_cn: "简体中文";
|
|
5
|
+
readonly zh_hk: "繁體中文";
|
|
6
|
+
readonly ja: "日本語";
|
|
7
|
+
readonly ko: "한국어";
|
|
8
|
+
readonly fr: "Français";
|
|
9
|
+
readonly de: "Deutsch";
|
|
10
|
+
readonly ru: "Russian";
|
|
11
|
+
readonly es: "Spanish";
|
|
12
|
+
readonly it: "Italiano";
|
|
13
|
+
readonly pt_br: "Portuguese (Brazil)";
|
|
14
|
+
};
|
|
15
|
+
export type LanguageKey = keyof typeof LANGUAGE_LABELS;
|
|
16
|
+
export type LanguageOption = {
|
|
17
|
+
code: LanguageKey;
|
|
18
|
+
label: (typeof LANGUAGE_LABELS)[LanguageKey];
|
|
19
|
+
};
|
|
20
|
+
export declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
|
|
21
|
+
export type DurationParts = {
|
|
22
|
+
seconds: number;
|
|
23
|
+
minute: number;
|
|
24
|
+
hour: number;
|
|
25
|
+
day: number;
|
|
26
|
+
};
|
|
27
|
+
export declare const getAutoLockOptions: (_deviceType: IDeviceType) => DurationParts[];
|
|
28
|
+
export declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
|
|
29
|
+
//# sourceMappingURL=deviceSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceSettings.d.ts","sourceRoot":"","sources":["../../src/utils/deviceSettings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,eAAe;;;;;;;;;;;;CAYlB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,eAAe,CAAC;AACvD,MAAM,MAAM,cAAc,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAEjG,eAAO,MAAM,iBAAiB,eAAgB,WAAW,KAAG,OAAO,MAAM,EAAE,MAAM,CAAC,EAuBjF,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,kBAAkB,gBAAiB,WAAW,KAAG,aAAa,EA2B1E,CAAC;AAEF,eAAO,MAAM,sBAAsB,gBAAiB,WAAW,KAAG,aAAa,EA0B9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homescreen.d.ts","sourceRoot":"","sources":["../../src/utils/homescreen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"homescreen.d.ts","sourceRoot":"","sources":["../../src/utils/homescreen.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtD,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,SAAS,QAAO,OAAO,MAAM,EAAE,WAAW,CAqNrD,CAAC;AAEH,eAAO,MAAM,YAAY,QAAO,OAAO,MAAM,EAAE,WAAW,CAKxD,CAAC;AACH,eAAO,MAAM,UAAU,QAAO,OAAO,MAAM,EAAE,WAAW,CAQtD,CAAC;AAEH,eAAO,MAAM,gBAAgB,eAAgB,WAAW,QAAQ,MAAM,WAoBrE,CAAC;AAEF,eAAO,MAAM,wBAAwB,aAAc,QAAQ,aAgC1D,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB;gBAKhB,WAAW;oBACP,WAAW,GAAG,KAAK;;4BAmCpC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { getDeviceTypeByBleName, getDeviceType, getDeviceBleName, getDeviceUUID,
|
|
|
7
7
|
export { getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceBLEFirmwareVersion, } from './deviceVersionUtils';
|
|
8
8
|
export { getFirmwareUpdateField, supportInputPinOnSoftware, getFirmwareUpdateFieldArray, } from './deviceFeaturesUtils';
|
|
9
9
|
export { checkNeedUpdateBootForTouch, checkNeedUpdateBootForClassicAndMini, } from '../api/firmware/updateBootloader';
|
|
10
|
+
export { getLanguageConfig, getAutoLockOptions, getAutoShutDownOptions } from './deviceSettings';
|
|
10
11
|
export { getHDPath, getScriptType, getOutputScriptType } from '../api/helpers/pathUtils';
|
|
11
12
|
export declare const isBleConnect: (env: string) => boolean;
|
|
12
13
|
export { getHomeScreenHex, getHomeScreenDefaultList, getHomeScreenSize } from './homescreen';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC3F,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC3F,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAE1B,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAIjG,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,eAAO,MAAM,YAAY,QAAS,MAAM,YAAiD,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7F,eAAO,MAAM,IAAI,OAAQ,MAAM,qBAG3B,CAAC"}
|