@0xsequence/api 0.43.17 → 0.43.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -582,7 +582,7 @@ const buildResponse = res => {
582
582
  });
583
583
  };
584
584
 
585
- const fetch = global.fetch ;
585
+ const fetch = typeof global === 'object' ? global.fetch : window.fetch;
586
586
  class SequenceAPIClient extends API {
587
587
  constructor(hostname, jwtAuth) {
588
588
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
@@ -582,7 +582,7 @@ const buildResponse = res => {
582
582
  });
583
583
  };
584
584
 
585
- const fetch = global.fetch ;
585
+ const fetch = typeof global === 'object' ? global.fetch : window.fetch;
586
586
  class SequenceAPIClient extends API {
587
587
  constructor(hostname, jwtAuth) {
588
588
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
@@ -578,7 +578,7 @@ const buildResponse = res => {
578
578
  });
579
579
  };
580
580
 
581
- const fetch = global.fetch ;
581
+ const fetch = typeof global === 'object' ? global.fetch : window.fetch;
582
582
  class SequenceAPIClient extends API {
583
583
  constructor(hostname, jwtAuth) {
584
584
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/api",
3
- "version": "0.43.17",
3
+ "version": "0.43.18",
4
4
  "description": "api sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/api",
6
6
  "source": "src/index.ts",
package/src/index.ts CHANGED
@@ -2,7 +2,7 @@ export * from './api.gen'
2
2
 
3
3
  import { API as ApiRpc } from './api.gen'
4
4
 
5
- const fetch = typeof 'global' !== undefined ? global.fetch : window.fetch
5
+ const fetch = typeof global === 'object' ? global.fetch : window.fetch
6
6
 
7
7
  export class SequenceAPIClient extends ApiRpc {
8
8
  constructor(hostname: string, public jwtAuth?: string) {