@btc-vision/bitcoin 7.0.0-alpha.4 → 7.0.0-alpha.5

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 (40) hide show
  1. package/browser/chunks/index.browser-CUaPaKyS.js +10742 -0
  2. package/browser/index.js +1884 -12608
  3. package/browser/workers/index.browser.d.ts +16 -0
  4. package/browser/workers/index.browser.d.ts.map +1 -0
  5. package/browser/workers/index.d.ts +3 -16
  6. package/browser/workers/index.d.ts.map +1 -1
  7. package/browser/workers/index.js +21 -0
  8. package/browser/workers/index.node.d.ts +12 -19
  9. package/browser/workers/index.node.d.ts.map +1 -1
  10. package/browser/workers/index.shared.d.ts +15 -0
  11. package/browser/workers/index.shared.d.ts.map +1 -0
  12. package/browser/workers/types.d.ts +5 -0
  13. package/browser/workers/types.d.ts.map +1 -1
  14. package/build/tsconfig.build.tsbuildinfo +1 -1
  15. package/build/workers/index.browser.d.ts +24 -0
  16. package/build/workers/index.browser.d.ts.map +1 -0
  17. package/build/workers/index.browser.js +30 -0
  18. package/build/workers/index.browser.js.map +1 -0
  19. package/build/workers/index.d.ts +5 -17
  20. package/build/workers/index.d.ts.map +1 -1
  21. package/build/workers/index.js +3 -11
  22. package/build/workers/index.js.map +1 -1
  23. package/build/workers/index.node.d.ts +17 -3
  24. package/build/workers/index.node.d.ts.map +1 -1
  25. package/build/workers/index.node.js +23 -4
  26. package/build/workers/index.node.js.map +1 -1
  27. package/build/workers/index.shared.d.ts +15 -0
  28. package/build/workers/index.shared.d.ts.map +1 -0
  29. package/build/workers/index.shared.js +20 -0
  30. package/build/workers/index.shared.js.map +1 -0
  31. package/build/workers/types.d.ts +5 -0
  32. package/build/workers/types.d.ts.map +1 -1
  33. package/package.json +9 -1
  34. package/src/workers/index.browser.ts +34 -0
  35. package/src/workers/index.node.ts +28 -5
  36. package/src/workers/index.shared.ts +58 -0
  37. package/src/workers/index.ts +6 -64
  38. package/src/workers/types.ts +5 -0
  39. package/vite.config.browser.ts +31 -6
  40. package/browser/chunks/WorkerSigningPool.sequential-DHha7j0b.js +0 -113
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Browser worker pool entry point.
3
+ *
4
+ * Uses Web Workers for parallel signing. Never references Node.js modules
5
+ * (worker_threads, os, etc.), so it is safe for browser bundlers.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
10
+ export * from './index.shared.js';
11
+ /**
12
+ * Detects the runtime environment.
13
+ *
14
+ * @returns Always 'browser' in this entry point.
15
+ */
16
+ export declare function detectRuntime(): 'node' | 'browser' | 'react-native' | 'unknown';
17
+ /**
18
+ * Creates a signing pool for the browser runtime using Web Workers.
19
+ *
20
+ * @param config - Optional pool configuration
21
+ * @returns A promise resolving to the initialized signing pool
22
+ */
23
+ export declare function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike>;
24
+ //# sourceMappingURL=index.browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../src/workers/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,mBAAmB,CAAC;AAElC;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAE/E;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAK3F"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Browser worker pool entry point.
3
+ *
4
+ * Uses Web Workers for parallel signing. Never references Node.js modules
5
+ * (worker_threads, os, etc.), so it is safe for browser bundlers.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ export * from './index.shared.js';
10
+ /**
11
+ * Detects the runtime environment.
12
+ *
13
+ * @returns Always 'browser' in this entry point.
14
+ */
15
+ export function detectRuntime() {
16
+ return 'browser';
17
+ }
18
+ /**
19
+ * Creates a signing pool for the browser runtime using Web Workers.
20
+ *
21
+ * @param config - Optional pool configuration
22
+ * @returns A promise resolving to the initialized signing pool
23
+ */
24
+ export async function createSigningPool(config) {
25
+ const { WorkerSigningPool } = await import('./WorkerSigningPool.js');
26
+ const pool = WorkerSigningPool.getInstance(config);
27
+ await pool.initialize();
28
+ return pool;
29
+ }
30
+ //# sourceMappingURL=index.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../src/workers/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,cAAc,mBAAmB,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,aAAa;IACzB,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAyB;IAC7D,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IACrE,MAAM,IAAI,GAAG,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IACxB,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Worker-based parallel signing module.
2
+ * Worker-based parallel signing module (generic entry point).
3
3
  *
4
4
  * Provides secure parallel signature computation using worker threads.
5
5
  * Works in both Node.js (worker_threads) and browsers (Web Workers).
6
+ * Uses runtime detection to select the appropriate pool implementation.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
@@ -45,12 +46,8 @@
45
46
  *
46
47
  * @packageDocumentation
47
48
  */
48
- import type { WorkerPoolConfig, SigningTask, ParallelSignerKeyPair, ParallelSigningResult } from './types.js';
49
- export { SignatureType, type SigningTaskMessage, type BatchSigningMessage, type BatchSigningTask, type BatchSigningResultMessage, type BatchSigningTaskResult, type BatchSigningTaskError, type WorkerInitMessage, type WorkerShutdownMessage, type WorkerMessage, type SigningResultMessage, type SigningErrorMessage, type WorkerReadyMessage, type WorkerShutdownAckMessage, type WorkerResponse, isSigningError, isSigningResult, isBatchResult, isWorkerReady, type WorkerEccLib, type WorkerPoolConfig, type SigningTask, type ParallelSignerKeyPair, type ParallelSigningResult, type SigningPoolLike, WorkerState, type PooledWorker, } from './types.js';
50
- export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
51
- export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
52
- export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
53
- export { signPsbtParallel, prepareSigningTasks, applySignaturesToPsbt, type ParallelSignOptions, type PsbtParallelKeyPair, } from './psbt-parallel.js';
49
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
50
+ export * from './index.shared.js';
54
51
  /**
55
52
  * Detects the runtime environment and returns the appropriate signing pool.
56
53
  *
@@ -78,14 +75,5 @@ export declare function detectRuntime(): 'node' | 'browser' | 'react-native' | '
78
75
  * await pool.shutdown();
79
76
  * ```
80
77
  */
81
- export declare function createSigningPool(config?: WorkerPoolConfig): Promise<{
82
- signBatch: (tasks: readonly SigningTask[], keyPair: ParallelSignerKeyPair) => Promise<ParallelSigningResult>;
83
- preserveWorkers: () => void;
84
- releaseWorkers: () => void;
85
- shutdown: () => Promise<void>;
86
- workerCount: number;
87
- idleWorkerCount: number;
88
- busyWorkerCount: number;
89
- isPreservingWorkers: boolean;
90
- }>;
78
+ export declare function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike>;
91
79
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AA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qB,KAC7B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;CAChC,CAAC,CAqBD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,mBAAmB,CAAC;AAElC;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAW/E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAqB3F"}
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Worker-based parallel signing module.
2
+ * Worker-based parallel signing module (generic entry point).
3
3
  *
4
4
  * Provides secure parallel signature computation using worker threads.
5
5
  * Works in both Node.js (worker_threads) and browsers (Web Workers).
6
+ * Uses runtime detection to select the appropriate pool implementation.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
@@ -45,16 +46,7 @@
45
46
  *
46
47
  * @packageDocumentation
47
48
  */
48
- // Type exports
49
- export { SignatureType, isSigningError, isSigningResult, isBatchResult, isWorkerReady, WorkerState, } from './types.js';
50
- // Browser worker pool
51
- export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
52
- // Worker code generation (for custom implementations)
53
- export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
54
- // ECC bundle (for embedding in custom workers)
55
- export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
56
- // PSBT parallel signing integration
57
- export { signPsbtParallel, prepareSigningTasks, applySignaturesToPsbt, } from './psbt-parallel.js';
49
+ export * from './index.shared.js';
58
50
  /**
59
51
  * Detects the runtime environment and returns the appropriate signing pool.
60
52
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAIH,eAAe;AACf,OAAO,EACH,aAAa,EAeb,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EAOb,WAAW,GAEd,MAAM,YAAY,CAAC;AAEpB,sBAAsB;AACtB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE3E,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEnG,+CAA+C;AAC/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,oCAAoC;AACpC,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,GAGxB,MAAM,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,UAAU,aAAa;IACzB,IAAI,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,OAAO,KAAK,aAAa,EAAE,CAAC;QAC1E,OAAO,cAAc,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC3D,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,KAAK,WAAW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,CAAC,CAAC;QACpF,MAAM,IAAI,GAAG,qBAAqB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACnE,CAAC;AACL,CAAC"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Node.js worker pool entry point.
3
3
  *
4
- * This module provides direct access to Node.js-specific worker functionality.
5
- * It re-exports everything from the base index plus Node.js specific exports.
4
+ * Uses worker_threads for parallel signing. Provides direct access to
5
+ * NodeWorkerSigningPool without runtime detection overhead.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
@@ -19,6 +19,20 @@
19
19
  *
20
20
  * @packageDocumentation
21
21
  */
22
- export * from './index.js';
22
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
23
+ export * from './index.shared.js';
23
24
  export { NodeWorkerSigningPool, type NodeWorkerPoolConfig } from './WorkerSigningPool.node.js';
25
+ /**
26
+ * Detects the runtime environment.
27
+ *
28
+ * @returns Always 'node' in this entry point.
29
+ */
30
+ export declare function detectRuntime(): 'node' | 'browser' | 'react-native' | 'unknown';
31
+ /**
32
+ * Creates a signing pool for the Node.js runtime using worker_threads.
33
+ *
34
+ * @param config - Optional pool configuration
35
+ * @returns A promise resolving to the initialized signing pool
36
+ */
37
+ export declare function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike>;
24
38
  //# sourceMappingURL=index.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/workers/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/workers/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAE/F;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAE/E;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAK3F"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Node.js worker pool entry point.
3
3
  *
4
- * This module provides direct access to Node.js-specific worker functionality.
5
- * It re-exports everything from the base index plus Node.js specific exports.
4
+ * Uses worker_threads for parallel signing. Provides direct access to
5
+ * NodeWorkerSigningPool without runtime detection overhead.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
@@ -19,8 +19,27 @@
19
19
  *
20
20
  * @packageDocumentation
21
21
  */
22
- // Re-export everything from browser-safe index
23
- export * from './index.js';
22
+ export * from './index.shared.js';
24
23
  // Node.js specific exports
25
24
  export { NodeWorkerSigningPool } from './WorkerSigningPool.node.js';
25
+ /**
26
+ * Detects the runtime environment.
27
+ *
28
+ * @returns Always 'node' in this entry point.
29
+ */
30
+ export function detectRuntime() {
31
+ return 'node';
32
+ }
33
+ /**
34
+ * Creates a signing pool for the Node.js runtime using worker_threads.
35
+ *
36
+ * @param config - Optional pool configuration
37
+ * @returns A promise resolving to the initialized signing pool
38
+ */
39
+ export async function createSigningPool(config) {
40
+ const { NodeWorkerSigningPool } = await import('./WorkerSigningPool.node.js');
41
+ const pool = NodeWorkerSigningPool.getInstance(config);
42
+ await pool.initialize();
43
+ return pool;
44
+ }
26
45
  //# sourceMappingURL=index.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../src/workers/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,+CAA+C;AAC/C,cAAc,YAAY,CAAC;AAE3B,2BAA2B;AAC3B,OAAO,EAAE,qBAAqB,EAA6B,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../src/workers/index.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,cAAc,mBAAmB,CAAC;AAElC,2BAA2B;AAC3B,OAAO,EAAE,qBAAqB,EAA6B,MAAM,6BAA6B,CAAC;AAE/F;;;;GAIG;AACH,MAAM,UAAU,aAAa;IACzB,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAyB;IAC7D,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAC9E,MAAM,IAAI,GAAG,qBAAqB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IACxB,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shared worker module exports.
3
+ *
4
+ * Contains all platform-agnostic exports used by browser, Node.js, and generic
5
+ * entry points. Platform-specific entry points re-export from this module and
6
+ * add their own `detectRuntime` and `createSigningPool` implementations.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ export { SignatureType, type SigningTaskMessage, type BatchSigningMessage, type BatchSigningTask, type BatchSigningResultMessage, type BatchSigningTaskResult, type BatchSigningTaskError, type WorkerInitMessage, type WorkerShutdownMessage, type WorkerMessage, type SigningResultMessage, type SigningErrorMessage, type WorkerReadyMessage, type WorkerShutdownAckMessage, type WorkerResponse, isSigningError, isSigningResult, isBatchResult, isWorkerReady, type WorkerEccLib, type WorkerPoolConfig, type SigningTask, type ParallelSignerKeyPair, type ParallelSigningResult, type SigningPoolLike, WorkerState, type PooledWorker, } from './types.js';
11
+ export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
12
+ export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
13
+ export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
14
+ export { signPsbtParallel, prepareSigningTasks, applySignaturesToPsbt, type ParallelSignOptions, type PsbtParallelKeyPair, } from './psbt-parallel.js';
15
+ //# sourceMappingURL=index.shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.shared.d.ts","sourceRoot":"","sources":["../../src/workers/index.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACH,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,YAAY,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG3E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAGnG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GAC3B,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared worker module exports.
3
+ *
4
+ * Contains all platform-agnostic exports used by browser, Node.js, and generic
5
+ * entry points. Platform-specific entry points re-export from this module and
6
+ * add their own `detectRuntime` and `createSigningPool` implementations.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ // Type exports
11
+ export { SignatureType, isSigningError, isSigningResult, isBatchResult, isWorkerReady, WorkerState, } from './types.js';
12
+ // Browser worker pool
13
+ export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
14
+ // Worker code generation (for custom implementations)
15
+ export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
16
+ // ECC bundle (for embedding in custom workers)
17
+ export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
18
+ // PSBT parallel signing integration
19
+ export { signPsbtParallel, prepareSigningTasks, applySignaturesToPsbt, } from './psbt-parallel.js';
20
+ //# sourceMappingURL=index.shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.shared.js","sourceRoot":"","sources":["../../src/workers/index.shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAe;AACf,OAAO,EACH,aAAa,EAeb,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EAOb,WAAW,GAEd,MAAM,YAAY,CAAC;AAEpB,sBAAsB;AACtB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE3E,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEnG,+CAA+C;AAC/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9D,oCAAoC;AACpC,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,GAGxB,MAAM,oBAAoB,CAAC"}
@@ -355,8 +355,13 @@ export type WorkerState = (typeof WorkerState)[keyof typeof WorkerState];
355
355
  */
356
356
  export interface SigningPoolLike {
357
357
  signBatch(tasks: readonly SigningTask[], keyPair: ParallelSignerKeyPair): Promise<ParallelSigningResult>;
358
+ preserveWorkers(): void;
359
+ releaseWorkers(): void;
358
360
  initialize(): Promise<void>;
359
361
  shutdown(): Promise<void>;
362
+ readonly workerCount: number;
363
+ readonly idleWorkerCount: number;
364
+ readonly busyWorkerCount: number;
360
365
  readonly isPreservingWorkers: boolean;
361
366
  }
362
367
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;IACtB,kCAAkC;;IAElC,iCAAiC;;CAE3B,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,wCAAwC;IACxC,QAAQ,CAAC,UAA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AC3B,KAAK,EAAE,WAAW,CAAC;IACnB,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,0CAA0C;IAC1C,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@btc-vision/bitcoin",
3
3
  "type": "module",
4
- "version": "7.0.0-alpha.4",
4
+ "version": "7.0.0-alpha.5",
5
5
  "sideEffects": false,
6
6
  "description": "Client-side Bitcoin JavaScript library",
7
7
  "engines": {
@@ -201,6 +201,14 @@
201
201
  "vite-plugin-wasm": "^3.5.0",
202
202
  "vitest": "^4.0.18"
203
203
  },
204
+ "peerDependencies": {
205
+ "react-native-worklets": ">=0.7.0"
206
+ },
207
+ "peerDependenciesMeta": {
208
+ "react-native-worklets": {
209
+ "optional": true
210
+ }
211
+ },
204
212
  "dependencies": {
205
213
  "@btc-vision/bip32": "^7.0.2",
206
214
  "@btc-vision/ecpair": "^4.0.2",
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Browser worker pool entry point.
3
+ *
4
+ * Uses Web Workers for parallel signing. Never references Node.js modules
5
+ * (worker_threads, os, etc.), so it is safe for browser bundlers.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+
10
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
11
+
12
+ export * from './index.shared.js';
13
+
14
+ /**
15
+ * Detects the runtime environment.
16
+ *
17
+ * @returns Always 'browser' in this entry point.
18
+ */
19
+ export function detectRuntime(): 'node' | 'browser' | 'react-native' | 'unknown' {
20
+ return 'browser';
21
+ }
22
+
23
+ /**
24
+ * Creates a signing pool for the browser runtime using Web Workers.
25
+ *
26
+ * @param config - Optional pool configuration
27
+ * @returns A promise resolving to the initialized signing pool
28
+ */
29
+ export async function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike> {
30
+ const { WorkerSigningPool } = await import('./WorkerSigningPool.js');
31
+ const pool = WorkerSigningPool.getInstance(config);
32
+ await pool.initialize();
33
+ return pool;
34
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Node.js worker pool entry point.
3
3
  *
4
- * This module provides direct access to Node.js-specific worker functionality.
5
- * It re-exports everything from the base index plus Node.js specific exports.
4
+ * Uses worker_threads for parallel signing. Provides direct access to
5
+ * NodeWorkerSigningPool without runtime detection overhead.
6
6
  *
7
7
  * @example
8
8
  * ```typescript
@@ -20,8 +20,31 @@
20
20
  * @packageDocumentation
21
21
  */
22
22
 
23
- // Re-export everything from browser-safe index
24
- export * from './index.js';
23
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
24
+
25
+ export * from './index.shared.js';
25
26
 
26
27
  // Node.js specific exports
27
- export { NodeWorkerSigningPool, type NodeWorkerPoolConfig } from './WorkerSigningPool.node.js';
28
+ export { NodeWorkerSigningPool, type NodeWorkerPoolConfig } from './WorkerSigningPool.node.js';
29
+
30
+ /**
31
+ * Detects the runtime environment.
32
+ *
33
+ * @returns Always 'node' in this entry point.
34
+ */
35
+ export function detectRuntime(): 'node' | 'browser' | 'react-native' | 'unknown' {
36
+ return 'node';
37
+ }
38
+
39
+ /**
40
+ * Creates a signing pool for the Node.js runtime using worker_threads.
41
+ *
42
+ * @param config - Optional pool configuration
43
+ * @returns A promise resolving to the initialized signing pool
44
+ */
45
+ export async function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike> {
46
+ const { NodeWorkerSigningPool } = await import('./WorkerSigningPool.node.js');
47
+ const pool = NodeWorkerSigningPool.getInstance(config);
48
+ await pool.initialize();
49
+ return pool;
50
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Shared worker module exports.
3
+ *
4
+ * Contains all platform-agnostic exports used by browser, Node.js, and generic
5
+ * entry points. Platform-specific entry points re-export from this module and
6
+ * add their own `detectRuntime` and `createSigningPool` implementations.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+
11
+ // Type exports
12
+ export {
13
+ SignatureType,
14
+ type SigningTaskMessage,
15
+ type BatchSigningMessage,
16
+ type BatchSigningTask,
17
+ type BatchSigningResultMessage,
18
+ type BatchSigningTaskResult,
19
+ type BatchSigningTaskError,
20
+ type WorkerInitMessage,
21
+ type WorkerShutdownMessage,
22
+ type WorkerMessage,
23
+ type SigningResultMessage,
24
+ type SigningErrorMessage,
25
+ type WorkerReadyMessage,
26
+ type WorkerShutdownAckMessage,
27
+ type WorkerResponse,
28
+ isSigningError,
29
+ isSigningResult,
30
+ isBatchResult,
31
+ isWorkerReady,
32
+ type WorkerEccLib,
33
+ type WorkerPoolConfig,
34
+ type SigningTask,
35
+ type ParallelSignerKeyPair,
36
+ type ParallelSigningResult,
37
+ type SigningPoolLike,
38
+ WorkerState,
39
+ type PooledWorker,
40
+ } from './types.js';
41
+
42
+ // Browser worker pool
43
+ export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
44
+
45
+ // Worker code generation (for custom implementations)
46
+ export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
47
+
48
+ // ECC bundle (for embedding in custom workers)
49
+ export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
50
+
51
+ // PSBT parallel signing integration
52
+ export {
53
+ signPsbtParallel,
54
+ prepareSigningTasks,
55
+ applySignaturesToPsbt,
56
+ type ParallelSignOptions,
57
+ type PsbtParallelKeyPair,
58
+ } from './psbt-parallel.js';
@@ -1,8 +1,9 @@
1
1
  /**
2
- * Worker-based parallel signing module.
2
+ * Worker-based parallel signing module (generic entry point).
3
3
  *
4
4
  * Provides secure parallel signature computation using worker threads.
5
5
  * Works in both Node.js (worker_threads) and browsers (Web Workers).
6
+ * Uses runtime detection to select the appropriate pool implementation.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
@@ -46,56 +47,9 @@
46
47
  * @packageDocumentation
47
48
  */
48
49
 
49
- import type { WorkerPoolConfig, SigningTask, ParallelSignerKeyPair, ParallelSigningResult } from './types.js';
50
+ import type { WorkerPoolConfig, SigningPoolLike } from './types.js';
50
51
 
51
- // Type exports
52
- export {
53
- SignatureType,
54
- type SigningTaskMessage,
55
- type BatchSigningMessage,
56
- type BatchSigningTask,
57
- type BatchSigningResultMessage,
58
- type BatchSigningTaskResult,
59
- type BatchSigningTaskError,
60
- type WorkerInitMessage,
61
- type WorkerShutdownMessage,
62
- type WorkerMessage,
63
- type SigningResultMessage,
64
- type SigningErrorMessage,
65
- type WorkerReadyMessage,
66
- type WorkerShutdownAckMessage,
67
- type WorkerResponse,
68
- isSigningError,
69
- isSigningResult,
70
- isBatchResult,
71
- isWorkerReady,
72
- type WorkerEccLib,
73
- type WorkerPoolConfig,
74
- type SigningTask,
75
- type ParallelSignerKeyPair,
76
- type ParallelSigningResult,
77
- type SigningPoolLike,
78
- WorkerState,
79
- type PooledWorker,
80
- } from './types.js';
81
-
82
- // Browser worker pool
83
- export { WorkerSigningPool, getSigningPool } from './WorkerSigningPool.js';
84
-
85
- // Worker code generation (for custom implementations)
86
- export { generateWorkerCode, createWorkerBlobUrl, revokeWorkerBlobUrl } from './signing-worker.js';
87
-
88
- // ECC bundle (for embedding in custom workers)
89
- export { ECC_BUNDLE, ECC_BUNDLE_SIZE } from './ecc-bundle.js';
90
-
91
- // PSBT parallel signing integration
92
- export {
93
- signPsbtParallel,
94
- prepareSigningTasks,
95
- applySignaturesToPsbt,
96
- type ParallelSignOptions,
97
- type PsbtParallelKeyPair,
98
- } from './psbt-parallel.js';
52
+ export * from './index.shared.js';
99
53
 
100
54
  /**
101
55
  * Detects the runtime environment and returns the appropriate signing pool.
@@ -136,19 +90,7 @@ export function detectRuntime(): 'node' | 'browser' | 'react-native' | 'unknown'
136
90
  * await pool.shutdown();
137
91
  * ```
138
92
  */
139
- export async function createSigningPool(config?: WorkerPoolConfig): Promise<{
140
- signBatch: (
141
- tasks: readonly SigningTask[],
142
- keyPair: ParallelSignerKeyPair,
143
- ) => Promise<ParallelSigningResult>;
144
- preserveWorkers: () => void;
145
- releaseWorkers: () => void;
146
- shutdown: () => Promise<void>;
147
- workerCount: number;
148
- idleWorkerCount: number;
149
- busyWorkerCount: number;
150
- isPreservingWorkers: boolean;
151
- }> {
93
+ export async function createSigningPool(config?: WorkerPoolConfig): Promise<SigningPoolLike> {
152
94
  const runtime = detectRuntime();
153
95
 
154
96
  if (runtime === 'node') {
@@ -169,4 +111,4 @@ export async function createSigningPool(config?: WorkerPoolConfig): Promise<{
169
111
  } else {
170
112
  throw new Error('Unsupported runtime for worker signing pool');
171
113
  }
172
- }
114
+ }
@@ -411,8 +411,13 @@ export interface SigningPoolLike {
411
411
  tasks: readonly SigningTask[],
412
412
  keyPair: ParallelSignerKeyPair,
413
413
  ): Promise<ParallelSigningResult>;
414
+ preserveWorkers(): void;
415
+ releaseWorkers(): void;
414
416
  initialize(): Promise<void>;
415
417
  shutdown(): Promise<void>;
418
+ readonly workerCount: number;
419
+ readonly idleWorkerCount: number;
420
+ readonly busyWorkerCount: number;
416
421
  readonly isPreservingWorkers: boolean;
417
422
  }
418
423