antelopeql 3.0.0 → 3.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.
@@ -1,16 +1,8 @@
1
1
  export async function sha256(data) {
2
- // Browser or Edge Runtime
3
- if (typeof crypto !== "undefined" && crypto.subtle) {
4
- // @ts-ignore - WebCrypto subtle.digest accepts Uint8Array at runtime; TS incorrectly rejects ArrayBufferLike
5
- const digest = await crypto.subtle.digest("SHA-256", data);
6
- return new Uint8Array(digest);
7
- }
8
- // Node.js (uses built-in `crypto`)
9
- if (typeof process !== "undefined" && process.versions?.node) {
10
- const { createHash } = await import("node:crypto");
11
- const hash = createHash("sha256").update(data).digest();
12
- return new Uint8Array(hash);
13
- }
14
- throw new Error("SHA-256 is not supported in this environment.");
2
+ const cryptoObj = globalThis.crypto;
3
+ if (!cryptoObj?.subtle)
4
+ throw new Error("WebCrypto SHA-256 is not available in this environment.");
5
+ const digest = await cryptoObj.subtle.digest("SHA-256", data);
6
+ return new Uint8Array(digest);
15
7
  }
16
8
  //# sourceMappingURL=sha256.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/utils/sha256.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAgB;IAC3C,0BAA0B;IAC1B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACnD,6GAA6G;QAC7G,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE3D,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,mCAAmC;IACnC,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC7D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QACnD,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;QACxD,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACnE,CAAC"}
1
+ {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/utils/sha256.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAgB;IAC3C,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;IAEpC,IAAI,CAAC,SAAS,EAAE,MAAM;QACpB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAE7E,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,MAAM,CAC1C,SAAS,EACT,IAA+B,CAChC,CAAC;IAEF,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antelopeql",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A GraphQL implementation for interacting with Antelope based blockchains.",
5
5
  "repository": {
6
6
  "type": "git",