zeldhash-miner 0.1.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/LICENSE +22 -0
- package/README.md +244 -0
- package/dist/index.d.ts +218 -0
- package/dist/index.js +775 -0
- package/dist/index.js.map +1 -0
- package/dist/worker.js +339 -0
- package/dist/worker.js.map +1 -0
- package/package.json +58 -0
- package/wasm/package.json +31 -0
- package/wasm/zeldhash_miner_wasm.d.ts +82 -0
- package/wasm/zeldhash_miner_wasm.js +1412 -0
- package/wasm/zeldhash_miner_wasm_bg.wasm +0 -0
- package/wasm/zeldhash_miner_wasm_bg.wasm.d.ts +27 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zeldhash-miner-wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"collaborators": [
|
|
5
|
+
"Ouziel Slama <ouziel@gmail.com>"
|
|
6
|
+
],
|
|
7
|
+
"description": "WASM bindings for the Zeldhash miner with optional WebGPU acceleration",
|
|
8
|
+
"version": "0.1.0",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/zeldhash/zeldhash-miner"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"zeldhash_miner_wasm_bg.wasm",
|
|
16
|
+
"zeldhash_miner_wasm.js",
|
|
17
|
+
"zeldhash_miner_wasm.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"main": "zeldhash_miner_wasm.js",
|
|
20
|
+
"homepage": "https://github.com/zeldhash/zeldhash-miner",
|
|
21
|
+
"types": "zeldhash_miner_wasm.d.ts",
|
|
22
|
+
"sideEffects": [
|
|
23
|
+
"./snippets/*"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"bitcoin",
|
|
27
|
+
"mining",
|
|
28
|
+
"wasm",
|
|
29
|
+
"webgpu"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export function build_mining_template(inputs: any, outputs: any, network: string, sats_per_vbyte: bigint, start_nonce: bigint, batch_size: number, distribution: any): any;
|
|
5
|
+
|
|
6
|
+
export function build_psbt(inputs: any, outputs: any, network: string, sats_per_vbyte: bigint, nonce: bigint, distribution: any): string;
|
|
7
|
+
|
|
8
|
+
export function calibrate_batch_size(): Promise<number>;
|
|
9
|
+
|
|
10
|
+
export function compute_txid(tx_bytes: Uint8Array): string;
|
|
11
|
+
|
|
12
|
+
export function init_gpu(): Promise<any>;
|
|
13
|
+
|
|
14
|
+
export function init_panic_hook(): void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Dispatch a GPU batch and return the match with the smallest nonce (OP_RETURN value).
|
|
18
|
+
*/
|
|
19
|
+
export function mine_batch_gpu(tx_prefix: Uint8Array, tx_suffix: Uint8Array, start_nonce: bigint, batch_size: number, target_zeros: number, use_cbor_nonce: boolean): Promise<any>;
|
|
20
|
+
|
|
21
|
+
export function mine_batch_wasm(tx_prefix: Uint8Array, tx_suffix: Uint8Array, start_nonce: bigint, batch_size: number, target_zeros: number, use_cbor_nonce: boolean): any;
|
|
22
|
+
|
|
23
|
+
export function mine_range_gpu(inputs: any, outputs: any, network: string, sats_per_vbyte: bigint, range: any, target_zeros: number, distribution: any): Promise<any>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Mine across a nonce range, automatically splitting at byte-length boundaries.
|
|
27
|
+
*/
|
|
28
|
+
export function mine_range_wasm(inputs: any, outputs: any, network: string, sats_per_vbyte: bigint, range: any, target_zeros: number, distribution: any): any;
|
|
29
|
+
|
|
30
|
+
export function validate_address(addr: string, network: string): any;
|
|
31
|
+
|
|
32
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
33
|
+
|
|
34
|
+
export interface InitOutput {
|
|
35
|
+
readonly memory: WebAssembly.Memory;
|
|
36
|
+
readonly mine_batch_wasm: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number) => any;
|
|
37
|
+
readonly mine_range_wasm: (a: any, b: any, c: number, d: number, e: bigint, f: any, g: number, h: any) => any;
|
|
38
|
+
readonly validate_address: (a: number, b: number, c: number, d: number) => any;
|
|
39
|
+
readonly build_psbt: (a: any, b: any, c: number, d: number, e: bigint, f: bigint, g: any) => [number, number, number, number];
|
|
40
|
+
readonly build_mining_template: (a: any, b: any, c: number, d: number, e: bigint, f: bigint, g: number, h: any) => [number, number, number];
|
|
41
|
+
readonly compute_txid: (a: number, b: number) => [number, number];
|
|
42
|
+
readonly init_gpu: () => any;
|
|
43
|
+
readonly mine_batch_gpu: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number) => any;
|
|
44
|
+
readonly mine_range_gpu: (a: any, b: any, c: number, d: number, e: bigint, f: any, g: number, h: any) => any;
|
|
45
|
+
readonly calibrate_batch_size: () => any;
|
|
46
|
+
readonly init_panic_hook: () => void;
|
|
47
|
+
readonly wasm_bindgen__convert__closures_____invoke__h4173f797cb68abd1: (a: number, b: number, c: any) => void;
|
|
48
|
+
readonly wasm_bindgen__closure__destroy__h08603745582b4e0f: (a: number, b: number) => void;
|
|
49
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1a38164a3a667135: (a: number, b: number, c: any) => void;
|
|
50
|
+
readonly wasm_bindgen__closure__destroy__h16b8b0f00158f31c: (a: number, b: number) => void;
|
|
51
|
+
readonly wasm_bindgen__convert__closures_____invoke__h2845bf56d21a7dac: (a: number, b: number, c: any, d: any) => void;
|
|
52
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
53
|
+
readonly __externref_table_alloc: () => number;
|
|
54
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
55
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
56
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
57
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
58
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
59
|
+
readonly __wbindgen_start: () => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
66
|
+
* a precompiled `WebAssembly.Module`.
|
|
67
|
+
*
|
|
68
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
69
|
+
*
|
|
70
|
+
* @returns {InitOutput}
|
|
71
|
+
*/
|
|
72
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
76
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
77
|
+
*
|
|
78
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
79
|
+
*
|
|
80
|
+
* @returns {Promise<InitOutput>}
|
|
81
|
+
*/
|
|
82
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|