@hirosystems/token-metadata-api-client 1.0.2 → 1.1.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/dist/api.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Token Metadata API
6
6
  * 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
7
  *
8
- * OpenAPI spec version: v0.1.0
8
+ * OpenAPI spec version: v0.3.0
9
9
  *
10
10
  *
11
11
  * NOTE: This file is auto generated by the swagger code generator program.
@@ -26,7 +26,7 @@ var __extends = (this && this.__extends) || (function () {
26
26
  };
27
27
  })();
28
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.TokenNotFoundResponse = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = void 0;
29
+ exports.TokensApi = exports.TokensApiFactory = exports.TokensApiFp = exports.TokensApiFetchParamCreator = exports.StatusApi = exports.StatusApiFactory = exports.StatusApiFp = exports.StatusApiFetchParamCreator = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = void 0;
30
30
  var url = require("url");
31
31
  var isomorphicFetch = require("isomorphic-fetch");
32
32
  var BASE_PATH = "https://api.hiro.so/".replace(/\/+$/, "");
@@ -76,21 +76,6 @@ var RequiredError = /** @class */ (function (_super) {
76
76
  return RequiredError;
77
77
  }(Error));
78
78
  exports.RequiredError = RequiredError;
79
- /**
80
- * @export
81
- * @namespace TokenNotFoundResponse
82
- */
83
- var TokenNotFoundResponse;
84
- (function (TokenNotFoundResponse) {
85
- /**
86
- * @export
87
- * @enum {string}
88
- */
89
- var ErrorEnum;
90
- (function (ErrorEnum) {
91
- ErrorEnum[ErrorEnum["TokenNotFound"] = 'Token not found'] = "TokenNotFound";
92
- })(ErrorEnum = TokenNotFoundResponse.ErrorEnum || (TokenNotFoundResponse.ErrorEnum = {}));
93
- })(TokenNotFoundResponse = exports.TokenNotFoundResponse || (exports.TokenNotFoundResponse = {}));
94
79
  /**
95
80
  * StatusApi - fetch parameter creator
96
81
  * @export
@@ -229,28 +214,78 @@ exports.TokensApiFetchParamCreator = function (configuration) {
229
214
  options: localVarRequestOptions,
230
215
  };
231
216
  },
217
+ /**
218
+ * Retrieves a list of Fungible Tokens
219
+ * @summary Fungible Tokens
220
+ * @param {string} [name]
221
+ * @param {string} [symbol]
222
+ * @param {string} [address] Stacks Address
223
+ * @param {number} [offset] Result offset
224
+ * @param {number} [limit] Results per page
225
+ * @param {OrderBy} [order_by] Parameter to order results by
226
+ * @param {Order} [order] Results order
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
231
+ if (options === void 0) { options = {}; }
232
+ var localVarPath = "/metadata/v1/ft";
233
+ var localVarUrlObj = url.parse(localVarPath, true);
234
+ var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
235
+ var localVarHeaderParameter = {};
236
+ var localVarQueryParameter = {};
237
+ if (name !== undefined) {
238
+ localVarQueryParameter['name'] = name;
239
+ }
240
+ if (symbol !== undefined) {
241
+ localVarQueryParameter['symbol'] = symbol;
242
+ }
243
+ if (address !== undefined) {
244
+ localVarQueryParameter['address'] = address;
245
+ }
246
+ if (offset !== undefined) {
247
+ localVarQueryParameter['offset'] = offset;
248
+ }
249
+ if (limit !== undefined) {
250
+ localVarQueryParameter['limit'] = limit;
251
+ }
252
+ if (order_by !== undefined) {
253
+ localVarQueryParameter['order_by'] = order_by;
254
+ }
255
+ if (order !== undefined) {
256
+ localVarQueryParameter['order'] = order;
257
+ }
258
+ localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
259
+ // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
260
+ delete localVarUrlObj.search;
261
+ localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
262
+ return {
263
+ url: url.format(localVarUrlObj),
264
+ options: localVarRequestOptions,
265
+ };
266
+ },
232
267
  /**
233
268
  * Retrieves metadata for a SIP-009 Non-Fungible Token
234
269
  * @summary Non-Fungible Token Metadata
235
270
  * @param {string} principal SIP-009 compliant smart contract principal
236
- * @param {number} tokenId Token ID to retrieve
271
+ * @param {number} token_id Token ID to retrieve
237
272
  * @param {string} [locale] Metadata localization to retrieve
238
273
  * @param {*} [options] Override http request option.
239
274
  * @throws {RequiredError}
240
275
  */
241
- getNftMetadata: function (principal, tokenId, locale, options) {
276
+ getNftMetadata: function (principal, token_id, locale, options) {
242
277
  if (options === void 0) { options = {}; }
243
278
  // verify required parameter 'principal' is not null or undefined
244
279
  if (principal === null || principal === undefined) {
245
280
  throw new RequiredError('principal', 'Required parameter principal was null or undefined when calling getNftMetadata.');
246
281
  }
247
- // verify required parameter 'tokenId' is not null or undefined
248
- if (tokenId === null || tokenId === undefined) {
249
- throw new RequiredError('tokenId', 'Required parameter tokenId was null or undefined when calling getNftMetadata.');
282
+ // verify required parameter 'token_id' is not null or undefined
283
+ if (token_id === null || token_id === undefined) {
284
+ throw new RequiredError('token_id', 'Required parameter token_id was null or undefined when calling getNftMetadata.');
250
285
  }
251
286
  var localVarPath = "/metadata/v1/nft/{principal}/{token_id}"
252
287
  .replace("{" + "principal" + "}", encodeURIComponent(String(principal)))
253
- .replace("{" + "token_id" + "}", encodeURIComponent(String(tokenId)));
288
+ .replace("{" + "token_id" + "}", encodeURIComponent(String(token_id)));
254
289
  var localVarUrlObj = url.parse(localVarPath, true);
255
290
  var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
256
291
  var localVarHeaderParameter = {};
@@ -271,24 +306,24 @@ exports.TokensApiFetchParamCreator = function (configuration) {
271
306
  * Retrieves metadata for a SIP-013 Semi-Fungible Token
272
307
  * @summary Semi-Fungible Token Metadata
273
308
  * @param {string} principal SIP-013 compliant smart contract principal
274
- * @param {number} tokenId Token ID to retrieve
309
+ * @param {number} token_id Token ID to retrieve
275
310
  * @param {string} [locale] Metadata localization to retrieve
276
311
  * @param {*} [options] Override http request option.
277
312
  * @throws {RequiredError}
278
313
  */
279
- getSftMetadata: function (principal, tokenId, locale, options) {
314
+ getSftMetadata: function (principal, token_id, locale, options) {
280
315
  if (options === void 0) { options = {}; }
281
316
  // verify required parameter 'principal' is not null or undefined
282
317
  if (principal === null || principal === undefined) {
283
318
  throw new RequiredError('principal', 'Required parameter principal was null or undefined when calling getSftMetadata.');
284
319
  }
285
- // verify required parameter 'tokenId' is not null or undefined
286
- if (tokenId === null || tokenId === undefined) {
287
- throw new RequiredError('tokenId', 'Required parameter tokenId was null or undefined when calling getSftMetadata.');
320
+ // verify required parameter 'token_id' is not null or undefined
321
+ if (token_id === null || token_id === undefined) {
322
+ throw new RequiredError('token_id', 'Required parameter token_id was null or undefined when calling getSftMetadata.');
288
323
  }
289
324
  var localVarPath = "/metadata/v1/sft/{principal}/{token_id}"
290
325
  .replace("{" + "principal" + "}", encodeURIComponent(String(principal)))
291
- .replace("{" + "token_id" + "}", encodeURIComponent(String(tokenId)));
326
+ .replace("{" + "token_id" + "}", encodeURIComponent(String(token_id)));
292
327
  var localVarUrlObj = url.parse(localVarPath, true);
293
328
  var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
294
329
  var localVarHeaderParameter = {};
@@ -336,17 +371,45 @@ exports.TokensApiFp = function (configuration) {
336
371
  });
337
372
  };
338
373
  },
374
+ /**
375
+ * Retrieves a list of Fungible Tokens
376
+ * @summary Fungible Tokens
377
+ * @param {string} [name]
378
+ * @param {string} [symbol]
379
+ * @param {string} [address] Stacks Address
380
+ * @param {number} [offset] Result offset
381
+ * @param {number} [limit] Results per page
382
+ * @param {OrderBy} [order_by] Parameter to order results by
383
+ * @param {Order} [order] Results order
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ */
387
+ getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
388
+ var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options);
389
+ return function (fetch, basePath) {
390
+ if (fetch === void 0) { fetch = isomorphicFetch; }
391
+ if (basePath === void 0) { basePath = BASE_PATH; }
392
+ return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
393
+ if (response.status >= 200 && response.status < 300) {
394
+ return response.json();
395
+ }
396
+ else {
397
+ throw response;
398
+ }
399
+ });
400
+ };
401
+ },
339
402
  /**
340
403
  * Retrieves metadata for a SIP-009 Non-Fungible Token
341
404
  * @summary Non-Fungible Token Metadata
342
405
  * @param {string} principal SIP-009 compliant smart contract principal
343
- * @param {number} tokenId Token ID to retrieve
406
+ * @param {number} token_id Token ID to retrieve
344
407
  * @param {string} [locale] Metadata localization to retrieve
345
408
  * @param {*} [options] Override http request option.
346
409
  * @throws {RequiredError}
347
410
  */
348
- getNftMetadata: function (principal, tokenId, locale, options) {
349
- var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getNftMetadata(principal, tokenId, locale, options);
411
+ getNftMetadata: function (principal, token_id, locale, options) {
412
+ var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getNftMetadata(principal, token_id, locale, options);
350
413
  return function (fetch, basePath) {
351
414
  if (fetch === void 0) { fetch = isomorphicFetch; }
352
415
  if (basePath === void 0) { basePath = BASE_PATH; }
@@ -364,13 +427,13 @@ exports.TokensApiFp = function (configuration) {
364
427
  * Retrieves metadata for a SIP-013 Semi-Fungible Token
365
428
  * @summary Semi-Fungible Token Metadata
366
429
  * @param {string} principal SIP-013 compliant smart contract principal
367
- * @param {number} tokenId Token ID to retrieve
430
+ * @param {number} token_id Token ID to retrieve
368
431
  * @param {string} [locale] Metadata localization to retrieve
369
432
  * @param {*} [options] Override http request option.
370
433
  * @throws {RequiredError}
371
434
  */
372
- getSftMetadata: function (principal, tokenId, locale, options) {
373
- var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getSftMetadata(principal, tokenId, locale, options);
435
+ getSftMetadata: function (principal, token_id, locale, options) {
436
+ var localVarFetchArgs = exports.TokensApiFetchParamCreator(configuration).getSftMetadata(principal, token_id, locale, options);
374
437
  return function (fetch, basePath) {
375
438
  if (fetch === void 0) { fetch = isomorphicFetch; }
376
439
  if (basePath === void 0) { basePath = BASE_PATH; }
@@ -403,29 +466,45 @@ exports.TokensApiFactory = function (configuration, fetch, basePath) {
403
466
  getFtMetadata: function (principal, locale, options) {
404
467
  return exports.TokensApiFp(configuration).getFtMetadata(principal, locale, options)(fetch, basePath);
405
468
  },
469
+ /**
470
+ * Retrieves a list of Fungible Tokens
471
+ * @summary Fungible Tokens
472
+ * @param {string} [name]
473
+ * @param {string} [symbol]
474
+ * @param {string} [address] Stacks Address
475
+ * @param {number} [offset] Result offset
476
+ * @param {number} [limit] Results per page
477
+ * @param {OrderBy} [order_by] Parameter to order results by
478
+ * @param {Order} [order] Results order
479
+ * @param {*} [options] Override http request option.
480
+ * @throws {RequiredError}
481
+ */
482
+ getFungibleTokens: function (name, symbol, address, offset, limit, order_by, order, options) {
483
+ return exports.TokensApiFp(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(fetch, basePath);
484
+ },
406
485
  /**
407
486
  * Retrieves metadata for a SIP-009 Non-Fungible Token
408
487
  * @summary Non-Fungible Token Metadata
409
488
  * @param {string} principal SIP-009 compliant smart contract principal
410
- * @param {number} tokenId Token ID to retrieve
489
+ * @param {number} token_id Token ID to retrieve
411
490
  * @param {string} [locale] Metadata localization to retrieve
412
491
  * @param {*} [options] Override http request option.
413
492
  * @throws {RequiredError}
414
493
  */
415
- getNftMetadata: function (principal, tokenId, locale, options) {
416
- return exports.TokensApiFp(configuration).getNftMetadata(principal, tokenId, locale, options)(fetch, basePath);
494
+ getNftMetadata: function (principal, token_id, locale, options) {
495
+ return exports.TokensApiFp(configuration).getNftMetadata(principal, token_id, locale, options)(fetch, basePath);
417
496
  },
418
497
  /**
419
498
  * Retrieves metadata for a SIP-013 Semi-Fungible Token
420
499
  * @summary Semi-Fungible Token Metadata
421
500
  * @param {string} principal SIP-013 compliant smart contract principal
422
- * @param {number} tokenId Token ID to retrieve
501
+ * @param {number} token_id Token ID to retrieve
423
502
  * @param {string} [locale] Metadata localization to retrieve
424
503
  * @param {*} [options] Override http request option.
425
504
  * @throws {RequiredError}
426
505
  */
427
- getSftMetadata: function (principal, tokenId, locale, options) {
428
- return exports.TokensApiFp(configuration).getSftMetadata(principal, tokenId, locale, options)(fetch, basePath);
506
+ getSftMetadata: function (principal, token_id, locale, options) {
507
+ return exports.TokensApiFp(configuration).getSftMetadata(principal, token_id, locale, options)(fetch, basePath);
429
508
  },
430
509
  };
431
510
  };
@@ -452,31 +531,48 @@ var TokensApi = /** @class */ (function (_super) {
452
531
  TokensApi.prototype.getFtMetadata = function (principal, locale, options) {
453
532
  return exports.TokensApiFp(this.configuration).getFtMetadata(principal, locale, options)(this.fetch, this.basePath);
454
533
  };
534
+ /**
535
+ * Retrieves a list of Fungible Tokens
536
+ * @summary Fungible Tokens
537
+ * @param {string} [name]
538
+ * @param {string} [symbol]
539
+ * @param {string} [address] Stacks Address
540
+ * @param {number} [offset] Result offset
541
+ * @param {number} [limit] Results per page
542
+ * @param {OrderBy} [order_by] Parameter to order results by
543
+ * @param {Order} [order] Results order
544
+ * @param {*} [options] Override http request option.
545
+ * @throws {RequiredError}
546
+ * @memberof TokensApi
547
+ */
548
+ TokensApi.prototype.getFungibleTokens = function (name, symbol, address, offset, limit, order_by, order, options) {
549
+ return exports.TokensApiFp(this.configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(this.fetch, this.basePath);
550
+ };
455
551
  /**
456
552
  * Retrieves metadata for a SIP-009 Non-Fungible Token
457
553
  * @summary Non-Fungible Token Metadata
458
554
  * @param {string} principal SIP-009 compliant smart contract principal
459
- * @param {number} tokenId Token ID to retrieve
555
+ * @param {number} token_id Token ID to retrieve
460
556
  * @param {string} [locale] Metadata localization to retrieve
461
557
  * @param {*} [options] Override http request option.
462
558
  * @throws {RequiredError}
463
559
  * @memberof TokensApi
464
560
  */
465
- TokensApi.prototype.getNftMetadata = function (principal, tokenId, locale, options) {
466
- return exports.TokensApiFp(this.configuration).getNftMetadata(principal, tokenId, locale, options)(this.fetch, this.basePath);
561
+ TokensApi.prototype.getNftMetadata = function (principal, token_id, locale, options) {
562
+ return exports.TokensApiFp(this.configuration).getNftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
467
563
  };
468
564
  /**
469
565
  * Retrieves metadata for a SIP-013 Semi-Fungible Token
470
566
  * @summary Semi-Fungible Token Metadata
471
567
  * @param {string} principal SIP-013 compliant smart contract principal
472
- * @param {number} tokenId Token ID to retrieve
568
+ * @param {number} token_id Token ID to retrieve
473
569
  * @param {string} [locale] Metadata localization to retrieve
474
570
  * @param {*} [options] Override http request option.
475
571
  * @throws {RequiredError}
476
572
  * @memberof TokensApi
477
573
  */
478
- TokensApi.prototype.getSftMetadata = function (principal, tokenId, locale, options) {
479
- return exports.TokensApiFp(this.configuration).getSftMetadata(principal, tokenId, locale, options)(this.fetch, this.basePath);
574
+ TokensApi.prototype.getSftMetadata = function (principal, token_id, locale, options) {
575
+ return exports.TokensApiFp(this.configuration).getSftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
480
576
  };
481
577
  return TokensApi;
482
578
  }(BaseAPI));
@@ -2,7 +2,7 @@
2
2
  * Token Metadata API
3
3
  * 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
4
  *
5
- * OpenAPI spec version: v0.1.0
5
+ * OpenAPI spec version: v0.3.0
6
6
  *
7
7
  *
8
8
  * NOTE: This file is auto generated by the swagger code generator program.
@@ -4,7 +4,7 @@
4
4
  * Token Metadata API
5
5
  * 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
6
  *
7
- * OpenAPI spec version: v0.1.0
7
+ * OpenAPI spec version: v0.3.0
8
8
  *
9
9
  *
10
10
  * NOTE: This file is auto generated by the swagger code generator program.
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Token Metadata API
3
3
  * 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
4
  *
5
- * OpenAPI spec version: v0.1.0
5
+ * OpenAPI spec version: v0.3.0
6
6
  *
7
7
  *
8
8
  * NOTE: This file is auto generated by the swagger code generator program.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Token Metadata API
5
5
  * 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
6
  *
7
- * OpenAPI spec version: v0.1.0
7
+ * OpenAPI spec version: v0.3.0
8
8
  *
9
9
  *
10
10
  * NOTE: This file is auto generated by the swagger code generator program.
package/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Token Metadata API
4
4
  * 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.
5
5
  *
6
- * OpenAPI spec version: v0.1.0
6
+ * OpenAPI spec version: v0.3.0
7
7
  *
8
8
  *
9
9
  * NOTE: This file is auto generated by the swagger code generator program.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirosystems/token-metadata-api-client",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Client for @hirosystems/token-metadata-api",
5
5
  "author": "Hiro Systems PBC <engineering@hiro.so> (https://hiro.so)",
6
6
  "keywords": [