@onekeyfe/hd-transport-web-device 1.0.34-alpha.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.
- package/README.md +29 -0
- package/dist/electron-ble-transport.d.ts +51 -0
- package/dist/electron-ble-transport.d.ts.map +1 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +766 -0
- package/dist/webble-utils.d.ts +4 -0
- package/dist/webble-utils.d.ts.map +1 -0
- package/dist/webusb.d.ts +33 -0
- package/dist/webusb.d.ts.map +1 -0
- package/package.json +31 -0
- package/src/electron-ble-transport.ts +709 -0
- package/src/index.ts +4 -0
- package/src/webble-utils.ts +30 -0
- package/src/webusb.ts +298 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webble-utils.d.ts","sourceRoot":"","sources":["../src/webble-utils.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,aAAa,UAAW,MAAM,GAAG,UAAU,KAAG,OAa1D,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU,MAAM,GAAG,IAAI,OAAO,MAAM,KAAG,OAYjE,CAAC"}
|
package/dist/webusb.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="w3c-web-usb" />
|
|
2
|
+
import transport, { AcquireInput } from '@onekeyfe/hd-transport';
|
|
3
|
+
interface DeviceInfo {
|
|
4
|
+
path: string;
|
|
5
|
+
device: USBDevice;
|
|
6
|
+
}
|
|
7
|
+
export default class WebUsbTransport {
|
|
8
|
+
messages: ReturnType<typeof transport.parseConfigure> | undefined;
|
|
9
|
+
name: string;
|
|
10
|
+
stopped: boolean;
|
|
11
|
+
configured: boolean;
|
|
12
|
+
Log?: any;
|
|
13
|
+
usb?: USB;
|
|
14
|
+
deviceList: Array<DeviceInfo>;
|
|
15
|
+
configurationId: number;
|
|
16
|
+
endpointId: number;
|
|
17
|
+
interfaceId: number;
|
|
18
|
+
init(logger: any): void;
|
|
19
|
+
configure(signedData: any): void;
|
|
20
|
+
promptDeviceAccess(): Promise<USBDevice | null>;
|
|
21
|
+
enumerate(): Promise<DeviceInfo[]>;
|
|
22
|
+
getConnectedDevices(): Promise<DeviceInfo[]>;
|
|
23
|
+
acquire(input: AcquireInput): Promise<string | undefined>;
|
|
24
|
+
findDevice(path: string): Promise<USBDevice>;
|
|
25
|
+
connect(path: string, first: boolean): Promise<void>;
|
|
26
|
+
connectToDevice(path: string, first: boolean): Promise<void>;
|
|
27
|
+
post(session: string, name: string, data: Record<string, unknown>): Promise<void>;
|
|
28
|
+
call(path: string, name: string, data: Record<string, unknown>): Promise<import("@onekeyfe/hd-transport").MessageFromOneKey>;
|
|
29
|
+
receiveData(path: string): Promise<string>;
|
|
30
|
+
release(path: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=webusb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webusb.d.ts","sourceRoot":"","sources":["../src/webusb.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,EAAE,EAAE,YAAY,EAAmB,MAAM,wBAAwB,CAAC;AAelF,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,QAAQ,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAElE,IAAI,SAAqB;IAEzB,OAAO,UAAS;IAEhB,UAAU,UAAS;IAEnB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,GAAG,CAAC,EAAE,GAAG,CAAC;IAMV,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAM;IAEnC,eAAe,SAAoB;IAEnC,UAAU,SAAe;IAEzB,WAAW,SAAgB;IAK3B,IAAI,CAAC,MAAM,EAAE,GAAG;IAgBhB,SAAS,CAAC,UAAU,EAAE,GAAG;IAWnB,kBAAkB;IAgBlB,SAAS;IAQT,mBAAmB;IAuBnB,OAAO,CAAC,KAAK,EAAE,YAAY;IAc3B,UAAU,CAAC,IAAI,EAAE,MAAM;IAwBvB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAiBpC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAgB5C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOjE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAyC9D,WAAW,CAAC,IAAI,EAAE,MAAM;IAkDxB,OAAO,CAAC,IAAI,EAAE,MAAM;CAK3B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onekeyfe/hd-transport-web-device",
|
|
3
|
+
"version": "1.0.34-alpha.0",
|
|
4
|
+
"author": "OneKey",
|
|
5
|
+
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/OneKeyHQ/hardware-js-sdk.git"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "rimraf dist && rollup -c ../../build/rollup.config.js -w",
|
|
18
|
+
"build": "rimraf dist && rollup -c ../../build/rollup.config.js",
|
|
19
|
+
"lint": "eslint .",
|
|
20
|
+
"lint:fix": "eslint . --fix"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@onekeyfe/hd-shared": "^1.0.34-alpha.0",
|
|
24
|
+
"@onekeyfe/hd-transport": "^1.0.34-alpha.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/w3c-web-usb": "^1.0.6",
|
|
28
|
+
"@types/web-bluetooth": "^0.0.17"
|
|
29
|
+
},
|
|
30
|
+
"gitHead": "a910879dea6198bd96016aec81429f31b9692bf1"
|
|
31
|
+
}
|