Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onekeyfe/hd-transport-react-native

Package Overview
Dependencies
Maintainers
2
Versions
252
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onekeyfe/hd-transport-react-native - npm Package Compare versions

Comparing version 1.0.7-alpha.2 to 1.0.7-alpha.3

1

dist/index.d.ts

@@ -30,2 +30,3 @@ import * as transport from '@onekeyfe/hd-transport';

enumerate(): Promise<Device[]>;
refreshCache(deviceId: string): Promise<void>;
acquire(input: BleAcquireInput): Promise<{

@@ -32,0 +33,0 @@ uuid: string;

26

dist/index.js

@@ -64,13 +64,2 @@ 'use strict';

});
const refreshCache = (peripheralId) => __awaiter(void 0, void 0, void 0, function* () {
try {
yield BleManager__default["default"].connect(peripheralId);
yield BleManager__default["default"].refreshCache(peripheralId);
yield BleManager__default["default"].disconnect(peripheralId, true);
console.log('refreshCache success');
}
catch (error) {
console.log('refreshCache error: ', error);
}
});

@@ -302,2 +291,14 @@ const timer = process.env.NODE_ENV === 'development'

}
refreshCache(deviceId) {
return __awaiter(this, void 0, void 0, function* () {
try {
const blePlxManager = yield this.getPlxManager();
yield blePlxManager.refreshGatt(deviceId);
yield new Promise(resolve => setTimeout(resolve, 500));
}
catch (error) {
console.log('refreshCache error: ', error);
}
});
}
acquire(input) {

@@ -390,2 +391,3 @@ var _a, _b, _c;

}
this.refreshCache(uuid);
if (reactNative.Platform.OS === 'android') {

@@ -489,3 +491,3 @@ const bondedDevices = yield getBondedDevices();

}
refreshCache(deviceId);
this.refreshCache(deviceId);
this.runPromise.reject(hdShared.ERRORS.TypedError(ERROR, (_c = error.reason) !== null && _c !== void 0 ? _c : error.message));

@@ -492,0 +494,0 @@ this.Log.debug(': monitor notify error, and has unreleased Promise');

{
"name": "@onekeyfe/hd-transport-react-native",
"version": "1.0.7-alpha.2",
"version": "1.0.7-alpha.3",
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",

@@ -22,8 +22,8 @@ "license": "MIT",

"dependencies": {
"@onekeyfe/hd-shared": "^1.0.7-alpha.2",
"@onekeyfe/hd-transport": "^1.0.7-alpha.2",
"@onekeyfe/react-native-ble-plx": "3.0.0",
"@onekeyfe/hd-shared": "^1.0.7-alpha.3",
"@onekeyfe/hd-transport": "^1.0.7-alpha.3",
"@onekeyfe/react-native-ble-plx": "https://github.com/OneKeyHQ/react-native-ble-plx.git#feat/refreshGatt",
"react-native-ble-manager": "^8.1.0"
},
"gitHead": "220798f8e3b49640651e919c92403aa6d2b9b813"
"gitHead": "2450f88fb75e9aeb6c5ebfc6a4ffb488bf5a60eb"
}

@@ -14,8 +14,3 @@ import { Platform, PermissionsAndroid } from 'react-native';

import type EventEmitter from 'events';
import {
initializeBleManager,
getConnectedDeviceIds,
getBondedDevices,
refreshCache,
} from './BleManager';
import { initializeBleManager, getConnectedDeviceIds, getBondedDevices } from './BleManager';
import { subscribeBleOn } from './subscribeBleOn';

@@ -192,2 +187,14 @@ import {

async refreshCache(deviceId: string) {
try {
const blePlxManager = await this.getPlxManager();
// @ts-expect-error
await blePlxManager.refreshGatt(deviceId);
// eslint-disable-next-line no-promise-executor-return
await new Promise(resolve => setTimeout(resolve, 500));
} catch (error) {
console.log('refreshCache error: ', error);
}
}
async acquire(input: BleAcquireInput) {

@@ -296,2 +303,4 @@ const { uuid, forceCleanRunPromise } = input;

this.refreshCache(uuid);
// check device is bonded

@@ -419,3 +428,3 @@ if (Platform.OS === 'android') {

}
refreshCache(deviceId);
this.refreshCache(deviceId);
this.runPromise.reject(ERRORS.TypedError(ERROR, error.reason ?? error.message));

@@ -422,0 +431,0 @@ this.Log.debug(': monitor notify error, and has unreleased Promise');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc