Skip to content

Commit 0eafe34

Browse files
committed
changing global to globalthis, removing window references
1 parent 953204e commit 0eafe34

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

packages/api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export * from './api.gen'
22

33
import { API as ApiRpc } from './api.gen'
44

5-
const fetch = typeof global === 'object' ? global.fetch : window.fetch
5+
const fetch = globalThis.fetch
66

77
export class SequenceAPIClient extends ApiRpc {
88
constructor(

packages/guard/src/signer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { encodeTypedDataDigest, TypedData } from '@0xsequence/utils'
55
import { BytesLike, ethers, TypedDataDomain } from 'ethers'
66
import { AuthMethodsReturn, Guard, RecoveryCode as GuardRecoveryCode } from './guard.gen'
77

8-
const fetch = typeof global === 'object' ? global.fetch : window.fetch
8+
const fetch = globalThis.fetch
99

1010
export class GuardSigner implements signers.SapientSigner {
1111
private guard: Guard

packages/indexer/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export * from './indexer.gen'
22

33
import { Indexer as IndexerRpc } from './indexer.gen'
44

5-
const fetch = typeof global === 'object' ? global.fetch : window.fetch
5+
const fetch = globalThis.fetch
66

77
export class SequenceIndexer extends IndexerRpc {
88
constructor(

packages/metadata/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export * from './metadata.gen'
22

33
import { Metadata as MetadataRpc, Collections as CollectionsRpc } from './metadata.gen'
44

5-
const fetch = typeof global === 'object' ? global.fetch : window.fetch
5+
const fetch = globalThis.fetch
66

77
export class SequenceMetadata extends MetadataRpc {
88
constructor(

packages/relayer/src/rpc-relayer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function isRpcRelayerOptions(obj: any): obj is RpcRelayerOptions {
3131
)
3232
}
3333

34-
const fetch = typeof global === 'object' ? global.fetch : window.fetch
34+
const fetch = globalThis.fetch
3535

3636
// TODO: rename to SequenceRelayer
3737
export class RpcRelayer implements Relayer {

packages/waas/src/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ export class SequenceWaaS {
707707

708708
// Special version of fetch that keeps track of the last seen Date header
709709
async fetch(input: RequestInfo, init?: RequestInit) {
710-
const res = await window.fetch(input, init)
710+
const res = await globalThis.fetch(input, init)
711711
const headerValue = res.headers.get('date')
712712
if (headerValue) {
713713
this.lastDate = new Date(headerValue)

0 commit comments

Comments
 (0)