Skip to content

Commit ab51c3d

Browse files
fffbbbcccChaituVR
andauthored
added a check for window to avoid breaking node envs (#998)
* added a check for window to avoid breaking node envs addresses #992 * v0.11.22 --------- Co-authored-by: Chaitanya <[email protected]>
1 parent 2b4650a commit ab51c3d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@snapshot-labs/snapshot.js",
3-
"version": "0.11.21",
3+
"version": "0.11.22",
44
"repository": "snapshot-labs/snapshot.js",
55
"license": "MIT",
66
"main": "dist/snapshot.cjs.js",

src/sign/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class Client {
8383
...domain
8484
};
8585
// @ts-ignore
86-
if (window?.ethereum?.isTrust) {
86+
if (typeof window !== 'undefined' && window.ethereum?.isTrust) {
8787
domainData.chainId = (await signer.provider.getNetwork()).chainId;
8888
}
8989
const data: any = { domain: domainData, types, message };

0 commit comments

Comments
 (0)