@onekeyfe/hd-core 1.0.39-alpha.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,11 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
9
9
  min: string;
10
10
  };
11
11
  };
12
+ getAddressTypeVersionRange(): {
13
+ pro: {
14
+ min: string;
15
+ };
16
+ };
12
17
  run(): Promise<import("packages/hd-transport/dist").CardanoMessageSignature>;
13
18
  }
14
19
  //# sourceMappingURL=CardanoSignMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;IAyBJ,eAAe;;;;;IAQT,GAAG;CASV"}
1
+ {"version":3,"file":"CardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/cardano/CardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,IAAI;IA2BJ,eAAe;;;;;IAQf,0BAA0B;;;;;IAQpB,GAAG;CAcV"}
@@ -12,6 +12,8 @@ export default class TronSignTransaction extends BaseMethod<TronSignTx> {
12
12
  };
13
13
  getFixDataTypeVersionRange(): DeviceFirmwareRange;
14
14
  checkFixDataTypeSupportVoteWitnessError(): void;
15
+ supportDelegateResourceLockPeriodVersionRange(): DeviceFirmwareRange;
16
+ checkSupportDelegateContractLockPeriod(): void;
15
17
  run(): Promise<import("@onekeyfe/hd-transport").TronSignedTx>;
16
18
  }
17
19
  //# sourceMappingURL=TronSignTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TronSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/tron/TronSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,UAAU,CAAC;IACrE,OAAO,CAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,UAAU;IA4G7D,IAAI;IAyBJ,eAAe;;;;;IAQf,0BAA0B,IAAI,mBAAmB;IAWjD,uCAAuC;IASjC,GAAG;CASV"}
1
+ {"version":3,"file":"TronSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/tron/TronSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,UAAU,CAAC;IACrE,OAAO,CAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,UAAU;IA6G7D,IAAI;IAyBJ,eAAe;;;;;IAQf,0BAA0B,IAAI,mBAAmB;IAWjD,uCAAuC;IASvC,6CAA6C,IAAI,mBAAmB;IAQpE,sCAAsC;IAWhC,GAAG;CAUV"}
@@ -11,6 +11,7 @@ export declare const UI_REQUEST: {
11
11
  readonly REQUEST_PASSPHRASE_ON_DEVICE: "ui-request_passphrase_on_device";
12
12
  readonly REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-request_select_device_in_bootloader_for_web_device";
13
13
  readonly CLOSE_UI_WINDOW: "ui-close_window";
14
+ readonly CLOSE_UI_PIN_WINDOW: "ui-close_pin_window";
14
15
  readonly DEVICE_PROGRESS: "ui-device_progress";
15
16
  readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission";
16
17
  readonly BLUETOOTH_UNSUPPORTED: "ui-bluetooth_unsupported";
@@ -35,7 +36,7 @@ export declare const UI_REQUEST: {
35
36
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
36
37
  };
37
38
  export interface UiRequestWithoutPayload {
38
- type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION;
39
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION;
39
40
  payload?: typeof undefined;
40
41
  }
41
42
  export interface UiRequestFirmwareProgressing {
@@ -1 +1 @@
1
- {"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/events/ui-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCb,CAAC;AAEX,MAAM,WAAW,uBAAuB;IACtC,IAAI,EACA,OAAO,UAAU,CAAC,eAAe,GACjC,OAAO,UAAU,CAAC,oBAAoB,GACtC,OAAO,UAAU,CAAC,qBAAqB,GACvC,OAAO,UAAU,CAAC,qBAAqB,GACvC,OAAO,UAAU,CAAC,8CAA8C,GAChE,OAAO,UAAU,CAAC,mBAAmB,GACrC,OAAO,UAAU,CAAC,2BAA2B,GAC7C,OAAO,UAAU,CAAC,mBAAmB,GACrC,OAAO,UAAU,CAAC,mCAAmC,CAAC;IAC1D,OAAO,CAAC,EAAE,OAAO,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,OAAO,UAAU,CAAC,mBAAmB,CAAC;IAC5C,OAAO,EAAE;QACP,IAAI,EAAE,UAAU,GAAG,KAAK,GAAG,YAAY,GAAG,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jD,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,gCAAgC,qCAAqC;IAErE,+BAA+B,oCAAoC;IACnE,uBAAuB,4BAA4B;IACnD,0BAA0B,+BAA+B;IACzD,uCAAuC,4CAA4C;IAEnF,sBAAsB,2BAA2B;IACjD,qBAAqB,0BAA0B;IAC/C,oCAAoC,yCAAyC;IAC7E,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,kBAAkB,uBAAuB;IACzC,gBAAgB,qBAAqB;IACrC,uBAAuB,4BAA4B;IACnD,iBAAiB,sBAAsB;IACvC,wBAAwB,6BAA6B;IACrD,gBAAgB,qBAAqB;IACrC,uBAAuB,4BAA4B;CACpD;AAED,MAAM,MAAM,yBAAyB,GAAG,GAAG,wBAAwB,EAAE,CAAC;AAEtE,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG;IAAE,KAAK,EAAE,OAAO,QAAQ,CAAA;CAAE,CAAC;AAElE,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,OAAO,QAAQ,EAAE,OAAO,CAK5D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import EventEmitter$1, { EventEmitter } from 'events';
2
2
  import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
3
  import { Messages, LowlevelTransportSharedPlugin, Success as Success$1, RecoveryDeviceType, SafetyCheckLevel, ResourceType, Features as Features$1, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, OneKeyDeviceInfo, Transport, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
4
4
  export { Messages as PROTO } from '@onekeyfe/hd-transport';
5
- import { EDeviceType, Deferred } from '@onekeyfe/hd-shared';
5
+ import { EDeviceType, Deferred, EFirmwareType } from '@onekeyfe/hd-shared';
6
6
 
7
7
  interface CommonParams {
8
8
  keepSession?: boolean;
@@ -1325,6 +1325,7 @@ type TronDelegateResourceContract = {
1325
1325
  balance?: number;
1326
1326
  receiverAddress?: string;
1327
1327
  lock?: boolean;
1328
+ lockPeriod?: number;
1328
1329
  };
1329
1330
  type TronUnDelegateResourceContract = {
1330
1331
  resource?: TronResourceCode;
@@ -1688,6 +1689,7 @@ type CardanoSignMessageMethodParams = {
1688
1689
  message: string;
1689
1690
  derivationType: number;
1690
1691
  networkId: number;
1692
+ addressType?: Messages.CardanoAddressType;
1691
1693
  };
1692
1694
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
1693
1695
 
@@ -2474,6 +2476,7 @@ declare const UI_REQUEST: {
2474
2476
  readonly REQUEST_PASSPHRASE_ON_DEVICE: "ui-request_passphrase_on_device";
2475
2477
  readonly REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-request_select_device_in_bootloader_for_web_device";
2476
2478
  readonly CLOSE_UI_WINDOW: "ui-close_window";
2479
+ readonly CLOSE_UI_PIN_WINDOW: "ui-close_pin_window";
2477
2480
  readonly DEVICE_PROGRESS: "ui-device_progress";
2478
2481
  readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission";
2479
2482
  readonly BLUETOOTH_UNSUPPORTED: "ui-bluetooth_unsupported";
@@ -2498,7 +2501,7 @@ declare const UI_REQUEST: {
2498
2501
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
2499
2502
  };
2500
2503
  interface UiRequestWithoutPayload {
2501
- type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION;
2504
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION;
2502
2505
  payload?: typeof undefined;
2503
2506
  }
2504
2507
  interface UiRequestFirmwareProgressing {
@@ -3080,6 +3083,7 @@ declare const getDeviceBleName: (features?: Features) => string | null;
3080
3083
  declare const getDeviceUUID: (features: Features) => string;
3081
3084
  declare const getDeviceLabel: (features?: Features) => string | null;
3082
3085
  declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3086
+ declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3083
3087
 
3084
3088
  declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3085
3089
  declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
@@ -3178,4 +3182,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
3178
3182
  declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3179
3183
  declare const HardwareTopLevelSdk: () => CoreApi;
3180
3184
 
3181
- export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, OnekeyFeatures, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLog, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
3185
+ export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, OnekeyFeatures, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLog, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
package/dist/index.js CHANGED
@@ -6,11 +6,11 @@ var semver = require('semver');
6
6
  var hdShared = require('@onekeyfe/hd-shared');
7
7
  var axios = require('axios');
8
8
  var lodash = require('lodash');
9
+ var hdTransport = require('@onekeyfe/hd-transport');
9
10
  var ByteBuffer = require('bytebuffer');
10
11
  var BigNumber = require('bignumber.js');
11
12
  var utils = require('@noble/hashes/utils');
12
13
  var blake2s = require('@noble/hashes/blake2s');
13
- var hdTransport = require('@onekeyfe/hd-transport');
14
14
  var sha256 = require('@noble/hashes/sha256');
15
15
  var JSZip = require('jszip');
16
16
  var sha3 = require('@noble/hashes/sha3');
@@ -1032,6 +1032,8 @@ const DeviceTypeToModels = {
1032
1032
  [hdShared.EDeviceType.Unknown]: [],
1033
1033
  };
1034
1034
 
1035
+ const existCapability = (features, capability) => { var _a; return (_a = features === null || features === void 0 ? void 0 : features.capabilities) === null || _a === void 0 ? void 0 : _a.includes(capability); };
1036
+
1035
1037
  const getDeviceType = (features) => {
1036
1038
  if (!features || typeof features !== 'object') {
1037
1039
  return hdShared.EDeviceType.Unknown;
@@ -1138,6 +1140,19 @@ const getMethodVersionRange = (features, getVersionRange) => {
1138
1140
  }
1139
1141
  return versionRange;
1140
1142
  };
1143
+ const getFirmwareType = (features) => {
1144
+ var _a;
1145
+ if (!features) {
1146
+ return hdShared.EFirmwareType.Universal;
1147
+ }
1148
+ if (features.fw_vendor === 'OneKey Bitcoin-only') {
1149
+ return hdShared.EFirmwareType.BitcoinOnly;
1150
+ }
1151
+ return ((_a = features === null || features === void 0 ? void 0 : features.capabilities) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
1152
+ !existCapability(features, hdTransport.Enum_Capability.Capability_Bitcoin_like)
1153
+ ? hdShared.EFirmwareType.BitcoinOnly
1154
+ : hdShared.EFirmwareType.Universal;
1155
+ };
1141
1156
 
1142
1157
  const getDeviceFirmwareVersion = (features) => {
1143
1158
  var _a, _b;
@@ -12859,6 +12874,10 @@ var nested$1 = {
12859
12874
  lock: {
12860
12875
  type: "bool",
12861
12876
  id: 5
12877
+ },
12878
+ lock_period: {
12879
+ type: "uint64",
12880
+ id: 6
12862
12881
  }
12863
12882
  }
12864
12883
  },
@@ -25716,6 +25735,7 @@ const UI_REQUEST = {
25716
25735
  REQUEST_PASSPHRASE_ON_DEVICE: 'ui-request_passphrase_on_device',
25717
25736
  REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: 'ui-request_select_device_in_bootloader_for_web_device',
25718
25737
  CLOSE_UI_WINDOW: 'ui-close_window',
25738
+ CLOSE_UI_PIN_WINDOW: 'ui-close_pin_window',
25719
25739
  DEVICE_PROGRESS: 'ui-device_progress',
25720
25740
  BLUETOOTH_PERMISSION: 'ui-bluetooth_permission',
25721
25741
  BLUETOOTH_UNSUPPORTED: 'ui-bluetooth_unsupported',
@@ -33459,6 +33479,7 @@ class TronSignTransaction extends BaseMethod {
33459
33479
  balance: tx.contract.delegateResourceContract.balance,
33460
33480
  receiver_address: tx.contract.delegateResourceContract.receiverAddress,
33461
33481
  lock: tx.contract.delegateResourceContract.lock,
33482
+ lock_period: tx.contract.delegateResourceContract.lockPeriod,
33462
33483
  },
33463
33484
  };
33464
33485
  }
@@ -33542,9 +33563,23 @@ class TronSignTransaction extends BaseMethod {
33542
33563
  const { cancel_all_unfreeze_v2_contract, vote_witness_contract } = this.params.contract;
33543
33564
  this.checkFeatureVersionLimit(() => !lodash.isEmpty(data) || !!cancel_all_unfreeze_v2_contract || !!vote_witness_contract, () => this.getFixDataTypeVersionRange());
33544
33565
  }
33566
+ supportDelegateResourceLockPeriodVersionRange() {
33567
+ return {
33568
+ pro: {
33569
+ min: '4.15.0',
33570
+ },
33571
+ };
33572
+ }
33573
+ checkSupportDelegateContractLockPeriod() {
33574
+ const { delegate_resource_contract } = this.params.contract;
33575
+ this.checkFeatureVersionLimit(() => !!delegate_resource_contract &&
33576
+ delegate_resource_contract.lock_period !== undefined &&
33577
+ delegate_resource_contract.lock_period !== null, () => this.supportDelegateResourceLockPeriodVersionRange());
33578
+ }
33545
33579
  run() {
33546
33580
  return __awaiter(this, void 0, void 0, function* () {
33547
33581
  this.checkFixDataTypeSupportVoteWitnessError();
33582
+ this.checkSupportDelegateContractLockPeriod();
33548
33583
  const response = yield this.device.commands.typedCall('TronSignTx', 'TronSignedTx', Object.assign({}, this.params));
33549
33584
  return Promise.resolve(response.message);
33550
33585
  });
@@ -35556,6 +35591,7 @@ class CardanoSignMessage extends BaseMethod {
35556
35591
  { name: 'message', type: 'string', required: true },
35557
35592
  { name: 'derivationType', type: 'number' },
35558
35593
  { name: 'networkId', type: 'number', required: true },
35594
+ { name: 'addressType', type: 'number' },
35559
35595
  ]);
35560
35596
  const addressN = validatePath(payload.path, 3);
35561
35597
  this.params = {
@@ -35565,6 +35601,7 @@ class CardanoSignMessage extends BaseMethod {
35565
35601
  ? payload.derivationType
35566
35602
  : hdTransport.Messages.CardanoDerivationType.ICARUS,
35567
35603
  network_id: payload.networkId,
35604
+ address_type: payload.addressType,
35568
35605
  };
35569
35606
  }
35570
35607
  getVersionRange() {
@@ -35574,8 +35611,16 @@ class CardanoSignMessage extends BaseMethod {
35574
35611
  },
35575
35612
  };
35576
35613
  }
35614
+ getAddressTypeVersionRange() {
35615
+ return {
35616
+ pro: {
35617
+ min: '4.9.3',
35618
+ },
35619
+ };
35620
+ }
35577
35621
  run() {
35578
35622
  return __awaiter(this, void 0, void 0, function* () {
35623
+ this.checkFeatureVersionLimit(() => this.params.address_type !== null && this.params.address_type !== undefined, () => this.getAddressTypeVersionRange());
35579
35624
  const res = yield this.device.commands.typedCall('CardanoSignMessage', 'CardanoMessageSignature', this.params);
35580
35625
  return res.message;
35581
35626
  });
@@ -38573,7 +38618,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
38573
38618
  DevicePool.clearDeviceCache(method.payload.connectId);
38574
38619
  return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckPassphraseStateError));
38575
38620
  }
38576
- postMessage(createUiMessage(UI_REQUEST.CLOSE_UI_WINDOW));
38621
+ postMessage(createUiMessage(UI_REQUEST.CLOSE_UI_PIN_WINDOW));
38577
38622
  }
38578
38623
  try {
38579
38624
  yield method.checkSafetyLevelOnTestNet();
@@ -39185,6 +39230,7 @@ exports.getDeviceType = getDeviceType;
39185
39230
  exports.getDeviceTypeByBleName = getDeviceTypeByBleName;
39186
39231
  exports.getDeviceUUID = getDeviceUUID;
39187
39232
  exports.getEnv = getEnv;
39233
+ exports.getFirmwareType = getFirmwareType;
39188
39234
  exports.getFirmwareUpdateField = getFirmwareUpdateField;
39189
39235
  exports.getFirmwareUpdateFieldArray = getFirmwareUpdateFieldArray;
39190
39236
  exports.getHDPath = getHDPath;
@@ -1,16 +1,19 @@
1
1
  import type { CardanoMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
+ import { PROTO } from '../../constants';
3
4
  export type CardanoSignMessageParams = {
4
5
  address_n: number[];
5
6
  message: string;
6
7
  derivation_type: number;
7
8
  network_id: number;
9
+ address_type: number;
8
10
  };
9
11
  export type CardanoSignMessageMethodParams = {
10
12
  path: string;
11
13
  message: string;
12
14
  derivationType: number;
13
15
  networkId: number;
16
+ addressType?: PROTO.CardanoAddressType;
14
17
  };
15
18
  export declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
16
19
  //# sourceMappingURL=cardanoSignMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cardanoSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/cardanoSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,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AAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,8BAA8B,GACpD,QAAQ,CAAC,uBAAuB,CAAC,CAAC"}
@@ -24,6 +24,7 @@ export type TronDelegateResourceContract = {
24
24
  balance?: number;
25
25
  receiverAddress?: string;
26
26
  lock?: boolean;
27
+ lockPeriod?: number;
27
28
  };
28
29
  export type TronUnDelegateResourceContract = {
29
30
  resource?: TronResourceCode;
@@ -1 +1 @@
1
- {"version":3,"file":"tronSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/tronSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,OAA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AM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,uBAAuB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,yBAAyB,GAC/C,QAAQ,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Enum_Capability } from '@onekeyfe/hd-transport';
2
+ import { Features } from '../types/device';
3
+ export declare const existCapability: (features: Features, capability: Enum_Capability) => boolean;
4
+ export declare const requireCapability: (features: Features, capability: Enum_Capability) => void;
5
+ //# sourceMappingURL=capabilitieUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilitieUtils.d.ts","sourceRoot":"","sources":["../../src/utils/capabilitieUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,eAAO,MAAM,eAAe,aAAc,QAAQ,cAAc,eAAe,YAEjC,CAAC;AAE/C,eAAO,MAAM,iBAAiB,aAAc,QAAQ,cAAc,eAAe,SAIhF,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { EFirmwareType } from '@onekeyfe/hd-shared';
1
2
  import type { Features, IDeviceModel, IDeviceType, IVersionRange } from '../types';
2
3
  export declare const getDeviceType: (features?: Features) => IDeviceType;
3
4
  export declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
@@ -5,4 +6,5 @@ export declare const getDeviceBleName: (features?: Features) => string | null;
5
6
  export declare const getDeviceUUID: (features: Features) => string;
6
7
  export declare const getDeviceLabel: (features?: Features) => string | null;
7
8
  export declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
9
+ export declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
8
10
  //# sourceMappingURL=deviceInfoUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceInfoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceInfoUtils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKnF,eAAO,MAAM,aAAa,cAAe,QAAQ,KAAG,WAiDnD,CAAC;AAMF,eAAO,MAAM,sBAAsB,UAAW,MAAM,KAAG,WAYtD,CAAC;AAMF,eAAO,MAAM,gBAAgB,cAAe,QAAQ,KAAG,MAAM,GAAG,IAG/D,CAAC;AAKF,eAAO,MAAM,aAAa,aAAc,QAAQ,WAG/C,CAAC;AAKF,eAAO,MAAM,cAAc,cAAe,QAAQ,kBAkBjD,CAAC;AAMF,eAAO,MAAM,qBAAqB,aACtB,QAAQ,GAAG,SAAS,iCACC,WAAW,GAAG,YAAY,KAAK,aAAa,GAAG,SAAS,KACtF,aAAa,GAAG,SAwBlB,CAAC"}
1
+ {"version":3,"file":"deviceInfoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceInfoUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIjE,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMnF,eAAO,MAAM,aAAa,cAAe,QAAQ,KAAG,WAiDnD,CAAC;AAMF,eAAO,MAAM,sBAAsB,UAAW,MAAM,KAAG,WAYtD,CAAC;AAMF,eAAO,MAAM,gBAAgB,cAAe,QAAQ,KAAG,MAAM,GAAG,IAG/D,CAAC;AAKF,eAAO,MAAM,aAAa,aAAc,QAAQ,WAG/C,CAAC;AAKF,eAAO,MAAM,cAAc,cAAe,QAAQ,kBAkBjD,CAAC;AAMF,eAAO,MAAM,qBAAqB,aACtB,QAAQ,GAAG,SAAS,iCACC,WAAW,GAAG,YAAY,KAAK,aAAa,GAAG,SAAS,KACtF,aAAa,GAAG,SAwBlB,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,QAAQ,GAAG,SAAS,kBAY7D,CAAC"}
@@ -2,7 +2,7 @@ export { getLogger, enableLog, LoggerNames, getLog, setLoggerPostMessage } from
2
2
  export * from './assets';
3
3
  export * from './versionUtils';
4
4
  export * from './patch';
5
- export { getDeviceTypeByBleName, getDeviceType, getDeviceBleName, getDeviceUUID, getDeviceLabel, getMethodVersionRange, } from './deviceInfoUtils';
5
+ export { getDeviceTypeByBleName, getDeviceType, getDeviceBleName, getDeviceUUID, getDeviceLabel, getMethodVersionRange, getFirmwareType, } from './deviceInfoUtils';
6
6
  export { getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceBLEFirmwareVersion, } from './deviceVersionUtils';
7
7
  export { getFirmwareUpdateField, supportInputPinOnSoftware, getFirmwareUpdateFieldArray, } from './deviceFeaturesUtils';
8
8
  export { checkNeedUpdateBootForTouch, checkNeedUpdateBootForClassicAndMini, } from '../api/firmware/updateBootloader';
@@ -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,g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O,EACL,2BAA2B,EAC3B,oCAAoC,GACrC,MAAM,kCAAkC,CAAC;AAI1C,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "1.0.39-alpha.8",
3
+ "version": "1.1.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "^1.0.39-alpha.8",
29
- "@onekeyfe/hd-transport": "^1.0.39-alpha.8",
28
+ "@onekeyfe/hd-shared": "^1.1.0",
29
+ "@onekeyfe/hd-transport": "^1.1.0",
30
30
  "axios": "^0.27.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -46,5 +46,5 @@
46
46
  "@types/web-bluetooth": "^0.0.21",
47
47
  "ripple-keypairs": "^1.1.4"
48
48
  },
49
- "gitHead": "ac900fb1eccd3b16adb85d4aa21fbfd9a3f803eb"
49
+ "gitHead": "13b454441ba366f8fbf7fb7cddc5e4539fb43bf1"
50
50
  }
@@ -20,6 +20,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
20
20
  { name: 'message', type: 'string', required: true },
21
21
  { name: 'derivationType', type: 'number' },
22
22
  { name: 'networkId', type: 'number', required: true },
23
+ { name: 'addressType', type: 'number' },
23
24
  ]);
24
25
 
25
26
  const addressN = validatePath(payload.path, 3);
@@ -32,6 +33,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
32
33
  ? payload.derivationType
33
34
  : PROTO.CardanoDerivationType.ICARUS,
34
35
  network_id: payload.networkId,
36
+ address_type: payload.addressType,
35
37
  };
36
38
  }
37
39
 
@@ -43,7 +45,20 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
43
45
  };
44
46
  }
45
47
 
48
+ getAddressTypeVersionRange() {
49
+ return {
50
+ pro: {
51
+ min: '4.9.3',
52
+ },
53
+ };
54
+ }
55
+
46
56
  async run() {
57
+ this.checkFeatureVersionLimit(
58
+ () => this.params.address_type !== null && this.params.address_type !== undefined,
59
+ () => this.getAddressTypeVersionRange()
60
+ );
61
+
47
62
  const res = await this.device.commands.typedCall(
48
63
  'CardanoSignMessage',
49
64
  'CardanoMessageSignature',
@@ -67,6 +67,7 @@ export default class TronSignTransaction extends BaseMethod<TronSignTx> {
67
67
  balance: tx.contract.delegateResourceContract.balance,
68
68
  receiver_address: tx.contract.delegateResourceContract.receiverAddress,
69
69
  lock: tx.contract.delegateResourceContract.lock,
70
+ lock_period: tx.contract.delegateResourceContract.lockPeriod,
70
71
  },
71
72
  };
72
73
  }
@@ -170,8 +171,28 @@ export default class TronSignTransaction extends BaseMethod<TronSignTx> {
170
171
  );
171
172
  }
172
173
 
174
+ supportDelegateResourceLockPeriodVersionRange(): DeviceFirmwareRange {
175
+ return {
176
+ pro: {
177
+ min: '4.15.0',
178
+ },
179
+ };
180
+ }
181
+
182
+ checkSupportDelegateContractLockPeriod() {
183
+ const { delegate_resource_contract } = this.params.contract;
184
+ this.checkFeatureVersionLimit(
185
+ () =>
186
+ !!delegate_resource_contract &&
187
+ delegate_resource_contract.lock_period !== undefined &&
188
+ delegate_resource_contract.lock_period !== null,
189
+ () => this.supportDelegateResourceLockPeriodVersionRange()
190
+ );
191
+ }
192
+
173
193
  async run() {
174
194
  this.checkFixDataTypeSupportVoteWitnessError();
195
+ this.checkSupportDelegateContractLockPeriod();
175
196
 
176
197
  const response = await this.device.commands.typedCall('TronSignTx', 'TronSignedTx', {
177
198
  ...this.params,
package/src/core/index.ts CHANGED
@@ -358,7 +358,7 @@ const onCallDevice = async (
358
358
  }
359
359
 
360
360
  // close pin popup window
361
- postMessage(createUiMessage(UI_REQUEST.CLOSE_UI_WINDOW));
361
+ postMessage(createUiMessage(UI_REQUEST.CLOSE_UI_PIN_WINDOW));
362
362
  }
363
363
 
364
364
  // Automatic check safety_check level for Kovan, Ropsten, Rinkeby, Goerli test networks.
@@ -11509,6 +11509,10 @@
11509
11509
  "lock": {
11510
11510
  "type": "bool",
11511
11511
  "id": 5
11512
+ },
11513
+ "lock_period": {
11514
+ "type": "uint64",
11515
+ "id": 6
11512
11516
  }
11513
11517
  }
11514
11518
  },
@@ -15,6 +15,7 @@ export const UI_REQUEST = {
15
15
  'ui-request_select_device_in_bootloader_for_web_device',
16
16
 
17
17
  CLOSE_UI_WINDOW: 'ui-close_window',
18
+ CLOSE_UI_PIN_WINDOW: 'ui-close_pin_window',
18
19
  DEVICE_PROGRESS: 'ui-device_progress',
19
20
 
20
21
  BLUETOOTH_PERMISSION: 'ui-bluetooth_permission',
@@ -49,6 +50,7 @@ export const UI_REQUEST = {
49
50
  export interface UiRequestWithoutPayload {
50
51
  type:
51
52
  | typeof UI_REQUEST.CLOSE_UI_WINDOW
53
+ | typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW
52
54
  | typeof UI_REQUEST.BLUETOOTH_PERMISSION
53
55
  | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED
54
56
  | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF
@@ -1,11 +1,13 @@
1
1
  import type { CardanoMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
+ import { PROTO } from '../../constants';
3
4
 
4
5
  export type CardanoSignMessageParams = {
5
6
  address_n: number[];
6
7
  message: string;
7
8
  derivation_type: number;
8
9
  network_id: number;
10
+ address_type: number;
9
11
  };
10
12
 
11
13
  export type CardanoSignMessageMethodParams = {
@@ -13,6 +15,7 @@ export type CardanoSignMessageMethodParams = {
13
15
  message: string;
14
16
  derivationType: number;
15
17
  networkId: number;
18
+ addressType?: PROTO.CardanoAddressType;
16
19
  };
17
20
 
18
21
  export declare function cardanoSignMessage(
@@ -29,6 +29,7 @@ export type TronDelegateResourceContract = {
29
29
  balance?: number;
30
30
  receiverAddress?: string;
31
31
  lock?: boolean;
32
+ lockPeriod?: number;
32
33
  };
33
34
 
34
35
  export type TronUnDelegateResourceContract = {
@@ -0,0 +1,12 @@
1
+ import { Enum_Capability } from '@onekeyfe/hd-transport';
2
+ import { Features } from '../types/device';
3
+
4
+ export const existCapability = (features: Features, capability: Enum_Capability) =>
5
+ // @ts-expect-error
6
+ features?.capabilities?.includes(capability);
7
+
8
+ export const requireCapability = (features: Features, capability: Enum_Capability) => {
9
+ if (!existCapability(features, capability)) {
10
+ throw new Error(`Capability ${capability} is required`);
11
+ }
12
+ };
@@ -1,8 +1,10 @@
1
1
  import { isEmpty } from 'lodash';
2
- import { EDeviceType } from '@onekeyfe/hd-shared';
2
+ import { EDeviceType, EFirmwareType } from '@onekeyfe/hd-shared';
3
+ import { Enum_Capability } from '@onekeyfe/hd-transport';
3
4
  import { DeviceModelToTypes } from '../types';
4
5
 
5
6
  import type { Features, IDeviceModel, IDeviceType, IVersionRange } from '../types';
7
+ import { existCapability } from './capabilitieUtils';
6
8
 
7
9
  /**
8
10
  * get device type by features
@@ -148,3 +150,17 @@ export const getMethodVersionRange = (
148
150
 
149
151
  return versionRange;
150
152
  };
153
+
154
+ export const getFirmwareType = (features: Features | undefined) => {
155
+ if (!features) {
156
+ return EFirmwareType.Universal;
157
+ }
158
+ if (features.fw_vendor === 'OneKey Bitcoin-only') {
159
+ return EFirmwareType.BitcoinOnly;
160
+ }
161
+ // old firmware
162
+ return features?.capabilities?.length > 0 &&
163
+ !existCapability(features, Enum_Capability.Capability_Bitcoin_like)
164
+ ? EFirmwareType.BitcoinOnly
165
+ : EFirmwareType.Universal;
166
+ };
@@ -10,6 +10,7 @@ export {
10
10
  getDeviceUUID,
11
11
  getDeviceLabel,
12
12
  getMethodVersionRange,
13
+ getFirmwareType,
13
14
  } from './deviceInfoUtils';
14
15
  export {
15
16
  getDeviceBoardloaderVersion,