@pezkuwi/hw-ledger-transports 14.0.5 → 14.0.6

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.
Files changed (83) hide show
  1. package/README.md +1 -1
  2. package/build/README.md +2 -0
  3. package/build/browser.js +5 -0
  4. package/build/cjs/browser.js +10 -0
  5. package/build/cjs/empty.js +7 -0
  6. package/build/cjs/node.d.ts +2 -0
  7. package/build/cjs/node.js +9 -0
  8. package/build/cjs/packageDetect.js +5 -0
  9. package/build/cjs/packageInfo.js +4 -0
  10. package/build/cjs/react-native.js +4 -0
  11. package/build/cjs/types.js +2 -0
  12. package/build/cjs/util.js +9 -0
  13. package/build/empty.d.ts +2 -0
  14. package/build/empty.js +3 -0
  15. package/build/node.d.ts +2 -0
  16. package/build/node.js +4 -0
  17. package/build/package.json +212 -0
  18. package/build/packageDetect.d.ts +1 -0
  19. package/build/packageDetect.js +3 -0
  20. package/build/packageInfo.d.ts +6 -0
  21. package/build/packageInfo.js +1 -0
  22. package/build/react-native.d.ts +1 -0
  23. package/build/react-native.js +1 -0
  24. package/build/types.d.ts +9 -0
  25. package/build/types.js +1 -0
  26. package/build/util.d.ts +2 -0
  27. package/build/util.js +6 -0
  28. package/build-deno/README.md +2 -0
  29. package/build-deno/browser.ts +9 -0
  30. package/build-deno/empty.ts +6 -0
  31. package/build-deno/mod.ts +2 -0
  32. package/build-deno/node.ts +8 -0
  33. package/build-deno/packageDetect.ts +7 -0
  34. package/build-deno/packageInfo.ts +3 -0
  35. package/build-deno/react-native.ts +2 -0
  36. package/build-deno/types.ts +13 -0
  37. package/build-deno/util.ts +10 -0
  38. package/{cjs → build-tsc-cjs}/packageInfo.js +1 -1
  39. package/{packageInfo.js → build-tsc-esm/packageInfo.js} +1 -1
  40. package/package.json +8 -189
  41. package/src/browser.ts +11 -0
  42. package/src/empty.ts +8 -0
  43. package/src/mod.ts +4 -0
  44. package/src/node.ts +10 -0
  45. package/src/packageDetect.ts +11 -0
  46. package/src/packageInfo.ts +6 -0
  47. package/src/react-native.ts +4 -0
  48. package/src/types.ts +17 -0
  49. package/src/util.ts +12 -0
  50. package/tsconfig.build.json +14 -0
  51. package/tsconfig.build.tsbuildinfo +1 -0
  52. /package/{LICENSE → build/LICENSE} +0 -0
  53. /package/{cjs → build}/browser.d.ts +0 -0
  54. /package/{empty.d.ts → build/cjs/browser.d.ts} +0 -0
  55. /package/{node.d.ts → build/cjs/empty.d.ts} +0 -0
  56. /package/{cjs → build/cjs}/package.json +0 -0
  57. /package/{packageDetect.d.ts → build/cjs/packageDetect.d.ts} +0 -0
  58. /package/{packageInfo.d.ts → build/cjs/packageInfo.d.ts} +0 -0
  59. /package/{react-native.d.ts → build/cjs/react-native.d.ts} +0 -0
  60. /package/{types.d.ts → build/cjs/types.d.ts} +0 -0
  61. /package/{util.d.ts → build/cjs/util.d.ts} +0 -0
  62. /package/{browser.d.ts → build-tsc/browser.d.ts} +0 -0
  63. /package/{cjs → build-tsc}/empty.d.ts +0 -0
  64. /package/{cjs → build-tsc}/node.d.ts +0 -0
  65. /package/{cjs → build-tsc}/packageDetect.d.ts +0 -0
  66. /package/{cjs → build-tsc}/packageInfo.d.ts +0 -0
  67. /package/{cjs → build-tsc}/react-native.d.ts +0 -0
  68. /package/{cjs → build-tsc}/types.d.ts +0 -0
  69. /package/{cjs → build-tsc}/util.d.ts +0 -0
  70. /package/{cjs → build-tsc-cjs}/browser.js +0 -0
  71. /package/{cjs → build-tsc-cjs}/empty.js +0 -0
  72. /package/{cjs → build-tsc-cjs}/node.js +0 -0
  73. /package/{cjs → build-tsc-cjs}/packageDetect.js +0 -0
  74. /package/{cjs → build-tsc-cjs}/react-native.js +0 -0
  75. /package/{cjs → build-tsc-cjs}/types.js +0 -0
  76. /package/{cjs → build-tsc-cjs}/util.js +0 -0
  77. /package/{browser.js → build-tsc-esm/browser.js} +0 -0
  78. /package/{empty.js → build-tsc-esm/empty.js} +0 -0
  79. /package/{node.js → build-tsc-esm/node.js} +0 -0
  80. /package/{packageDetect.js → build-tsc-esm/packageDetect.js} +0 -0
  81. /package/{react-native.js → build-tsc-esm/react-native.js} +0 -0
  82. /package/{types.js → build-tsc-esm/types.js} +0 -0
  83. /package/{util.js → build-tsc-esm/util.js} +0 -0
package/README.md CHANGED
@@ -1,2 +1,2 @@
1
- # @polkadot/hw-ledger-transports
1
+ # @pezkuwi/hw-ledger-transports
2
2
 
@@ -0,0 +1,2 @@
1
+ # @pezkuwi/hw-ledger-transports
2
+
@@ -0,0 +1,5 @@
1
+ import LedgerHid from '@ledgerhq/hw-transport-webhid';
2
+ import LedgerUsb from '@ledgerhq/hw-transport-webusb';
3
+ import { createDefs } from './util.js';
4
+ export { packageInfo } from './packageInfo.js';
5
+ export const transports = /*#__PURE__*/ createDefs(['webusb', LedgerUsb], ['hid', LedgerHid]);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transports = exports.packageInfo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const hw_transport_webhid_1 = tslib_1.__importDefault(require("@ledgerhq/hw-transport-webhid"));
6
+ const hw_transport_webusb_1 = tslib_1.__importDefault(require("@ledgerhq/hw-transport-webusb"));
7
+ const util_js_1 = require("./util.js");
8
+ var packageInfo_js_1 = require("./packageInfo.js");
9
+ Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
10
+ exports.transports = (0, util_js_1.createDefs)(['webusb', hw_transport_webusb_1.default], ['hid', hw_transport_webhid_1.default]);
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transports = exports.packageInfo = void 0;
4
+ const util_js_1 = require("./util.js");
5
+ var packageInfo_js_1 = require("./packageInfo.js");
6
+ Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
7
+ exports.transports = (0, util_js_1.createDefs)();
@@ -0,0 +1,2 @@
1
+ export { packageInfo } from './packageInfo.js';
2
+ export declare const transports: import("./types.js").TransportDef[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transports = exports.packageInfo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const hw_transport_node_hid_singleton_1 = tslib_1.__importDefault(require("@ledgerhq/hw-transport-node-hid-singleton"));
6
+ const util_js_1 = require("./util.js");
7
+ var packageInfo_js_1 = require("./packageInfo.js");
8
+ Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
9
+ exports.transports = (0, util_js_1.createDefs)(['hid', hw_transport_node_hid_singleton_1.default]);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const util_1 = require("@pezkuwi/util");
4
+ const packageInfo_js_1 = require("./packageInfo.js");
5
+ (0, util_1.detectPackage)(packageInfo_js_1.packageInfo, null, []);
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.packageInfo = void 0;
4
+ exports.packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.6' };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./empty.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDefs = createDefs;
4
+ function createDefs(...items) {
5
+ return items.map(([type, Clazz]) => ({
6
+ create: () => Clazz.create(),
7
+ type
8
+ }));
9
+ }
@@ -0,0 +1,2 @@
1
+ export { packageInfo } from './packageInfo.js';
2
+ export declare const transports: import("./types.js").TransportDef[];
package/build/empty.js ADDED
@@ -0,0 +1,3 @@
1
+ import { createDefs } from './util.js';
2
+ export { packageInfo } from './packageInfo.js';
3
+ export const transports = /*#__PURE__*/ createDefs();
@@ -0,0 +1,2 @@
1
+ export { packageInfo } from './packageInfo.js';
2
+ export declare const transports: import("./types.js").TransportDef[];
package/build/node.js ADDED
@@ -0,0 +1,4 @@
1
+ import LedgerHid from '@ledgerhq/hw-transport-node-hid-singleton';
2
+ import { createDefs } from './util.js';
3
+ export { packageInfo } from './packageInfo.js';
4
+ export const transports = /*#__PURE__*/ createDefs(['hid', LedgerHid]);
@@ -0,0 +1,212 @@
1
+ {
2
+ "author": "Jaco Greeff <jacogr@gmail.com>",
3
+ "bugs": "https://github.com/pezkuwichain/pezkuwi-common/issues",
4
+ "engines": {
5
+ "node": ">=18"
6
+ },
7
+ "homepage": "https://github.com/pezkuwichain/pezkuwi-common/tree/master/packages/hw-ledger-transports#readme",
8
+ "license": "Apache-2.0",
9
+ "name": "@pezkuwi/hw-ledger-transports",
10
+ "repository": {
11
+ "directory": "packages/hw-ledger-transports",
12
+ "type": "git",
13
+ "url": "https://github.com/pezkuwichain/pezkuwi-common.git"
14
+ },
15
+ "sideEffects": false,
16
+ "type": "module",
17
+ "version": "14.0.6",
18
+ "main": "./cjs/node.js",
19
+ "module": "./node.js",
20
+ "browser": "./cjs/browser.js",
21
+ "react-native": "./cjs/react-native.js",
22
+ "types": "./node.d.ts",
23
+ "exports": {
24
+ "./cjs/package.json": "./cjs/package.json",
25
+ "./cjs/*": "./cjs/*.js",
26
+ ".": {
27
+ "types": "./node.d.ts",
28
+ "react-native": {
29
+ "module": {
30
+ "types": "./react-native.d.ts",
31
+ "default": "./react-native.js"
32
+ },
33
+ "require": {
34
+ "types": "./cjs/react-native.d.ts",
35
+ "default": "./cjs/react-native.js"
36
+ },
37
+ "default": {
38
+ "types": "./react-native.d.ts",
39
+ "default": "./react-native.js"
40
+ }
41
+ },
42
+ "browser": {
43
+ "module": {
44
+ "types": "./browser.d.ts",
45
+ "default": "./browser.js"
46
+ },
47
+ "require": {
48
+ "types": "./cjs/browser.d.ts",
49
+ "default": "./cjs/browser.js"
50
+ },
51
+ "default": {
52
+ "types": "./browser.d.ts",
53
+ "default": "./browser.js"
54
+ }
55
+ },
56
+ "node": {
57
+ "module": {
58
+ "types": "./node.d.ts",
59
+ "default": "./node.js"
60
+ },
61
+ "require": {
62
+ "types": "./cjs/node.d.ts",
63
+ "default": "./cjs/node.js"
64
+ },
65
+ "default": {
66
+ "types": "./node.d.ts",
67
+ "default": "./node.js"
68
+ }
69
+ }
70
+ },
71
+ "./browser": {
72
+ "module": {
73
+ "types": "./browser.d.ts",
74
+ "default": "./browser.js"
75
+ },
76
+ "require": {
77
+ "types": "./cjs/browser.d.ts",
78
+ "default": "./cjs/browser.js"
79
+ },
80
+ "default": {
81
+ "types": "./browser.d.ts",
82
+ "default": "./browser.js"
83
+ }
84
+ },
85
+ "./empty": {
86
+ "module": {
87
+ "types": "./empty.d.ts",
88
+ "default": "./empty.js"
89
+ },
90
+ "require": {
91
+ "types": "./cjs/empty.d.ts",
92
+ "default": "./cjs/empty.js"
93
+ },
94
+ "default": {
95
+ "types": "./empty.d.ts",
96
+ "default": "./empty.js"
97
+ }
98
+ },
99
+ "./node": {
100
+ "module": {
101
+ "types": "./node.d.ts",
102
+ "default": "./node.js"
103
+ },
104
+ "require": {
105
+ "types": "./cjs/node.d.ts",
106
+ "default": "./cjs/node.js"
107
+ },
108
+ "default": {
109
+ "types": "./node.d.ts",
110
+ "default": "./node.js"
111
+ }
112
+ },
113
+ "./package.json": {
114
+ "require": "./cjs/package.json",
115
+ "default": "./package.json"
116
+ },
117
+ "./packageDetect": {
118
+ "module": {
119
+ "types": "./packageDetect.d.ts",
120
+ "default": "./packageDetect.js"
121
+ },
122
+ "require": {
123
+ "types": "./cjs/packageDetect.d.ts",
124
+ "default": "./cjs/packageDetect.js"
125
+ },
126
+ "default": {
127
+ "types": "./packageDetect.d.ts",
128
+ "default": "./packageDetect.js"
129
+ }
130
+ },
131
+ "./packageInfo.js": {
132
+ "module": {
133
+ "types": "./packageInfo.d.ts",
134
+ "default": "./packageInfo.js"
135
+ },
136
+ "require": {
137
+ "types": "./cjs/packageInfo.d.ts",
138
+ "default": "./cjs/packageInfo.js"
139
+ },
140
+ "default": {
141
+ "types": "./packageInfo.d.ts",
142
+ "default": "./packageInfo.js"
143
+ }
144
+ },
145
+ "./packageInfo": {
146
+ "module": {
147
+ "types": "./packageInfo.d.ts",
148
+ "default": "./packageInfo.js"
149
+ },
150
+ "require": {
151
+ "types": "./cjs/packageInfo.d.ts",
152
+ "default": "./cjs/packageInfo.js"
153
+ },
154
+ "default": {
155
+ "types": "./packageInfo.d.ts",
156
+ "default": "./packageInfo.js"
157
+ }
158
+ },
159
+ "./react-native": {
160
+ "module": {
161
+ "types": "./react-native.d.ts",
162
+ "default": "./react-native.js"
163
+ },
164
+ "require": {
165
+ "types": "./cjs/react-native.d.ts",
166
+ "default": "./cjs/react-native.js"
167
+ },
168
+ "default": {
169
+ "types": "./react-native.d.ts",
170
+ "default": "./react-native.js"
171
+ }
172
+ },
173
+ "./types": {
174
+ "module": {
175
+ "types": "./types.d.ts",
176
+ "default": "./types.js"
177
+ },
178
+ "require": {
179
+ "types": "./cjs/types.d.ts",
180
+ "default": "./cjs/types.js"
181
+ },
182
+ "default": {
183
+ "types": "./types.d.ts",
184
+ "default": "./types.js"
185
+ }
186
+ },
187
+ "./util": {
188
+ "module": {
189
+ "types": "./util.d.ts",
190
+ "default": "./util.js"
191
+ },
192
+ "require": {
193
+ "types": "./cjs/util.d.ts",
194
+ "default": "./cjs/util.js"
195
+ },
196
+ "default": {
197
+ "types": "./util.d.ts",
198
+ "default": "./util.js"
199
+ }
200
+ }
201
+ },
202
+ "dependencies": {
203
+ "@ledgerhq/hw-transport": "^6.31.4",
204
+ "@ledgerhq/hw-transport-webhid": "^6.29.4",
205
+ "@ledgerhq/hw-transport-webusb": "^6.29.4",
206
+ "@pezkuwi/util": "14.0.1",
207
+ "tslib": "^2.8.0"
208
+ },
209
+ "optionalDependencies": {
210
+ "@ledgerhq/hw-transport-node-hid-singleton": "^6.31.5"
211
+ }
212
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { detectPackage } from '@pezkuwi/util';
2
+ import { packageInfo } from './packageInfo.js';
3
+ detectPackage(packageInfo, null, []);
@@ -0,0 +1,6 @@
1
+ export declare const packageInfo: {
2
+ name: string;
3
+ path: string;
4
+ type: string;
5
+ version: string;
6
+ };
@@ -0,0 +1 @@
1
+ export const packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };
@@ -0,0 +1 @@
1
+ export * from './empty.js';
@@ -0,0 +1 @@
1
+ export * from './empty.js';
@@ -0,0 +1,9 @@
1
+ import type * as HwTransport from '@ledgerhq/hw-transport';
2
+ export type TransportType = 'hid' | 'webusb';
3
+ export type Transport = HwTransport.default;
4
+ export interface TransportDef {
5
+ /** Create a transport to be used in Ledger operations */
6
+ create(): Promise<Transport>;
7
+ /** The type of the underlying transport definition */
8
+ type: TransportType;
9
+ }
package/build/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { TransportDef, TransportType } from './types.js';
2
+ export declare function createDefs(...items: readonly [type: TransportType, Clazz: unknown][]): TransportDef[];
package/build/util.js ADDED
@@ -0,0 +1,6 @@
1
+ export function createDefs(...items) {
2
+ return items.map(([type, Clazz]) => ({
3
+ create: () => Clazz.create(),
4
+ type
5
+ }));
6
+ }
@@ -0,0 +1,2 @@
1
+ # @pezkuwi/hw-ledger-transports
2
+
@@ -0,0 +1,9 @@
1
+
2
+ import LedgerHid from 'https://esm.sh/@ledgerhq/hw-transport-webhid@6.29.4';
3
+ import LedgerUsb from 'https://esm.sh/@ledgerhq/hw-transport-webusb@6.29.4';
4
+
5
+ import { createDefs } from './util.ts';
6
+
7
+ export { packageInfo } from './packageInfo.ts';
8
+
9
+ export const transports = /*#__PURE__*/ createDefs(['webusb', LedgerUsb], ['hid', LedgerHid]);
@@ -0,0 +1,6 @@
1
+
2
+ import { createDefs } from './util.ts';
3
+
4
+ export { packageInfo } from './packageInfo.ts';
5
+
6
+ export const transports = /*#__PURE__*/ createDefs();
@@ -0,0 +1,2 @@
1
+
2
+ export * from './empty.ts';
@@ -0,0 +1,8 @@
1
+
2
+ import LedgerHid from 'https://esm.sh/@ledgerhq/hw-transport-node-hid-singleton@6.31.5';
3
+
4
+ import { createDefs } from './util.ts';
5
+
6
+ export { packageInfo } from './packageInfo.ts';
7
+
8
+ export const transports = /*#__PURE__*/ createDefs(['hid', LedgerHid]);
@@ -0,0 +1,7 @@
1
+
2
+
3
+ import { detectPackage } from 'https://deno.land/x/pezkuwi/util/mod.ts';
4
+
5
+ import { packageInfo } from './packageInfo.ts';
6
+
7
+ detectPackage(packageInfo, null, []);
@@ -0,0 +1,3 @@
1
+
2
+
3
+ export const packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: new URL(import.meta.url).pathname, type: 'deno', version: '14.0.6' };
@@ -0,0 +1,2 @@
1
+
2
+ export * from './empty.ts';
@@ -0,0 +1,13 @@
1
+
2
+ import type * as HwTransport from 'https://esm.sh/@ledgerhq/hw-transport@6.31.4';
3
+
4
+ export type TransportType = 'hid' | 'webusb';
5
+
6
+ export type Transport = HwTransport.default;
7
+
8
+ export interface TransportDef {
9
+ /** Create a transport to be used in Ledger operations */
10
+ create (): Promise<Transport>;
11
+ /** The type of the underlying transport definition */
12
+ type: TransportType;
13
+ }
@@ -0,0 +1,10 @@
1
+
2
+ import type { Transport, TransportDef, TransportType } from './types.ts';
3
+
4
+ export function createDefs (...items: readonly [type: TransportType, Clazz: unknown][]): TransportDef[] {
5
+ return items.map(([type, Clazz]): TransportDef => ({
6
+ create: (): Promise<Transport> =>
7
+ (Clazz as Pick<TransportDef, 'create'>).create(),
8
+ type
9
+ }));
10
+ }
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageInfo = void 0;
4
- exports.packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.1' };
4
+ exports.packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.6' };
@@ -1 +1 @@
1
- export const packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.1' };
1
+ export const packageInfo = { name: '@pezkuwi/hw-ledger-transports', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };