chia_wasm 0.2.6 → 0.8.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 CHANGED
@@ -6,7 +6,7 @@ Build
6
6
  Use `wasm-pack` to build the wasm `pkg` file used with npm. Install it with:
7
7
 
8
8
  ```
9
- $ cargo install wasm-pack
9
+ $ cargo install wasm-pack --locked
10
10
  ```
11
11
 
12
12
  Then build with
package/chia_wasm.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @returns {BigInt}
4
+ * @returns {bigint}
5
5
  */
6
- export function a_test_function(): BigInt;
6
+ export function a_test_function(): bigint;
package/chia_wasm.js CHANGED
@@ -1,2 +1,4 @@
1
1
  import * as wasm from "./chia_wasm_bg.wasm";
2
- export * from "./chia_wasm_bg.js";
2
+ import { __wbg_set_wasm } from "./chia_wasm_bg.js";
3
+ __wbg_set_wasm(wasm);
4
+ export * from "./chia_wasm_bg.js";
package/chia_wasm_bg.js CHANGED
@@ -1,31 +1,13 @@
1
- import * as wasm from './chia_wasm_bg.wasm';
2
-
3
- let cachegetInt32Memory0 = null;
4
- function getInt32Memory0() {
5
- if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
6
- cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
7
- }
8
- return cachegetInt32Memory0;
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
9
4
  }
10
5
 
11
- const u32CvtShim = new Uint32Array(2);
12
-
13
- const uint64CvtShim = new BigUint64Array(u32CvtShim.buffer);
14
6
  /**
15
- * @returns {BigInt}
7
+ * @returns {bigint}
16
8
  */
17
9
  export function a_test_function() {
18
- try {
19
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
20
- wasm.a_test_function(retptr);
21
- var r0 = getInt32Memory0()[retptr / 4 + 0];
22
- var r1 = getInt32Memory0()[retptr / 4 + 1];
23
- u32CvtShim[0] = r0;
24
- u32CvtShim[1] = r1;
25
- const n0 = uint64CvtShim[0];
26
- return n0;
27
- } finally {
28
- wasm.__wbindgen_add_to_stack_pointer(16);
29
- }
10
+ const ret = wasm.a_test_function();
11
+ return BigInt.asUintN(64, ret);
30
12
  }
31
13
 
package/chia_wasm_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -4,11 +4,11 @@
4
4
  "Richard Kiss <him@richardkiss.com>"
5
5
  ],
6
6
  "description": "Code useful for implementing chia consensus.",
7
- "version": "0.2.6",
7
+ "version": "0.8.0",
8
8
  "license": "Apache-2.0",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/Chia-Network/chia_rs/"
11
+ "url": "https://github.com/Chia-Network/chia_rs"
12
12
  },
13
13
  "files": [
14
14
  "chia_wasm_bg.wasm",
@@ -17,7 +17,7 @@
17
17
  "chia_wasm.d.ts"
18
18
  ],
19
19
  "module": "chia_wasm.js",
20
- "homepage": "https://github.com/Chia-Network/chia_rs/",
20
+ "homepage": "https://github.com/Chia-Network/chia_rs",
21
21
  "types": "chia_wasm.d.ts",
22
22
  "sideEffects": [
23
23
  "./chia_wasm.js",