Skip to content

Commit c5ca74d

Browse files
fix window issue
1 parent 379af9c commit c5ca74d

File tree

1 file changed

+2
-2
lines changed
  • packages/payment-processor/src/payment

1 file changed

+2
-2
lines changed

packages/payment-processor/src/payment/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export class UnsupportedCurrencyNetwork extends Error {
2828
* Utility to get the default window.ethereum provider, or throws an error.
2929
*/
3030
export function getProvider(): providers.Web3Provider {
31-
if (typeof window !== 'undefined' && 'ethereum' in window) {
32-
return new ethers.providers.Web3Provider((window as any).ethereum);
31+
if ('ethereum' in globalThis) {
32+
return new ethers.providers.Web3Provider((globalThis as any).ethereum);
3333
}
3434
throw new Error('ethereum not found, you must pass your own web3 provider');
3535
}

0 commit comments

Comments
 (0)