@0xsequence/metadata 0.0.0-20220412184039 → 0.0.0-20220425195445
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 -11
- package/dist/0xsequence-metadata.cjs.dev.js +223 -0
- package/dist/0xsequence-metadata.cjs.js +6 -15
- package/dist/0xsequence-metadata.cjs.prod.js +223 -0
- package/dist/0xsequence-metadata.esm.js +211 -0
- package/dist/declarations/src/index.d.ts +5 -0
- package/dist/declarations/src/metadata.gen.d.ts +189 -0
- package/package.json +1 -1
- package/src/metadata.gen.ts +3 -92
- package/CHANGELOG.md +0 -212
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
|
|
3
|
-
|
|
4
|
-
// curious why you need to?
|
|
5
|
-
// this file exists so that you can import from the entrypoint normally
|
|
6
|
-
// except that it points to your source file and you don't need to run build constantly
|
|
7
|
-
// which means we need to re-export all of the modules from your source file
|
|
8
|
-
// and since export * doesn't include default exports, we need to read your source file
|
|
9
|
-
// to check for a default export and re-export it if it exists
|
|
10
|
-
// it's not ideal, but it works pretty well ¯\_(ツ)_/¯
|
|
11
|
-
export * from "../src/index";
|
|
1
|
+
export * from "./declarations/src/index";
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var fetch = require('cross-fetch');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
10
|
+
|
|
11
|
+
function _extends() {
|
|
12
|
+
_extends = Object.assign || function (target) {
|
|
13
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
+
var source = arguments[i];
|
|
15
|
+
|
|
16
|
+
for (var key in source) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
18
|
+
target[key] = source[key];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return _extends.apply(this, arguments);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* eslint-disable */
|
|
30
|
+
// sequence-metadata v0.4.0 eaaa99d70565871556a53333df1c49d28c8be767
|
|
31
|
+
// --
|
|
32
|
+
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
33
|
+
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
34
|
+
// WebRPC description and code-gen version
|
|
35
|
+
const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
36
|
+
|
|
37
|
+
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
38
|
+
|
|
39
|
+
const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767"; //
|
|
40
|
+
// Types
|
|
41
|
+
//
|
|
42
|
+
|
|
43
|
+
exports.SwapType = void 0;
|
|
44
|
+
|
|
45
|
+
(function (SwapType) {
|
|
46
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
47
|
+
SwapType["BUY"] = "BUY";
|
|
48
|
+
SwapType["SELL"] = "SELL";
|
|
49
|
+
})(exports.SwapType || (exports.SwapType = {}));
|
|
50
|
+
|
|
51
|
+
//
|
|
52
|
+
// Client
|
|
53
|
+
//
|
|
54
|
+
class Metadata {
|
|
55
|
+
constructor(hostname, fetch) {
|
|
56
|
+
this.hostname = void 0;
|
|
57
|
+
this.fetch = void 0;
|
|
58
|
+
this.path = '/rpc/Metadata/';
|
|
59
|
+
|
|
60
|
+
this.ping = headers => {
|
|
61
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
62
|
+
return buildResponse(res).then(_data => {
|
|
63
|
+
return {
|
|
64
|
+
status: _data.status
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
this.version = headers => {
|
|
71
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
72
|
+
return buildResponse(res).then(_data => {
|
|
73
|
+
return {
|
|
74
|
+
version: _data.version
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
this.runtimeStatus = headers => {
|
|
81
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
82
|
+
return buildResponse(res).then(_data => {
|
|
83
|
+
return {
|
|
84
|
+
status: _data.status
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
this.getTokenMetadata = (args, headers) => {
|
|
91
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
92
|
+
return buildResponse(res).then(_data => {
|
|
93
|
+
return {
|
|
94
|
+
tokenMetadata: _data.tokenMetadata
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
101
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
102
|
+
return buildResponse(res).then(_data => {
|
|
103
|
+
return {
|
|
104
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
this.getContractInfo = (args, headers) => {
|
|
111
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
112
|
+
return buildResponse(res).then(_data => {
|
|
113
|
+
return {
|
|
114
|
+
contractInfo: _data.contractInfo
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
121
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
122
|
+
return buildResponse(res).then(_data => {
|
|
123
|
+
return {
|
|
124
|
+
contractInfoMap: _data.contractInfoMap
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
this.searchContractInfo = (args, headers) => {
|
|
131
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
132
|
+
return buildResponse(res).then(_data => {
|
|
133
|
+
return {
|
|
134
|
+
contractInfoList: _data.contractInfoList
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
141
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
142
|
+
return buildResponse(res).then(_data => {
|
|
143
|
+
return {
|
|
144
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
151
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
152
|
+
return buildResponse(res).then(_data => {
|
|
153
|
+
return {
|
|
154
|
+
quantity: _data.quantity
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
161
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
162
|
+
return buildResponse(res).then(_data => {
|
|
163
|
+
return {
|
|
164
|
+
prices: _data.prices
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this.hostname = hostname;
|
|
171
|
+
this.fetch = fetch;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
url(name) {
|
|
175
|
+
return this.hostname + this.path + name;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
181
|
+
return {
|
|
182
|
+
method: 'POST',
|
|
183
|
+
headers: _extends({}, headers, {
|
|
184
|
+
'Content-Type': 'application/json'
|
|
185
|
+
}),
|
|
186
|
+
body: JSON.stringify(body || {})
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const buildResponse = res => {
|
|
191
|
+
return res.text().then(text => {
|
|
192
|
+
let data;
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
data = JSON.parse(text);
|
|
196
|
+
} catch (err) {
|
|
197
|
+
throw {
|
|
198
|
+
code: 'unknown',
|
|
199
|
+
msg: `expecting JSON, got: ${text}`,
|
|
200
|
+
status: res.status
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (!res.ok) {
|
|
205
|
+
throw data; // webrpc error response
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return data;
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
class SequenceMetadataClient extends Metadata {
|
|
213
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
214
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
exports.Metadata = Metadata;
|
|
220
|
+
exports.SequenceMetadataClient = SequenceMetadataClient;
|
|
221
|
+
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
222
|
+
exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
|
|
223
|
+
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,223 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var fetch = require('cross-fetch');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var fetch__default = /*#__PURE__*/_interopDefault(fetch);
|
|
10
|
+
|
|
11
|
+
function _extends() {
|
|
12
|
+
_extends = Object.assign || function (target) {
|
|
13
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
+
var source = arguments[i];
|
|
15
|
+
|
|
16
|
+
for (var key in source) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
18
|
+
target[key] = source[key];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return target;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return _extends.apply(this, arguments);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* eslint-disable */
|
|
30
|
+
// sequence-metadata v0.4.0 eaaa99d70565871556a53333df1c49d28c8be767
|
|
31
|
+
// --
|
|
32
|
+
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
33
|
+
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
34
|
+
// WebRPC description and code-gen version
|
|
35
|
+
const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
36
|
+
|
|
37
|
+
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
38
|
+
|
|
39
|
+
const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767"; //
|
|
40
|
+
// Types
|
|
41
|
+
//
|
|
42
|
+
|
|
43
|
+
exports.SwapType = void 0;
|
|
44
|
+
|
|
45
|
+
(function (SwapType) {
|
|
46
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
47
|
+
SwapType["BUY"] = "BUY";
|
|
48
|
+
SwapType["SELL"] = "SELL";
|
|
49
|
+
})(exports.SwapType || (exports.SwapType = {}));
|
|
50
|
+
|
|
51
|
+
//
|
|
52
|
+
// Client
|
|
53
|
+
//
|
|
54
|
+
class Metadata {
|
|
55
|
+
constructor(hostname, fetch) {
|
|
56
|
+
this.hostname = void 0;
|
|
57
|
+
this.fetch = void 0;
|
|
58
|
+
this.path = '/rpc/Metadata/';
|
|
59
|
+
|
|
60
|
+
this.ping = headers => {
|
|
61
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
62
|
+
return buildResponse(res).then(_data => {
|
|
63
|
+
return {
|
|
64
|
+
status: _data.status
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
this.version = headers => {
|
|
71
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
72
|
+
return buildResponse(res).then(_data => {
|
|
73
|
+
return {
|
|
74
|
+
version: _data.version
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
this.runtimeStatus = headers => {
|
|
81
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
82
|
+
return buildResponse(res).then(_data => {
|
|
83
|
+
return {
|
|
84
|
+
status: _data.status
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
this.getTokenMetadata = (args, headers) => {
|
|
91
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
92
|
+
return buildResponse(res).then(_data => {
|
|
93
|
+
return {
|
|
94
|
+
tokenMetadata: _data.tokenMetadata
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
101
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
102
|
+
return buildResponse(res).then(_data => {
|
|
103
|
+
return {
|
|
104
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
this.getContractInfo = (args, headers) => {
|
|
111
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
112
|
+
return buildResponse(res).then(_data => {
|
|
113
|
+
return {
|
|
114
|
+
contractInfo: _data.contractInfo
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
121
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
122
|
+
return buildResponse(res).then(_data => {
|
|
123
|
+
return {
|
|
124
|
+
contractInfoMap: _data.contractInfoMap
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
this.searchContractInfo = (args, headers) => {
|
|
131
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
132
|
+
return buildResponse(res).then(_data => {
|
|
133
|
+
return {
|
|
134
|
+
contractInfoList: _data.contractInfoList
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
141
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
142
|
+
return buildResponse(res).then(_data => {
|
|
143
|
+
return {
|
|
144
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
151
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
152
|
+
return buildResponse(res).then(_data => {
|
|
153
|
+
return {
|
|
154
|
+
quantity: _data.quantity
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
161
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
162
|
+
return buildResponse(res).then(_data => {
|
|
163
|
+
return {
|
|
164
|
+
prices: _data.prices
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
this.hostname = hostname;
|
|
171
|
+
this.fetch = fetch;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
url(name) {
|
|
175
|
+
return this.hostname + this.path + name;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
181
|
+
return {
|
|
182
|
+
method: 'POST',
|
|
183
|
+
headers: _extends({}, headers, {
|
|
184
|
+
'Content-Type': 'application/json'
|
|
185
|
+
}),
|
|
186
|
+
body: JSON.stringify(body || {})
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const buildResponse = res => {
|
|
191
|
+
return res.text().then(text => {
|
|
192
|
+
let data;
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
data = JSON.parse(text);
|
|
196
|
+
} catch (err) {
|
|
197
|
+
throw {
|
|
198
|
+
code: 'unknown',
|
|
199
|
+
msg: `expecting JSON, got: ${text}`,
|
|
200
|
+
status: res.status
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (!res.ok) {
|
|
205
|
+
throw data; // webrpc error response
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return data;
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
class SequenceMetadataClient extends Metadata {
|
|
213
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
214
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
exports.Metadata = Metadata;
|
|
220
|
+
exports.SequenceMetadataClient = SequenceMetadataClient;
|
|
221
|
+
exports.WebRPCSchemaHash = WebRPCSchemaHash;
|
|
222
|
+
exports.WebRPCSchemaVersion = WebRPCSchemaVersion;
|
|
223
|
+
exports.WebRPCVersion = WebRPCVersion;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import fetch from 'cross-fetch';
|
|
2
|
+
|
|
3
|
+
function _extends() {
|
|
4
|
+
_extends = Object.assign || function (target) {
|
|
5
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6
|
+
var source = arguments[i];
|
|
7
|
+
|
|
8
|
+
for (var key in source) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10
|
+
target[key] = source[key];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return _extends.apply(this, arguments);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* eslint-disable */
|
|
22
|
+
// sequence-metadata v0.4.0 eaaa99d70565871556a53333df1c49d28c8be767
|
|
23
|
+
// --
|
|
24
|
+
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
25
|
+
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
26
|
+
// WebRPC description and code-gen version
|
|
27
|
+
const WebRPCVersion = "v1"; // Schema version of your RIDL schema
|
|
28
|
+
|
|
29
|
+
const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
|
|
30
|
+
|
|
31
|
+
const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767"; //
|
|
32
|
+
// Types
|
|
33
|
+
//
|
|
34
|
+
|
|
35
|
+
let SwapType;
|
|
36
|
+
|
|
37
|
+
(function (SwapType) {
|
|
38
|
+
SwapType["UNKNOWN"] = "UNKNOWN";
|
|
39
|
+
SwapType["BUY"] = "BUY";
|
|
40
|
+
SwapType["SELL"] = "SELL";
|
|
41
|
+
})(SwapType || (SwapType = {}));
|
|
42
|
+
|
|
43
|
+
//
|
|
44
|
+
// Client
|
|
45
|
+
//
|
|
46
|
+
class Metadata {
|
|
47
|
+
constructor(hostname, fetch) {
|
|
48
|
+
this.hostname = void 0;
|
|
49
|
+
this.fetch = void 0;
|
|
50
|
+
this.path = '/rpc/Metadata/';
|
|
51
|
+
|
|
52
|
+
this.ping = headers => {
|
|
53
|
+
return this.fetch(this.url('Ping'), createHTTPRequest({}, headers)).then(res => {
|
|
54
|
+
return buildResponse(res).then(_data => {
|
|
55
|
+
return {
|
|
56
|
+
status: _data.status
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
this.version = headers => {
|
|
63
|
+
return this.fetch(this.url('Version'), createHTTPRequest({}, headers)).then(res => {
|
|
64
|
+
return buildResponse(res).then(_data => {
|
|
65
|
+
return {
|
|
66
|
+
version: _data.version
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
this.runtimeStatus = headers => {
|
|
73
|
+
return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers)).then(res => {
|
|
74
|
+
return buildResponse(res).then(_data => {
|
|
75
|
+
return {
|
|
76
|
+
status: _data.status
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
this.getTokenMetadata = (args, headers) => {
|
|
83
|
+
return this.fetch(this.url('GetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
|
|
84
|
+
return buildResponse(res).then(_data => {
|
|
85
|
+
return {
|
|
86
|
+
tokenMetadata: _data.tokenMetadata
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
this.getTokenMetadataBatch = (args, headers) => {
|
|
93
|
+
return this.fetch(this.url('GetTokenMetadataBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
94
|
+
return buildResponse(res).then(_data => {
|
|
95
|
+
return {
|
|
96
|
+
contractTokenMetadata: _data.contractTokenMetadata
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
this.getContractInfo = (args, headers) => {
|
|
103
|
+
return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
104
|
+
return buildResponse(res).then(_data => {
|
|
105
|
+
return {
|
|
106
|
+
contractInfo: _data.contractInfo
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
this.getContractInfoBatch = (args, headers) => {
|
|
113
|
+
return this.fetch(this.url('GetContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
114
|
+
return buildResponse(res).then(_data => {
|
|
115
|
+
return {
|
|
116
|
+
contractInfoMap: _data.contractInfoMap
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
this.searchContractInfo = (args, headers) => {
|
|
123
|
+
return this.fetch(this.url('SearchContractInfo'), createHTTPRequest(args, headers)).then(res => {
|
|
124
|
+
return buildResponse(res).then(_data => {
|
|
125
|
+
return {
|
|
126
|
+
contractInfoList: _data.contractInfoList
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
this.searchContractInfoBatch = (args, headers) => {
|
|
133
|
+
return this.fetch(this.url('SearchContractInfoBatch'), createHTTPRequest(args, headers)).then(res => {
|
|
134
|
+
return buildResponse(res).then(_data => {
|
|
135
|
+
return {
|
|
136
|
+
contractInfoByChain: _data.contractInfoByChain
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
this.getNiftyswapTokenQuantity = (args, headers) => {
|
|
143
|
+
return this.fetch(this.url('GetNiftyswapTokenQuantity'), createHTTPRequest(args, headers)).then(res => {
|
|
144
|
+
return buildResponse(res).then(_data => {
|
|
145
|
+
return {
|
|
146
|
+
quantity: _data.quantity
|
|
147
|
+
};
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
this.getNiftyswapUnitPrices = (args, headers) => {
|
|
153
|
+
return this.fetch(this.url('GetNiftyswapUnitPrices'), createHTTPRequest(args, headers)).then(res => {
|
|
154
|
+
return buildResponse(res).then(_data => {
|
|
155
|
+
return {
|
|
156
|
+
prices: _data.prices
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
this.hostname = hostname;
|
|
163
|
+
this.fetch = fetch;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
url(name) {
|
|
167
|
+
return this.hostname + this.path + name;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const createHTTPRequest = (body = {}, headers = {}) => {
|
|
173
|
+
return {
|
|
174
|
+
method: 'POST',
|
|
175
|
+
headers: _extends({}, headers, {
|
|
176
|
+
'Content-Type': 'application/json'
|
|
177
|
+
}),
|
|
178
|
+
body: JSON.stringify(body || {})
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const buildResponse = res => {
|
|
183
|
+
return res.text().then(text => {
|
|
184
|
+
let data;
|
|
185
|
+
|
|
186
|
+
try {
|
|
187
|
+
data = JSON.parse(text);
|
|
188
|
+
} catch (err) {
|
|
189
|
+
throw {
|
|
190
|
+
code: 'unknown',
|
|
191
|
+
msg: `expecting JSON, got: ${text}`,
|
|
192
|
+
status: res.status
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (!res.ok) {
|
|
197
|
+
throw data; // webrpc error response
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return data;
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
class SequenceMetadataClient extends Metadata {
|
|
205
|
+
constructor(hostname = 'https://metadata.sequence.app') {
|
|
206
|
+
super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { Metadata, SequenceMetadataClient, SwapType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export declare const WebRPCVersion = "v1";
|
|
2
|
+
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
+
export declare const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767";
|
|
4
|
+
export declare enum SwapType {
|
|
5
|
+
UNKNOWN = "UNKNOWN",
|
|
6
|
+
BUY = "BUY",
|
|
7
|
+
SELL = "SELL"
|
|
8
|
+
}
|
|
9
|
+
export interface Version {
|
|
10
|
+
webrpcVersion: string;
|
|
11
|
+
schemaVersion: string;
|
|
12
|
+
schemaHash: string;
|
|
13
|
+
appVersion: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RuntimeStatus {
|
|
16
|
+
healthOK: boolean;
|
|
17
|
+
startTime: string;
|
|
18
|
+
uptime: number;
|
|
19
|
+
ver: string;
|
|
20
|
+
branch: string;
|
|
21
|
+
commitHash: string;
|
|
22
|
+
checks: RuntimeChecks;
|
|
23
|
+
}
|
|
24
|
+
export interface RuntimeChecks {
|
|
25
|
+
}
|
|
26
|
+
export interface ContractInfo {
|
|
27
|
+
chainId: number;
|
|
28
|
+
address: string;
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
symbol: string;
|
|
32
|
+
decimals?: number;
|
|
33
|
+
logoURI: string;
|
|
34
|
+
extensions: ContractInfoExtensions;
|
|
35
|
+
}
|
|
36
|
+
export interface ContractInfoExtensions {
|
|
37
|
+
link: string;
|
|
38
|
+
description: string;
|
|
39
|
+
ogImage: string;
|
|
40
|
+
originChainId: number;
|
|
41
|
+
originAddress: string;
|
|
42
|
+
blacklist: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface TokenMetadata {
|
|
45
|
+
tokenId: string;
|
|
46
|
+
contractAddress: string;
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
image: string;
|
|
50
|
+
decimals: number;
|
|
51
|
+
properties: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
video: string;
|
|
55
|
+
audio: string;
|
|
56
|
+
image_data: string;
|
|
57
|
+
external_url: string;
|
|
58
|
+
background_color: string;
|
|
59
|
+
animation_url: string;
|
|
60
|
+
attributes: Array<{
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
export interface GetNiftyswapUnitPricesRequest {
|
|
65
|
+
swapType: SwapType;
|
|
66
|
+
ids: Array<string>;
|
|
67
|
+
amounts: Array<string>;
|
|
68
|
+
}
|
|
69
|
+
export interface Metadata {
|
|
70
|
+
ping(headers?: object): Promise<PingReturn>;
|
|
71
|
+
version(headers?: object): Promise<VersionReturn>;
|
|
72
|
+
runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>;
|
|
73
|
+
getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>;
|
|
74
|
+
getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>;
|
|
75
|
+
getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>;
|
|
76
|
+
getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>;
|
|
77
|
+
searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>;
|
|
78
|
+
searchContractInfoBatch(args: SearchContractInfoBatchArgs, headers?: object): Promise<SearchContractInfoBatchReturn>;
|
|
79
|
+
getNiftyswapTokenQuantity(args: GetNiftyswapTokenQuantityArgs, headers?: object): Promise<GetNiftyswapTokenQuantityReturn>;
|
|
80
|
+
getNiftyswapUnitPrices(args: GetNiftyswapUnitPricesArgs, headers?: object): Promise<GetNiftyswapUnitPricesReturn>;
|
|
81
|
+
}
|
|
82
|
+
export interface PingArgs {
|
|
83
|
+
}
|
|
84
|
+
export interface PingReturn {
|
|
85
|
+
status: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface VersionArgs {
|
|
88
|
+
}
|
|
89
|
+
export interface VersionReturn {
|
|
90
|
+
version: Version;
|
|
91
|
+
}
|
|
92
|
+
export interface RuntimeStatusArgs {
|
|
93
|
+
}
|
|
94
|
+
export interface RuntimeStatusReturn {
|
|
95
|
+
status: RuntimeStatus;
|
|
96
|
+
}
|
|
97
|
+
export interface GetTokenMetadataArgs {
|
|
98
|
+
chainID: string;
|
|
99
|
+
contractAddress: string;
|
|
100
|
+
tokenIDs: Array<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface GetTokenMetadataReturn {
|
|
103
|
+
tokenMetadata: Array<TokenMetadata>;
|
|
104
|
+
}
|
|
105
|
+
export interface GetTokenMetadataBatchArgs {
|
|
106
|
+
chainID: string;
|
|
107
|
+
contractTokenMap: {
|
|
108
|
+
[key: string]: Array<string>;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface GetTokenMetadataBatchReturn {
|
|
112
|
+
contractTokenMetadata: {
|
|
113
|
+
[key: string]: Array<TokenMetadata>;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export interface GetContractInfoArgs {
|
|
117
|
+
chainID: string;
|
|
118
|
+
contractAddress: string;
|
|
119
|
+
}
|
|
120
|
+
export interface GetContractInfoReturn {
|
|
121
|
+
contractInfo: ContractInfo;
|
|
122
|
+
}
|
|
123
|
+
export interface GetContractInfoBatchArgs {
|
|
124
|
+
chainID: string;
|
|
125
|
+
contractAddresses: Array<string>;
|
|
126
|
+
}
|
|
127
|
+
export interface GetContractInfoBatchReturn {
|
|
128
|
+
contractInfoMap: {
|
|
129
|
+
[key: string]: ContractInfo;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
export interface SearchContractInfoArgs {
|
|
133
|
+
contractAddress: string;
|
|
134
|
+
}
|
|
135
|
+
export interface SearchContractInfoReturn {
|
|
136
|
+
contractInfoList: Array<ContractInfo>;
|
|
137
|
+
}
|
|
138
|
+
export interface SearchContractInfoBatchArgs {
|
|
139
|
+
contractAddresses: Array<string>;
|
|
140
|
+
}
|
|
141
|
+
export interface SearchContractInfoBatchReturn {
|
|
142
|
+
contractInfoByChain: {
|
|
143
|
+
[key: string]: Array<ContractInfo>;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export interface GetNiftyswapTokenQuantityArgs {
|
|
147
|
+
chainID: string;
|
|
148
|
+
contractAddress: string;
|
|
149
|
+
tokenIDs: Array<string>;
|
|
150
|
+
}
|
|
151
|
+
export interface GetNiftyswapTokenQuantityReturn {
|
|
152
|
+
quantity: {
|
|
153
|
+
[key: string]: string;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface GetNiftyswapUnitPricesArgs {
|
|
157
|
+
chainID: string;
|
|
158
|
+
contractAddress: string;
|
|
159
|
+
req: GetNiftyswapUnitPricesRequest;
|
|
160
|
+
}
|
|
161
|
+
export interface GetNiftyswapUnitPricesReturn {
|
|
162
|
+
prices: {
|
|
163
|
+
[key: string]: string;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export declare class Metadata implements Metadata {
|
|
167
|
+
protected hostname: string;
|
|
168
|
+
protected fetch: Fetch;
|
|
169
|
+
protected path: string;
|
|
170
|
+
constructor(hostname: string, fetch: Fetch);
|
|
171
|
+
private url;
|
|
172
|
+
ping: (headers?: object | undefined) => Promise<PingReturn>;
|
|
173
|
+
version: (headers?: object | undefined) => Promise<VersionReturn>;
|
|
174
|
+
runtimeStatus: (headers?: object | undefined) => Promise<RuntimeStatusReturn>;
|
|
175
|
+
getTokenMetadata: (args: GetTokenMetadataArgs, headers?: object | undefined) => Promise<GetTokenMetadataReturn>;
|
|
176
|
+
getTokenMetadataBatch: (args: GetTokenMetadataBatchArgs, headers?: object | undefined) => Promise<GetTokenMetadataBatchReturn>;
|
|
177
|
+
getContractInfo: (args: GetContractInfoArgs, headers?: object | undefined) => Promise<GetContractInfoReturn>;
|
|
178
|
+
getContractInfoBatch: (args: GetContractInfoBatchArgs, headers?: object | undefined) => Promise<GetContractInfoBatchReturn>;
|
|
179
|
+
searchContractInfo: (args: SearchContractInfoArgs, headers?: object | undefined) => Promise<SearchContractInfoReturn>;
|
|
180
|
+
searchContractInfoBatch: (args: SearchContractInfoBatchArgs, headers?: object | undefined) => Promise<SearchContractInfoBatchReturn>;
|
|
181
|
+
getNiftyswapTokenQuantity: (args: GetNiftyswapTokenQuantityArgs, headers?: object | undefined) => Promise<GetNiftyswapTokenQuantityReturn>;
|
|
182
|
+
getNiftyswapUnitPrices: (args: GetNiftyswapUnitPricesArgs, headers?: object | undefined) => Promise<GetNiftyswapUnitPricesReturn>;
|
|
183
|
+
}
|
|
184
|
+
export interface WebRPCError extends Error {
|
|
185
|
+
code: string;
|
|
186
|
+
msg: string;
|
|
187
|
+
status: number;
|
|
188
|
+
}
|
|
189
|
+
export declare 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-20220425195445",
|
|
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/metadata.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-metadata v0.4.0
|
|
2
|
+
// sequence-metadata v0.4.0 eaaa99d70565871556a53333df1c49d28c8be767
|
|
3
3
|
// --
|
|
4
4
|
// This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
|
|
5
5
|
// Do not edit by hand. Update your webrpc schema and re-generate.
|
|
@@ -11,32 +11,18 @@ export const WebRPCVersion = "v1"
|
|
|
11
11
|
export const WebRPCSchemaVersion = "v0.4.0"
|
|
12
12
|
|
|
13
13
|
// Schema hash generated from your RIDL schema
|
|
14
|
-
export const WebRPCSchemaHash = "
|
|
14
|
+
export const WebRPCSchemaHash = "eaaa99d70565871556a53333df1c49d28c8be767"
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
//
|
|
18
18
|
// Types
|
|
19
19
|
//
|
|
20
|
-
export enum ContractType {
|
|
21
|
-
ERC20 = 'ERC20',
|
|
22
|
-
ContractURI = 'ContractURI',
|
|
23
|
-
OpenSea = 'OpenSea',
|
|
24
|
-
ERC1155 = 'ERC1155',
|
|
25
|
-
ERC721 = 'ERC721',
|
|
26
|
-
UNKNOWN = 'UNKNOWN'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
20
|
export enum SwapType {
|
|
30
21
|
UNKNOWN = 'UNKNOWN',
|
|
31
22
|
BUY = 'BUY',
|
|
32
23
|
SELL = 'SELL'
|
|
33
24
|
}
|
|
34
25
|
|
|
35
|
-
export enum SortOrder {
|
|
36
|
-
DESC = 'DESC',
|
|
37
|
-
ASC = 'ASC'
|
|
38
|
-
}
|
|
39
|
-
|
|
40
26
|
export interface Version {
|
|
41
27
|
webrpcVersion: string
|
|
42
28
|
schemaVersion: string
|
|
@@ -57,13 +43,6 @@ export interface RuntimeStatus {
|
|
|
57
43
|
export interface RuntimeChecks {
|
|
58
44
|
}
|
|
59
45
|
|
|
60
|
-
export interface ContractIndex {
|
|
61
|
-
chainId: string
|
|
62
|
-
address: string
|
|
63
|
-
type: ContractType
|
|
64
|
-
metadata: {[key: string]: any}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
46
|
export interface ContractInfo {
|
|
68
47
|
chainId: number
|
|
69
48
|
address: string
|
|
@@ -84,14 +63,6 @@ export interface ContractInfoExtensions {
|
|
|
84
63
|
blacklist: boolean
|
|
85
64
|
}
|
|
86
65
|
|
|
87
|
-
export interface TokenIndex {
|
|
88
|
-
chainId: string
|
|
89
|
-
contractAddress: string
|
|
90
|
-
tokenId: string
|
|
91
|
-
metadata: {[key: string]: any}
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
66
|
export interface TokenMetadata {
|
|
96
67
|
tokenId: string
|
|
97
68
|
contractAddress: string
|
|
@@ -115,24 +86,12 @@ export interface GetNiftyswapUnitPricesRequest {
|
|
|
115
86
|
amounts: Array<string>
|
|
116
87
|
}
|
|
117
88
|
|
|
118
|
-
export interface Page {
|
|
119
|
-
pageSize?: number
|
|
120
|
-
page?: number
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface SortBy {
|
|
124
|
-
column: string
|
|
125
|
-
order: SortOrder
|
|
126
|
-
}
|
|
127
|
-
|
|
128
89
|
export interface Metadata {
|
|
129
90
|
ping(headers?: object): Promise<PingReturn>
|
|
130
91
|
version(headers?: object): Promise<VersionReturn>
|
|
131
92
|
runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>
|
|
132
93
|
getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>
|
|
133
94
|
getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>
|
|
134
|
-
searchTokenMetadata(args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn>
|
|
135
|
-
searchTokenIDs(args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn>
|
|
136
95
|
getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>
|
|
137
96
|
getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>
|
|
138
97
|
searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>
|
|
@@ -176,28 +135,6 @@ export interface GetTokenMetadataBatchArgs {
|
|
|
176
135
|
export interface GetTokenMetadataBatchReturn {
|
|
177
136
|
contractTokenMetadata: {[key: string]: Array<TokenMetadata>}
|
|
178
137
|
}
|
|
179
|
-
export interface SearchTokenMetadataArgs {
|
|
180
|
-
chainID: string
|
|
181
|
-
contractAddress: string
|
|
182
|
-
filter: string
|
|
183
|
-
page?: Page
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface SearchTokenMetadataReturn {
|
|
187
|
-
page: Page
|
|
188
|
-
tokenMetadata: Array<TokenMetadata>
|
|
189
|
-
}
|
|
190
|
-
export interface SearchTokenIDsArgs {
|
|
191
|
-
chainID: string
|
|
192
|
-
contractAddress: string
|
|
193
|
-
filter: string
|
|
194
|
-
page?: Page
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export interface SearchTokenIDsReturn {
|
|
198
|
-
page: Page
|
|
199
|
-
tokenIds: Array<string>
|
|
200
|
-
}
|
|
201
138
|
export interface GetContractInfoArgs {
|
|
202
139
|
chainID: string
|
|
203
140
|
contractAddress: string
|
|
@@ -329,32 +266,6 @@ export class Metadata implements Metadata {
|
|
|
329
266
|
})
|
|
330
267
|
}
|
|
331
268
|
|
|
332
|
-
searchTokenMetadata = (args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn> => {
|
|
333
|
-
return this.fetch(
|
|
334
|
-
this.url('SearchTokenMetadata'),
|
|
335
|
-
createHTTPRequest(args, headers)).then((res) => {
|
|
336
|
-
return buildResponse(res).then(_data => {
|
|
337
|
-
return {
|
|
338
|
-
page: <Page>(_data.page),
|
|
339
|
-
tokenMetadata: <Array<TokenMetadata>>(_data.tokenMetadata)
|
|
340
|
-
}
|
|
341
|
-
})
|
|
342
|
-
})
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
searchTokenIDs = (args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn> => {
|
|
346
|
-
return this.fetch(
|
|
347
|
-
this.url('SearchTokenIDs'),
|
|
348
|
-
createHTTPRequest(args, headers)).then((res) => {
|
|
349
|
-
return buildResponse(res).then(_data => {
|
|
350
|
-
return {
|
|
351
|
-
page: <Page>(_data.page),
|
|
352
|
-
tokenIds: <Array<string>>(_data.tokenIds)
|
|
353
|
-
}
|
|
354
|
-
})
|
|
355
|
-
})
|
|
356
|
-
}
|
|
357
|
-
|
|
358
269
|
getContractInfo = (args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn> => {
|
|
359
270
|
return this.fetch(
|
|
360
271
|
this.url('GetContractInfo'),
|
|
@@ -459,4 +370,4 @@ const buildResponse = (res: Response): Promise<any> => {
|
|
|
459
370
|
})
|
|
460
371
|
}
|
|
461
372
|
|
|
462
|
-
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
|
373
|
+
export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
|
package/CHANGELOG.md
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
# @0xsequence/metadata
|
|
2
|
-
|
|
3
|
-
## 0.0.0-20220412184039
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- update metadata proto
|
|
8
|
-
|
|
9
|
-
## 0.36.9
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- minor dev xp improvements
|
|
14
|
-
|
|
15
|
-
## 0.36.8
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
- more connect options (theme, payment providers, funding currencies)
|
|
20
|
-
|
|
21
|
-
## 0.36.7
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- fix missing break
|
|
26
|
-
|
|
27
|
-
## 0.36.6
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- wallet_switchEthereumChain support
|
|
32
|
-
|
|
33
|
-
## 0.36.5
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- auth: bump ethauth to 0.7.0
|
|
38
|
-
network, wallet: don't assume position of auth network in list
|
|
39
|
-
api/indexer/metadata: trim trailing slash on hostname, and add endpoint urls
|
|
40
|
-
relayer: Allow to specify local relayer transaction parameters like gas price or gas limit
|
|
41
|
-
|
|
42
|
-
## 0.36.4
|
|
43
|
-
|
|
44
|
-
### Patch Changes
|
|
45
|
-
|
|
46
|
-
- Updating list of chain ids to include other ethereum compatible chains
|
|
47
|
-
|
|
48
|
-
## 0.36.3
|
|
49
|
-
|
|
50
|
-
### Patch Changes
|
|
51
|
-
|
|
52
|
-
- provider: pass connect options to prompter methods
|
|
53
|
-
|
|
54
|
-
## 0.36.2
|
|
55
|
-
|
|
56
|
-
### Patch Changes
|
|
57
|
-
|
|
58
|
-
- transactions: Setting target to 0x0 when empty to during SequenceTxAbiEncode
|
|
59
|
-
|
|
60
|
-
## 0.36.1
|
|
61
|
-
|
|
62
|
-
### Patch Changes
|
|
63
|
-
|
|
64
|
-
- metadata: update client with more fields
|
|
65
|
-
|
|
66
|
-
## 0.36.0
|
|
67
|
-
|
|
68
|
-
### Minor Changes
|
|
69
|
-
|
|
70
|
-
- relayer, wallet: fee quote support
|
|
71
|
-
|
|
72
|
-
## 0.35.12
|
|
73
|
-
|
|
74
|
-
### Patch Changes
|
|
75
|
-
|
|
76
|
-
- provider: rename wallet.commands to wallet.utils
|
|
77
|
-
|
|
78
|
-
## 0.35.11
|
|
79
|
-
|
|
80
|
-
### Patch Changes
|
|
81
|
-
|
|
82
|
-
- provider/utils: smoother message validation
|
|
83
|
-
|
|
84
|
-
## 0.35.10
|
|
85
|
-
|
|
86
|
-
### Patch Changes
|
|
87
|
-
|
|
88
|
-
- upgrade deps
|
|
89
|
-
|
|
90
|
-
## 0.35.9
|
|
91
|
-
|
|
92
|
-
### Patch Changes
|
|
93
|
-
|
|
94
|
-
- provider: window-transport override event handlers with new wallet instance
|
|
95
|
-
|
|
96
|
-
## 0.35.8
|
|
97
|
-
|
|
98
|
-
### Patch Changes
|
|
99
|
-
|
|
100
|
-
- provider: async wallet sign in improvements
|
|
101
|
-
|
|
102
|
-
## 0.35.7
|
|
103
|
-
|
|
104
|
-
### Patch Changes
|
|
105
|
-
|
|
106
|
-
- config: cache wallet configs
|
|
107
|
-
|
|
108
|
-
## 0.35.6
|
|
109
|
-
|
|
110
|
-
### Patch Changes
|
|
111
|
-
|
|
112
|
-
- provider: support async signin of wallet request handler
|
|
113
|
-
|
|
114
|
-
## 0.35.5
|
|
115
|
-
|
|
116
|
-
### Patch Changes
|
|
117
|
-
|
|
118
|
-
- wallet: skip threshold check during fee estimation
|
|
119
|
-
|
|
120
|
-
## 0.35.4
|
|
121
|
-
|
|
122
|
-
### Patch Changes
|
|
123
|
-
|
|
124
|
-
- - browser extension mode, center window
|
|
125
|
-
|
|
126
|
-
## 0.35.3
|
|
127
|
-
|
|
128
|
-
### Patch Changes
|
|
129
|
-
|
|
130
|
-
- - update window position when in browser extension mode
|
|
131
|
-
|
|
132
|
-
## 0.35.2
|
|
133
|
-
|
|
134
|
-
### Patch Changes
|
|
135
|
-
|
|
136
|
-
- - provider: WindowMessageHandler accept optional windowHref
|
|
137
|
-
|
|
138
|
-
## 0.35.1
|
|
139
|
-
|
|
140
|
-
### Patch Changes
|
|
141
|
-
|
|
142
|
-
- wallet: update config on undeployed too
|
|
143
|
-
|
|
144
|
-
## 0.35.0
|
|
145
|
-
|
|
146
|
-
### Minor Changes
|
|
147
|
-
|
|
148
|
-
- - config: add buildStubSignature
|
|
149
|
-
- provider: add checks to signing cases for wallet deployment and config statuses
|
|
150
|
-
- provider: add prompt for wallet deployment
|
|
151
|
-
- relayer: add BaseRelayer.prependWalletDeploy
|
|
152
|
-
- relayer: add Relayer.feeOptions
|
|
153
|
-
- relayer: account for wallet deployment in fee estimation
|
|
154
|
-
- transactions: add fromTransactionish
|
|
155
|
-
- wallet: add Account.prependConfigUpdate
|
|
156
|
-
- wallet: add Account.getFeeOptions
|
|
157
|
-
|
|
158
|
-
## 0.34.0
|
|
159
|
-
|
|
160
|
-
### Minor Changes
|
|
161
|
-
|
|
162
|
-
- - upgrade deps
|
|
163
|
-
|
|
164
|
-
## 0.31.3
|
|
165
|
-
|
|
166
|
-
### Patch Changes
|
|
167
|
-
|
|
168
|
-
- update metadata bindings
|
|
169
|
-
|
|
170
|
-
## 0.31.0
|
|
171
|
-
|
|
172
|
-
### Minor Changes
|
|
173
|
-
|
|
174
|
-
- - upgrading to ethers v5.5
|
|
175
|
-
|
|
176
|
-
## 0.30.0
|
|
177
|
-
|
|
178
|
-
### Minor Changes
|
|
179
|
-
|
|
180
|
-
- - upgrade most deps
|
|
181
|
-
|
|
182
|
-
## 0.29.8
|
|
183
|
-
|
|
184
|
-
### Patch Changes
|
|
185
|
-
|
|
186
|
-
- update api
|
|
187
|
-
|
|
188
|
-
## 0.29.1
|
|
189
|
-
|
|
190
|
-
### Patch Changes
|
|
191
|
-
|
|
192
|
-
- metadata: ContractInfo.decimals is now optional, i.e. may be undefined
|
|
193
|
-
|
|
194
|
-
api: new APIs for user storage and isUsingGoogleMail
|
|
195
|
-
|
|
196
|
-
## 0.29.0
|
|
197
|
-
|
|
198
|
-
### Minor Changes
|
|
199
|
-
|
|
200
|
-
- major architectural changes in Sequence design
|
|
201
|
-
|
|
202
|
-
- only one API instance, API is no longer a per-chain service
|
|
203
|
-
- separate per-chain indexer service, API no longer handles indexing
|
|
204
|
-
- single contract metadata service, API no longer serves metadata
|
|
205
|
-
|
|
206
|
-
chaind package has been removed, indexer and metadata packages have been added
|
|
207
|
-
|
|
208
|
-
stronger typing with new explicit ChainId type
|
|
209
|
-
|
|
210
|
-
multicall fixes and improvements
|
|
211
|
-
|
|
212
|
-
forbid "wait" transactions in sendTransactionBatch calls
|