@alephium/web3 0.12.5-rc.0 → 0.12.5

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,5 +1,4 @@
1
1
  export declare class WebCrypto {
2
2
  subtle: SubtleCrypto;
3
- constructor();
4
3
  getRandomValues<T extends ArrayBufferView | null>(array: T): T;
5
4
  }
@@ -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": "v0.12.5-rc.0",
3
+ "version": "0.12.5",
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,11 +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: SubtleCrypto
26
-
27
- constructor() {
28
- this.subtle = isBrowser ? globalThis.crypto.subtle : webcrypto.subtle
29
- }
25
+ subtle = isBrowser ? globalThis.crypto.subtle : webcrypto ? webcrypto.subtle : crypto.subtle
30
26
 
31
27
  public getRandomValues<T extends ArrayBufferView | null>(array: T): T {
32
28
  if (!ArrayBuffer.isView(array)) {