@0xsequence/api 0.0.0-20231117190010 → 0.0.0-20231121142317

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.
@@ -600,27 +600,21 @@ const buildResponse = res => {
600
600
 
601
601
  const fetch = typeof global === 'object' ? global.fetch : window.fetch;
602
602
  class SequenceAPIClient extends API {
603
- constructor(hostname, _projectAccessKey, _jwtAuth) {
603
+ constructor(hostname, jwtAuth) {
604
604
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
605
605
  this._fetch = (input, init) => {
606
- // automatically include jwt and access key auth header to requests
606
+ // automatically include jwt auth header to requests
607
607
  // if its been set on the api client
608
608
  const headers = {};
609
- const jwtAuth = this.jwtAuth;
610
- const projectAccessKey = this.projectAccessKey;
611
- if (jwtAuth && jwtAuth.length > 0) {
612
- headers['Authorization'] = `BEARER ${jwtAuth}`;
613
- }
614
- if (projectAccessKey && projectAccessKey.length > 0) {
615
- headers['X-Access-Key'] = projectAccessKey;
609
+ if (this.jwtAuth && this.jwtAuth.length > 0) {
610
+ headers['Authorization'] = `BEARER ${this.jwtAuth}`;
616
611
  }
617
612
 
618
613
  // before the request is made
619
614
  init.headers = _extends({}, init.headers, headers);
620
615
  return fetch(input, init);
621
616
  };
622
- this.projectAccessKey = _projectAccessKey;
623
- this.jwtAuth = _jwtAuth;
617
+ this.jwtAuth = jwtAuth;
624
618
  this.fetch = this._fetch;
625
619
  }
626
620
  }
@@ -600,27 +600,21 @@ const buildResponse = res => {
600
600
 
601
601
  const fetch = typeof global === 'object' ? global.fetch : window.fetch;
602
602
  class SequenceAPIClient extends API {
603
- constructor(hostname, _projectAccessKey, _jwtAuth) {
603
+ constructor(hostname, jwtAuth) {
604
604
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
605
605
  this._fetch = (input, init) => {
606
- // automatically include jwt and access key auth header to requests
606
+ // automatically include jwt auth header to requests
607
607
  // if its been set on the api client
608
608
  const headers = {};
609
- const jwtAuth = this.jwtAuth;
610
- const projectAccessKey = this.projectAccessKey;
611
- if (jwtAuth && jwtAuth.length > 0) {
612
- headers['Authorization'] = `BEARER ${jwtAuth}`;
613
- }
614
- if (projectAccessKey && projectAccessKey.length > 0) {
615
- headers['X-Access-Key'] = projectAccessKey;
609
+ if (this.jwtAuth && this.jwtAuth.length > 0) {
610
+ headers['Authorization'] = `BEARER ${this.jwtAuth}`;
616
611
  }
617
612
 
618
613
  // before the request is made
619
614
  init.headers = _extends({}, init.headers, headers);
620
615
  return fetch(input, init);
621
616
  };
622
- this.projectAccessKey = _projectAccessKey;
623
- this.jwtAuth = _jwtAuth;
617
+ this.jwtAuth = jwtAuth;
624
618
  this.fetch = this._fetch;
625
619
  }
626
620
  }
@@ -596,27 +596,21 @@ const buildResponse = res => {
596
596
 
597
597
  const fetch = typeof global === 'object' ? global.fetch : window.fetch;
598
598
  class SequenceAPIClient extends API {
599
- constructor(hostname, _projectAccessKey, _jwtAuth) {
599
+ constructor(hostname, jwtAuth) {
600
600
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
601
601
  this._fetch = (input, init) => {
602
- // automatically include jwt and access key auth header to requests
602
+ // automatically include jwt auth header to requests
603
603
  // if its been set on the api client
604
604
  const headers = {};
605
- const jwtAuth = this.jwtAuth;
606
- const projectAccessKey = this.projectAccessKey;
607
- if (jwtAuth && jwtAuth.length > 0) {
608
- headers['Authorization'] = `BEARER ${jwtAuth}`;
609
- }
610
- if (projectAccessKey && projectAccessKey.length > 0) {
611
- headers['X-Access-Key'] = projectAccessKey;
605
+ if (this.jwtAuth && this.jwtAuth.length > 0) {
606
+ headers['Authorization'] = `BEARER ${this.jwtAuth}`;
612
607
  }
613
608
 
614
609
  // before the request is made
615
610
  init.headers = _extends({}, init.headers, headers);
616
611
  return fetch(input, init);
617
612
  };
618
- this.projectAccessKey = _projectAccessKey;
619
- this.jwtAuth = _jwtAuth;
613
+ this.jwtAuth = jwtAuth;
620
614
  this.fetch = this._fetch;
621
615
  }
622
616
  }
@@ -1,8 +1,7 @@
1
1
  export * from "./api.gen.js";
2
2
  import { API as ApiRpc } from "./api.gen.js";
3
3
  export declare class SequenceAPIClient extends ApiRpc {
4
- projectAccessKey?: string | undefined;
5
4
  jwtAuth?: string | undefined;
6
- constructor(hostname: string, projectAccessKey?: string | undefined, jwtAuth?: string | undefined);
5
+ constructor(hostname: string, jwtAuth?: string | undefined);
7
6
  _fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
8
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/api",
3
- "version": "0.0.0-20231117190010",
3
+ "version": "0.0.0-20231121142317",
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
@@ -7,7 +7,6 @@ const fetch = typeof global === 'object' ? global.fetch : window.fetch
7
7
  export class SequenceAPIClient extends ApiRpc {
8
8
  constructor(
9
9
  hostname: string,
10
- public projectAccessKey?: string,
11
10
  public jwtAuth?: string
12
11
  ) {
13
12
  super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
@@ -15,19 +14,11 @@ export class SequenceAPIClient extends ApiRpc {
15
14
  }
16
15
 
17
16
  _fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
18
- // automatically include jwt and access key auth header to requests
17
+ // automatically include jwt auth header to requests
19
18
  // if its been set on the api client
20
19
  const headers: { [key: string]: any } = {}
21
-
22
- const jwtAuth = this.jwtAuth
23
- const projectAccessKey = this.projectAccessKey
24
-
25
- if (jwtAuth && jwtAuth.length > 0) {
26
- headers['Authorization'] = `BEARER ${jwtAuth}`
27
- }
28
-
29
- if (projectAccessKey && projectAccessKey.length > 0) {
30
- headers['X-Access-Key'] = projectAccessKey
20
+ if (this.jwtAuth && this.jwtAuth.length > 0) {
21
+ headers['Authorization'] = `BEARER ${this.jwtAuth}`
31
22
  }
32
23
 
33
24
  // before the request is made