@0xsequence/metadata 0.0.0-20230920204248 → 0.0.0-20230920211640
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.d.ts +1 -1
- package/dist/0xsequence-metadata.cjs.d.ts.map +1 -1
- package/dist/0xsequence-metadata.cjs.dev.js +278 -0
- package/dist/0xsequence-metadata.cjs.js +6 -15
- package/dist/0xsequence-metadata.cjs.prod.js +278 -0
- package/dist/0xsequence-metadata.esm.js +266 -0
- package/dist/declarations/src/index.d.ts +5 -0
- package/dist/declarations/src/metadata.gen.d.ts +325 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./declarations/src/index";
|
|
2
2
|
//# sourceMappingURL=0xsequence-metadata.cjs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0xsequence-metadata.cjs.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"0xsequence-metadata.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
for (var key in source) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
+
target[key] = source[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
return _extends.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* eslint-disable */
|
|
21
|
+
// sequence-metadata v0.4.0 e4c229eadea7c35df2afe8e17afb7dbbc6e118a4
|
|
22
|
+
// --
|
|
23
|
+
// Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
|
|
24
|
+
//
|
|
25
|
+
// webrpc-gen -schema=metadata.ridl -target=typescript@v0.10.0 -client -out=./clients/metadata.gen.ts
|
|
26
|
+
|
|
27
|
+
// WebRPC description and code-gen version
|
|
28
|
+
const WebRPCVersion = 'v1';
|
|
29
|
+
|
|
30
|
+
// Schema version of your RIDL schema
|
|
31
|
+
const WebRPCSchemaVersion = 'v0.4.0';
|
|
32
|
+
|
|
33
|
+
// Schema hash generated from your RIDL schema
|
|
34
|
+
const WebRPCSchemaHash = 'e4c229eadea7c35df2afe8e17afb7dbbc6e118a4';
|
|
35
|
+
|
|
36
|
+
//
|
|
37
|
+
// Types
|
|
38
|
+
//
|
|
39
|
+
|
|
40
|
+
let ContractType = /*#__PURE__*/function (ContractType) {
|
|
41
|
+
ContractType["UNKNOWN"] = "UNKNOWN";
|
|
42
|
+
ContractType["ERC20"] = "ERC20";
|
|
43
|
+
ContractType["ERC721"] = "ERC721";
|
|
44
|
+
ContractType["ERC1155"] = "ERC1155";
|
|
45
|
+
return ContractType;
|
|
46
|
+
}({});
|
|
47
|
+
let PropertyType = /*#__PURE__*/function (PropertyType) {
|
|
48
|
+
PropertyType["INT"] = "INT";
|
|
49
|
+
PropertyType["STRING"] = "STRING";
|
|
50
|
+
PropertyType["ARRAY"] = "ARRAY";
|
|
51
|
+
PropertyType["GENERIC"] = "GENERIC";
|
|
52
|
+
return PropertyType;
|
|
53
|
+
}({});
|
|
54
|
+
let SwapType = /*#__PURE__*/function (SwapType) {
|
|
55
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
56
|
+
SwapType["BUY"] = "BUY";
|
|
57
|
+
SwapType["SELL"] = "SELL";
|
|
58
|
+
return SwapType;
|
|
59
|
+
}({});
|
|
60
|
+
let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
61
|
+
SortOrder["DESC"] = "DESC";
|
|
62
|
+
SortOrder["ASC"] = "ASC";
|
|
63
|
+
return SortOrder;
|
|
64
|
+
}({});
|
|
65
|
+
//
|
|
66
|
+
// Client
|
|
67
|
+
//
|
|
68
|
+
class Metadata {
|
|
69
|
+
constructor(hostname, fetch) {
|
|
70
|
+
this.path = '/rpc/Metadata/';
|
|
71
|
+
this.ping = headers => {
|
|
72
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
73
|
+
return buildResponse(res).then(_data => {
|
|
74
|
+
return {
|
|
75
|
+
status: _data.status
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.version = headers => {
|
|
81
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
82
|
+
return buildResponse(res).then(_data => {
|
|
83
|
+
return {
|
|
84
|
+
version: _data.version
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
this.runtimeStatus = headers => {
|
|
90
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
91
|
+
return buildResponse(res).then(_data => {
|
|
92
|
+
return {
|
|
93
|
+
status: _data.status
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
this.getTokenMetadata = (args, headers) => {
|
|
99
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
100
|
+
return buildResponse(res).then(_data => {
|
|
101
|
+
return {
|
|
102
|
+
tokenMetadata: _data.tokenMetadata
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
this.refreshTokenMetadata = (args, headers) => {
|
|
108
|
+
return this.fetch(this.url('RefreshTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
109
|
+
return buildResponse(res).then(_data => {
|
|
110
|
+
return {
|
|
111
|
+
status: _data.status
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
117
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
118
|
+
return buildResponse(res).then(_data => {
|
|
119
|
+
return {
|
|
120
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
this.searchTokenMetadata = (args, headers) => {
|
|
126
|
+
return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
127
|
+
return buildResponse(res).then(_data => {
|
|
128
|
+
return {
|
|
129
|
+
page: _data.page,
|
|
130
|
+
tokenMetadata: _data.tokenMetadata
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
this.searchTokenIDs = (args, headers) => {
|
|
136
|
+
return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
|
|
137
|
+
return buildResponse(res).then(_data => {
|
|
138
|
+
return {
|
|
139
|
+
page: _data.page,
|
|
140
|
+
tokenIds: _data.tokenIds
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
this.tokenCollectionFilters = (args, headers) => {
|
|
146
|
+
return this.fetch(this.url('TokenCollectionFilters'), createHTTPRequest(args, headers)).then(res => {
|
|
147
|
+
return buildResponse(res).then(_data => {
|
|
148
|
+
return {
|
|
149
|
+
filters: _data.filters
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
this.getContractInfo = (args, headers) => {
|
|
155
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
156
|
+
return buildResponse(res).then(_data => {
|
|
157
|
+
return {
|
|
158
|
+
contractInfo: _data.contractInfo
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
164
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
165
|
+
return buildResponse(res).then(_data => {
|
|
166
|
+
return {
|
|
167
|
+
contractInfoMap: _data.contractInfoMap
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
this.searchContractInfo = (args, headers) => {
|
|
173
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
174
|
+
return buildResponse(res).then(_data => {
|
|
175
|
+
return {
|
|
176
|
+
contractInfoList: _data.contractInfoList
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
182
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
183
|
+
return buildResponse(res).then(_data => {
|
|
184
|
+
return {
|
|
185
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
this.searchMetadata = (args, headers) => {
|
|
191
|
+
return this.fetch(this.url('SearchMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
192
|
+
return buildResponse(res).then(_data => {
|
|
193
|
+
return {
|
|
194
|
+
tokenMetadata: _data.tokenMetadata,
|
|
195
|
+
contractInfo: _data.contractInfo
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
201
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
202
|
+
return buildResponse(res).then(_data => {
|
|
203
|
+
return {
|
|
204
|
+
quantity: _data.quantity
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
210
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
211
|
+
return buildResponse(res).then(_data => {
|
|
212
|
+
return {
|
|
213
|
+
prices: _data.prices
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
this.getNiftyswapUnitPricesWithQuantities = (args, headers) => {
|
|
219
|
+
return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers)).then(res => {
|
|
220
|
+
return buildResponse(res).then(_data => {
|
|
221
|
+
return {
|
|
222
|
+
prices: _data.prices
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
this.hostname = hostname;
|
|
228
|
+
this.fetch = (input, init) => fetch(input, init);
|
|
229
|
+
}
|
|
230
|
+
url(name) {
|
|
231
|
+
return this.hostname + this.path + name;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
235
|
+
return {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
headers: _extends({}, headers, {
|
|
238
|
+
'Content-Type': 'application/json'
|
|
239
|
+
}),
|
|
240
|
+
body: JSON.stringify(body || {})
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
const buildResponse = res => {
|
|
244
|
+
return res.text().then(text => {
|
|
245
|
+
let data;
|
|
246
|
+
try {
|
|
247
|
+
data = JSON.parse(text);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
throw {
|
|
250
|
+
code: 'unknown',
|
|
251
|
+
msg: `expecting JSON, got: ${text}`,
|
|
252
|
+
status: res.status
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (!res.ok) {
|
|
256
|
+
throw data; // webrpc error response
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return data;
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
264
|
+
class SequenceMetadataClient extends Metadata {
|
|
265
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
266
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
exports.ContractType = ContractType;
|
|
271
|
+
exports.Metadata = Metadata;
|
|
272
|
+
exports.PropertyType = PropertyType;
|
|
273
|
+
exports.SequenceMetadataClient = SequenceMetadataClient;
|
|
274
|
+
exports.SortOrder = SortOrder;
|
|
275
|
+
exports.SwapType = SwapType;
|
|
276
|
+
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
277
|
+
exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
|
|
278
|
+
exports.WebRPCVersion = WebRPCVersion;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
// this file might look strange and you might be wondering what it's for
|
|
3
|
-
// it's lets you import your source files by importing this entrypoint
|
|
4
|
-
// as you would import it if it was built with preconstruct build
|
|
5
|
-
// this file is slightly different to some others though
|
|
6
|
-
// it has a require hook which compiles your code with Babel
|
|
7
|
-
// this means that you don't have to set up @babel/register or anything like that
|
|
8
|
-
// but you can still require this module and it'll be compiled
|
|
1
|
+
'use strict';
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
unregister();
|
|
3
|
+
if (process.env.NODE_ENV === "production") {
|
|
4
|
+
module.exports = require("./0xsequence-metadata.cjs.prod.js");
|
|
5
|
+
} else {
|
|
6
|
+
module.exports = require("./0xsequence-metadata.cjs.dev.js");
|
|
7
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
for (var key in source) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
11
|
+
target[key] = source[key];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
return _extends.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* eslint-disable */
|
|
21
|
+
// sequence-metadata v0.4.0 e4c229eadea7c35df2afe8e17afb7dbbc6e118a4
|
|
22
|
+
// --
|
|
23
|
+
// Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
|
|
24
|
+
//
|
|
25
|
+
// webrpc-gen -schema=metadata.ridl -target=typescript@v0.10.0 -client -out=./clients/metadata.gen.ts
|
|
26
|
+
|
|
27
|
+
// WebRPC description and code-gen version
|
|
28
|
+
const WebRPCVersion = 'v1';
|
|
29
|
+
|
|
30
|
+
// Schema version of your RIDL schema
|
|
31
|
+
const WebRPCSchemaVersion = 'v0.4.0';
|
|
32
|
+
|
|
33
|
+
// Schema hash generated from your RIDL schema
|
|
34
|
+
const WebRPCSchemaHash = 'e4c229eadea7c35df2afe8e17afb7dbbc6e118a4';
|
|
35
|
+
|
|
36
|
+
//
|
|
37
|
+
// Types
|
|
38
|
+
//
|
|
39
|
+
|
|
40
|
+
let ContractType = /*#__PURE__*/function (ContractType) {
|
|
41
|
+
ContractType["UNKNOWN"] = "UNKNOWN";
|
|
42
|
+
ContractType["ERC20"] = "ERC20";
|
|
43
|
+
ContractType["ERC721"] = "ERC721";
|
|
44
|
+
ContractType["ERC1155"] = "ERC1155";
|
|
45
|
+
return ContractType;
|
|
46
|
+
}({});
|
|
47
|
+
let PropertyType = /*#__PURE__*/function (PropertyType) {
|
|
48
|
+
PropertyType["INT"] = "INT";
|
|
49
|
+
PropertyType["STRING"] = "STRING";
|
|
50
|
+
PropertyType["ARRAY"] = "ARRAY";
|
|
51
|
+
PropertyType["GENERIC"] = "GENERIC";
|
|
52
|
+
return PropertyType;
|
|
53
|
+
}({});
|
|
54
|
+
let SwapType = /*#__PURE__*/function (SwapType) {
|
|
55
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
56
|
+
SwapType["BUY"] = "BUY";
|
|
57
|
+
SwapType["SELL"] = "SELL";
|
|
58
|
+
return SwapType;
|
|
59
|
+
}({});
|
|
60
|
+
let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
61
|
+
SortOrder["DESC"] = "DESC";
|
|
62
|
+
SortOrder["ASC"] = "ASC";
|
|
63
|
+
return SortOrder;
|
|
64
|
+
}({});
|
|
65
|
+
//
|
|
66
|
+
// Client
|
|
67
|
+
//
|
|
68
|
+
class Metadata {
|
|
69
|
+
constructor(hostname, fetch) {
|
|
70
|
+
this.path = '/rpc/Metadata/';
|
|
71
|
+
this.ping = headers => {
|
|
72
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
73
|
+
return buildResponse(res).then(_data => {
|
|
74
|
+
return {
|
|
75
|
+
status: _data.status
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.version = headers => {
|
|
81
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
82
|
+
return buildResponse(res).then(_data => {
|
|
83
|
+
return {
|
|
84
|
+
version: _data.version
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
this.runtimeStatus = headers => {
|
|
90
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
91
|
+
return buildResponse(res).then(_data => {
|
|
92
|
+
return {
|
|
93
|
+
status: _data.status
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
this.getTokenMetadata = (args, headers) => {
|
|
99
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
100
|
+
return buildResponse(res).then(_data => {
|
|
101
|
+
return {
|
|
102
|
+
tokenMetadata: _data.tokenMetadata
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
this.refreshTokenMetadata = (args, headers) => {
|
|
108
|
+
return this.fetch(this.url('RefreshTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
109
|
+
return buildResponse(res).then(_data => {
|
|
110
|
+
return {
|
|
111
|
+
status: _data.status
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
117
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
118
|
+
return buildResponse(res).then(_data => {
|
|
119
|
+
return {
|
|
120
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
this.searchTokenMetadata = (args, headers) => {
|
|
126
|
+
return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
127
|
+
return buildResponse(res).then(_data => {
|
|
128
|
+
return {
|
|
129
|
+
page: _data.page,
|
|
130
|
+
tokenMetadata: _data.tokenMetadata
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
this.searchTokenIDs = (args, headers) => {
|
|
136
|
+
return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
|
|
137
|
+
return buildResponse(res).then(_data => {
|
|
138
|
+
return {
|
|
139
|
+
page: _data.page,
|
|
140
|
+
tokenIds: _data.tokenIds
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
this.tokenCollectionFilters = (args, headers) => {
|
|
146
|
+
return this.fetch(this.url('TokenCollectionFilters'), createHTTPRequest(args, headers)).then(res => {
|
|
147
|
+
return buildResponse(res).then(_data => {
|
|
148
|
+
return {
|
|
149
|
+
filters: _data.filters
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
this.getContractInfo = (args, headers) => {
|
|
155
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
156
|
+
return buildResponse(res).then(_data => {
|
|
157
|
+
return {
|
|
158
|
+
contractInfo: _data.contractInfo
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
164
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
165
|
+
return buildResponse(res).then(_data => {
|
|
166
|
+
return {
|
|
167
|
+
contractInfoMap: _data.contractInfoMap
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
this.searchContractInfo = (args, headers) => {
|
|
173
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
174
|
+
return buildResponse(res).then(_data => {
|
|
175
|
+
return {
|
|
176
|
+
contractInfoList: _data.contractInfoList
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
182
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
183
|
+
return buildResponse(res).then(_data => {
|
|
184
|
+
return {
|
|
185
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
this.searchMetadata = (args, headers) => {
|
|
191
|
+
return this.fetch(this.url('SearchMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
192
|
+
return buildResponse(res).then(_data => {
|
|
193
|
+
return {
|
|
194
|
+
tokenMetadata: _data.tokenMetadata,
|
|
195
|
+
contractInfo: _data.contractInfo
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
201
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
202
|
+
return buildResponse(res).then(_data => {
|
|
203
|
+
return {
|
|
204
|
+
quantity: _data.quantity
|
|
205
|
+
};
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
210
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
211
|
+
return buildResponse(res).then(_data => {
|
|
212
|
+
return {
|
|
213
|
+
prices: _data.prices
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
this.getNiftyswapUnitPricesWithQuantities = (args, headers) => {
|
|
219
|
+
return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers)).then(res => {
|
|
220
|
+
return buildResponse(res).then(_data => {
|
|
221
|
+
return {
|
|
222
|
+
prices: _data.prices
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
this.hostname = hostname;
|
|
228
|
+
this.fetch = (input, init) => fetch(input, init);
|
|
229
|
+
}
|
|
230
|
+
url(name) {
|
|
231
|
+
return this.hostname + this.path + name;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
235
|
+
return {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
headers: _extends({}, headers, {
|
|
238
|
+
'Content-Type': 'application/json'
|
|
239
|
+
}),
|
|
240
|
+
body: JSON.stringify(body || {})
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
const buildResponse = res => {
|
|
244
|
+
return res.text().then(text => {
|
|
245
|
+
let data;
|
|
246
|
+
try {
|
|
247
|
+
data = JSON.parse(text);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
throw {
|
|
250
|
+
code: 'unknown',
|
|
251
|
+
msg: `expecting JSON, got: ${text}`,
|
|
252
|
+
status: res.status
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
if (!res.ok) {
|
|
256
|
+
throw data; // webrpc error response
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return data;
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
264
|
+
class SequenceMetadataClient extends Metadata {
|
|
265
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
266
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
exports.ContractType = ContractType;
|
|
271
|
+
exports.Metadata = Metadata;
|
|
272
|
+
exports.PropertyType = PropertyType;
|
|
273
|
+
exports.SequenceMetadataClient = SequenceMetadataClient;
|
|
274
|
+
exports.SortOrder = SortOrder;
|
|
275
|
+
exports.SwapType = SwapType;
|
|
276
|
+
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
277
|
+
exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
|
|
278
|
+
exports.WebRPCVersion = WebRPCVersion;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
3
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for (var key in source) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* eslint-disable */
|
|
17
|
+
// sequence-metadata v0.4.0 e4c229eadea7c35df2afe8e17afb7dbbc6e118a4
|
|
18
|
+
// --
|
|
19
|
+
// Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
|
|
20
|
+
//
|
|
21
|
+
// webrpc-gen -schema=metadata.ridl -target=typescript@v0.10.0 -client -out=./clients/metadata.gen.ts
|
|
22
|
+
|
|
23
|
+
// WebRPC description and code-gen version
|
|
24
|
+
const WebRPCVersion = 'v1';
|
|
25
|
+
|
|
26
|
+
// Schema version of your RIDL schema
|
|
27
|
+
const WebRPCSchemaVersion = 'v0.4.0';
|
|
28
|
+
|
|
29
|
+
// Schema hash generated from your RIDL schema
|
|
30
|
+
const WebRPCSchemaHash = 'e4c229eadea7c35df2afe8e17afb7dbbc6e118a4';
|
|
31
|
+
|
|
32
|
+
//
|
|
33
|
+
// Types
|
|
34
|
+
//
|
|
35
|
+
|
|
36
|
+
let ContractType = /*#__PURE__*/function (ContractType) {
|
|
37
|
+
ContractType["UNKNOWN"] = "UNKNOWN";
|
|
38
|
+
ContractType["ERC20"] = "ERC20";
|
|
39
|
+
ContractType["ERC721"] = "ERC721";
|
|
40
|
+
ContractType["ERC1155"] = "ERC1155";
|
|
41
|
+
return ContractType;
|
|
42
|
+
}({});
|
|
43
|
+
let PropertyType = /*#__PURE__*/function (PropertyType) {
|
|
44
|
+
PropertyType["INT"] = "INT";
|
|
45
|
+
PropertyType["STRING"] = "STRING";
|
|
46
|
+
PropertyType["ARRAY"] = "ARRAY";
|
|
47
|
+
PropertyType["GENERIC"] = "GENERIC";
|
|
48
|
+
return PropertyType;
|
|
49
|
+
}({});
|
|
50
|
+
let SwapType = /*#__PURE__*/function (SwapType) {
|
|
51
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
52
|
+
SwapType["BUY"] = "BUY";
|
|
53
|
+
SwapType["SELL"] = "SELL";
|
|
54
|
+
return SwapType;
|
|
55
|
+
}({});
|
|
56
|
+
let SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
57
|
+
SortOrder["DESC"] = "DESC";
|
|
58
|
+
SortOrder["ASC"] = "ASC";
|
|
59
|
+
return SortOrder;
|
|
60
|
+
}({});
|
|
61
|
+
//
|
|
62
|
+
// Client
|
|
63
|
+
//
|
|
64
|
+
class Metadata {
|
|
65
|
+
constructor(hostname, fetch) {
|
|
66
|
+
this.path = '/rpc/Metadata/';
|
|
67
|
+
this.ping = headers => {
|
|
68
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
69
|
+
return buildResponse(res).then(_data => {
|
|
70
|
+
return {
|
|
71
|
+
status: _data.status
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
this.version = headers => {
|
|
77
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
78
|
+
return buildResponse(res).then(_data => {
|
|
79
|
+
return {
|
|
80
|
+
version: _data.version
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
this.runtimeStatus = headers => {
|
|
86
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
87
|
+
return buildResponse(res).then(_data => {
|
|
88
|
+
return {
|
|
89
|
+
status: _data.status
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
this.getTokenMetadata = (args, headers) => {
|
|
95
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
96
|
+
return buildResponse(res).then(_data => {
|
|
97
|
+
return {
|
|
98
|
+
tokenMetadata: _data.tokenMetadata
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
this.refreshTokenMetadata = (args, headers) => {
|
|
104
|
+
return this.fetch(this.url('RefreshTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
105
|
+
return buildResponse(res).then(_data => {
|
|
106
|
+
return {
|
|
107
|
+
status: _data.status
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
113
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
114
|
+
return buildResponse(res).then(_data => {
|
|
115
|
+
return {
|
|
116
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
this.searchTokenMetadata = (args, headers) => {
|
|
122
|
+
return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
123
|
+
return buildResponse(res).then(_data => {
|
|
124
|
+
return {
|
|
125
|
+
page: _data.page,
|
|
126
|
+
tokenMetadata: _data.tokenMetadata
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
this.searchTokenIDs = (args, headers) => {
|
|
132
|
+
return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
|
|
133
|
+
return buildResponse(res).then(_data => {
|
|
134
|
+
return {
|
|
135
|
+
page: _data.page,
|
|
136
|
+
tokenIds: _data.tokenIds
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
this.tokenCollectionFilters = (args, headers) => {
|
|
142
|
+
return this.fetch(this.url('TokenCollectionFilters'), createHTTPRequest(args, headers)).then(res => {
|
|
143
|
+
return buildResponse(res).then(_data => {
|
|
144
|
+
return {
|
|
145
|
+
filters: _data.filters
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
this.getContractInfo = (args, headers) => {
|
|
151
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
152
|
+
return buildResponse(res).then(_data => {
|
|
153
|
+
return {
|
|
154
|
+
contractInfo: _data.contractInfo
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
160
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
161
|
+
return buildResponse(res).then(_data => {
|
|
162
|
+
return {
|
|
163
|
+
contractInfoMap: _data.contractInfoMap
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
this.searchContractInfo = (args, headers) => {
|
|
169
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
170
|
+
return buildResponse(res).then(_data => {
|
|
171
|
+
return {
|
|
172
|
+
contractInfoList: _data.contractInfoList
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
178
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
179
|
+
return buildResponse(res).then(_data => {
|
|
180
|
+
return {
|
|
181
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
this.searchMetadata = (args, headers) => {
|
|
187
|
+
return this.fetch(this.url('SearchMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
188
|
+
return buildResponse(res).then(_data => {
|
|
189
|
+
return {
|
|
190
|
+
tokenMetadata: _data.tokenMetadata,
|
|
191
|
+
contractInfo: _data.contractInfo
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
197
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
198
|
+
return buildResponse(res).then(_data => {
|
|
199
|
+
return {
|
|
200
|
+
quantity: _data.quantity
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
206
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
207
|
+
return buildResponse(res).then(_data => {
|
|
208
|
+
return {
|
|
209
|
+
prices: _data.prices
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
this.getNiftyswapUnitPricesWithQuantities = (args, headers) => {
|
|
215
|
+
return this.fetch(this.url('GetNiftyswapUnitPricesWithQuantities'), createHTTPRequest(args, headers)).then(res => {
|
|
216
|
+
return buildResponse(res).then(_data => {
|
|
217
|
+
return {
|
|
218
|
+
prices: _data.prices
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
this.hostname = hostname;
|
|
224
|
+
this.fetch = (input, init) => fetch(input, init);
|
|
225
|
+
}
|
|
226
|
+
url(name) {
|
|
227
|
+
return this.hostname + this.path + name;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
231
|
+
return {
|
|
232
|
+
method: 'POST',
|
|
233
|
+
headers: _extends({}, headers, {
|
|
234
|
+
'Content-Type': 'application/json'
|
|
235
|
+
}),
|
|
236
|
+
body: JSON.stringify(body || {})
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
const buildResponse = res => {
|
|
240
|
+
return res.text().then(text => {
|
|
241
|
+
let data;
|
|
242
|
+
try {
|
|
243
|
+
data = JSON.parse(text);
|
|
244
|
+
} catch (err) {
|
|
245
|
+
throw {
|
|
246
|
+
code: 'unknown',
|
|
247
|
+
msg: `expecting JSON, got: ${text}`,
|
|
248
|
+
status: res.status
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
if (!res.ok) {
|
|
252
|
+
throw data; // webrpc error response
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return data;
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const fetch = typeof global === 'object' ? global.fetch : window.fetch;
|
|
260
|
+
class SequenceMetadataClient extends Metadata {
|
|
261
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
262
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export { ContractType, Metadata, PropertyType, SequenceMetadataClient, SortOrder, SwapType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
export declare const WebRPCVersion = "v1";
|
|
2
|
+
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
+
export declare const WebRPCSchemaHash = "e4c229eadea7c35df2afe8e17afb7dbbc6e118a4";
|
|
4
|
+
export declare enum ContractType {
|
|
5
|
+
UNKNOWN = "UNKNOWN",
|
|
6
|
+
ERC20 = "ERC20",
|
|
7
|
+
ERC721 = "ERC721",
|
|
8
|
+
ERC1155 = "ERC1155"
|
|
9
|
+
}
|
|
10
|
+
export declare enum PropertyType {
|
|
11
|
+
INT = "INT",
|
|
12
|
+
STRING = "STRING",
|
|
13
|
+
ARRAY = "ARRAY",
|
|
14
|
+
GENERIC = "GENERIC"
|
|
15
|
+
}
|
|
16
|
+
export declare enum SwapType {
|
|
17
|
+
UNKNOWN = "UNKNOWN",
|
|
18
|
+
BUY = "BUY",
|
|
19
|
+
SELL = "SELL"
|
|
20
|
+
}
|
|
21
|
+
export declare enum SortOrder {
|
|
22
|
+
DESC = "DESC",
|
|
23
|
+
ASC = "ASC"
|
|
24
|
+
}
|
|
25
|
+
export interface Version {
|
|
26
|
+
webrpcVersion: string;
|
|
27
|
+
schemaVersion: string;
|
|
28
|
+
schemaHash: string;
|
|
29
|
+
appVersion: string;
|
|
30
|
+
}
|
|
31
|
+
export interface RuntimeStatus {
|
|
32
|
+
healthOK: boolean;
|
|
33
|
+
startTime: string;
|
|
34
|
+
uptime: number;
|
|
35
|
+
ver: string;
|
|
36
|
+
branch: string;
|
|
37
|
+
commitHash: string;
|
|
38
|
+
checks: RuntimeChecks;
|
|
39
|
+
}
|
|
40
|
+
export interface RuntimeChecks {
|
|
41
|
+
}
|
|
42
|
+
export interface ContractIndex {
|
|
43
|
+
chainId: number;
|
|
44
|
+
address: string;
|
|
45
|
+
type: ContractType;
|
|
46
|
+
metadata: {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
};
|
|
49
|
+
contentHash: number;
|
|
50
|
+
deployed: boolean;
|
|
51
|
+
bytecodeHash: string;
|
|
52
|
+
notFound: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface TokenIndex {
|
|
55
|
+
key: string;
|
|
56
|
+
chainId: number;
|
|
57
|
+
contractAddress: string;
|
|
58
|
+
tokenId: string;
|
|
59
|
+
metadata: {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
};
|
|
62
|
+
notFound: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ContractInfo {
|
|
65
|
+
chainId: number;
|
|
66
|
+
address: string;
|
|
67
|
+
name: string;
|
|
68
|
+
type: string;
|
|
69
|
+
symbol: string;
|
|
70
|
+
decimals?: number;
|
|
71
|
+
logoURI: string;
|
|
72
|
+
deployed: boolean;
|
|
73
|
+
bytecodeHash: string;
|
|
74
|
+
extensions: ContractInfoExtensions;
|
|
75
|
+
}
|
|
76
|
+
export interface ContractInfoExtensions {
|
|
77
|
+
link: string;
|
|
78
|
+
description: string;
|
|
79
|
+
ogImage: string;
|
|
80
|
+
originChainId: number;
|
|
81
|
+
originAddress: string;
|
|
82
|
+
blacklist: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface TokenMetadata {
|
|
85
|
+
tokenId: string;
|
|
86
|
+
contractAddress: string;
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
image: string;
|
|
90
|
+
decimals: number;
|
|
91
|
+
properties: {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
};
|
|
94
|
+
video: string;
|
|
95
|
+
audio: string;
|
|
96
|
+
image_data: string;
|
|
97
|
+
external_url: string;
|
|
98
|
+
background_color: string;
|
|
99
|
+
animation_url: string;
|
|
100
|
+
attributes: Array<{
|
|
101
|
+
[key: string]: any;
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
export interface PropertyFilter {
|
|
105
|
+
name: string;
|
|
106
|
+
type: PropertyType;
|
|
107
|
+
min?: number;
|
|
108
|
+
max?: number;
|
|
109
|
+
values?: Array<any>;
|
|
110
|
+
}
|
|
111
|
+
export interface Filter {
|
|
112
|
+
text?: string;
|
|
113
|
+
properties?: Array<PropertyFilter>;
|
|
114
|
+
}
|
|
115
|
+
export interface GetNiftyswapUnitPricesRequest {
|
|
116
|
+
swapType: SwapType;
|
|
117
|
+
ids: Array<string>;
|
|
118
|
+
amounts: Array<string>;
|
|
119
|
+
}
|
|
120
|
+
export interface GetNiftyswapUnitPricesResponse {
|
|
121
|
+
unitPrice: string;
|
|
122
|
+
unitAmount: string;
|
|
123
|
+
availableAmount: string;
|
|
124
|
+
}
|
|
125
|
+
export interface Page {
|
|
126
|
+
pageSize?: number;
|
|
127
|
+
page?: number;
|
|
128
|
+
}
|
|
129
|
+
export interface SortBy {
|
|
130
|
+
column: string;
|
|
131
|
+
order: SortOrder;
|
|
132
|
+
}
|
|
133
|
+
export interface Metadata {
|
|
134
|
+
ping(headers?: object): Promise<PingReturn>;
|
|
135
|
+
version(headers?: object): Promise<VersionReturn>;
|
|
136
|
+
runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>;
|
|
137
|
+
getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>;
|
|
138
|
+
refreshTokenMetadata(args: RefreshTokenMetadataArgs, headers?: object): Promise<RefreshTokenMetadataReturn>;
|
|
139
|
+
getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>;
|
|
140
|
+
searchTokenMetadata(args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn>;
|
|
141
|
+
searchTokenIDs(args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn>;
|
|
142
|
+
tokenCollectionFilters(args: TokenCollectionFiltersArgs, headers?: object): Promise<TokenCollectionFiltersReturn>;
|
|
143
|
+
getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>;
|
|
144
|
+
getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>;
|
|
145
|
+
searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>;
|
|
146
|
+
searchContractInfoBatch(args: SearchContractInfoBatchArgs, headers?: object): Promise<SearchContractInfoBatchReturn>;
|
|
147
|
+
searchMetadata(args: SearchMetadataArgs, headers?: object): Promise<SearchMetadataReturn>;
|
|
148
|
+
getNiftyswapTokenQuantity(args: GetNiftyswapTokenQuantityArgs, headers?: object): Promise<GetNiftyswapTokenQuantityReturn>;
|
|
149
|
+
getNiftyswapUnitPrices(args: GetNiftyswapUnitPricesArgs, headers?: object): Promise<GetNiftyswapUnitPricesReturn>;
|
|
150
|
+
getNiftyswapUnitPricesWithQuantities(args: GetNiftyswapUnitPricesWithQuantitiesArgs, headers?: object): Promise<GetNiftyswapUnitPricesWithQuantitiesReturn>;
|
|
151
|
+
}
|
|
152
|
+
export interface PingArgs {
|
|
153
|
+
}
|
|
154
|
+
export interface PingReturn {
|
|
155
|
+
status: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface VersionArgs {
|
|
158
|
+
}
|
|
159
|
+
export interface VersionReturn {
|
|
160
|
+
version: Version;
|
|
161
|
+
}
|
|
162
|
+
export interface RuntimeStatusArgs {
|
|
163
|
+
}
|
|
164
|
+
export interface RuntimeStatusReturn {
|
|
165
|
+
status: RuntimeStatus;
|
|
166
|
+
}
|
|
167
|
+
export interface GetTokenMetadataArgs {
|
|
168
|
+
chainID: string;
|
|
169
|
+
contractAddress: string;
|
|
170
|
+
tokenIDs: Array<string>;
|
|
171
|
+
}
|
|
172
|
+
export interface GetTokenMetadataReturn {
|
|
173
|
+
tokenMetadata: Array<TokenMetadata>;
|
|
174
|
+
}
|
|
175
|
+
export interface RefreshTokenMetadataArgs {
|
|
176
|
+
chainID: string;
|
|
177
|
+
contractAddress: string;
|
|
178
|
+
tokenIDs?: Array<string>;
|
|
179
|
+
refreshAll?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface RefreshTokenMetadataReturn {
|
|
182
|
+
status: {
|
|
183
|
+
[key: string]: boolean;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export interface GetTokenMetadataBatchArgs {
|
|
187
|
+
chainID: string;
|
|
188
|
+
contractTokenMap: {
|
|
189
|
+
[key: string]: Array<string>;
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
export interface GetTokenMetadataBatchReturn {
|
|
193
|
+
contractTokenMetadata: {
|
|
194
|
+
[key: string]: Array<TokenMetadata>;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
export interface SearchTokenMetadataArgs {
|
|
198
|
+
chainID: string;
|
|
199
|
+
contractAddress: string;
|
|
200
|
+
filter: Filter;
|
|
201
|
+
page?: Page;
|
|
202
|
+
}
|
|
203
|
+
export interface SearchTokenMetadataReturn {
|
|
204
|
+
page: Page;
|
|
205
|
+
tokenMetadata: Array<TokenMetadata>;
|
|
206
|
+
}
|
|
207
|
+
export interface SearchTokenIDsArgs {
|
|
208
|
+
chainID: string;
|
|
209
|
+
contractAddress: string;
|
|
210
|
+
filter: Filter;
|
|
211
|
+
page?: Page;
|
|
212
|
+
}
|
|
213
|
+
export interface SearchTokenIDsReturn {
|
|
214
|
+
page: Page;
|
|
215
|
+
tokenIds: Array<string>;
|
|
216
|
+
}
|
|
217
|
+
export interface TokenCollectionFiltersArgs {
|
|
218
|
+
chainID: string;
|
|
219
|
+
contractAddress: string;
|
|
220
|
+
}
|
|
221
|
+
export interface TokenCollectionFiltersReturn {
|
|
222
|
+
filters: Array<PropertyFilter>;
|
|
223
|
+
}
|
|
224
|
+
export interface GetContractInfoArgs {
|
|
225
|
+
chainID: string;
|
|
226
|
+
contractAddress: string;
|
|
227
|
+
}
|
|
228
|
+
export interface GetContractInfoReturn {
|
|
229
|
+
contractInfo: ContractInfo;
|
|
230
|
+
}
|
|
231
|
+
export interface GetContractInfoBatchArgs {
|
|
232
|
+
chainID: string;
|
|
233
|
+
contractAddresses: Array<string>;
|
|
234
|
+
}
|
|
235
|
+
export interface GetContractInfoBatchReturn {
|
|
236
|
+
contractInfoMap: {
|
|
237
|
+
[key: string]: ContractInfo;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export interface SearchContractInfoArgs {
|
|
241
|
+
contractAddress: string;
|
|
242
|
+
}
|
|
243
|
+
export interface SearchContractInfoReturn {
|
|
244
|
+
contractInfoList: Array<ContractInfo>;
|
|
245
|
+
}
|
|
246
|
+
export interface SearchContractInfoBatchArgs {
|
|
247
|
+
contractAddresses: Array<string>;
|
|
248
|
+
}
|
|
249
|
+
export interface SearchContractInfoBatchReturn {
|
|
250
|
+
contractInfoByChain: {
|
|
251
|
+
[key: string]: Array<ContractInfo>;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
export interface SearchMetadataArgs {
|
|
255
|
+
filter: string;
|
|
256
|
+
chainID?: string;
|
|
257
|
+
types?: Array<ContractType>;
|
|
258
|
+
excludeTokenMetadata?: boolean;
|
|
259
|
+
}
|
|
260
|
+
export interface SearchMetadataReturn {
|
|
261
|
+
tokenMetadata: Array<TokenMetadata>;
|
|
262
|
+
contractInfo: Array<ContractInfo>;
|
|
263
|
+
}
|
|
264
|
+
export interface GetNiftyswapTokenQuantityArgs {
|
|
265
|
+
chainID: string;
|
|
266
|
+
contractAddress: string;
|
|
267
|
+
tokenIDs: Array<string>;
|
|
268
|
+
}
|
|
269
|
+
export interface GetNiftyswapTokenQuantityReturn {
|
|
270
|
+
quantity: {
|
|
271
|
+
[key: string]: string;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
export interface GetNiftyswapUnitPricesArgs {
|
|
275
|
+
chainID: string;
|
|
276
|
+
contractAddress: string;
|
|
277
|
+
req: GetNiftyswapUnitPricesRequest;
|
|
278
|
+
fresh: boolean;
|
|
279
|
+
}
|
|
280
|
+
export interface GetNiftyswapUnitPricesReturn {
|
|
281
|
+
prices: {
|
|
282
|
+
[key: string]: string;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
export interface GetNiftyswapUnitPricesWithQuantitiesArgs {
|
|
286
|
+
chainID: string;
|
|
287
|
+
contractAddress: string;
|
|
288
|
+
req: GetNiftyswapUnitPricesRequest;
|
|
289
|
+
fresh: boolean;
|
|
290
|
+
}
|
|
291
|
+
export interface GetNiftyswapUnitPricesWithQuantitiesReturn {
|
|
292
|
+
prices: {
|
|
293
|
+
[key: string]: GetNiftyswapUnitPricesResponse;
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
export declare class Metadata implements Metadata {
|
|
297
|
+
protected hostname: string;
|
|
298
|
+
protected fetch: Fetch;
|
|
299
|
+
protected path: string;
|
|
300
|
+
constructor(hostname: string, fetch: Fetch);
|
|
301
|
+
private url;
|
|
302
|
+
ping: (headers?: object | undefined) => Promise<PingReturn>;
|
|
303
|
+
version: (headers?: object | undefined) => Promise<VersionReturn>;
|
|
304
|
+
runtimeStatus: (headers?: object | undefined) => Promise<RuntimeStatusReturn>;
|
|
305
|
+
getTokenMetadata: (args: GetTokenMetadataArgs, headers?: object | undefined) => Promise<GetTokenMetadataReturn>;
|
|
306
|
+
refreshTokenMetadata: (args: RefreshTokenMetadataArgs, headers?: object | undefined) => Promise<RefreshTokenMetadataReturn>;
|
|
307
|
+
getTokenMetadataBatch: (args: GetTokenMetadataBatchArgs, headers?: object | undefined) => Promise<GetTokenMetadataBatchReturn>;
|
|
308
|
+
searchTokenMetadata: (args: SearchTokenMetadataArgs, headers?: object | undefined) => Promise<SearchTokenMetadataReturn>;
|
|
309
|
+
searchTokenIDs: (args: SearchTokenIDsArgs, headers?: object | undefined) => Promise<SearchTokenIDsReturn>;
|
|
310
|
+
tokenCollectionFilters: (args: TokenCollectionFiltersArgs, headers?: object | undefined) => Promise<TokenCollectionFiltersReturn>;
|
|
311
|
+
getContractInfo: (args: GetContractInfoArgs, headers?: object | undefined) => Promise<GetContractInfoReturn>;
|
|
312
|
+
getContractInfoBatch: (args: GetContractInfoBatchArgs, headers?: object | undefined) => Promise<GetContractInfoBatchReturn>;
|
|
313
|
+
searchContractInfo: (args: SearchContractInfoArgs, headers?: object | undefined) => Promise<SearchContractInfoReturn>;
|
|
314
|
+
searchContractInfoBatch: (args: SearchContractInfoBatchArgs, headers?: object | undefined) => Promise<SearchContractInfoBatchReturn>;
|
|
315
|
+
searchMetadata: (args: SearchMetadataArgs, headers?: object | undefined) => Promise<SearchMetadataReturn>;
|
|
316
|
+
getNiftyswapTokenQuantity: (args: GetNiftyswapTokenQuantityArgs, headers?: object | undefined) => Promise<GetNiftyswapTokenQuantityReturn>;
|
|
317
|
+
getNiftyswapUnitPrices: (args: GetNiftyswapUnitPricesArgs, headers?: object | undefined) => Promise<GetNiftyswapUnitPricesReturn>;
|
|
318
|
+
getNiftyswapUnitPricesWithQuantities: (args: GetNiftyswapUnitPricesWithQuantitiesArgs, headers?: object | undefined) => Promise<GetNiftyswapUnitPricesWithQuantitiesReturn>;
|
|
319
|
+
}
|
|
320
|
+
export interface WebRPCError extends Error {
|
|
321
|
+
code: string;
|
|
322
|
+
msg: string;
|
|
323
|
+
status: number;
|
|
324
|
+
}
|
|
325
|
+
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/metadata",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230920211640",
|
|
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",
|