@cashu/coco-expo-sqlite 1.0.0 → 1.0.1

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/dist/index.cjs CHANGED
@@ -1013,7 +1013,7 @@ function rowToProof(r) {
1013
1013
  secret: r.secret,
1014
1014
  C: r.C,
1015
1015
  ...r.dleqJson ? { dleq: JSON.parse(r.dleqJson) } : {},
1016
- ...r.witnessJson ? { witness: JSON.parse(r.witnessJson) } : {},
1016
+ ...r.witnessJson ? { witness: (0, _cashu_coco_core.parsePersistedProofWitness)(r.witnessJson) } : {},
1017
1017
  mintUrl: r.mintUrl,
1018
1018
  state: r.state,
1019
1019
  ...r.usedByOperationId ? { usedByOperationId: r.usedByOperationId } : {},
@@ -1034,7 +1034,7 @@ var ExpoProofRepository = class {
1034
1034
  const insertSql = "INSERT INTO coco_cashu_proofs (mintUrl, id, amount, secret, C, dleqJson, witnessJson, state, createdAt, usedByOperationId, createdByOperationId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
1035
1035
  for (const p of proofs) {
1036
1036
  const dleqJson = p.dleq ? JSON.stringify(p.dleq) : null;
1037
- const witnessJson = p.witness ? JSON.stringify(p.witness) : null;
1037
+ const witnessJson = (0, _cashu_coco_core.stringifyProofWitness)(p.witness);
1038
1038
  await tx.run(insertSql, [
1039
1039
  mintUrl,
1040
1040
  p.id,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { normalizeMintUrl } from "@cashu/coco-core";
1
+ import { normalizeMintUrl, parsePersistedProofWitness, stringifyProofWitness } from "@cashu/coco-core";
2
2
 
3
3
  //#region src/db.ts
4
4
  function isWebRuntime() {
@@ -1013,7 +1013,7 @@ function rowToProof(r) {
1013
1013
  secret: r.secret,
1014
1014
  C: r.C,
1015
1015
  ...r.dleqJson ? { dleq: JSON.parse(r.dleqJson) } : {},
1016
- ...r.witnessJson ? { witness: JSON.parse(r.witnessJson) } : {},
1016
+ ...r.witnessJson ? { witness: parsePersistedProofWitness(r.witnessJson) } : {},
1017
1017
  mintUrl: r.mintUrl,
1018
1018
  state: r.state,
1019
1019
  ...r.usedByOperationId ? { usedByOperationId: r.usedByOperationId } : {},
@@ -1034,7 +1034,7 @@ var ExpoProofRepository = class {
1034
1034
  const insertSql = "INSERT INTO coco_cashu_proofs (mintUrl, id, amount, secret, C, dleqJson, witnessJson, state, createdAt, usedByOperationId, createdByOperationId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
1035
1035
  for (const p of proofs) {
1036
1036
  const dleqJson = p.dleq ? JSON.stringify(p.dleq) : null;
1037
- const witnessJson = p.witness ? JSON.stringify(p.witness) : null;
1037
+ const witnessJson = stringifyProofWitness(p.witness);
1038
1038
  await tx.run(insertSql, [
1039
1039
  mintUrl,
1040
1040
  p.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashu/coco-expo-sqlite",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "README.md"
16
16
  ],
17
17
  "devDependencies": {
18
- "@cashu/coco-adapter-tests": "1.0.0"
18
+ "@cashu/coco-adapter-tests": "1.0.1"
19
19
  },
20
20
  "exports": {
21
21
  ".": {
@@ -33,6 +33,6 @@
33
33
  "peerDependencies": {
34
34
  "typescript": "^5",
35
35
  "expo-sqlite": "*",
36
- "@cashu/coco-core": "1.0.0"
36
+ "@cashu/coco-core": "1.0.1"
37
37
  }
38
38
  }