@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.
- package/dist/0xsequence-metadata.cjs.dev.js +27 -3
- package/dist/0xsequence-metadata.cjs.prod.js +27 -3
- package/dist/0xsequence-metadata.esm.js +27 -4
- package/dist/declarations/src/index.d.ts +6 -1
- package/dist/declarations/src/metadata.gen.d.ts +11 -11
- package/package.json +1 -1
- package/src/index.ts +32 -2
- package/src/metadata.gen.ts +12 -12
|
@@ -18,7 +18,7 @@ function _extends() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/* eslint-disable */
|
|
21
|
-
// sequence-metadata v0.4.0
|
|
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 = '
|
|
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
|
|
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
|
|
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 = '
|
|
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
|
|
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
|
|
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 = '
|
|
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
|
|
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 = "
|
|
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
|
|
99
|
-
image
|
|
100
|
-
video
|
|
101
|
-
audio
|
|
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
|
|
109
|
-
external_url
|
|
110
|
-
background_color
|
|
111
|
-
animation_url
|
|
108
|
+
image_data?: string;
|
|
109
|
+
external_url?: string;
|
|
110
|
+
background_color?: string;
|
|
111
|
+
animation_url?: string;
|
|
112
112
|
decimals?: number;
|
|
113
|
-
updatedAt
|
|
113
|
+
updatedAt?: string;
|
|
114
114
|
assets?: Array<Asset>;
|
|
115
115
|
}
|
|
116
116
|
export interface PropertyFilter {
|
package/package.json
CHANGED
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
|
|
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
|
+
}
|
package/src/metadata.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-metadata v0.4.0
|
|
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 = '
|
|
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
|
|
122
|
-
image
|
|
123
|
-
video
|
|
124
|
-
audio
|
|
125
|
-
properties
|
|
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
|
|
128
|
-
external_url
|
|
129
|
-
background_color
|
|
130
|
-
animation_url
|
|
127
|
+
image_data?: string
|
|
128
|
+
external_url?: string
|
|
129
|
+
background_color?: string
|
|
130
|
+
animation_url?: string
|
|
131
131
|
decimals?: number
|
|
132
|
-
updatedAt
|
|
132
|
+
updatedAt?: string
|
|
133
133
|
assets?: Array<Asset>
|
|
134
134
|
}
|
|
135
135
|
|