@0xsequence/metadata 1.9.8 → 1.9.10

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.
@@ -18,7 +18,7 @@ function _extends() {
18
18
  }
19
19
 
20
20
  /* eslint-disable */
21
- // sequence-metadata v0.4.0 ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2
21
+ // sequence-metadata v0.4.0 b7b940d2801967e99878867d2fac3f35a6556bb8
22
22
  // --
23
23
  // Code generated by webrpc-gen@v0.14.0-dev with typescript@v0.10.0 generator. DO NOT EDIT.
24
24
  //
@@ -31,7 +31,7 @@ const WebRPCVersion = 'v1';
31
31
  const WebRPCSchemaVersion = 'v0.4.0';
32
32
 
33
33
  // Schema hash generated from your RIDL schema
34
- const WebRPCSchemaHash = 'ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2';
34
+ const WebRPCSchemaHash = 'b7b940d2801967e99878867d2fac3f35a6556bb8';
35
35
 
36
36
  //
37
37
  // Types
@@ -506,7 +506,7 @@ class SequenceMetadata extends Metadata {
506
506
  this.jwtAuth = jwtAuth;
507
507
  this._fetch = (input, init) => {
508
508
  // automatically include jwt and access key auth header to requests
509
- // if its been set on the api client
509
+ // if its been set on the client
510
510
  const headers = {};
511
511
  const jwtAuth = this.jwtAuth;
512
512
  const projectAccessKey = this.projectAccessKey;
@@ -524,11 +524,35 @@ class SequenceMetadata extends Metadata {
524
524
  this.fetch = this._fetch;
525
525
  }
526
526
  }
527
+ class SequenceCollections extends Collections {
528
+ constructor(hostname = 'https://metadata.sequence.app', jwtAuth) {
529
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
530
+ this.jwtAuth = jwtAuth;
531
+ this._fetch = (input, init) => {
532
+ // automatically include jwt auth header to requests
533
+ // if its been set on the client
534
+ const headers = {};
535
+ const jwtAuth = this.jwtAuth;
536
+ if (jwtAuth && jwtAuth.length > 0) {
537
+ headers['Authorization'] = `BEARER ${jwtAuth}`;
538
+ }
539
+
540
+ // before the request is made
541
+ init.headers = _extends({}, init.headers, headers);
542
+ return fetch(input, init);
543
+ };
544
+ this.fetch = this._fetch;
545
+ }
546
+
547
+ // TODO: add uploadAsset() method similar to,
548
+ // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
549
+ }
527
550
 
528
551
  exports.Collections = Collections;
529
552
  exports.ContractType = ContractType;
530
553
  exports.Metadata = Metadata;
531
554
  exports.PropertyType = PropertyType;
555
+ exports.SequenceCollections = SequenceCollections;
532
556
  exports.SequenceMetadata = SequenceMetadata;
533
557
  exports.SwapType = SwapType;
534
558
  exports.TaskStatus = TaskStatus;
@@ -18,7 +18,7 @@ function _extends() {
18
18
  }
19
19
 
20
20
  /* eslint-disable */
21
- // sequence-metadata v0.4.0 ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2
21
+ // sequence-metadata v0.4.0 b7b940d2801967e99878867d2fac3f35a6556bb8
22
22
  // --
23
23
  // Code generated by webrpc-gen@v0.14.0-dev with typescript@v0.10.0 generator. DO NOT EDIT.
24
24
  //
@@ -31,7 +31,7 @@ const WebRPCVersion = 'v1';
31
31
  const WebRPCSchemaVersion = 'v0.4.0';
32
32
 
33
33
  // Schema hash generated from your RIDL schema
34
- const WebRPCSchemaHash = 'ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2';
34
+ const WebRPCSchemaHash = 'b7b940d2801967e99878867d2fac3f35a6556bb8';
35
35
 
36
36
  //
37
37
  // Types
@@ -506,7 +506,7 @@ class SequenceMetadata extends Metadata {
506
506
  this.jwtAuth = jwtAuth;
507
507
  this._fetch = (input, init) => {
508
508
  // automatically include jwt and access key auth header to requests
509
- // if its been set on the api client
509
+ // if its been set on the client
510
510
  const headers = {};
511
511
  const jwtAuth = this.jwtAuth;
512
512
  const projectAccessKey = this.projectAccessKey;
@@ -524,11 +524,35 @@ class SequenceMetadata extends Metadata {
524
524
  this.fetch = this._fetch;
525
525
  }
526
526
  }
527
+ class SequenceCollections extends Collections {
528
+ constructor(hostname = 'https://metadata.sequence.app', jwtAuth) {
529
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
530
+ this.jwtAuth = jwtAuth;
531
+ this._fetch = (input, init) => {
532
+ // automatically include jwt auth header to requests
533
+ // if its been set on the client
534
+ const headers = {};
535
+ const jwtAuth = this.jwtAuth;
536
+ if (jwtAuth && jwtAuth.length > 0) {
537
+ headers['Authorization'] = `BEARER ${jwtAuth}`;
538
+ }
539
+
540
+ // before the request is made
541
+ init.headers = _extends({}, init.headers, headers);
542
+ return fetch(input, init);
543
+ };
544
+ this.fetch = this._fetch;
545
+ }
546
+
547
+ // TODO: add uploadAsset() method similar to,
548
+ // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
549
+ }
527
550
 
528
551
  exports.Collections = Collections;
529
552
  exports.ContractType = ContractType;
530
553
  exports.Metadata = Metadata;
531
554
  exports.PropertyType = PropertyType;
555
+ exports.SequenceCollections = SequenceCollections;
532
556
  exports.SequenceMetadata = SequenceMetadata;
533
557
  exports.SwapType = SwapType;
534
558
  exports.TaskStatus = TaskStatus;
@@ -14,7 +14,7 @@ function _extends() {
14
14
  }
15
15
 
16
16
  /* eslint-disable */
17
- // sequence-metadata v0.4.0 ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2
17
+ // sequence-metadata v0.4.0 b7b940d2801967e99878867d2fac3f35a6556bb8
18
18
  // --
19
19
  // Code generated by webrpc-gen@v0.14.0-dev with typescript@v0.10.0 generator. DO NOT EDIT.
20
20
  //
@@ -27,7 +27,7 @@ const WebRPCVersion = 'v1';
27
27
  const WebRPCSchemaVersion = 'v0.4.0';
28
28
 
29
29
  // Schema hash generated from your RIDL schema
30
- const WebRPCSchemaHash = 'ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2';
30
+ const WebRPCSchemaHash = 'b7b940d2801967e99878867d2fac3f35a6556bb8';
31
31
 
32
32
  //
33
33
  // Types
@@ -502,7 +502,7 @@ class SequenceMetadata extends Metadata {
502
502
  this.jwtAuth = jwtAuth;
503
503
  this._fetch = (input, init) => {
504
504
  // automatically include jwt and access key auth header to requests
505
- // if its been set on the api client
505
+ // if its been set on the client
506
506
  const headers = {};
507
507
  const jwtAuth = this.jwtAuth;
508
508
  const projectAccessKey = this.projectAccessKey;
@@ -520,5 +520,28 @@ class SequenceMetadata extends Metadata {
520
520
  this.fetch = this._fetch;
521
521
  }
522
522
  }
523
+ class SequenceCollections extends Collections {
524
+ constructor(hostname = 'https://metadata.sequence.app', jwtAuth) {
525
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
526
+ this.jwtAuth = jwtAuth;
527
+ this._fetch = (input, init) => {
528
+ // automatically include jwt auth header to requests
529
+ // if its been set on the client
530
+ const headers = {};
531
+ const jwtAuth = this.jwtAuth;
532
+ if (jwtAuth && jwtAuth.length > 0) {
533
+ headers['Authorization'] = `BEARER ${jwtAuth}`;
534
+ }
535
+
536
+ // before the request is made
537
+ init.headers = _extends({}, init.headers, headers);
538
+ return fetch(input, init);
539
+ };
540
+ this.fetch = this._fetch;
541
+ }
542
+
543
+ // TODO: add uploadAsset() method similar to,
544
+ // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
545
+ }
523
546
 
524
- export { Collections, ContractType, Metadata, PropertyType, SequenceMetadata, SwapType, TaskStatus, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
547
+ export { Collections, ContractType, Metadata, PropertyType, SequenceCollections, SequenceMetadata, SwapType, TaskStatus, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
@@ -1,8 +1,13 @@
1
1
  export * from "./metadata.gen.js";
2
- import { Metadata as MetadataRpc } from "./metadata.gen.js";
2
+ import { Metadata as MetadataRpc, Collections as CollectionsRpc } from "./metadata.gen.js";
3
3
  export declare class SequenceMetadata extends MetadataRpc {
4
4
  projectAccessKey?: string | undefined;
5
5
  jwtAuth?: string | undefined;
6
6
  constructor(hostname?: string, projectAccessKey?: string | undefined, jwtAuth?: string | undefined);
7
7
  _fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
8
8
  }
9
+ export declare class SequenceCollections extends CollectionsRpc {
10
+ jwtAuth?: string | undefined;
11
+ constructor(hostname?: string, jwtAuth?: string | undefined);
12
+ _fetch: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
13
+ }
@@ -1,6 +1,6 @@
1
1
  export declare const WebRPCVersion = "v1";
2
2
  export declare const WebRPCSchemaVersion = "v0.4.0";
3
- export declare const WebRPCSchemaHash = "ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2";
3
+ export declare const WebRPCSchemaHash = "b7b940d2801967e99878867d2fac3f35a6556bb8";
4
4
  export declare enum ContractType {
5
5
  UNKNOWN = "UNKNOWN",
6
6
  ERC20 = "ERC20",
@@ -95,22 +95,22 @@ export interface ContractInfoExtensions {
95
95
  export interface TokenMetadata {
96
96
  tokenId: string;
97
97
  name: string;
98
- description: string;
99
- image: string;
100
- video: string;
101
- audio: string;
102
- properties: {
98
+ description?: string;
99
+ image?: string;
100
+ video?: string;
101
+ audio?: string;
102
+ properties?: {
103
103
  [key: string]: any;
104
104
  };
105
105
  attributes: Array<{
106
106
  [key: string]: any;
107
107
  }>;
108
- image_data: string;
109
- external_url: string;
110
- background_color: string;
111
- animation_url: string;
108
+ image_data?: string;
109
+ external_url?: string;
110
+ background_color?: string;
111
+ animation_url?: string;
112
112
  decimals?: number;
113
- updatedAt: string;
113
+ updatedAt?: string;
114
114
  assets?: Array<Asset>;
115
115
  }
116
116
  export interface PropertyFilter {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/metadata",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
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
@@ -1,6 +1,6 @@
1
1
  export * from './metadata.gen'
2
2
 
3
- import { Metadata as MetadataRpc } from './metadata.gen'
3
+ import { Metadata as MetadataRpc, Collections as CollectionsRpc } from './metadata.gen'
4
4
 
5
5
  const fetch = typeof global === 'object' ? global.fetch : window.fetch
6
6
 
@@ -16,7 +16,7 @@ export class SequenceMetadata extends MetadataRpc {
16
16
 
17
17
  _fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
18
18
  // automatically include jwt and access key auth header to requests
19
- // if its been set on the api client
19
+ // if its been set on the client
20
20
  const headers: { [key: string]: any } = {}
21
21
 
22
22
  const jwtAuth = this.jwtAuth
@@ -36,3 +36,33 @@ export class SequenceMetadata extends MetadataRpc {
36
36
  return fetch(input, init)
37
37
  }
38
38
  }
39
+
40
+ export class SequenceCollections extends CollectionsRpc {
41
+ constructor(
42
+ hostname: string = 'https://metadata.sequence.app',
43
+ public jwtAuth?: string
44
+ ) {
45
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
46
+ this.fetch = this._fetch
47
+ }
48
+
49
+ _fetch = (input: RequestInfo, init?: RequestInit): Promise<Response> => {
50
+ // automatically include jwt auth header to requests
51
+ // if its been set on the client
52
+ const headers: { [key: string]: any } = {}
53
+
54
+ const jwtAuth = this.jwtAuth
55
+
56
+ if (jwtAuth && jwtAuth.length > 0) {
57
+ headers['Authorization'] = `BEARER ${jwtAuth}`
58
+ }
59
+
60
+ // before the request is made
61
+ init!.headers = { ...init!.headers, ...headers }
62
+
63
+ return fetch(input, init)
64
+ }
65
+
66
+ // TODO: add uploadAsset() method similar to,
67
+ // https://github.com/0xsequence/go-sequence/blob/master/metadata/collections.go#L52
68
+ }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // sequence-metadata v0.4.0 ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2
2
+ // sequence-metadata v0.4.0 b7b940d2801967e99878867d2fac3f35a6556bb8
3
3
  // --
4
4
  // Code generated by webrpc-gen@v0.14.0-dev with typescript@v0.10.0 generator. DO NOT EDIT.
5
5
  //
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
12
12
  export const WebRPCSchemaVersion = 'v0.4.0'
13
13
 
14
14
  // Schema hash generated from your RIDL schema
15
- export const WebRPCSchemaHash = 'ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2'
15
+ export const WebRPCSchemaHash = 'b7b940d2801967e99878867d2fac3f35a6556bb8'
16
16
 
17
17
  //
18
18
  // Types
@@ -118,18 +118,18 @@ export interface ContractInfoExtensions {
118
118
  export interface TokenMetadata {
119
119
  tokenId: string
120
120
  name: string
121
- description: string
122
- image: string
123
- video: string
124
- audio: string
125
- properties: { [key: string]: any }
121
+ description?: string
122
+ image?: string
123
+ video?: string
124
+ audio?: string
125
+ properties?: { [key: string]: any }
126
126
  attributes: Array<{ [key: string]: any }>
127
- image_data: string
128
- external_url: string
129
- background_color: string
130
- animation_url: string
127
+ image_data?: string
128
+ external_url?: string
129
+ background_color?: string
130
+ animation_url?: string
131
131
  decimals?: number
132
- updatedAt: string
132
+ updatedAt?: string
133
133
  assets?: Array<Asset>
134
134
  }
135
135