@hirosystems/token-metadata-api-client 1.3.0 → 2.0.0
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/README.md +10 -5
- package/lib/generated/schema.d.ts +692 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +23 -0
- package/lib/index.js.map +1 -0
- package/lib/index.umd.js +613 -0
- package/lib/index.umd.js.map +1 -0
- package/package.json +15 -34
- package/api.ts +0 -1079
- package/configuration.ts +0 -65
- package/custom.d.ts +0 -2
- package/dist/api.d.ts +0 -821
- package/dist/api.js +0 -600
- package/dist/configuration.d.ts +0 -55
- package/dist/configuration.js +0 -27
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -26
- package/index.ts +0 -15
package/dist/api.js
DELETED
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/// <reference path="./custom.d.ts" />
|
|
3
|
-
// tslint:disable
|
|
4
|
-
/**
|
|
5
|
-
* Token Metadata API
|
|
6
|
-
* Welcome to the API reference overview for the [Token Metadata API](https://docs.hiro.so/token-metadata-api). Service that indexes metadata for every SIP-009, SIP-010, and SIP-013 Token in the Stacks blockchain and exposes it via REST API endpoints.
|
|
7
|
-
*
|
|
8
|
-
* OpenAPI spec version: v0.4.0
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This file is auto generated by the swagger code generator program.
|
|
12
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
|
13
|
-
* Do not edit the file manually.
|
|
14
|
-
*/
|
|
15
|
-
var __extends = (this && this.__extends) || (function () {
|
|
16
|
-
var extendStatics = function (d, b) {
|
|
17
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
20
|
-
return extendStatics(d, b);
|
|
21
|
-
};
|
|
22
|
-
return function (d, b) {
|
|
23
|
-
extendStatics(d, b);
|
|
24
|
-
function __() { this.constructor = d; }
|
|
25
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
26
|
-
};
|
|
27
|
-
})();
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.TokensApi = exports.TokensApiFactory = exports.TokensApiFp = exports.TokensApiFetchParamCreator = exports.StatusApi = exports.StatusApiFactory = exports.StatusApiFp = exports.StatusApiFetchParamCreator = exports.OrderBy = exports.Order = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = void 0;
|
|
30
|
-
var url = require("url");
|
|
31
|
-
var isomorphicFetch = require("isomorphic-fetch");
|
|
32
|
-
var BASE_PATH = "https://api.hiro.so/".replace(/\/+$/, "");
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @export
|
|
36
|
-
*/
|
|
37
|
-
exports.COLLECTION_FORMATS = {
|
|
38
|
-
csv: ",",
|
|
39
|
-
ssv: " ",
|
|
40
|
-
tsv: "\t",
|
|
41
|
-
pipes: "|",
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @export
|
|
46
|
-
* @class BaseAPI
|
|
47
|
-
*/
|
|
48
|
-
var BaseAPI = /** @class */ (function () {
|
|
49
|
-
function BaseAPI(configuration, basePath, fetch) {
|
|
50
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
51
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
52
|
-
this.basePath = basePath;
|
|
53
|
-
this.fetch = fetch;
|
|
54
|
-
if (configuration) {
|
|
55
|
-
this.configuration = configuration;
|
|
56
|
-
this.basePath = configuration.basePath || this.basePath;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return BaseAPI;
|
|
60
|
-
}());
|
|
61
|
-
exports.BaseAPI = BaseAPI;
|
|
62
|
-
;
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @export
|
|
66
|
-
* @class RequiredError
|
|
67
|
-
* @extends {Error}
|
|
68
|
-
*/
|
|
69
|
-
var RequiredError = /** @class */ (function (_super) {
|
|
70
|
-
__extends(RequiredError, _super);
|
|
71
|
-
function RequiredError(field, msg) {
|
|
72
|
-
var _this = _super.call(this, msg) || this;
|
|
73
|
-
_this.field = field;
|
|
74
|
-
_this.name = "RequiredError";
|
|
75
|
-
return _this;
|
|
76
|
-
}
|
|
77
|
-
return RequiredError;
|
|
78
|
-
}(Error));
|
|
79
|
-
exports.RequiredError = RequiredError;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @export
|
|
83
|
-
* @interface Order
|
|
84
|
-
*/
|
|
85
|
-
var Order;
|
|
86
|
-
(function (Order) {
|
|
87
|
-
Order["asc"] = "asc";
|
|
88
|
-
Order["desc"] = "desc";
|
|
89
|
-
})(Order = exports.Order || (exports.Order = {}));
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @export
|
|
93
|
-
* @interface OrderBy
|
|
94
|
-
*/
|
|
95
|
-
var OrderBy;
|
|
96
|
-
(function (OrderBy) {
|
|
97
|
-
OrderBy["name"] = "name";
|
|
98
|
-
OrderBy["symbol"] = "symbol";
|
|
99
|
-
})(OrderBy = exports.OrderBy || (exports.OrderBy = {}));
|
|
100
|
-
/**
|
|
101
|
-
* StatusApi - fetch parameter creator
|
|
102
|
-
* @export
|
|
103
|
-
*/
|
|
104
|
-
exports.StatusApiFetchParamCreator = function (configuration) {
|
|
105
|
-
return {
|
|
106
|
-
/**
|
|
107
|
-
* Displays the status of the API and its current workload
|
|
108
|
-
* @summary API Status
|
|
109
|
-
* @param {*} [options] Override http request option.
|
|
110
|
-
* @throws {RequiredError}
|
|
111
|
-
*/
|
|
112
|
-
getApiStatus: function (options) {
|
|
113
|
-
if (options === void 0) { options = {}; }
|
|
114
|
-
var localVarPath = "/metadata/v1/";
|
|
115
|
-
var localVarUrlObj = url.parse(localVarPath, true);
|
|
116
|
-
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
117
|
-
var localVarHeaderParameter = {};
|
|
118
|
-
var localVarQueryParameter = {};
|
|
119
|
-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
120
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
121
|
-
delete localVarUrlObj.search;
|
|
122
|
-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
123
|
-
return {
|
|
124
|
-
url: url.format(localVarUrlObj),
|
|
125
|
-
options: localVarRequestOptions,
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* StatusApi - functional programming interface
|
|
132
|
-
* @export
|
|
133
|
-
*/
|
|
134
|
-
exports.StatusApiFp = function (configuration) {
|
|
135
|
-
return {
|
|
136
|
-
/**
|
|
137
|
-
* Displays the status of the API and its current workload
|
|
138
|
-
* @summary API Status
|
|
139
|
-
* @param {*} [options] Override http request option.
|
|
140
|
-
* @throws {RequiredError}
|
|
141
|
-
*/
|
|
142
|
-
getApiStatus: function (options) {
|
|
143
|
-
var localVarFetchArgs = exports.StatusApiFetchParamCreator(configuration).getApiStatus(options);
|
|
144
|
-
return function (fetch, basePath) {
|
|
145
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
146
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
147
|
-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
|
|
148
|
-
if (response.status >= 200 && response.status < 300) {
|
|
149
|
-
return response.json();
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
throw response;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* StatusApi - factory interface
|
|
161
|
-
* @export
|
|
162
|
-
*/
|
|
163
|
-
exports.StatusApiFactory = function (configuration, fetch, basePath) {
|
|
164
|
-
return {
|
|
165
|
-
/**
|
|
166
|
-
* Displays the status of the API and its current workload
|
|
167
|
-
* @summary API Status
|
|
168
|
-
* @param {*} [options] Override http request option.
|
|
169
|
-
* @throws {RequiredError}
|
|
170
|
-
*/
|
|
171
|
-
getApiStatus: function (options) {
|
|
172
|
-
return exports.StatusApiFp(configuration).getApiStatus(options)(fetch, basePath);
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
/**
|
|
177
|
-
* StatusApi - object-oriented interface
|
|
178
|
-
* @export
|
|
179
|
-
* @class StatusApi
|
|
180
|
-
* @extends {BaseAPI}
|
|
181
|
-
*/
|
|
182
|
-
var StatusApi = /** @class */ (function (_super) {
|
|
183
|
-
__extends(StatusApi, _super);
|
|
184
|
-
function StatusApi() {
|
|
185
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Displays the status of the API and its current workload
|
|
189
|
-
* @summary API Status
|
|
190
|
-
* @param {*} [options] Override http request option.
|
|
191
|
-
* @throws {RequiredError}
|
|
192
|
-
* @memberof StatusApi
|
|
193
|
-
*/
|
|
194
|
-
StatusApi.prototype.getApiStatus = function (options) {
|
|
195
|
-
return exports.StatusApiFp(this.configuration).getApiStatus(options)(this.fetch, this.basePath);
|
|
196
|
-
};
|
|
197
|
-
return StatusApi;
|
|
198
|
-
}(BaseAPI));
|
|
199
|
-
exports.StatusApi = StatusApi;
|
|
200
|
-
/**
|
|
201
|
-
* TokensApi - fetch parameter creator
|
|
202
|
-
* @export
|
|
203
|
-
*/
|
|
204
|
-
exports.TokensApiFetchParamCreator = function (configuration) {
|
|
205
|
-
return {
|
|
206
|
-
/**
|
|
207
|
-
* Retrieves metadata for a SIP-010 Fungible Token
|
|
208
|
-
* @summary Fungible Token Metadata
|
|
209
|
-
* @param {string} principal Principal for the contract which owns the SIP-010 token
|
|
210
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
211
|
-
* @param {*} [options] Override http request option.
|
|
212
|
-
* @throws {RequiredError}
|
|
213
|
-
*/
|
|
214
|
-
getFtMetadata: function (principal, locale, options) {
|
|
215
|
-
if (options === void 0) { options = {}; }
|
|
216
|
-
// verify required parameter 'principal' is not null or undefined
|
|
217
|
-
if (principal === null || principal === undefined) {
|
|
218
|
-
throw new RequiredError('principal', 'Required parameter principal was null or undefined when calling getFtMetadata.');
|
|
219
|
-
}
|
|
220
|
-
var localVarPath = "/metadata/v1/ft/{principal}"
|
|
221
|
-
.replace("{" + "principal" + "}", encodeURIComponent(String(principal)));
|
|
222
|
-
var localVarUrlObj = url.parse(localVarPath, true);
|
|
223
|
-
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
224
|
-
var localVarHeaderParameter = {};
|
|
225
|
-
var localVarQueryParameter = {};
|
|
226
|
-
if (locale !== undefined) {
|
|
227
|
-
localVarQueryParameter['locale'] = locale;
|
|
228
|
-
}
|
|
229
|
-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
230
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
231
|
-
delete localVarUrlObj.search;
|
|
232
|
-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
233
|
-
return {
|
|
234
|
-
url: url.format(localVarUrlObj),
|
|
235
|
-
options: localVarRequestOptions,
|
|
236
|
-
};
|
|
237
|
-
},
|
|
238
|
-
/**
|
|
239
|
-
* Retrieves a list of Fungible Tokens
|
|
240
|
-
* @summary Fungible Tokens
|
|
241
|
-
* @param {string} [name]
|
|
242
|
-
* @param {string} [symbol]
|
|
243
|
-
* @param {string} [address] Stacks Address
|
|
244
|
-
* @param {number} [offset] Result offset
|
|
245
|
-
* @param {number} [limit] Results per page
|
|
246
|
-
* @param {OrderBy} [order_by] Parameter to order results by
|
|
247
|
-
* @param {Order} [order] Results order
|
|
248
|
-
* @param {*} [options] Override http request option.
|
|
249
|
-
* @throws {RequiredError}
|
|
250
|
-
*/
|
|
251
|
-
getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
|
|
252
|
-
if (options === void 0) { options = {}; }
|
|
253
|
-
var localVarPath = "/metadata/v1/ft";
|
|
254
|
-
var localVarUrlObj = url.parse(localVarPath, true);
|
|
255
|
-
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
256
|
-
var localVarHeaderParameter = {};
|
|
257
|
-
var localVarQueryParameter = {};
|
|
258
|
-
if (name !== undefined) {
|
|
259
|
-
localVarQueryParameter['name'] = name;
|
|
260
|
-
}
|
|
261
|
-
if (symbol !== undefined) {
|
|
262
|
-
localVarQueryParameter['symbol'] = symbol;
|
|
263
|
-
}
|
|
264
|
-
if (address !== undefined) {
|
|
265
|
-
localVarQueryParameter['address'] = address;
|
|
266
|
-
}
|
|
267
|
-
if (offset !== undefined) {
|
|
268
|
-
localVarQueryParameter['offset'] = offset;
|
|
269
|
-
}
|
|
270
|
-
if (limit !== undefined) {
|
|
271
|
-
localVarQueryParameter['limit'] = limit;
|
|
272
|
-
}
|
|
273
|
-
if (order_by !== undefined) {
|
|
274
|
-
localVarQueryParameter['order_by'] = order_by;
|
|
275
|
-
}
|
|
276
|
-
if (order !== undefined) {
|
|
277
|
-
localVarQueryParameter['order'] = order;
|
|
278
|
-
}
|
|
279
|
-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
280
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
281
|
-
delete localVarUrlObj.search;
|
|
282
|
-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
283
|
-
return {
|
|
284
|
-
url: url.format(localVarUrlObj),
|
|
285
|
-
options: localVarRequestOptions,
|
|
286
|
-
};
|
|
287
|
-
},
|
|
288
|
-
/**
|
|
289
|
-
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
290
|
-
* @summary Non-Fungible Token Metadata
|
|
291
|
-
* @param {string} principal SIP-009 compliant smart contract principal
|
|
292
|
-
* @param {number} token_id Token ID to retrieve
|
|
293
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
294
|
-
* @param {*} [options] Override http request option.
|
|
295
|
-
* @throws {RequiredError}
|
|
296
|
-
*/
|
|
297
|
-
getNftMetadata: function (principal, token_id, locale, options) {
|
|
298
|
-
if (options === void 0) { options = {}; }
|
|
299
|
-
// verify required parameter 'principal' is not null or undefined
|
|
300
|
-
if (principal === null || principal === undefined) {
|
|
301
|
-
throw new RequiredError('principal', 'Required parameter principal was null or undefined when calling getNftMetadata.');
|
|
302
|
-
}
|
|
303
|
-
// verify required parameter 'token_id' is not null or undefined
|
|
304
|
-
if (token_id === null || token_id === undefined) {
|
|
305
|
-
throw new RequiredError('token_id', 'Required parameter token_id was null or undefined when calling getNftMetadata.');
|
|
306
|
-
}
|
|
307
|
-
var localVarPath = "/metadata/v1/nft/{principal}/{token_id}"
|
|
308
|
-
.replace("{" + "principal" + "}", encodeURIComponent(String(principal)))
|
|
309
|
-
.replace("{" + "token_id" + "}", encodeURIComponent(String(token_id)));
|
|
310
|
-
var localVarUrlObj = url.parse(localVarPath, true);
|
|
311
|
-
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
312
|
-
var localVarHeaderParameter = {};
|
|
313
|
-
var localVarQueryParameter = {};
|
|
314
|
-
if (locale !== undefined) {
|
|
315
|
-
localVarQueryParameter['locale'] = locale;
|
|
316
|
-
}
|
|
317
|
-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
318
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
319
|
-
delete localVarUrlObj.search;
|
|
320
|
-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
321
|
-
return {
|
|
322
|
-
url: url.format(localVarUrlObj),
|
|
323
|
-
options: localVarRequestOptions,
|
|
324
|
-
};
|
|
325
|
-
},
|
|
326
|
-
/**
|
|
327
|
-
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
328
|
-
* @summary Semi-Fungible Token Metadata
|
|
329
|
-
* @param {string} principal SIP-013 compliant smart contract principal
|
|
330
|
-
* @param {number} token_id Token ID to retrieve
|
|
331
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
332
|
-
* @param {*} [options] Override http request option.
|
|
333
|
-
* @throws {RequiredError}
|
|
334
|
-
*/
|
|
335
|
-
getSftMetadata: function (principal, token_id, locale, options) {
|
|
336
|
-
if (options === void 0) { options = {}; }
|
|
337
|
-
// verify required parameter 'principal' is not null or undefined
|
|
338
|
-
if (principal === null || principal === undefined) {
|
|
339
|
-
throw new RequiredError('principal', 'Required parameter principal was null or undefined when calling getSftMetadata.');
|
|
340
|
-
}
|
|
341
|
-
// verify required parameter 'token_id' is not null or undefined
|
|
342
|
-
if (token_id === null || token_id === undefined) {
|
|
343
|
-
throw new RequiredError('token_id', 'Required parameter token_id was null or undefined when calling getSftMetadata.');
|
|
344
|
-
}
|
|
345
|
-
var localVarPath = "/metadata/v1/sft/{principal}/{token_id}"
|
|
346
|
-
.replace("{" + "principal" + "}", encodeURIComponent(String(principal)))
|
|
347
|
-
.replace("{" + "token_id" + "}", encodeURIComponent(String(token_id)));
|
|
348
|
-
var localVarUrlObj = url.parse(localVarPath, true);
|
|
349
|
-
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
350
|
-
var localVarHeaderParameter = {};
|
|
351
|
-
var localVarQueryParameter = {};
|
|
352
|
-
if (locale !== undefined) {
|
|
353
|
-
localVarQueryParameter['locale'] = locale;
|
|
354
|
-
}
|
|
355
|
-
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
356
|
-
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
357
|
-
delete localVarUrlObj.search;
|
|
358
|
-
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
359
|
-
return {
|
|
360
|
-
url: url.format(localVarUrlObj),
|
|
361
|
-
options: localVarRequestOptions,
|
|
362
|
-
};
|
|
363
|
-
},
|
|
364
|
-
};
|
|
365
|
-
};
|
|
366
|
-
/**
|
|
367
|
-
* TokensApi - functional programming interface
|
|
368
|
-
* @export
|
|
369
|
-
*/
|
|
370
|
-
exports.TokensApiFp = function (configuration) {
|
|
371
|
-
return {
|
|
372
|
-
/**
|
|
373
|
-
* Retrieves metadata for a SIP-010 Fungible Token
|
|
374
|
-
* @summary Fungible Token Metadata
|
|
375
|
-
* @param {string} principal Principal for the contract which owns the SIP-010 token
|
|
376
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
377
|
-
* @param {*} [options] Override http request option.
|
|
378
|
-
* @throws {RequiredError}
|
|
379
|
-
*/
|
|
380
|
-
getFtMetadata: function (principal, locale, options) {
|
|
381
|
-
var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getFtMetadata(principal, locale, options);
|
|
382
|
-
return function (fetch, basePath) {
|
|
383
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
384
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
385
|
-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
|
|
386
|
-
if (response.status >= 200 && response.status < 300) {
|
|
387
|
-
return response.json();
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
throw response;
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
};
|
|
394
|
-
},
|
|
395
|
-
/**
|
|
396
|
-
* Retrieves a list of Fungible Tokens
|
|
397
|
-
* @summary Fungible Tokens
|
|
398
|
-
* @param {string} [name]
|
|
399
|
-
* @param {string} [symbol]
|
|
400
|
-
* @param {string} [address] Stacks Address
|
|
401
|
-
* @param {number} [offset] Result offset
|
|
402
|
-
* @param {number} [limit] Results per page
|
|
403
|
-
* @param {OrderBy} [order_by] Parameter to order results by
|
|
404
|
-
* @param {Order} [order] Results order
|
|
405
|
-
* @param {*} [options] Override http request option.
|
|
406
|
-
* @throws {RequiredError}
|
|
407
|
-
*/
|
|
408
|
-
getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
|
|
409
|
-
var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options);
|
|
410
|
-
return function (fetch, basePath) {
|
|
411
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
412
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
413
|
-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
|
|
414
|
-
if (response.status >= 200 && response.status < 300) {
|
|
415
|
-
return response.json();
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
throw response;
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
},
|
|
423
|
-
/**
|
|
424
|
-
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
425
|
-
* @summary Non-Fungible Token Metadata
|
|
426
|
-
* @param {string} principal SIP-009 compliant smart contract principal
|
|
427
|
-
* @param {number} token_id Token ID to retrieve
|
|
428
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
429
|
-
* @param {*} [options] Override http request option.
|
|
430
|
-
* @throws {RequiredError}
|
|
431
|
-
*/
|
|
432
|
-
getNftMetadata: function (principal, token_id, locale, options) {
|
|
433
|
-
var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getNftMetadata(principal, token_id, locale, options);
|
|
434
|
-
return function (fetch, basePath) {
|
|
435
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
436
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
437
|
-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
|
|
438
|
-
if (response.status >= 200 && response.status < 300) {
|
|
439
|
-
return response.json();
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
throw response;
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
};
|
|
446
|
-
},
|
|
447
|
-
/**
|
|
448
|
-
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
449
|
-
* @summary Semi-Fungible Token Metadata
|
|
450
|
-
* @param {string} principal SIP-013 compliant smart contract principal
|
|
451
|
-
* @param {number} token_id Token ID to retrieve
|
|
452
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
453
|
-
* @param {*} [options] Override http request option.
|
|
454
|
-
* @throws {RequiredError}
|
|
455
|
-
*/
|
|
456
|
-
getSftMetadata: function (principal, token_id, locale, options) {
|
|
457
|
-
var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getSftMetadata(principal, token_id, locale, options);
|
|
458
|
-
return function (fetch, basePath) {
|
|
459
|
-
if (fetch === void 0) { fetch = isomorphicFetch; }
|
|
460
|
-
if (basePath === void 0) { basePath = BASE_PATH; }
|
|
461
|
-
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
|
|
462
|
-
if (response.status >= 200 && response.status < 300) {
|
|
463
|
-
return response.json();
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
throw response;
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
};
|
|
470
|
-
},
|
|
471
|
-
};
|
|
472
|
-
};
|
|
473
|
-
/**
|
|
474
|
-
* TokensApi - factory interface
|
|
475
|
-
* @export
|
|
476
|
-
*/
|
|
477
|
-
exports.TokensApiFactory = function (configuration, fetch, basePath) {
|
|
478
|
-
return {
|
|
479
|
-
/**
|
|
480
|
-
* Retrieves metadata for a SIP-010 Fungible Token
|
|
481
|
-
* @summary Fungible Token Metadata
|
|
482
|
-
* @param {string} principal Principal for the contract which owns the SIP-010 token
|
|
483
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
484
|
-
* @param {*} [options] Override http request option.
|
|
485
|
-
* @throws {RequiredError}
|
|
486
|
-
*/
|
|
487
|
-
getFtMetadata: function (principal, locale, options) {
|
|
488
|
-
return exports.TokensApiFp(configuration).getFtMetadata(principal, locale, options)(fetch, basePath);
|
|
489
|
-
},
|
|
490
|
-
/**
|
|
491
|
-
* Retrieves a list of Fungible Tokens
|
|
492
|
-
* @summary Fungible Tokens
|
|
493
|
-
* @param {string} [name]
|
|
494
|
-
* @param {string} [symbol]
|
|
495
|
-
* @param {string} [address] Stacks Address
|
|
496
|
-
* @param {number} [offset] Result offset
|
|
497
|
-
* @param {number} [limit] Results per page
|
|
498
|
-
* @param {OrderBy} [order_by] Parameter to order results by
|
|
499
|
-
* @param {Order} [order] Results order
|
|
500
|
-
* @param {*} [options] Override http request option.
|
|
501
|
-
* @throws {RequiredError}
|
|
502
|
-
*/
|
|
503
|
-
getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
|
|
504
|
-
return exports.TokensApiFp(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(fetch, basePath);
|
|
505
|
-
},
|
|
506
|
-
/**
|
|
507
|
-
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
508
|
-
* @summary Non-Fungible Token Metadata
|
|
509
|
-
* @param {string} principal SIP-009 compliant smart contract principal
|
|
510
|
-
* @param {number} token_id Token ID to retrieve
|
|
511
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
512
|
-
* @param {*} [options] Override http request option.
|
|
513
|
-
* @throws {RequiredError}
|
|
514
|
-
*/
|
|
515
|
-
getNftMetadata: function (principal, token_id, locale, options) {
|
|
516
|
-
return exports.TokensApiFp(configuration).getNftMetadata(principal, token_id, locale, options)(fetch, basePath);
|
|
517
|
-
},
|
|
518
|
-
/**
|
|
519
|
-
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
520
|
-
* @summary Semi-Fungible Token Metadata
|
|
521
|
-
* @param {string} principal SIP-013 compliant smart contract principal
|
|
522
|
-
* @param {number} token_id Token ID to retrieve
|
|
523
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
524
|
-
* @param {*} [options] Override http request option.
|
|
525
|
-
* @throws {RequiredError}
|
|
526
|
-
*/
|
|
527
|
-
getSftMetadata: function (principal, token_id, locale, options) {
|
|
528
|
-
return exports.TokensApiFp(configuration).getSftMetadata(principal, token_id, locale, options)(fetch, basePath);
|
|
529
|
-
},
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
/**
|
|
533
|
-
* TokensApi - object-oriented interface
|
|
534
|
-
* @export
|
|
535
|
-
* @class TokensApi
|
|
536
|
-
* @extends {BaseAPI}
|
|
537
|
-
*/
|
|
538
|
-
var TokensApi = /** @class */ (function (_super) {
|
|
539
|
-
__extends(TokensApi, _super);
|
|
540
|
-
function TokensApi() {
|
|
541
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Retrieves metadata for a SIP-010 Fungible Token
|
|
545
|
-
* @summary Fungible Token Metadata
|
|
546
|
-
* @param {string} principal Principal for the contract which owns the SIP-010 token
|
|
547
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
548
|
-
* @param {*} [options] Override http request option.
|
|
549
|
-
* @throws {RequiredError}
|
|
550
|
-
* @memberof TokensApi
|
|
551
|
-
*/
|
|
552
|
-
TokensApi.prototype.getFtMetadata = function (principal, locale, options) {
|
|
553
|
-
return exports.TokensApiFp(this.configuration).getFtMetadata(principal, locale, options)(this.fetch, this.basePath);
|
|
554
|
-
};
|
|
555
|
-
/**
|
|
556
|
-
* Retrieves a list of Fungible Tokens
|
|
557
|
-
* @summary Fungible Tokens
|
|
558
|
-
* @param {string} [name]
|
|
559
|
-
* @param {string} [symbol]
|
|
560
|
-
* @param {string} [address] Stacks Address
|
|
561
|
-
* @param {number} [offset] Result offset
|
|
562
|
-
* @param {number} [limit] Results per page
|
|
563
|
-
* @param {OrderBy} [order_by] Parameter to order results by
|
|
564
|
-
* @param {Order} [order] Results order
|
|
565
|
-
* @param {*} [options] Override http request option.
|
|
566
|
-
* @throws {RequiredError}
|
|
567
|
-
* @memberof TokensApi
|
|
568
|
-
*/
|
|
569
|
-
TokensApi.prototype.getFungibleTokens = function (name, symbol, address, offset, limit, order_by, order, options) {
|
|
570
|
-
return exports.TokensApiFp(this.configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(this.fetch, this.basePath);
|
|
571
|
-
};
|
|
572
|
-
/**
|
|
573
|
-
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
574
|
-
* @summary Non-Fungible Token Metadata
|
|
575
|
-
* @param {string} principal SIP-009 compliant smart contract principal
|
|
576
|
-
* @param {number} token_id Token ID to retrieve
|
|
577
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
578
|
-
* @param {*} [options] Override http request option.
|
|
579
|
-
* @throws {RequiredError}
|
|
580
|
-
* @memberof TokensApi
|
|
581
|
-
*/
|
|
582
|
-
TokensApi.prototype.getNftMetadata = function (principal, token_id, locale, options) {
|
|
583
|
-
return exports.TokensApiFp(this.configuration).getNftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
|
|
584
|
-
};
|
|
585
|
-
/**
|
|
586
|
-
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
587
|
-
* @summary Semi-Fungible Token Metadata
|
|
588
|
-
* @param {string} principal SIP-013 compliant smart contract principal
|
|
589
|
-
* @param {number} token_id Token ID to retrieve
|
|
590
|
-
* @param {string} [locale] Metadata localization to retrieve
|
|
591
|
-
* @param {*} [options] Override http request option.
|
|
592
|
-
* @throws {RequiredError}
|
|
593
|
-
* @memberof TokensApi
|
|
594
|
-
*/
|
|
595
|
-
TokensApi.prototype.getSftMetadata = function (principal, token_id, locale, options) {
|
|
596
|
-
return exports.TokensApiFp(this.configuration).getSftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
|
|
597
|
-
};
|
|
598
|
-
return TokensApi;
|
|
599
|
-
}(BaseAPI));
|
|
600
|
-
exports.TokensApi = TokensApi;
|
package/dist/configuration.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Token Metadata API
|
|
3
|
-
* Welcome to the API reference overview for the [Token Metadata API](https://docs.hiro.so/token-metadata-api). Service that indexes metadata for every SIP-009, SIP-010, and SIP-013 Token in the Stacks blockchain and exposes it via REST API endpoints.
|
|
4
|
-
*
|
|
5
|
-
* OpenAPI spec version: v0.4.0
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This file is auto generated by the swagger code generator program.
|
|
9
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
|
-
* Do not edit the file manually.
|
|
11
|
-
*/
|
|
12
|
-
export interface ConfigurationParameters {
|
|
13
|
-
apiKey?: string | ((name: string) => string);
|
|
14
|
-
username?: string;
|
|
15
|
-
password?: string;
|
|
16
|
-
accessToken?: string | ((name: string, scopes?: string[]) => string);
|
|
17
|
-
basePath?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare class Configuration {
|
|
20
|
-
/**
|
|
21
|
-
* parameter for apiKey security
|
|
22
|
-
* @param name security name
|
|
23
|
-
* @memberof Configuration
|
|
24
|
-
*/
|
|
25
|
-
apiKey?: string | ((name: string) => string);
|
|
26
|
-
/**
|
|
27
|
-
* parameter for basic security
|
|
28
|
-
*
|
|
29
|
-
* @type {string}
|
|
30
|
-
* @memberof Configuration
|
|
31
|
-
*/
|
|
32
|
-
username?: string;
|
|
33
|
-
/**
|
|
34
|
-
* parameter for basic security
|
|
35
|
-
*
|
|
36
|
-
* @type {string}
|
|
37
|
-
* @memberof Configuration
|
|
38
|
-
*/
|
|
39
|
-
password?: string;
|
|
40
|
-
/**
|
|
41
|
-
* parameter for oauth2 security
|
|
42
|
-
* @param name security name
|
|
43
|
-
* @param scopes oauth2 scope
|
|
44
|
-
* @memberof Configuration
|
|
45
|
-
*/
|
|
46
|
-
accessToken?: string | ((name: string, scopes?: string[]) => string);
|
|
47
|
-
/**
|
|
48
|
-
* override base path
|
|
49
|
-
*
|
|
50
|
-
* @type {string}
|
|
51
|
-
* @memberof Configuration
|
|
52
|
-
*/
|
|
53
|
-
basePath?: string;
|
|
54
|
-
constructor(param?: ConfigurationParameters);
|
|
55
|
-
}
|
package/dist/configuration.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// tslint:disable
|
|
3
|
-
/**
|
|
4
|
-
* Token Metadata API
|
|
5
|
-
* Welcome to the API reference overview for the [Token Metadata API](https://docs.hiro.so/token-metadata-api). Service that indexes metadata for every SIP-009, SIP-010, and SIP-013 Token in the Stacks blockchain and exposes it via REST API endpoints.
|
|
6
|
-
*
|
|
7
|
-
* OpenAPI spec version: v0.4.0
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* NOTE: This file is auto generated by the swagger code generator program.
|
|
11
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
|
12
|
-
* Do not edit the file manually.
|
|
13
|
-
*/
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Configuration = void 0;
|
|
16
|
-
var Configuration = /** @class */ (function () {
|
|
17
|
-
function Configuration(param) {
|
|
18
|
-
if (param === void 0) { param = {}; }
|
|
19
|
-
this.apiKey = param.apiKey;
|
|
20
|
-
this.username = param.username;
|
|
21
|
-
this.password = param.password;
|
|
22
|
-
this.accessToken = param.accessToken;
|
|
23
|
-
this.basePath = param.basePath;
|
|
24
|
-
}
|
|
25
|
-
return Configuration;
|
|
26
|
-
}());
|
|
27
|
-
exports.Configuration = Configuration;
|