@onekeyfe/hd-core 0.1.9 → 0.1.12
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/CheckBridgeStatus.d.ts +6 -0
- package/dist/api/CheckBridgeStatus.d.ts.map +1 -0
- package/dist/api/device/DeviceVerify.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +37 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/checkBridgeStatus.d.ts +3 -0
- package/dist/types/api/checkBridgeStatus.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.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 +3 -0
- package/dist/utils/patch.d.ts.map +1 -0
- package/package.json +5 -4
- package/src/api/CheckBridgeStatus.ts +21 -0
- package/src/api/device/DeviceVerify.ts +2 -0
- package/src/api/index.ts +1 -0
- package/src/device/DeviceCommands.ts +2 -2
- package/src/inject.ts +5 -0
- package/src/types/api/checkBridgeStatus.ts +3 -0
- package/src/types/api/index.ts +3 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/patch.ts +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckBridgeStatus.d.ts","sourceRoot":"","sources":["../../src/api/CheckBridgeStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU;IACvD,IAAI;IAIE,GAAG;CAYV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceVerify.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceVerify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviceVerify.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceVerify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAC5E,IAAI;IAUE,GAAG;CAoCV"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as btcVerifyMessage } from './btc/BTCVerifyMessage';
|
|
|
9
9
|
export { default as checkFirmwareRelease } from './CheckFirmwareRelease';
|
|
10
10
|
export { default as checkBLEFirmwareRelease } from './CheckBLEFirmwareRelease';
|
|
11
11
|
export { default as checkTransportRelease } from './CheckTransportRelease';
|
|
12
|
+
export { default as checkBridgeStatus } from './CheckBridgeStatus';
|
|
12
13
|
export { default as deviceBackup } from './device/DeviceBackup';
|
|
13
14
|
export { default as deviceChangePin } from './device/DeviceChangePin';
|
|
14
15
|
export { default as deviceFlags } from './device/DeviceFlags';
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO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,6 +238,8 @@ declare type TransportReleaseStatus = 'valid' | 'outdated';
|
|
|
238
238
|
|
|
239
239
|
declare function checkTransportRelease(): Response<TransportReleaseStatus>;
|
|
240
240
|
|
|
241
|
+
declare function checkBridgeStatus(): Response<boolean>;
|
|
242
|
+
|
|
241
243
|
declare type EVMAddress = {
|
|
242
244
|
path: string;
|
|
243
245
|
address: string;
|
|
@@ -889,6 +891,7 @@ declare type CoreApi = {
|
|
|
889
891
|
checkFirmwareRelease: typeof checkFirmwareRelease;
|
|
890
892
|
checkBLEFirmwareRelease: typeof checkBLEFirmwareRelease;
|
|
891
893
|
checkTransportRelease: typeof checkTransportRelease;
|
|
894
|
+
checkBridgeStatus: typeof checkBridgeStatus;
|
|
892
895
|
cipherKeyValue: typeof cipherKeyValue;
|
|
893
896
|
deviceBackup: typeof deviceBackup;
|
|
894
897
|
deviceChangePin: typeof deviceChangePin;
|
|
@@ -1269,6 +1272,8 @@ declare const normalizeVersionArray: (version: number[]) => number[];
|
|
|
1269
1272
|
declare const versionSplit: (version: string) => number[];
|
|
1270
1273
|
declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
|
|
1271
1274
|
|
|
1275
|
+
declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoCatalystRegistrationParametersType"> | TypedResponseMessage<"CardanoTxInputType"> | TypedResponseMessage<"CardanoTxOutputType"> | TypedResponseMessage<"CardanoTxCertificateType"> | TypedResponseMessage<"CardanoTxWithdrawalType"> | TypedResponseMessage<"CardanoTxAuxiliaryDataType"> | TypedResponseMessage<"CardanoAssetGroupType"> | TypedResponseMessage<"CardanoTokenType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TxAckPaymentRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoPoolOwnerType"> | TypedResponseMessage<"CardanoPoolRelayParametersType"> | TypedResponseMessage<"CardanoSignTx"> | TypedResponseMessage<"CardanoSignedTxChunk"> | TypedResponseMessage<"CardanoSignedTxChunkAck"> | TypedResponseMessage<"CardanoSignedTx"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetFirmware"> | TypedResponseMessage<"FirmwareChunk"> | TypedResponseMessage<"FirmwareChunkAck"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinReboot"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx">;
|
|
1276
|
+
|
|
1272
1277
|
declare const getDeviceType: (features?: _onekeyfe_hd_transport.Features | undefined) => IDeviceType;
|
|
1273
1278
|
declare const getDeviceTypeByBleName: (name?: string | undefined) => IDeviceType | null;
|
|
1274
1279
|
declare const getDeviceTypeByDeviceId: (deviceId?: string | undefined) => IDeviceType;
|
|
@@ -1314,4 +1319,4 @@ declare class DataManager {
|
|
|
1314
1319
|
|
|
1315
1320
|
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
|
|
1316
1321
|
|
|
1317
|
-
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, Features, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getScriptType, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, safeThrowError, versionCompare, versionSplit };
|
|
1322
|
+
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, Features, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getScriptType, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, versionCompare, versionSplit };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var semver = require('semver');
|
|
|
6
6
|
var hdShared = require('@onekeyfe/hd-shared');
|
|
7
7
|
var axios = require('axios');
|
|
8
8
|
var BigNumber = require('bignumber.js');
|
|
9
|
+
var sha256 = require('js-sha256');
|
|
9
10
|
var hdTransport = require('@onekeyfe/hd-transport');
|
|
10
11
|
|
|
11
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -13,6 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
14
|
var semver__default = /*#__PURE__*/_interopDefaultLegacy(semver);
|
|
14
15
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
15
16
|
var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
|
|
17
|
+
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
16
18
|
|
|
17
19
|
const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
18
20
|
const api = {
|
|
@@ -35,6 +37,7 @@ const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
|
35
37
|
checkFirmwareRelease: connectId => call({ connectId, method: 'checkFirmwareRelease' }),
|
|
36
38
|
checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
|
|
37
39
|
checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
|
|
40
|
+
checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
|
|
38
41
|
cipherKeyValue: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'cipherKeyValue' })),
|
|
39
42
|
deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
|
|
40
43
|
deviceChangePin: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceChangePin' })),
|
|
@@ -764,6 +767,16 @@ const versionCompare = (a, b) => {
|
|
|
764
767
|
return 0;
|
|
765
768
|
};
|
|
766
769
|
|
|
770
|
+
function patchFeatures(response) {
|
|
771
|
+
if (response.type !== 'Features') {
|
|
772
|
+
return response;
|
|
773
|
+
}
|
|
774
|
+
if (response.message.major_version < 1) {
|
|
775
|
+
response.message.major_version = 1;
|
|
776
|
+
}
|
|
777
|
+
return response;
|
|
778
|
+
}
|
|
779
|
+
|
|
767
780
|
const getDeviceModel = (features) => {
|
|
768
781
|
if (!features || typeof features !== 'object') {
|
|
769
782
|
return 'model_mini';
|
|
@@ -10093,7 +10106,7 @@ class DeviceCommands {
|
|
|
10093
10106
|
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `${code || 'Failure_UnknownCode'},${message || 'Failure_UnknownMessage'}`));
|
|
10094
10107
|
}
|
|
10095
10108
|
if (res.type === 'Features') {
|
|
10096
|
-
return Promise.resolve(res);
|
|
10109
|
+
return Promise.resolve(patchFeatures(res));
|
|
10097
10110
|
}
|
|
10098
10111
|
if (res.type === 'ButtonRequest') {
|
|
10099
10112
|
if (res.message.code === 'ButtonRequest_PassphraseEntry') {
|
|
@@ -11625,6 +11638,26 @@ class CheckTransportRelease extends BaseMethod {
|
|
|
11625
11638
|
}
|
|
11626
11639
|
}
|
|
11627
11640
|
|
|
11641
|
+
class CheckBridgeStatus extends BaseMethod {
|
|
11642
|
+
init() {
|
|
11643
|
+
this.useDevice = false;
|
|
11644
|
+
}
|
|
11645
|
+
run() {
|
|
11646
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11647
|
+
return new Promise(resolve => {
|
|
11648
|
+
axios__default["default"]
|
|
11649
|
+
.request({
|
|
11650
|
+
url: 'http://localhost:21320',
|
|
11651
|
+
method: 'POST',
|
|
11652
|
+
withCredentials: false,
|
|
11653
|
+
})
|
|
11654
|
+
.then(() => resolve(true))
|
|
11655
|
+
.catch(() => resolve(false));
|
|
11656
|
+
});
|
|
11657
|
+
});
|
|
11658
|
+
}
|
|
11659
|
+
}
|
|
11660
|
+
|
|
11628
11661
|
class DeviceBackup extends BaseMethod {
|
|
11629
11662
|
init() { }
|
|
11630
11663
|
run() {
|
|
@@ -11811,7 +11844,7 @@ class DeviceVerify extends BaseMethod {
|
|
|
11811
11844
|
const deviceType = getDeviceType(this.device.features);
|
|
11812
11845
|
let response;
|
|
11813
11846
|
if (deviceType === 'classic') {
|
|
11814
|
-
const res = yield this.device.commands.typedCall('BixinVerifyDeviceRequest', 'BixinVerifyDeviceAck', Object.assign({}, this.params));
|
|
11847
|
+
const res = yield this.device.commands.typedCall('BixinVerifyDeviceRequest', 'BixinVerifyDeviceAck', Object.assign(Object.assign({}, this.params), { data: sha256__default["default"].sha256(this.params.data) }));
|
|
11815
11848
|
response = res.message;
|
|
11816
11849
|
}
|
|
11817
11850
|
else if (deviceType === 'mini') {
|
|
@@ -13226,6 +13259,7 @@ var ApiMethods = /*#__PURE__*/Object.freeze({
|
|
|
13226
13259
|
checkFirmwareRelease: CheckFirmwareRelease,
|
|
13227
13260
|
checkBLEFirmwareRelease: CheckBLEFirmwareRelease,
|
|
13228
13261
|
checkTransportRelease: CheckTransportRelease,
|
|
13262
|
+
checkBridgeStatus: CheckBridgeStatus,
|
|
13229
13263
|
deviceBackup: DeviceBackup,
|
|
13230
13264
|
deviceChangePin: DeviceChangePin,
|
|
13231
13265
|
deviceFlags: DeviceFlags,
|
|
@@ -13767,6 +13801,7 @@ exports.isValidVersionString = isValidVersionString;
|
|
|
13767
13801
|
exports.normalizeVersionArray = normalizeVersionArray;
|
|
13768
13802
|
exports.parseConnectSettings = parseConnectSettings;
|
|
13769
13803
|
exports.parseMessage = parseMessage;
|
|
13804
|
+
exports.patchFeatures = patchFeatures;
|
|
13770
13805
|
exports.safeThrowError = safeThrowError;
|
|
13771
13806
|
exports.versionCompare = versionCompare;
|
|
13772
13807
|
exports.versionSplit = versionSplit;
|
package/dist/inject.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,OAoHd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkBridgeStatus.d.ts","sourceRoot":"","sources":["../../../src/types/api/checkBridgeStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,iBAAiB,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { checkFirmwareRelease } from './checkFirmwareRelease';
|
|
|
5
5
|
import { init } from './init';
|
|
6
6
|
import { checkBLEFirmwareRelease } from './checkBLEFirmwareRelease';
|
|
7
7
|
import { checkTransportRelease } from './checkTransportRelease';
|
|
8
|
+
import { checkBridgeStatus } from './checkBridgeStatus';
|
|
8
9
|
import { evmGetAddress } from './evmGetAddress';
|
|
9
10
|
import { evmGetPublicKey } from './evmGetPublicKey';
|
|
10
11
|
import { evmSignMessage } from './evmSignMessage';
|
|
@@ -56,6 +57,7 @@ export declare type CoreApi = {
|
|
|
56
57
|
checkFirmwareRelease: typeof checkFirmwareRelease;
|
|
57
58
|
checkBLEFirmwareRelease: typeof checkBLEFirmwareRelease;
|
|
58
59
|
checkTransportRelease: typeof checkTransportRelease;
|
|
60
|
+
checkBridgeStatus: typeof checkBridgeStatus;
|
|
59
61
|
cipherKeyValue: typeof cipherKeyValue;
|
|
60
62
|
deviceBackup: typeof deviceBackup;
|
|
61
63
|
deviceChangePin: typeof deviceChangePin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRo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5C,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;IAEtD,cAAc,EAAE,OAAO,cAAc,CAAC;CACvC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { initLog, enableLog } from './logger';
|
|
2
2
|
export * from './assets';
|
|
3
3
|
export * from './versionUtils';
|
|
4
|
+
export * from './patch';
|
|
4
5
|
export { getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getDeviceLabel, } from './deviceFeaturesUtils';
|
|
5
6
|
export { getHDPath, getScriptType } from '../api/helpers/pathUtils';
|
|
6
7
|
export { initLog, enableLog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DefaultMessageResponse } from '../device/DeviceCommands';
|
|
2
|
+
export declare function patchFeatures(response: DefaultMessageResponse): import("../device/DeviceCommands").TypedResponseMessage<"BinanceGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"BinancePublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceTxRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceCoin"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceInputOutput"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceTransferMsg"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceOrderMsg"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceCancelMsg"> | import("../device/DeviceCommands").TypedResponseMessage<"BinanceSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"HDNodeType"> | import("../device/DeviceCommands").TypedResponseMessage<"HDNodePathType"> | import("../device/DeviceCommands").TypedResponseMessage<"MultisigRedeemScriptType"> | import("../device/DeviceCommands").TypedResponseMessage<"GetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"PublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"GetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"Address"> | import("../device/DeviceCommands").TypedResponseMessage<"GetOwnershipId"> | import("../device/DeviceCommands").TypedResponseMessage<"OwnershipId"> | import("../device/DeviceCommands").TypedResponseMessage<"SignMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"MessageSignature"> | import("../device/DeviceCommands").TypedResponseMessage<"VerifyMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"SignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"TxRequestDetailsType"> | import("../device/DeviceCommands").TypedResponseMessage<"TxRequestSerializedType"> | import("../device/DeviceCommands").TypedResponseMessage<"TxRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"TxInputType"> | import("../device/DeviceCommands").TypedResponseMessage<"TxOutputBinType"> | import("../device/DeviceCommands").TypedResponseMessage<"TxOutputType"> | import("../device/DeviceCommands").TypedResponseMessage<"PrevTx"> | import("../device/DeviceCommands").TypedResponseMessage<"PrevInput"> | import("../device/DeviceCommands").TypedResponseMessage<"PrevOutput"> | import("../device/DeviceCommands").TypedResponseMessage<"TextMemo"> | import("../device/DeviceCommands").TypedResponseMessage<"RefundMemo"> | import("../device/DeviceCommands").TypedResponseMessage<"CoinPurchaseMemo"> | import("../device/DeviceCommands").TypedResponseMessage<"PaymentRequestMemo"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPaymentRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAck"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckInputWrapper"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckInput"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckOutputWrapper"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckOutput"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevMeta"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevInputWrapper"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevInput"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevOutputWrapper"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevOutput"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | import("../device/DeviceCommands").TypedResponseMessage<"TxAckPrevExtraData"> | import("../device/DeviceCommands").TypedResponseMessage<"GetOwnershipProof"> | import("../device/DeviceCommands").TypedResponseMessage<"OwnershipProof"> | import("../device/DeviceCommands").TypedResponseMessage<"AuthorizeCoinJoin"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareErase"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareUpload"> | import("../device/DeviceCommands").TypedResponseMessage<"SelfTest"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoBlockchainPointerType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoNativeScript"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoGetNativeScriptHash"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoNativeScriptHash"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoAddressParametersType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignTxInit"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxInput"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxOutput"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoAssetGroup"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoToken"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolOwner"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolRelayParameters"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolMetadataType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolParametersType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxCertificate"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxWithdrawal"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoCatalystRegistrationParametersType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxAuxiliaryData"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxMint"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxCollateralInput"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxRequiredSigner"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxItemAck"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxWitnessRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxWitnessResponse"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxHostAck"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxBodyHash"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignTxFinished"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxInputType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTokenType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoAssetGroupType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxOutputType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolOwnerType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoPoolRelayParametersType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxCertificateType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxWithdrawalType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoTxAuxiliaryDataType"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignedTxChunk"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignedTxChunkAck"> | import("../device/DeviceCommands").TypedResponseMessage<"CardanoSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"Success"> | import("../device/DeviceCommands").TypedResponseMessage<"Failure"> | import("../device/DeviceCommands").TypedResponseMessage<"ButtonRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"ButtonAck"> | import("../device/DeviceCommands").TypedResponseMessage<"PinMatrixRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"PinMatrixAck"> | import("../device/DeviceCommands").TypedResponseMessage<"PassphraseRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"PassphraseAck"> | import("../device/DeviceCommands").TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"Deprecated_PassphraseStateAck"> | import("../device/DeviceCommands").TypedResponseMessage<"CipherKeyValue"> | import("../device/DeviceCommands").TypedResponseMessage<"CipheredKeyValue"> | import("../device/DeviceCommands").TypedResponseMessage<"IdentityType"> | import("../device/DeviceCommands").TypedResponseMessage<"SignIdentity"> | import("../device/DeviceCommands").TypedResponseMessage<"SignedIdentity"> | import("../device/DeviceCommands").TypedResponseMessage<"GetECDHSessionKey"> | import("../device/DeviceCommands").TypedResponseMessage<"ECDHSessionKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EosGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EosPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EosTxHeader"> | import("../device/DeviceCommands").TypedResponseMessage<"EosSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"EosTxActionRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"EosAsset"> | import("../device/DeviceCommands").TypedResponseMessage<"EosPermissionLevel"> | import("../device/DeviceCommands").TypedResponseMessage<"EosAuthorizationKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EosAuthorizationAccount"> | import("../device/DeviceCommands").TypedResponseMessage<"EosAuthorizationWait"> | import("../device/DeviceCommands").TypedResponseMessage<"EosAuthorization"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionCommon"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionTransfer"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionDelegate"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionUndelegate"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionRefund"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionBuyRam"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionBuyRamBytes"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionSellRam"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionVoteProducer"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionUpdateAuth"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionDeleteAuth"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionLinkAuth"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionUnlinkAuth"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionNewAccount"> | import("../device/DeviceCommands").TypedResponseMessage<"EosActionUnknown"> | import("../device/DeviceCommands").TypedResponseMessage<"EosTxActionAck"> | import("../device/DeviceCommands").TypedResponseMessage<"EosSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignTypedData"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTypedDataStructRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumFieldType"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumStructMember"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTypedDataStructAck"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTypedDataValueRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTypedDataValueAck"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumAccessList"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignTxEIP1559"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTxRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTxAck"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignMessageEIP712"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumMessageSignature"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumVerifyMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumSignTypedHash"> | import("../device/DeviceCommands").TypedResponseMessage<"EthereumTypedDataSignature"> | import("../device/DeviceCommands").TypedResponseMessage<"Initialize"> | import("../device/DeviceCommands").TypedResponseMessage<"GetFeatures"> | import("../device/DeviceCommands").TypedResponseMessage<"Features"> | import("../device/DeviceCommands").TypedResponseMessage<"LockDevice"> | import("../device/DeviceCommands").TypedResponseMessage<"EndSession"> | import("../device/DeviceCommands").TypedResponseMessage<"ApplySettings"> | import("../device/DeviceCommands").TypedResponseMessage<"ApplyFlags"> | import("../device/DeviceCommands").TypedResponseMessage<"ChangePin"> | import("../device/DeviceCommands").TypedResponseMessage<"ChangeWipeCode"> | import("../device/DeviceCommands").TypedResponseMessage<"SdProtect"> | import("../device/DeviceCommands").TypedResponseMessage<"Ping"> | import("../device/DeviceCommands").TypedResponseMessage<"Cancel"> | import("../device/DeviceCommands").TypedResponseMessage<"GetEntropy"> | import("../device/DeviceCommands").TypedResponseMessage<"Entropy"> | import("../device/DeviceCommands").TypedResponseMessage<"GetFirmwareHash"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareHash"> | import("../device/DeviceCommands").TypedResponseMessage<"GetFirmware"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareChunk"> | import("../device/DeviceCommands").TypedResponseMessage<"FirmwareChunkAck"> | import("../device/DeviceCommands").TypedResponseMessage<"WipeDevice"> | import("../device/DeviceCommands").TypedResponseMessage<"ResetDevice"> | import("../device/DeviceCommands").TypedResponseMessage<"BackupDevice"> | import("../device/DeviceCommands").TypedResponseMessage<"EntropyRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"EntropyAck"> | import("../device/DeviceCommands").TypedResponseMessage<"RecoveryDevice"> | import("../device/DeviceCommands").TypedResponseMessage<"WordRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"WordAck"> | import("../device/DeviceCommands").TypedResponseMessage<"SetU2FCounter"> | import("../device/DeviceCommands").TypedResponseMessage<"GetNextU2FCounter"> | import("../device/DeviceCommands").TypedResponseMessage<"NextU2FCounter"> | import("../device/DeviceCommands").TypedResponseMessage<"DoPreauthorized"> | import("../device/DeviceCommands").TypedResponseMessage<"PreauthorizedRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"CancelAuthorization"> | import("../device/DeviceCommands").TypedResponseMessage<"BixinReboot"> | import("../device/DeviceCommands").TypedResponseMessage<"BixinVerifyDeviceRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"BixinVerifyDeviceAck"> | import("../device/DeviceCommands").TypedResponseMessage<"SESignMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"SEMessageSignature"> | import("../device/DeviceCommands").TypedResponseMessage<"ReadSEPublicCert"> | import("../device/DeviceCommands").TypedResponseMessage<"SEPublicCert"> | import("../device/DeviceCommands").TypedResponseMessage<"RebootToBootloader"> | import("../device/DeviceCommands").TypedResponseMessage<"GetNonce"> | import("../device/DeviceCommands").TypedResponseMessage<"Nonce"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMTransactionCommon"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMMosaic"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMTransfer"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMProvisionNamespace"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMMosaicDefinition"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMMosaicCreation"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMMosaicSupplyChange"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMCosignatoryModification"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMAggregateModification"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMImportanceTransfer"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMDecryptMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"NEMDecryptedMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"RippleGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"RippleAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"RipplePayment"> | import("../device/DeviceCommands").TypedResponseMessage<"RippleSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"RippleSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinSignMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinMessageSignature"> | import("../device/DeviceCommands").TypedResponseMessage<"StarcoinVerifyMessage"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarAsset"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarTxOpRequest"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarPaymentOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarCreateAccountOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarManageSellOfferOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarManageBuyOfferOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarSetOptionsOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarChangeTrustOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarAllowTrustOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarAccountMergeOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarManageDataOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarBumpSequenceOp"> | import("../device/DeviceCommands").TypedResponseMessage<"StellarSignedTx"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosGetAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosAddress"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosGetPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosPublicKey"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosContractID"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosRevealOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosManagerTransfer"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosParametersManager"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosTransactionOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosOriginationOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosDelegationOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosProposalOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosBallotOp"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosSignTx"> | import("../device/DeviceCommands").TypedResponseMessage<"TezosSignedTx">;
|
|
3
|
+
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../src/utils/patch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,sBAAsB,mvqBAW7D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "^0.1.
|
|
29
|
-
"@onekeyfe/hd-transport": "^0.1.
|
|
28
|
+
"@onekeyfe/hd-shared": "^0.1.12",
|
|
29
|
+
"@onekeyfe/hd-transport": "^0.1.12",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
|
+
"js-sha256": "^0.9.0",
|
|
32
33
|
"parse-uri": "^1.0.7",
|
|
33
34
|
"semver": "^7.3.7"
|
|
34
35
|
},
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"@types/parse-uri": "^1.0.0",
|
|
37
38
|
"@types/semver": "^7.3.9"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "38d4f8d711d212de8617f217a0148dcf3cdcc477"
|
|
40
41
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { BaseMethod } from './BaseMethod';
|
|
3
|
+
|
|
4
|
+
export default class CheckBridgeStatus extends BaseMethod {
|
|
5
|
+
init() {
|
|
6
|
+
this.useDevice = false;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
async run() {
|
|
10
|
+
return new Promise<boolean>(resolve => {
|
|
11
|
+
axios
|
|
12
|
+
.request({
|
|
13
|
+
url: 'http://localhost:21320',
|
|
14
|
+
method: 'POST',
|
|
15
|
+
withCredentials: false,
|
|
16
|
+
})
|
|
17
|
+
.then(() => resolve(true))
|
|
18
|
+
.catch(() => resolve(false));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import sha256 from 'js-sha256';
|
|
1
2
|
import { BixinVerifyDeviceRequest } from '@onekeyfe/hd-transport';
|
|
2
3
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
4
|
import { formatAnyHex } from '../helpers/hexUtils';
|
|
@@ -28,6 +29,7 @@ export default class DeviceVerify extends BaseMethod<BixinVerifyDeviceRequest> {
|
|
|
28
29
|
'BixinVerifyDeviceAck',
|
|
29
30
|
{
|
|
30
31
|
...this.params,
|
|
32
|
+
data: sha256.sha256(this.params.data),
|
|
31
33
|
}
|
|
32
34
|
);
|
|
33
35
|
response = res.message;
|
package/src/api/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as btcVerifyMessage } from './btc/BTCVerifyMessage';
|
|
|
9
9
|
export { default as checkFirmwareRelease } from './CheckFirmwareRelease';
|
|
10
10
|
export { default as checkBLEFirmwareRelease } from './CheckBLEFirmwareRelease';
|
|
11
11
|
export { default as checkTransportRelease } from './CheckTransportRelease';
|
|
12
|
+
export { default as checkBridgeStatus } from './CheckBridgeStatus';
|
|
12
13
|
export { default as deviceBackup } from './device/DeviceBackup';
|
|
13
14
|
export { default as deviceChangePin } from './device/DeviceChangePin';
|
|
14
15
|
export { default as deviceFlags } from './device/DeviceFlags';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Transport, Messages } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { ERRORS, HardwareError, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
3
|
import TransportManager from '../data-manager/TransportManager';
|
|
4
|
-
import { initLog } from '../utils';
|
|
4
|
+
import { initLog, patchFeatures } from '../utils';
|
|
5
5
|
import type { Device } from './Device';
|
|
6
6
|
import { DEVICE } from '../events';
|
|
7
7
|
|
|
@@ -162,7 +162,7 @@ export class DeviceCommands {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
if (res.type === 'Features') {
|
|
165
|
-
return Promise.resolve(res);
|
|
165
|
+
return Promise.resolve(patchFeatures(res));
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
if (res.type === 'ButtonRequest') {
|
package/src/inject.ts
CHANGED
|
@@ -66,6 +66,11 @@ export const inject = ({
|
|
|
66
66
|
*/
|
|
67
67
|
checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* 检查 Bridge 是否安装
|
|
71
|
+
*/
|
|
72
|
+
checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
|
|
73
|
+
|
|
69
74
|
cipherKeyValue: (connectId, params) => call({ ...params, connectId, method: 'cipherKeyValue' }),
|
|
70
75
|
|
|
71
76
|
deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
|
package/src/types/api/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { checkFirmwareRelease } from './checkFirmwareRelease';
|
|
|
5
5
|
import { init } from './init';
|
|
6
6
|
import { checkBLEFirmwareRelease } from './checkBLEFirmwareRelease';
|
|
7
7
|
import { checkTransportRelease } from './checkTransportRelease';
|
|
8
|
+
import { checkBridgeStatus } from './checkBridgeStatus';
|
|
8
9
|
import { evmGetAddress } from './evmGetAddress';
|
|
9
10
|
import { evmGetPublicKey } from './evmGetPublicKey';
|
|
10
11
|
import { evmSignMessage } from './evmSignMessage';
|
|
@@ -70,6 +71,8 @@ export type CoreApi = {
|
|
|
70
71
|
|
|
71
72
|
checkTransportRelease: typeof checkTransportRelease;
|
|
72
73
|
|
|
74
|
+
checkBridgeStatus: typeof checkBridgeStatus;
|
|
75
|
+
|
|
73
76
|
cipherKeyValue: typeof cipherKeyValue;
|
|
74
77
|
|
|
75
78
|
deviceBackup: typeof deviceBackup;
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DefaultMessageResponse } from '../device/DeviceCommands';
|
|
2
|
+
|
|
3
|
+
export function patchFeatures(response: DefaultMessageResponse) {
|
|
4
|
+
if (response.type !== 'Features') {
|
|
5
|
+
return response;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Bootloader 小于 1.8.7 时 major_version 可能小于 0,需要转换为 1
|
|
9
|
+
if (response.message.major_version < 1) {
|
|
10
|
+
response.message.major_version = 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return response;
|
|
14
|
+
}
|