Skip to content

Commit 1a4d82d

Browse files
authored
Update: Crypto Pkg Polyfilled (#571)
1 parent 131d57e commit 1a4d82d

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "web3-api",
2+
"name": "engine",
33
"version": "0.1.0",
44
"license": "Apache-2.0",
55
"description": "thirdweb Engine",
@@ -52,6 +52,7 @@
5252
"cookie-parser": "^1.4.6",
5353
"copyfiles": "^2.4.1",
5454
"cron-parser": "^4.9.0",
55+
"crypto": "^1.0.1",
5556
"crypto-js": "^4.2.0",
5657
"dotenv": "^16.0.3",
5758
"ethers": "5",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import "./polyfill";
12
import { initServer } from "./server";
23
import { initWorker } from "./worker";
34

src/polyfill.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as crypto from "crypto";
2+
3+
if (typeof globalThis.crypto === "undefined") {
4+
(globalThis as any).crypto = crypto;
5+
}

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5466,7 +5466,7 @@ crypto-js@^4.2.0:
54665466
resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631"
54675467
integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==
54685468

5469-
crypto@1.0.1:
5469+
crypto@1.0.1, crypto@^1.0.1:
54705470
version "1.0.1"
54715471
resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037"
54725472
integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==

0 commit comments

Comments
 (0)