@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/api.ts +292 -83
- package/configuration.ts +1 -1
- package/dist/api.d.ts +218 -68
- package/dist/api.js +143 -47
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/api.ts
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.
|
|
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.
|
|
@@ -119,7 +119,7 @@ export interface ApiStatusResponse {
|
|
|
119
119
|
* @type {string}
|
|
120
120
|
* @memberof ApiStatusResponse
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
server_version: string;
|
|
123
123
|
/**
|
|
124
124
|
*
|
|
125
125
|
* @type {string}
|
|
@@ -137,13 +137,13 @@ export interface ApiStatusResponse {
|
|
|
137
137
|
* @type {ApiTokenContractCount}
|
|
138
138
|
* @memberof ApiStatusResponse
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
token_contracts?: ApiTokenContractCount;
|
|
141
141
|
/**
|
|
142
142
|
*
|
|
143
143
|
* @type {ApiJobCount}
|
|
144
144
|
* @memberof ApiStatusResponse
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
job_queue?: ApiJobCount;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
*
|
|
@@ -156,19 +156,19 @@ export interface ApiTokenContractCount {
|
|
|
156
156
|
* @type {number}
|
|
157
157
|
* @memberof ApiTokenContractCount
|
|
158
158
|
*/
|
|
159
|
-
|
|
159
|
+
sip_009?: number;
|
|
160
160
|
/**
|
|
161
161
|
*
|
|
162
162
|
* @type {number}
|
|
163
163
|
* @memberof ApiTokenContractCount
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
sip_010?: number;
|
|
166
166
|
/**
|
|
167
167
|
*
|
|
168
168
|
* @type {number}
|
|
169
169
|
* @memberof ApiTokenContractCount
|
|
170
170
|
*/
|
|
171
|
-
|
|
171
|
+
sip_013?: number;
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
*
|
|
@@ -195,6 +195,80 @@ export interface ApiTokenCount {
|
|
|
195
195
|
*/
|
|
196
196
|
sft?: number;
|
|
197
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
*
|
|
200
|
+
* @export
|
|
201
|
+
* @interface ErrorResponse
|
|
202
|
+
*/
|
|
203
|
+
export interface ErrorResponse {
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @export
|
|
208
|
+
* @interface FtBasicMetadataResponse
|
|
209
|
+
*/
|
|
210
|
+
export interface FtBasicMetadataResponse {
|
|
211
|
+
/**
|
|
212
|
+
*
|
|
213
|
+
* @type {string}
|
|
214
|
+
* @memberof FtBasicMetadataResponse
|
|
215
|
+
*/
|
|
216
|
+
name?: string;
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
* @type {string}
|
|
220
|
+
* @memberof FtBasicMetadataResponse
|
|
221
|
+
*/
|
|
222
|
+
symbol?: string;
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* @type {number}
|
|
226
|
+
* @memberof FtBasicMetadataResponse
|
|
227
|
+
*/
|
|
228
|
+
decimals?: number;
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
* @type {string}
|
|
232
|
+
* @memberof FtBasicMetadataResponse
|
|
233
|
+
*/
|
|
234
|
+
total_supply?: string;
|
|
235
|
+
/**
|
|
236
|
+
*
|
|
237
|
+
* @type {string}
|
|
238
|
+
* @memberof FtBasicMetadataResponse
|
|
239
|
+
*/
|
|
240
|
+
token_uri?: string;
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @type {string}
|
|
244
|
+
* @memberof FtBasicMetadataResponse
|
|
245
|
+
*/
|
|
246
|
+
description?: string;
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* @type {string}
|
|
250
|
+
* @memberof FtBasicMetadataResponse
|
|
251
|
+
*/
|
|
252
|
+
image_uri?: string;
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* @type {string}
|
|
256
|
+
* @memberof FtBasicMetadataResponse
|
|
257
|
+
*/
|
|
258
|
+
image_canonical_uri?: string;
|
|
259
|
+
/**
|
|
260
|
+
*
|
|
261
|
+
* @type {string}
|
|
262
|
+
* @memberof FtBasicMetadataResponse
|
|
263
|
+
*/
|
|
264
|
+
tx_id: string;
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* @type {string}
|
|
268
|
+
* @memberof FtBasicMetadataResponse
|
|
269
|
+
*/
|
|
270
|
+
sender_address: string;
|
|
271
|
+
}
|
|
198
272
|
/**
|
|
199
273
|
*
|
|
200
274
|
* @export
|
|
@@ -224,13 +298,13 @@ export interface FtMetadataResponse {
|
|
|
224
298
|
* @type {string}
|
|
225
299
|
* @memberof FtMetadataResponse
|
|
226
300
|
*/
|
|
227
|
-
|
|
301
|
+
total_supply?: string;
|
|
228
302
|
/**
|
|
229
303
|
*
|
|
230
304
|
* @type {string}
|
|
231
305
|
* @memberof FtMetadataResponse
|
|
232
306
|
*/
|
|
233
|
-
|
|
307
|
+
token_uri?: string;
|
|
234
308
|
/**
|
|
235
309
|
*
|
|
236
310
|
* @type {string}
|
|
@@ -242,25 +316,25 @@ export interface FtMetadataResponse {
|
|
|
242
316
|
* @type {string}
|
|
243
317
|
* @memberof FtMetadataResponse
|
|
244
318
|
*/
|
|
245
|
-
|
|
319
|
+
image_uri?: string;
|
|
246
320
|
/**
|
|
247
321
|
*
|
|
248
322
|
* @type {string}
|
|
249
323
|
* @memberof FtMetadataResponse
|
|
250
324
|
*/
|
|
251
|
-
|
|
325
|
+
image_canonical_uri?: string;
|
|
252
326
|
/**
|
|
253
327
|
*
|
|
254
328
|
* @type {string}
|
|
255
329
|
* @memberof FtMetadataResponse
|
|
256
330
|
*/
|
|
257
|
-
|
|
331
|
+
tx_id: string;
|
|
258
332
|
/**
|
|
259
333
|
*
|
|
260
334
|
* @type {string}
|
|
261
335
|
* @memberof FtMetadataResponse
|
|
262
336
|
*/
|
|
263
|
-
|
|
337
|
+
sender_address: string;
|
|
264
338
|
/**
|
|
265
339
|
*
|
|
266
340
|
* @type {Metadata}
|
|
@@ -303,7 +377,7 @@ export interface Metadata {
|
|
|
303
377
|
* @type {string}
|
|
304
378
|
* @memberof Metadata
|
|
305
379
|
*/
|
|
306
|
-
|
|
380
|
+
cached_image?: string;
|
|
307
381
|
/**
|
|
308
382
|
*
|
|
309
383
|
* @type {Array<MetadataAttribute>}
|
|
@@ -334,13 +408,13 @@ export interface MetadataAttribute {
|
|
|
334
408
|
* @type {string}
|
|
335
409
|
* @memberof MetadataAttribute
|
|
336
410
|
*/
|
|
337
|
-
|
|
411
|
+
trait_type: string;
|
|
338
412
|
/**
|
|
339
413
|
*
|
|
340
414
|
* @type {string}
|
|
341
415
|
* @memberof MetadataAttribute
|
|
342
416
|
*/
|
|
343
|
-
|
|
417
|
+
display_type?: string;
|
|
344
418
|
/**
|
|
345
419
|
*
|
|
346
420
|
* @type {any}
|
|
@@ -384,7 +458,7 @@ export interface NftMetadataResponse {
|
|
|
384
458
|
* @type {string}
|
|
385
459
|
* @memberof NftMetadataResponse
|
|
386
460
|
*/
|
|
387
|
-
|
|
461
|
+
token_uri?: string;
|
|
388
462
|
/**
|
|
389
463
|
*
|
|
390
464
|
* @type {Metadata}
|
|
@@ -395,67 +469,85 @@ export interface NftMetadataResponse {
|
|
|
395
469
|
/**
|
|
396
470
|
*
|
|
397
471
|
* @export
|
|
398
|
-
* @interface
|
|
472
|
+
* @interface NotFoundErrorResponse
|
|
399
473
|
*/
|
|
400
|
-
export interface
|
|
474
|
+
export interface NotFoundErrorResponse {
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
*
|
|
478
|
+
* @export
|
|
479
|
+
* @interface Order
|
|
480
|
+
*/
|
|
481
|
+
export interface Order {
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
*
|
|
485
|
+
* @export
|
|
486
|
+
* @interface OrderBy
|
|
487
|
+
*/
|
|
488
|
+
export interface OrderBy {
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
*
|
|
492
|
+
* @export
|
|
493
|
+
* @interface PaginatedFtBasicMetadataResponse
|
|
494
|
+
*/
|
|
495
|
+
export interface PaginatedFtBasicMetadataResponse {
|
|
401
496
|
/**
|
|
402
497
|
*
|
|
403
|
-
* @type {
|
|
404
|
-
* @memberof
|
|
498
|
+
* @type {number}
|
|
499
|
+
* @memberof PaginatedFtBasicMetadataResponse
|
|
405
500
|
*/
|
|
406
|
-
|
|
501
|
+
limit: number;
|
|
407
502
|
/**
|
|
408
503
|
*
|
|
409
504
|
* @type {number}
|
|
410
|
-
* @memberof
|
|
505
|
+
* @memberof PaginatedFtBasicMetadataResponse
|
|
411
506
|
*/
|
|
412
|
-
|
|
507
|
+
offset: number;
|
|
413
508
|
/**
|
|
414
509
|
*
|
|
415
|
-
* @type {
|
|
416
|
-
* @memberof
|
|
510
|
+
* @type {number}
|
|
511
|
+
* @memberof PaginatedFtBasicMetadataResponse
|
|
417
512
|
*/
|
|
418
|
-
|
|
513
|
+
total: number;
|
|
419
514
|
/**
|
|
420
515
|
*
|
|
421
|
-
* @type {
|
|
422
|
-
* @memberof
|
|
516
|
+
* @type {Array<FtBasicMetadataResponse>}
|
|
517
|
+
* @memberof PaginatedFtBasicMetadataResponse
|
|
423
518
|
*/
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
*
|
|
428
|
-
* @export
|
|
429
|
-
* @interface TokenErrorResponse
|
|
430
|
-
*/
|
|
431
|
-
export interface TokenErrorResponse {
|
|
519
|
+
results: Array<FtBasicMetadataResponse>;
|
|
432
520
|
}
|
|
433
521
|
/**
|
|
434
522
|
*
|
|
435
523
|
* @export
|
|
436
|
-
* @interface
|
|
524
|
+
* @interface SftMetadataResponse
|
|
437
525
|
*/
|
|
438
|
-
export interface
|
|
526
|
+
export interface SftMetadataResponse {
|
|
439
527
|
/**
|
|
440
528
|
*
|
|
441
529
|
* @type {string}
|
|
442
|
-
* @memberof
|
|
530
|
+
* @memberof SftMetadataResponse
|
|
443
531
|
*/
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
export namespace TokenNotFoundResponse {
|
|
532
|
+
token_uri?: string;
|
|
533
|
+
/**
|
|
534
|
+
*
|
|
535
|
+
* @type {number}
|
|
536
|
+
* @memberof SftMetadataResponse
|
|
537
|
+
*/
|
|
538
|
+
decimals?: number;
|
|
452
539
|
/**
|
|
453
|
-
*
|
|
454
|
-
* @
|
|
540
|
+
*
|
|
541
|
+
* @type {string}
|
|
542
|
+
* @memberof SftMetadataResponse
|
|
455
543
|
*/
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
544
|
+
total_supply?: string;
|
|
545
|
+
/**
|
|
546
|
+
*
|
|
547
|
+
* @type {Metadata}
|
|
548
|
+
* @memberof SftMetadataResponse
|
|
549
|
+
*/
|
|
550
|
+
metadata?: Metadata;
|
|
459
551
|
}
|
|
460
552
|
/**
|
|
461
553
|
* StatusApi - fetch parameter creator
|
|
@@ -593,27 +685,85 @@ export const TokensApiFetchParamCreator = function (configuration?: Configuratio
|
|
|
593
685
|
options: localVarRequestOptions,
|
|
594
686
|
};
|
|
595
687
|
},
|
|
688
|
+
/**
|
|
689
|
+
* Retrieves a list of Fungible Tokens
|
|
690
|
+
* @summary Fungible Tokens
|
|
691
|
+
* @param {string} [name]
|
|
692
|
+
* @param {string} [symbol]
|
|
693
|
+
* @param {string} [address] Stacks Address
|
|
694
|
+
* @param {number} [offset] Result offset
|
|
695
|
+
* @param {number} [limit] Results per page
|
|
696
|
+
* @param {OrderBy} [order_by] Parameter to order results by
|
|
697
|
+
* @param {Order} [order] Results order
|
|
698
|
+
* @param {*} [options] Override http request option.
|
|
699
|
+
* @throws {RequiredError}
|
|
700
|
+
*/
|
|
701
|
+
getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options: any = {}): FetchArgs {
|
|
702
|
+
const localVarPath = `/metadata/v1/ft`;
|
|
703
|
+
const localVarUrlObj = url.parse(localVarPath, true);
|
|
704
|
+
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
705
|
+
const localVarHeaderParameter = {} as any;
|
|
706
|
+
const localVarQueryParameter = {} as any;
|
|
707
|
+
|
|
708
|
+
if (name !== undefined) {
|
|
709
|
+
localVarQueryParameter['name'] = name;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
if (symbol !== undefined) {
|
|
713
|
+
localVarQueryParameter['symbol'] = symbol;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
if (address !== undefined) {
|
|
717
|
+
localVarQueryParameter['address'] = address;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
if (offset !== undefined) {
|
|
721
|
+
localVarQueryParameter['offset'] = offset;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if (limit !== undefined) {
|
|
725
|
+
localVarQueryParameter['limit'] = limit;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
if (order_by !== undefined) {
|
|
729
|
+
localVarQueryParameter['order_by'] = order_by;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (order !== undefined) {
|
|
733
|
+
localVarQueryParameter['order'] = order;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
|
|
737
|
+
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
|
|
738
|
+
delete localVarUrlObj.search;
|
|
739
|
+
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
|
|
740
|
+
|
|
741
|
+
return {
|
|
742
|
+
url: url.format(localVarUrlObj),
|
|
743
|
+
options: localVarRequestOptions,
|
|
744
|
+
};
|
|
745
|
+
},
|
|
596
746
|
/**
|
|
597
747
|
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
598
748
|
* @summary Non-Fungible Token Metadata
|
|
599
749
|
* @param {string} principal SIP-009 compliant smart contract principal
|
|
600
|
-
* @param {number}
|
|
750
|
+
* @param {number} token_id Token ID to retrieve
|
|
601
751
|
* @param {string} [locale] Metadata localization to retrieve
|
|
602
752
|
* @param {*} [options] Override http request option.
|
|
603
753
|
* @throws {RequiredError}
|
|
604
754
|
*/
|
|
605
|
-
getNftMetadata(principal: string,
|
|
755
|
+
getNftMetadata(principal: string, token_id: number, locale?: string, options: any = {}): FetchArgs {
|
|
606
756
|
// verify required parameter 'principal' is not null or undefined
|
|
607
757
|
if (principal === null || principal === undefined) {
|
|
608
758
|
throw new RequiredError('principal','Required parameter principal was null or undefined when calling getNftMetadata.');
|
|
609
759
|
}
|
|
610
|
-
// verify required parameter '
|
|
611
|
-
if (
|
|
612
|
-
throw new RequiredError('
|
|
760
|
+
// verify required parameter 'token_id' is not null or undefined
|
|
761
|
+
if (token_id === null || token_id === undefined) {
|
|
762
|
+
throw new RequiredError('token_id','Required parameter token_id was null or undefined when calling getNftMetadata.');
|
|
613
763
|
}
|
|
614
764
|
const localVarPath = `/metadata/v1/nft/{principal}/{token_id}`
|
|
615
765
|
.replace(`{${"principal"}}`, encodeURIComponent(String(principal)))
|
|
616
|
-
.replace(`{${"token_id"}}`, encodeURIComponent(String(
|
|
766
|
+
.replace(`{${"token_id"}}`, encodeURIComponent(String(token_id)));
|
|
617
767
|
const localVarUrlObj = url.parse(localVarPath, true);
|
|
618
768
|
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
619
769
|
const localVarHeaderParameter = {} as any;
|
|
@@ -637,23 +787,23 @@ export const TokensApiFetchParamCreator = function (configuration?: Configuratio
|
|
|
637
787
|
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
638
788
|
* @summary Semi-Fungible Token Metadata
|
|
639
789
|
* @param {string} principal SIP-013 compliant smart contract principal
|
|
640
|
-
* @param {number}
|
|
790
|
+
* @param {number} token_id Token ID to retrieve
|
|
641
791
|
* @param {string} [locale] Metadata localization to retrieve
|
|
642
792
|
* @param {*} [options] Override http request option.
|
|
643
793
|
* @throws {RequiredError}
|
|
644
794
|
*/
|
|
645
|
-
getSftMetadata(principal: string,
|
|
795
|
+
getSftMetadata(principal: string, token_id: number, locale?: string, options: any = {}): FetchArgs {
|
|
646
796
|
// verify required parameter 'principal' is not null or undefined
|
|
647
797
|
if (principal === null || principal === undefined) {
|
|
648
798
|
throw new RequiredError('principal','Required parameter principal was null or undefined when calling getSftMetadata.');
|
|
649
799
|
}
|
|
650
|
-
// verify required parameter '
|
|
651
|
-
if (
|
|
652
|
-
throw new RequiredError('
|
|
800
|
+
// verify required parameter 'token_id' is not null or undefined
|
|
801
|
+
if (token_id === null || token_id === undefined) {
|
|
802
|
+
throw new RequiredError('token_id','Required parameter token_id was null or undefined when calling getSftMetadata.');
|
|
653
803
|
}
|
|
654
804
|
const localVarPath = `/metadata/v1/sft/{principal}/{token_id}`
|
|
655
805
|
.replace(`{${"principal"}}`, encodeURIComponent(String(principal)))
|
|
656
|
-
.replace(`{${"token_id"}}`, encodeURIComponent(String(
|
|
806
|
+
.replace(`{${"token_id"}}`, encodeURIComponent(String(token_id)));
|
|
657
807
|
const localVarUrlObj = url.parse(localVarPath, true);
|
|
658
808
|
const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
|
|
659
809
|
const localVarHeaderParameter = {} as any;
|
|
@@ -702,17 +852,42 @@ export const TokensApiFp = function(configuration?: Configuration) {
|
|
|
702
852
|
});
|
|
703
853
|
};
|
|
704
854
|
},
|
|
855
|
+
/**
|
|
856
|
+
* Retrieves a list of Fungible Tokens
|
|
857
|
+
* @summary Fungible Tokens
|
|
858
|
+
* @param {string} [name]
|
|
859
|
+
* @param {string} [symbol]
|
|
860
|
+
* @param {string} [address] Stacks Address
|
|
861
|
+
* @param {number} [offset] Result offset
|
|
862
|
+
* @param {number} [limit] Results per page
|
|
863
|
+
* @param {OrderBy} [order_by] Parameter to order results by
|
|
864
|
+
* @param {Order} [order] Results order
|
|
865
|
+
* @param {*} [options] Override http request option.
|
|
866
|
+
* @throws {RequiredError}
|
|
867
|
+
*/
|
|
868
|
+
getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<PaginatedFtBasicMetadataResponse> {
|
|
869
|
+
const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options);
|
|
870
|
+
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
|
|
871
|
+
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
|
|
872
|
+
if (response.status >= 200 && response.status < 300) {
|
|
873
|
+
return response.json();
|
|
874
|
+
} else {
|
|
875
|
+
throw response;
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
};
|
|
879
|
+
},
|
|
705
880
|
/**
|
|
706
881
|
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
707
882
|
* @summary Non-Fungible Token Metadata
|
|
708
883
|
* @param {string} principal SIP-009 compliant smart contract principal
|
|
709
|
-
* @param {number}
|
|
884
|
+
* @param {number} token_id Token ID to retrieve
|
|
710
885
|
* @param {string} [locale] Metadata localization to retrieve
|
|
711
886
|
* @param {*} [options] Override http request option.
|
|
712
887
|
* @throws {RequiredError}
|
|
713
888
|
*/
|
|
714
|
-
getNftMetadata(principal: string,
|
|
715
|
-
const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getNftMetadata(principal,
|
|
889
|
+
getNftMetadata(principal: string, token_id: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<NftMetadataResponse> {
|
|
890
|
+
const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getNftMetadata(principal, token_id, locale, options);
|
|
716
891
|
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
|
|
717
892
|
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
|
|
718
893
|
if (response.status >= 200 && response.status < 300) {
|
|
@@ -727,13 +902,13 @@ export const TokensApiFp = function(configuration?: Configuration) {
|
|
|
727
902
|
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
728
903
|
* @summary Semi-Fungible Token Metadata
|
|
729
904
|
* @param {string} principal SIP-013 compliant smart contract principal
|
|
730
|
-
* @param {number}
|
|
905
|
+
* @param {number} token_id Token ID to retrieve
|
|
731
906
|
* @param {string} [locale] Metadata localization to retrieve
|
|
732
907
|
* @param {*} [options] Override http request option.
|
|
733
908
|
* @throws {RequiredError}
|
|
734
909
|
*/
|
|
735
|
-
getSftMetadata(principal: string,
|
|
736
|
-
const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getSftMetadata(principal,
|
|
910
|
+
getSftMetadata(principal: string, token_id: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<SftMetadataResponse> {
|
|
911
|
+
const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getSftMetadata(principal, token_id, locale, options);
|
|
737
912
|
return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
|
|
738
913
|
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
|
|
739
914
|
if (response.status >= 200 && response.status < 300) {
|
|
@@ -764,29 +939,45 @@ export const TokensApiFactory = function (configuration?: Configuration, fetch?:
|
|
|
764
939
|
getFtMetadata(principal: string, locale?: string, options?: any) {
|
|
765
940
|
return TokensApiFp(configuration).getFtMetadata(principal, locale, options)(fetch, basePath);
|
|
766
941
|
},
|
|
942
|
+
/**
|
|
943
|
+
* Retrieves a list of Fungible Tokens
|
|
944
|
+
* @summary Fungible Tokens
|
|
945
|
+
* @param {string} [name]
|
|
946
|
+
* @param {string} [symbol]
|
|
947
|
+
* @param {string} [address] Stacks Address
|
|
948
|
+
* @param {number} [offset] Result offset
|
|
949
|
+
* @param {number} [limit] Results per page
|
|
950
|
+
* @param {OrderBy} [order_by] Parameter to order results by
|
|
951
|
+
* @param {Order} [order] Results order
|
|
952
|
+
* @param {*} [options] Override http request option.
|
|
953
|
+
* @throws {RequiredError}
|
|
954
|
+
*/
|
|
955
|
+
getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
|
|
956
|
+
return TokensApiFp(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(fetch, basePath);
|
|
957
|
+
},
|
|
767
958
|
/**
|
|
768
959
|
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
769
960
|
* @summary Non-Fungible Token Metadata
|
|
770
961
|
* @param {string} principal SIP-009 compliant smart contract principal
|
|
771
|
-
* @param {number}
|
|
962
|
+
* @param {number} token_id Token ID to retrieve
|
|
772
963
|
* @param {string} [locale] Metadata localization to retrieve
|
|
773
964
|
* @param {*} [options] Override http request option.
|
|
774
965
|
* @throws {RequiredError}
|
|
775
966
|
*/
|
|
776
|
-
getNftMetadata(principal: string,
|
|
777
|
-
return TokensApiFp(configuration).getNftMetadata(principal,
|
|
967
|
+
getNftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
|
|
968
|
+
return TokensApiFp(configuration).getNftMetadata(principal, token_id, locale, options)(fetch, basePath);
|
|
778
969
|
},
|
|
779
970
|
/**
|
|
780
971
|
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
781
972
|
* @summary Semi-Fungible Token Metadata
|
|
782
973
|
* @param {string} principal SIP-013 compliant smart contract principal
|
|
783
|
-
* @param {number}
|
|
974
|
+
* @param {number} token_id Token ID to retrieve
|
|
784
975
|
* @param {string} [locale] Metadata localization to retrieve
|
|
785
976
|
* @param {*} [options] Override http request option.
|
|
786
977
|
* @throws {RequiredError}
|
|
787
978
|
*/
|
|
788
|
-
getSftMetadata(principal: string,
|
|
789
|
-
return TokensApiFp(configuration).getSftMetadata(principal,
|
|
979
|
+
getSftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
|
|
980
|
+
return TokensApiFp(configuration).getSftMetadata(principal, token_id, locale, options)(fetch, basePath);
|
|
790
981
|
},
|
|
791
982
|
};
|
|
792
983
|
};
|
|
@@ -811,32 +1002,50 @@ export class TokensApi extends BaseAPI {
|
|
|
811
1002
|
return TokensApiFp(this.configuration).getFtMetadata(principal, locale, options)(this.fetch, this.basePath);
|
|
812
1003
|
}
|
|
813
1004
|
|
|
1005
|
+
/**
|
|
1006
|
+
* Retrieves a list of Fungible Tokens
|
|
1007
|
+
* @summary Fungible Tokens
|
|
1008
|
+
* @param {string} [name]
|
|
1009
|
+
* @param {string} [symbol]
|
|
1010
|
+
* @param {string} [address] Stacks Address
|
|
1011
|
+
* @param {number} [offset] Result offset
|
|
1012
|
+
* @param {number} [limit] Results per page
|
|
1013
|
+
* @param {OrderBy} [order_by] Parameter to order results by
|
|
1014
|
+
* @param {Order} [order] Results order
|
|
1015
|
+
* @param {*} [options] Override http request option.
|
|
1016
|
+
* @throws {RequiredError}
|
|
1017
|
+
* @memberof TokensApi
|
|
1018
|
+
*/
|
|
1019
|
+
public getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
|
|
1020
|
+
return TokensApiFp(this.configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(this.fetch, this.basePath);
|
|
1021
|
+
}
|
|
1022
|
+
|
|
814
1023
|
/**
|
|
815
1024
|
* Retrieves metadata for a SIP-009 Non-Fungible Token
|
|
816
1025
|
* @summary Non-Fungible Token Metadata
|
|
817
1026
|
* @param {string} principal SIP-009 compliant smart contract principal
|
|
818
|
-
* @param {number}
|
|
1027
|
+
* @param {number} token_id Token ID to retrieve
|
|
819
1028
|
* @param {string} [locale] Metadata localization to retrieve
|
|
820
1029
|
* @param {*} [options] Override http request option.
|
|
821
1030
|
* @throws {RequiredError}
|
|
822
1031
|
* @memberof TokensApi
|
|
823
1032
|
*/
|
|
824
|
-
public getNftMetadata(principal: string,
|
|
825
|
-
return TokensApiFp(this.configuration).getNftMetadata(principal,
|
|
1033
|
+
public getNftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
|
|
1034
|
+
return TokensApiFp(this.configuration).getNftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
|
|
826
1035
|
}
|
|
827
1036
|
|
|
828
1037
|
/**
|
|
829
1038
|
* Retrieves metadata for a SIP-013 Semi-Fungible Token
|
|
830
1039
|
* @summary Semi-Fungible Token Metadata
|
|
831
1040
|
* @param {string} principal SIP-013 compliant smart contract principal
|
|
832
|
-
* @param {number}
|
|
1041
|
+
* @param {number} token_id Token ID to retrieve
|
|
833
1042
|
* @param {string} [locale] Metadata localization to retrieve
|
|
834
1043
|
* @param {*} [options] Override http request option.
|
|
835
1044
|
* @throws {RequiredError}
|
|
836
1045
|
* @memberof TokensApi
|
|
837
1046
|
*/
|
|
838
|
-
public getSftMetadata(principal: string,
|
|
839
|
-
return TokensApiFp(this.configuration).getSftMetadata(principal,
|
|
1047
|
+
public getSftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
|
|
1048
|
+
return TokensApiFp(this.configuration).getSftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
|
|
840
1049
|
}
|
|
841
1050
|
|
|
842
1051
|
}
|
package/configuration.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.
|
|
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.
|