@dignetwork/chip35-dl-coin-wasm 0.2.0 → 0.3.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.
@@ -3,6 +3,15 @@
3
3
 
4
4
  export function addFee(spender_synthetic_key: Uint8Array, selected_coins: any, assert_coin_ids: any, fee: bigint): any;
5
5
 
6
+ /**
7
+ * Reconstruct a DataStore from the coin spend that created its current coin (the launcher
8
+ * spend for an eve store). Lets the app MELT a store it did not mint in-session: fetch the
9
+ * creating spend from a full node, rebuild the DataStore here, then meltStore() it.
10
+ * `coin_spend` is the wasm CoinSpend shape (Uint8Array fields); `prev_delegated_puzzles` is
11
+ * the parent's delegated-puzzle list ([] for an owner-only store).
12
+ */
13
+ export function dataStoreFromSpend(coin_spend: any, prev_delegated_puzzles: any): any;
14
+
6
15
  /**
7
16
  * Derive the digstore-scoped owner discovery hint for a 32-byte owner puzzle hash. The app
8
17
  * computes the SAME hint to enumerate the wallet's stores via coinset
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./chip35_dl_coin_wasm_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
 
7
7
  export {
8
- addFee, digstoreOwnerHint, hexSpendBundleToCoinSpends, init, meltStore, mintStore, oracleSpend, spendBundleToHex, updateStoreMetadata, updateStoreOwnership
8
+ addFee, dataStoreFromSpend, digstoreOwnerHint, hexSpendBundleToCoinSpends, init, meltStore, mintStore, oracleSpend, spendBundleToHex, updateStoreMetadata, updateStoreOwnership
9
9
  } from "./chip35_dl_coin_wasm_bg.js";
@@ -23,6 +23,32 @@ export function addFee(spender_synthetic_key, selected_coins, assert_coin_ids, f
23
23
  }
24
24
  }
25
25
 
26
+ /**
27
+ * Reconstruct a DataStore from the coin spend that created its current coin (the launcher
28
+ * spend for an eve store). Lets the app MELT a store it did not mint in-session: fetch the
29
+ * creating spend from a full node, rebuild the DataStore here, then meltStore() it.
30
+ * `coin_spend` is the wasm CoinSpend shape (Uint8Array fields); `prev_delegated_puzzles` is
31
+ * the parent's delegated-puzzle list ([] for an owner-only store).
32
+ * @param {any} coin_spend
33
+ * @param {any} prev_delegated_puzzles
34
+ * @returns {any}
35
+ */
36
+ export function dataStoreFromSpend(coin_spend, prev_delegated_puzzles) {
37
+ try {
38
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
39
+ wasm.dataStoreFromSpend(retptr, addHeapObject(coin_spend), addHeapObject(prev_delegated_puzzles));
40
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
41
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
42
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
43
+ if (r2) {
44
+ throw takeObject(r1);
45
+ }
46
+ return takeObject(r0);
47
+ } finally {
48
+ wasm.__wbindgen_add_to_stack_pointer(16);
49
+ }
50
+ }
51
+
26
52
  /**
27
53
  * Derive the digstore-scoped owner discovery hint for a 32-byte owner puzzle hash. The app
28
54
  * computes the SAME hint to enumerate the wallet's stores via coinset
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dignetwork/chip35-dl-coin-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for the isolated CHIP-0035 DataLayer store coin driver.",
5
- "version": "0.2.0",
5
+ "version": "0.3.0",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
8
8
  "access": "public"