Skip to content

Commit

Permalink
added a check for window to avoid breaking node envs
Browse files Browse the repository at this point in the history
  • Loading branch information
fffbbbccc committed May 11, 2024
1 parent 2b4650a commit 4982600
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sign/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class Client {
...domain
};
// @ts-ignore
if (window?.ethereum?.isTrust) {
if (typeof window !== 'undefined' && window.ethereum?.isTrust) {
domainData.chainId = (await signer.provider.getNetwork()).chainId;
}
const data: any = { domain: domainData, types, message };
Expand Down

0 comments on commit 4982600

Please sign in to comment.