@0xsequence/metadata 0.43.14 → 0.43.16

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.
@@ -262,9 +262,10 @@ const buildResponse = res => {
262
262
  });
263
263
  };
264
264
 
265
+ const fetch = global ? global.fetch : window.fetch;
265
266
  class SequenceMetadataClient extends Metadata {
266
267
  constructor(hostname = 'https://metadata.sequence.app') {
267
- super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, global.fetch);
268
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
268
269
  }
269
270
  }
270
271
 
@@ -262,9 +262,10 @@ const buildResponse = res => {
262
262
  });
263
263
  };
264
264
 
265
+ const fetch = global ? global.fetch : window.fetch;
265
266
  class SequenceMetadataClient extends Metadata {
266
267
  constructor(hostname = 'https://metadata.sequence.app') {
267
- super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, global.fetch);
268
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
268
269
  }
269
270
  }
270
271
 
@@ -258,9 +258,10 @@ const buildResponse = res => {
258
258
  });
259
259
  };
260
260
 
261
+ const fetch = global ? global.fetch : window.fetch;
261
262
  class SequenceMetadataClient extends Metadata {
262
263
  constructor(hostname = 'https://metadata.sequence.app') {
263
- super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, global.fetch);
264
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
264
265
  }
265
266
  }
266
267
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/metadata",
3
- "version": "0.43.14",
3
+ "version": "0.43.16",
4
4
  "description": "metadata sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/metadata",
6
6
  "source": "src/index.ts",
package/src/index.ts CHANGED
@@ -2,8 +2,10 @@ export * from './metadata.gen'
2
2
 
3
3
  import { Metadata as MetadataRpc } from './metadata.gen'
4
4
 
5
+ const fetch = global ? global.fetch : window.fetch
6
+
5
7
  export class SequenceMetadataClient extends MetadataRpc {
6
8
  constructor(hostname: string = 'https://metadata.sequence.app') {
7
- super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, global.fetch)
9
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
8
10
  }
9
11
  }