@0xkaleab/sdk-js 0.2.7 → 0.2.8

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.
@@ -28,8 +28,9 @@ async function getRqModule() {
28
28
  }
29
29
  return _rqMod;
30
30
  }
31
+ const isNode = typeof process !== "undefined" && !!process.versions?.node;
31
32
  async function getWasmSource() {
32
- if (typeof window === "undefined") {
33
+ if (isNode) {
33
34
  // Node.js: read the .wasm file from disk as a buffer
34
35
  const { readFileSync } = await Promise.resolve().then(() => require("node:fs"));
35
36
  // Use require.resolve if available (CJS), otherwise createRequire (ESM)
@@ -17,8 +17,9 @@ async function getRqModule() {
17
17
  }
18
18
  return _rqMod;
19
19
  }
20
+ const isNode = typeof process !== "undefined" && !!process.versions?.node;
20
21
  async function getWasmSource() {
21
- if (typeof window === "undefined") {
22
+ if (isNode) {
22
23
  // Node.js: read the .wasm file from disk as a buffer
23
24
  const { readFileSync } = await import("node:fs");
24
25
  // Use require.resolve if available (CJS), otherwise createRequire (ESM)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xkaleab/sdk-js",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Lumera JS/TS SDK — CosmJS+REST blockchain client and Cascade (sn-api) client",
5
5
  "publishConfig": { "access": "public" },
6
6
  "files": [