@hirosystems/token-metadata-api-client 1.0.1 → 1.0.2

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.d.ts ADDED
@@ -0,0 +1,643 @@
1
+ /**
2
+ * Token Metadata API
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
+ *
5
+ * OpenAPI spec version: v0.1.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
+ /// <reference path="../custom.d.ts" />
13
+ import { Configuration } from "./configuration";
14
+ /**
15
+ *
16
+ * @export
17
+ */
18
+ export declare const COLLECTION_FORMATS: {
19
+ csv: string;
20
+ ssv: string;
21
+ tsv: string;
22
+ pipes: string;
23
+ };
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface FetchAPI
28
+ */
29
+ export interface FetchAPI {
30
+ (url: string, init?: any): Promise<Response>;
31
+ }
32
+ /**
33
+ *
34
+ * @export
35
+ * @interface FetchArgs
36
+ */
37
+ export interface FetchArgs {
38
+ url: string;
39
+ options: any;
40
+ }
41
+ /**
42
+ *
43
+ * @export
44
+ * @class BaseAPI
45
+ */
46
+ export declare class BaseAPI {
47
+ protected basePath: string;
48
+ protected fetch: FetchAPI;
49
+ protected configuration: Configuration;
50
+ constructor(configuration?: Configuration, basePath?: string, fetch?: FetchAPI);
51
+ }
52
+ /**
53
+ *
54
+ * @export
55
+ * @class RequiredError
56
+ * @extends {Error}
57
+ */
58
+ export declare class RequiredError extends Error {
59
+ field: string;
60
+ name: "RequiredError";
61
+ constructor(field: string, msg?: string);
62
+ }
63
+ /**
64
+ *
65
+ * @export
66
+ * @interface ApiJobCount
67
+ */
68
+ export interface ApiJobCount {
69
+ /**
70
+ *
71
+ * @type {number}
72
+ * @memberof ApiJobCount
73
+ */
74
+ pending?: number;
75
+ /**
76
+ *
77
+ * @type {number}
78
+ * @memberof ApiJobCount
79
+ */
80
+ queued?: number;
81
+ /**
82
+ *
83
+ * @type {number}
84
+ * @memberof ApiJobCount
85
+ */
86
+ done?: number;
87
+ /**
88
+ *
89
+ * @type {number}
90
+ * @memberof ApiJobCount
91
+ */
92
+ failed?: number;
93
+ }
94
+ /**
95
+ *
96
+ * @export
97
+ * @interface ApiStatusResponse
98
+ */
99
+ export interface ApiStatusResponse {
100
+ /**
101
+ *
102
+ * @type {string}
103
+ * @memberof ApiStatusResponse
104
+ */
105
+ serverVersion: string;
106
+ /**
107
+ *
108
+ * @type {string}
109
+ * @memberof ApiStatusResponse
110
+ */
111
+ status: string;
112
+ /**
113
+ *
114
+ * @type {ApiTokenCount}
115
+ * @memberof ApiStatusResponse
116
+ */
117
+ tokens?: ApiTokenCount;
118
+ /**
119
+ *
120
+ * @type {ApiTokenContractCount}
121
+ * @memberof ApiStatusResponse
122
+ */
123
+ tokenContracts?: ApiTokenContractCount;
124
+ /**
125
+ *
126
+ * @type {ApiJobCount}
127
+ * @memberof ApiStatusResponse
128
+ */
129
+ jobQueue?: ApiJobCount;
130
+ }
131
+ /**
132
+ *
133
+ * @export
134
+ * @interface ApiTokenContractCount
135
+ */
136
+ export interface ApiTokenContractCount {
137
+ /**
138
+ *
139
+ * @type {number}
140
+ * @memberof ApiTokenContractCount
141
+ */
142
+ sip009?: number;
143
+ /**
144
+ *
145
+ * @type {number}
146
+ * @memberof ApiTokenContractCount
147
+ */
148
+ sip010?: number;
149
+ /**
150
+ *
151
+ * @type {number}
152
+ * @memberof ApiTokenContractCount
153
+ */
154
+ sip013?: number;
155
+ }
156
+ /**
157
+ *
158
+ * @export
159
+ * @interface ApiTokenCount
160
+ */
161
+ export interface ApiTokenCount {
162
+ /**
163
+ *
164
+ * @type {number}
165
+ * @memberof ApiTokenCount
166
+ */
167
+ ft?: number;
168
+ /**
169
+ *
170
+ * @type {number}
171
+ * @memberof ApiTokenCount
172
+ */
173
+ nft?: number;
174
+ /**
175
+ *
176
+ * @type {number}
177
+ * @memberof ApiTokenCount
178
+ */
179
+ sft?: number;
180
+ }
181
+ /**
182
+ *
183
+ * @export
184
+ * @interface FtMetadataResponse
185
+ */
186
+ export interface FtMetadataResponse {
187
+ /**
188
+ *
189
+ * @type {string}
190
+ * @memberof FtMetadataResponse
191
+ */
192
+ name?: string;
193
+ /**
194
+ *
195
+ * @type {string}
196
+ * @memberof FtMetadataResponse
197
+ */
198
+ symbol?: string;
199
+ /**
200
+ *
201
+ * @type {number}
202
+ * @memberof FtMetadataResponse
203
+ */
204
+ decimals?: number;
205
+ /**
206
+ *
207
+ * @type {string}
208
+ * @memberof FtMetadataResponse
209
+ */
210
+ totalSupply?: string;
211
+ /**
212
+ *
213
+ * @type {string}
214
+ * @memberof FtMetadataResponse
215
+ */
216
+ tokenUri?: string;
217
+ /**
218
+ *
219
+ * @type {string}
220
+ * @memberof FtMetadataResponse
221
+ */
222
+ description?: string;
223
+ /**
224
+ *
225
+ * @type {string}
226
+ * @memberof FtMetadataResponse
227
+ */
228
+ imageUri?: string;
229
+ /**
230
+ *
231
+ * @type {string}
232
+ * @memberof FtMetadataResponse
233
+ */
234
+ imageCanonicalUri?: string;
235
+ /**
236
+ *
237
+ * @type {string}
238
+ * @memberof FtMetadataResponse
239
+ */
240
+ txId: string;
241
+ /**
242
+ *
243
+ * @type {string}
244
+ * @memberof FtMetadataResponse
245
+ */
246
+ senderAddress: string;
247
+ /**
248
+ *
249
+ * @type {Metadata}
250
+ * @memberof FtMetadataResponse
251
+ */
252
+ metadata?: Metadata;
253
+ }
254
+ /**
255
+ *
256
+ * @export
257
+ * @interface Metadata
258
+ */
259
+ export interface Metadata {
260
+ /**
261
+ *
262
+ * @type {number}
263
+ * @memberof Metadata
264
+ */
265
+ sip: number;
266
+ /**
267
+ *
268
+ * @type {string}
269
+ * @memberof Metadata
270
+ */
271
+ name?: string;
272
+ /**
273
+ *
274
+ * @type {string}
275
+ * @memberof Metadata
276
+ */
277
+ description?: string;
278
+ /**
279
+ *
280
+ * @type {string}
281
+ * @memberof Metadata
282
+ */
283
+ image?: string;
284
+ /**
285
+ *
286
+ * @type {string}
287
+ * @memberof Metadata
288
+ */
289
+ cachedImage?: string;
290
+ /**
291
+ *
292
+ * @type {Array<MetadataAttribute>}
293
+ * @memberof Metadata
294
+ */
295
+ attributes?: Array<MetadataAttribute>;
296
+ /**
297
+ *
298
+ * @type {{ [key: string]: any; }}
299
+ * @memberof Metadata
300
+ */
301
+ properties?: {
302
+ [key: string]: any;
303
+ };
304
+ /**
305
+ *
306
+ * @type {MetadataLocalization}
307
+ * @memberof Metadata
308
+ */
309
+ localization?: MetadataLocalization;
310
+ }
311
+ /**
312
+ *
313
+ * @export
314
+ * @interface MetadataAttribute
315
+ */
316
+ export interface MetadataAttribute {
317
+ /**
318
+ *
319
+ * @type {string}
320
+ * @memberof MetadataAttribute
321
+ */
322
+ traitType: string;
323
+ /**
324
+ *
325
+ * @type {string}
326
+ * @memberof MetadataAttribute
327
+ */
328
+ displayType?: string;
329
+ /**
330
+ *
331
+ * @type {any}
332
+ * @memberof MetadataAttribute
333
+ */
334
+ value: any;
335
+ }
336
+ /**
337
+ *
338
+ * @export
339
+ * @interface MetadataLocalization
340
+ */
341
+ export interface MetadataLocalization {
342
+ /**
343
+ *
344
+ * @type {string}
345
+ * @memberof MetadataLocalization
346
+ */
347
+ uri: string;
348
+ /**
349
+ *
350
+ * @type {string}
351
+ * @memberof MetadataLocalization
352
+ */
353
+ _default: string;
354
+ /**
355
+ *
356
+ * @type {Array<string>}
357
+ * @memberof MetadataLocalization
358
+ */
359
+ locales: Array<string>;
360
+ }
361
+ /**
362
+ *
363
+ * @export
364
+ * @interface NftMetadataResponse
365
+ */
366
+ export interface NftMetadataResponse {
367
+ /**
368
+ *
369
+ * @type {string}
370
+ * @memberof NftMetadataResponse
371
+ */
372
+ tokenUri?: string;
373
+ /**
374
+ *
375
+ * @type {Metadata}
376
+ * @memberof NftMetadataResponse
377
+ */
378
+ metadata?: Metadata;
379
+ }
380
+ /**
381
+ *
382
+ * @export
383
+ * @interface SftMetadataResponse
384
+ */
385
+ export interface SftMetadataResponse {
386
+ /**
387
+ *
388
+ * @type {string}
389
+ * @memberof SftMetadataResponse
390
+ */
391
+ tokenUri?: string;
392
+ /**
393
+ *
394
+ * @type {number}
395
+ * @memberof SftMetadataResponse
396
+ */
397
+ decimals?: number;
398
+ /**
399
+ *
400
+ * @type {string}
401
+ * @memberof SftMetadataResponse
402
+ */
403
+ totalSupply?: string;
404
+ /**
405
+ *
406
+ * @type {Metadata}
407
+ * @memberof SftMetadataResponse
408
+ */
409
+ metadata?: Metadata;
410
+ }
411
+ /**
412
+ *
413
+ * @export
414
+ * @interface TokenErrorResponse
415
+ */
416
+ export interface TokenErrorResponse {
417
+ }
418
+ /**
419
+ *
420
+ * @export
421
+ * @interface TokenNotFoundResponse
422
+ */
423
+ export interface TokenNotFoundResponse {
424
+ /**
425
+ *
426
+ * @type {string}
427
+ * @memberof TokenNotFoundResponse
428
+ */
429
+ error: TokenNotFoundResponse.ErrorEnum;
430
+ }
431
+ /**
432
+ * @export
433
+ * @namespace TokenNotFoundResponse
434
+ */
435
+ export declare namespace TokenNotFoundResponse {
436
+ /**
437
+ * @export
438
+ * @enum {string}
439
+ */
440
+ enum ErrorEnum {
441
+ TokenNotFound
442
+ }
443
+ }
444
+ /**
445
+ * StatusApi - fetch parameter creator
446
+ * @export
447
+ */
448
+ export declare const StatusApiFetchParamCreator: (configuration?: Configuration) => {
449
+ /**
450
+ * Displays the status of the API and its current workload
451
+ * @summary API Status
452
+ * @param {*} [options] Override http request option.
453
+ * @throws {RequiredError}
454
+ */
455
+ getApiStatus(options?: any): FetchArgs;
456
+ };
457
+ /**
458
+ * StatusApi - functional programming interface
459
+ * @export
460
+ */
461
+ export declare const StatusApiFp: (configuration?: Configuration) => {
462
+ /**
463
+ * Displays the status of the API and its current workload
464
+ * @summary API Status
465
+ * @param {*} [options] Override http request option.
466
+ * @throws {RequiredError}
467
+ */
468
+ getApiStatus(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<ApiStatusResponse>;
469
+ };
470
+ /**
471
+ * StatusApi - factory interface
472
+ * @export
473
+ */
474
+ export declare const StatusApiFactory: (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) => {
475
+ /**
476
+ * Displays the status of the API and its current workload
477
+ * @summary API Status
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ */
481
+ getApiStatus(options?: any): Promise<ApiStatusResponse>;
482
+ };
483
+ /**
484
+ * StatusApi - object-oriented interface
485
+ * @export
486
+ * @class StatusApi
487
+ * @extends {BaseAPI}
488
+ */
489
+ export declare class StatusApi extends BaseAPI {
490
+ /**
491
+ * Displays the status of the API and its current workload
492
+ * @summary API Status
493
+ * @param {*} [options] Override http request option.
494
+ * @throws {RequiredError}
495
+ * @memberof StatusApi
496
+ */
497
+ getApiStatus(options?: any): Promise<ApiStatusResponse>;
498
+ }
499
+ /**
500
+ * TokensApi - fetch parameter creator
501
+ * @export
502
+ */
503
+ export declare const TokensApiFetchParamCreator: (configuration?: Configuration) => {
504
+ /**
505
+ * Retrieves metadata for a SIP-010 Fungible Token
506
+ * @summary Fungible Token Metadata
507
+ * @param {string} principal Principal for the contract which owns the SIP-010 token
508
+ * @param {string} [locale] Metadata localization to retrieve
509
+ * @param {*} [options] Override http request option.
510
+ * @throws {RequiredError}
511
+ */
512
+ getFtMetadata(principal: string, locale?: string, options?: any): FetchArgs;
513
+ /**
514
+ * Retrieves metadata for a SIP-009 Non-Fungible Token
515
+ * @summary Non-Fungible Token Metadata
516
+ * @param {string} principal SIP-009 compliant smart contract principal
517
+ * @param {number} tokenId Token ID to retrieve
518
+ * @param {string} [locale] Metadata localization to retrieve
519
+ * @param {*} [options] Override http request option.
520
+ * @throws {RequiredError}
521
+ */
522
+ getNftMetadata(principal: string, tokenId: number, locale?: string, options?: any): FetchArgs;
523
+ /**
524
+ * Retrieves metadata for a SIP-013 Semi-Fungible Token
525
+ * @summary Semi-Fungible Token Metadata
526
+ * @param {string} principal SIP-013 compliant smart contract principal
527
+ * @param {number} tokenId Token ID to retrieve
528
+ * @param {string} [locale] Metadata localization to retrieve
529
+ * @param {*} [options] Override http request option.
530
+ * @throws {RequiredError}
531
+ */
532
+ getSftMetadata(principal: string, tokenId: number, locale?: string, options?: any): FetchArgs;
533
+ };
534
+ /**
535
+ * TokensApi - functional programming interface
536
+ * @export
537
+ */
538
+ export declare const TokensApiFp: (configuration?: Configuration) => {
539
+ /**
540
+ * Retrieves metadata for a SIP-010 Fungible Token
541
+ * @summary Fungible Token Metadata
542
+ * @param {string} principal Principal for the contract which owns the SIP-010 token
543
+ * @param {string} [locale] Metadata localization to retrieve
544
+ * @param {*} [options] Override http request option.
545
+ * @throws {RequiredError}
546
+ */
547
+ getFtMetadata(principal: string, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<FtMetadataResponse>;
548
+ /**
549
+ * Retrieves metadata for a SIP-009 Non-Fungible Token
550
+ * @summary Non-Fungible Token Metadata
551
+ * @param {string} principal SIP-009 compliant smart contract principal
552
+ * @param {number} tokenId Token ID to retrieve
553
+ * @param {string} [locale] Metadata localization to retrieve
554
+ * @param {*} [options] Override http request option.
555
+ * @throws {RequiredError}
556
+ */
557
+ getNftMetadata(principal: string, tokenId: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<NftMetadataResponse>;
558
+ /**
559
+ * Retrieves metadata for a SIP-013 Semi-Fungible Token
560
+ * @summary Semi-Fungible Token Metadata
561
+ * @param {string} principal SIP-013 compliant smart contract principal
562
+ * @param {number} tokenId Token ID to retrieve
563
+ * @param {string} [locale] Metadata localization to retrieve
564
+ * @param {*} [options] Override http request option.
565
+ * @throws {RequiredError}
566
+ */
567
+ getSftMetadata(principal: string, tokenId: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<SftMetadataResponse>;
568
+ };
569
+ /**
570
+ * TokensApi - factory interface
571
+ * @export
572
+ */
573
+ export declare const TokensApiFactory: (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) => {
574
+ /**
575
+ * Retrieves metadata for a SIP-010 Fungible Token
576
+ * @summary Fungible Token Metadata
577
+ * @param {string} principal Principal for the contract which owns the SIP-010 token
578
+ * @param {string} [locale] Metadata localization to retrieve
579
+ * @param {*} [options] Override http request option.
580
+ * @throws {RequiredError}
581
+ */
582
+ getFtMetadata(principal: string, locale?: string, options?: any): Promise<FtMetadataResponse>;
583
+ /**
584
+ * Retrieves metadata for a SIP-009 Non-Fungible Token
585
+ * @summary Non-Fungible Token Metadata
586
+ * @param {string} principal SIP-009 compliant smart contract principal
587
+ * @param {number} tokenId Token ID to retrieve
588
+ * @param {string} [locale] Metadata localization to retrieve
589
+ * @param {*} [options] Override http request option.
590
+ * @throws {RequiredError}
591
+ */
592
+ getNftMetadata(principal: string, tokenId: number, locale?: string, options?: any): Promise<NftMetadataResponse>;
593
+ /**
594
+ * Retrieves metadata for a SIP-013 Semi-Fungible Token
595
+ * @summary Semi-Fungible Token Metadata
596
+ * @param {string} principal SIP-013 compliant smart contract principal
597
+ * @param {number} tokenId Token ID to retrieve
598
+ * @param {string} [locale] Metadata localization to retrieve
599
+ * @param {*} [options] Override http request option.
600
+ * @throws {RequiredError}
601
+ */
602
+ getSftMetadata(principal: string, tokenId: number, locale?: string, options?: any): Promise<SftMetadataResponse>;
603
+ };
604
+ /**
605
+ * TokensApi - object-oriented interface
606
+ * @export
607
+ * @class TokensApi
608
+ * @extends {BaseAPI}
609
+ */
610
+ export declare class TokensApi extends BaseAPI {
611
+ /**
612
+ * Retrieves metadata for a SIP-010 Fungible Token
613
+ * @summary Fungible Token Metadata
614
+ * @param {string} principal Principal for the contract which owns the SIP-010 token
615
+ * @param {string} [locale] Metadata localization to retrieve
616
+ * @param {*} [options] Override http request option.
617
+ * @throws {RequiredError}
618
+ * @memberof TokensApi
619
+ */
620
+ getFtMetadata(principal: string, locale?: string, options?: any): Promise<FtMetadataResponse>;
621
+ /**
622
+ * Retrieves metadata for a SIP-009 Non-Fungible Token
623
+ * @summary Non-Fungible Token Metadata
624
+ * @param {string} principal SIP-009 compliant smart contract principal
625
+ * @param {number} tokenId Token ID to retrieve
626
+ * @param {string} [locale] Metadata localization to retrieve
627
+ * @param {*} [options] Override http request option.
628
+ * @throws {RequiredError}
629
+ * @memberof TokensApi
630
+ */
631
+ getNftMetadata(principal: string, tokenId: number, locale?: string, options?: any): Promise<NftMetadataResponse>;
632
+ /**
633
+ * Retrieves metadata for a SIP-013 Semi-Fungible Token
634
+ * @summary Semi-Fungible Token Metadata
635
+ * @param {string} principal SIP-013 compliant smart contract principal
636
+ * @param {number} tokenId Token ID to retrieve
637
+ * @param {string} [locale] Metadata localization to retrieve
638
+ * @param {*} [options] Override http request option.
639
+ * @throws {RequiredError}
640
+ * @memberof TokensApi
641
+ */
642
+ getSftMetadata(principal: string, tokenId: number, locale?: string, options?: any): Promise<SftMetadataResponse>;
643
+ }