spasm.js 2.0.0-alpha.1 → 2.0.0-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spasm.js",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "Tools for developing Signer and Protocol Agnostic Social Media (SPASM) apps.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -44,6 +44,7 @@
44
44
  "@types/node": "^20.11.20",
45
45
  "bech32": "^2.0.0",
46
46
  "ethers": "^6.13.1",
47
+ "js-sha256": "^0.11.0",
47
48
  "nostr-tools": "^2.7.0"
48
49
  },
49
50
  "exports": {
@@ -51,6 +52,10 @@
51
52
  "import": "./lib.esm/index.js",
52
53
  "default": "./lib.commonjs/index.js"
53
54
  },
55
+ "./convert": {
56
+ "import": "./lib.esm/convert/index.js",
57
+ "default": "./lib.commonjs/convert/index.js"
58
+ },
54
59
  "./id": {
55
60
  "import": "./lib.esm/id/index.js",
56
61
  "default": "./lib.commonjs/id/index.js"
@@ -59,10 +64,6 @@
59
64
  "import": "./lib.esm/identify/index.js",
60
65
  "default": "./lib.commonjs/identify/index.js"
61
66
  },
62
- "./convert": {
63
- "import": "./lib.esm/convert/index.js",
64
- "default": "./lib.commonjs/convert/index.js"
65
- },
66
67
  "./utils": {
67
68
  "import": "./lib.esm/utils/index.js",
68
69
  "default": "./lib.commonjs/utils/index.js"
@@ -23,7 +23,7 @@ import {
23
23
  * built-in 'crypto' module works only in a server-side
24
24
  * Node.js environment, not on the client-side (browser).
25
25
  */
26
- // import { sha256 } from "js-sha256"
26
+ import { sha256 } from "js-sha256"
27
27
  import { ethers} from "ethers";
28
28
 
29
29
  // Filter out undefined, null, 0, '', false, NaN, {}, []
@@ -387,8 +387,7 @@ export const getHashOfString = (
387
387
  if (typeof(string) !== "string") return ""
388
388
 
389
389
  if (algorithm === "sha256") {
390
- // return sha256(string)
391
- return "nosha256"
390
+ return sha256(string)
392
391
  }
393
392
 
394
393
  return ""