@alephium/web3 0.12.4 → 0.12.5-rc.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.
@@ -23,7 +23,7 @@ const crypto_1 = require("crypto");
23
23
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
24
24
  class WebCrypto {
25
25
  constructor() {
26
- this.subtle = isBrowser ? globalThis.crypto.subtle : crypto_1.webcrypto.subtle;
26
+ this.subtle = isBrowser ? globalThis.crypto.subtle : crypto_1.webcrypto ? crypto_1.webcrypto.subtle : crypto.subtle;
27
27
  }
28
28
  getRandomValues(array) {
29
29
  if (!ArrayBuffer.isView(array)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alephium/web3",
3
- "version": "0.12.4",
3
+ "version": "0.12.5-rc.1",
4
4
  "description": "A JS/TS library to interact with the Alephium platform",
5
5
  "license": "GPL",
6
6
  "main": "dist/src/index.js",
@@ -22,7 +22,7 @@ import { webcrypto, randomFillSync } from 'crypto'
22
22
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'
23
23
 
24
24
  export class WebCrypto {
25
- subtle = isBrowser ? globalThis.crypto.subtle : webcrypto.subtle
25
+ subtle = isBrowser ? globalThis.crypto.subtle : webcrypto ? webcrypto.subtle : crypto.subtle
26
26
 
27
27
  public getRandomValues<T extends ArrayBufferView | null>(array: T): T {
28
28
  if (!ArrayBuffer.isView(array)) {