@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.
@@ -0,0 +1,692 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+
6
+ export interface paths {
7
+ "/metadata/v1/ft": {
8
+ parameters: {
9
+ query?: never;
10
+ header?: never;
11
+ path?: never;
12
+ cookie?: never;
13
+ };
14
+ /**
15
+ * Fungible Tokens
16
+ * @description Retrieves a list of Fungible Tokens
17
+ */
18
+ get: operations["getFungibleTokens"];
19
+ put?: never;
20
+ post?: never;
21
+ delete?: never;
22
+ options?: never;
23
+ head?: never;
24
+ patch?: never;
25
+ trace?: never;
26
+ };
27
+ "/metadata/v1/ft/{principal}": {
28
+ parameters: {
29
+ query?: never;
30
+ header?: never;
31
+ path?: never;
32
+ cookie?: never;
33
+ };
34
+ /**
35
+ * Fungible Token Metadata
36
+ * @description Retrieves metadata for a SIP-010 Fungible Token
37
+ */
38
+ get: operations["getFtMetadata"];
39
+ put?: never;
40
+ post?: never;
41
+ delete?: never;
42
+ options?: never;
43
+ head?: never;
44
+ patch?: never;
45
+ trace?: never;
46
+ };
47
+ "/metadata/v1/nft/{principal}/{token_id}": {
48
+ parameters: {
49
+ query?: never;
50
+ header?: never;
51
+ path?: never;
52
+ cookie?: never;
53
+ };
54
+ /**
55
+ * Non-Fungible Token Metadata
56
+ * @description Retrieves metadata for a SIP-009 Non-Fungible Token
57
+ */
58
+ get: operations["getNftMetadata"];
59
+ put?: never;
60
+ post?: never;
61
+ delete?: never;
62
+ options?: never;
63
+ head?: never;
64
+ patch?: never;
65
+ trace?: never;
66
+ };
67
+ "/metadata/v1/sft/{principal}/{token_id}": {
68
+ parameters: {
69
+ query?: never;
70
+ header?: never;
71
+ path?: never;
72
+ cookie?: never;
73
+ };
74
+ /**
75
+ * Semi-Fungible Token Metadata
76
+ * @description Retrieves metadata for a SIP-013 Semi-Fungible Token
77
+ */
78
+ get: operations["getSftMetadata"];
79
+ put?: never;
80
+ post?: never;
81
+ delete?: never;
82
+ options?: never;
83
+ head?: never;
84
+ patch?: never;
85
+ trace?: never;
86
+ };
87
+ "/metadata/v1/": {
88
+ parameters: {
89
+ query?: never;
90
+ header?: never;
91
+ path?: never;
92
+ cookie?: never;
93
+ };
94
+ /**
95
+ * API Status
96
+ * @description Displays the status of the API and its current workload
97
+ */
98
+ get: operations["getApiStatus"];
99
+ put?: never;
100
+ post?: never;
101
+ delete?: never;
102
+ options?: never;
103
+ head?: never;
104
+ patch?: never;
105
+ trace?: never;
106
+ };
107
+ }
108
+ export type webhooks = Record<string, never>;
109
+ export interface components {
110
+ schemas: never;
111
+ responses: never;
112
+ parameters: never;
113
+ requestBodies: never;
114
+ headers: never;
115
+ pathItems: never;
116
+ }
117
+ export type $defs = Record<string, never>;
118
+ export interface operations {
119
+ getFungibleTokens: {
120
+ parameters: {
121
+ query?: {
122
+ name?: string;
123
+ symbol?: string;
124
+ /**
125
+ * @description Stacks Address
126
+ * @example SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9
127
+ */
128
+ address?: string;
129
+ /** @description Result offset */
130
+ offset?: number;
131
+ /** @description Results per page */
132
+ limit?: number;
133
+ /** @description Parameter to order results by */
134
+ order_by?: "name" | "symbol";
135
+ /** @description Results order */
136
+ order?: "asc" | "desc";
137
+ };
138
+ header?: never;
139
+ path?: never;
140
+ cookie?: never;
141
+ };
142
+ requestBody?: never;
143
+ responses: {
144
+ /** @description Default Response */
145
+ 200: {
146
+ headers: {
147
+ [name: string]: unknown;
148
+ };
149
+ content: {
150
+ "application/json": {
151
+ /** @example 20 */
152
+ limit: number;
153
+ /** @example 0 */
154
+ offset: number;
155
+ /** @example 1 */
156
+ total: number;
157
+ results: {
158
+ /** @example Wrapped USD */
159
+ name?: string;
160
+ /** @example xUSD */
161
+ symbol?: string;
162
+ /** @example 8 */
163
+ decimals?: number;
164
+ /** @example 9999980000000 */
165
+ total_supply?: string;
166
+ /**
167
+ * Format: uri
168
+ * @example ipfs://ipfs/Qmf9yDYuPTrp8NRUFf8xxDd5Ud24Dx9uYMwMn8o8G2cWPW/12200.json
169
+ */
170
+ token_uri?: string;
171
+ /** @example Heavy hitters, all-stars and legends of the game join forces to create a collection of unique varsity jackets */
172
+ description?: string;
173
+ /**
174
+ * Format: uri
175
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
176
+ */
177
+ image_uri?: string;
178
+ /**
179
+ * Format: uri
180
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
181
+ */
182
+ image_thumbnail_uri?: string;
183
+ /**
184
+ * Format: uri
185
+ * @example ipfs://ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
186
+ */
187
+ image_canonical_uri?: string;
188
+ /** @example 0xef2ac1126e16f46843228b1dk4830e19eb7599129e4jf392cab9e65ae83a45c0 */
189
+ tx_id: string;
190
+ /** @example ST399W7Z9WS0GMSNQGJGME5JAENKN56D65VGMGKGA */
191
+ sender_address: string;
192
+ /** @example SP1H1733V5MZ3SZ9XRW9FKYGEZT0JDGEB8Y634C7R.miamicoin-token-v2 */
193
+ contract_principal: string;
194
+ }[];
195
+ };
196
+ };
197
+ };
198
+ };
199
+ };
200
+ getFtMetadata: {
201
+ parameters: {
202
+ query?: {
203
+ /** @description Metadata localization to retrieve */
204
+ locale?: string;
205
+ };
206
+ header?: never;
207
+ path: {
208
+ /**
209
+ * @description Principal for the contract which owns the SIP-010 token
210
+ * @example SP32XCD69XPS3GKDEXAQ29PJRDSD5AR643GNEEBXZ.fari-token
211
+ */
212
+ principal: string;
213
+ };
214
+ cookie?: never;
215
+ };
216
+ requestBody?: never;
217
+ responses: {
218
+ /** @description Default Response */
219
+ 200: {
220
+ headers: {
221
+ [name: string]: unknown;
222
+ };
223
+ content: {
224
+ "application/json": {
225
+ /** @example Wrapped USD */
226
+ name?: string;
227
+ /** @example xUSD */
228
+ symbol?: string;
229
+ /** @example 8 */
230
+ decimals?: number;
231
+ /** @example 9999980000000 */
232
+ total_supply?: string;
233
+ /**
234
+ * Format: uri
235
+ * @example ipfs://ipfs/Qmf9yDYuPTrp8NRUFf8xxDd5Ud24Dx9uYMwMn8o8G2cWPW/12200.json
236
+ */
237
+ token_uri?: string;
238
+ /** @example Heavy hitters, all-stars and legends of the game join forces to create a collection of unique varsity jackets */
239
+ description?: string;
240
+ /**
241
+ * Format: uri
242
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
243
+ */
244
+ image_uri?: string;
245
+ /**
246
+ * Format: uri
247
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
248
+ */
249
+ image_thumbnail_uri?: string;
250
+ /**
251
+ * Format: uri
252
+ * @example ipfs://ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
253
+ */
254
+ image_canonical_uri?: string;
255
+ /** @example 0x5642ca7d68976b6b2a2055689d9a57de26d67f0dd8b016d1b0d94cb634454cdd */
256
+ tx_id: string;
257
+ /** @example SPZA22A4D15RKH5G8XDGQ7BPC20Q5JNMH0VQKSR6 */
258
+ sender_address: string;
259
+ /** @example SPZA22A4D15RKH5G8XDGQ7BPC20Q5JNMH0VQKSR6.token-ststx-earn-v1::stSTXearn */
260
+ asset_identifier: string;
261
+ /** Metadata */
262
+ metadata?: {
263
+ /** @example 16 */
264
+ sip: number;
265
+ /** @example Satoshi's Team #12200 */
266
+ name?: string;
267
+ /** @example Heavy hitters, all-stars and legends of the game join forces to create a collection of unique varsity jackets */
268
+ description?: string;
269
+ /**
270
+ * Format: uri
271
+ * @example ipfs://ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
272
+ */
273
+ image?: string;
274
+ /**
275
+ * Format: uri
276
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
277
+ */
278
+ cached_image?: string;
279
+ /**
280
+ * Format: uri
281
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
282
+ */
283
+ cached_thumbnail_image?: string;
284
+ attributes?: {
285
+ /** @example Background */
286
+ trait_type: string;
287
+ /** @example string */
288
+ display_type?: string;
289
+ /**
290
+ * Metadata Value
291
+ * @example value
292
+ */
293
+ value: unknown;
294
+ }[];
295
+ /**
296
+ * Metadata Properties
297
+ * @example {
298
+ * "collection": "Foo Collection",
299
+ * "total_supply": "10000"
300
+ * }
301
+ */
302
+ properties?: {
303
+ [key: string]: unknown;
304
+ };
305
+ /** Metadata Localization */
306
+ localization?: {
307
+ /**
308
+ * Format: uri
309
+ * @example http://token.com/metadata?hl={locale}
310
+ */
311
+ uri: string;
312
+ /** @example en */
313
+ default: string;
314
+ /** @example [
315
+ * "en",
316
+ * "jp"
317
+ * ] */
318
+ locales: string[];
319
+ };
320
+ };
321
+ };
322
+ };
323
+ };
324
+ /** @description Default Response */
325
+ 404: {
326
+ headers: {
327
+ [name: string]: unknown;
328
+ };
329
+ content: {
330
+ "application/json": {
331
+ /** @enum {string} */
332
+ error: "Token not found";
333
+ } | {
334
+ /** @enum {string} */
335
+ error: "Contract not found";
336
+ };
337
+ };
338
+ };
339
+ /** @description Default Response */
340
+ 422: {
341
+ headers: {
342
+ [name: string]: unknown;
343
+ };
344
+ content: {
345
+ "application/json": {
346
+ /** @enum {string} */
347
+ error: "Token metadata fetch in progress";
348
+ } | {
349
+ /** @enum {string} */
350
+ error: "Locale not found";
351
+ } | {
352
+ /** @enum {string} */
353
+ error: "Token error";
354
+ message: string;
355
+ };
356
+ };
357
+ };
358
+ };
359
+ };
360
+ getNftMetadata: {
361
+ parameters: {
362
+ query?: {
363
+ /** @description Metadata localization to retrieve */
364
+ locale?: string;
365
+ };
366
+ header?: never;
367
+ path: {
368
+ /**
369
+ * @description SIP-009 compliant smart contract principal
370
+ * @example SP497E7RX3233ATBS2AB9G4WTHB63X5PBSP5VGAQ.boomboxes-cycle-12
371
+ */
372
+ principal: string;
373
+ /**
374
+ * @description Token ID to retrieve
375
+ * @example 35
376
+ */
377
+ token_id: number;
378
+ };
379
+ cookie?: never;
380
+ };
381
+ requestBody?: never;
382
+ responses: {
383
+ /** @description Default Response */
384
+ 200: {
385
+ headers: {
386
+ [name: string]: unknown;
387
+ };
388
+ content: {
389
+ "application/json": {
390
+ /**
391
+ * Format: uri
392
+ * @example ipfs://ipfs/Qmf9yDYuPTrp8NRUFf8xxDd5Ud24Dx9uYMwMn8o8G2cWPW/12200.json
393
+ */
394
+ token_uri?: string;
395
+ /** Metadata */
396
+ metadata?: {
397
+ /** @example 16 */
398
+ sip: number;
399
+ /** @example Satoshi's Team #12200 */
400
+ name?: string;
401
+ /** @example Heavy hitters, all-stars and legends of the game join forces to create a collection of unique varsity jackets */
402
+ description?: string;
403
+ /**
404
+ * Format: uri
405
+ * @example ipfs://ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
406
+ */
407
+ image?: string;
408
+ /**
409
+ * Format: uri
410
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
411
+ */
412
+ cached_image?: string;
413
+ /**
414
+ * Format: uri
415
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
416
+ */
417
+ cached_thumbnail_image?: string;
418
+ attributes?: {
419
+ /** @example Background */
420
+ trait_type: string;
421
+ /** @example string */
422
+ display_type?: string;
423
+ /**
424
+ * Metadata Value
425
+ * @example value
426
+ */
427
+ value: unknown;
428
+ }[];
429
+ /**
430
+ * Metadata Properties
431
+ * @example {
432
+ * "collection": "Foo Collection",
433
+ * "total_supply": "10000"
434
+ * }
435
+ */
436
+ properties?: {
437
+ [key: string]: unknown;
438
+ };
439
+ /** Metadata Localization */
440
+ localization?: {
441
+ /**
442
+ * Format: uri
443
+ * @example http://token.com/metadata?hl={locale}
444
+ */
445
+ uri: string;
446
+ /** @example en */
447
+ default: string;
448
+ /** @example [
449
+ * "en",
450
+ * "jp"
451
+ * ] */
452
+ locales: string[];
453
+ };
454
+ };
455
+ };
456
+ };
457
+ };
458
+ /** @description Default Response */
459
+ 404: {
460
+ headers: {
461
+ [name: string]: unknown;
462
+ };
463
+ content: {
464
+ "application/json": {
465
+ /** @enum {string} */
466
+ error: "Token not found";
467
+ } | {
468
+ /** @enum {string} */
469
+ error: "Contract not found";
470
+ };
471
+ };
472
+ };
473
+ /** @description Default Response */
474
+ 422: {
475
+ headers: {
476
+ [name: string]: unknown;
477
+ };
478
+ content: {
479
+ "application/json": {
480
+ /** @enum {string} */
481
+ error: "Token metadata fetch in progress";
482
+ } | {
483
+ /** @enum {string} */
484
+ error: "Locale not found";
485
+ } | {
486
+ /** @enum {string} */
487
+ error: "Token error";
488
+ message: string;
489
+ };
490
+ };
491
+ };
492
+ };
493
+ };
494
+ getSftMetadata: {
495
+ parameters: {
496
+ query?: {
497
+ /** @description Metadata localization to retrieve */
498
+ locale?: string;
499
+ };
500
+ header?: never;
501
+ path: {
502
+ /**
503
+ * @description SIP-013 compliant smart contract principal
504
+ * @example SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.key-alex-autoalex-v1
505
+ */
506
+ principal: string;
507
+ /**
508
+ * @description Token ID to retrieve
509
+ * @example 35
510
+ */
511
+ token_id: number;
512
+ };
513
+ cookie?: never;
514
+ };
515
+ requestBody?: never;
516
+ responses: {
517
+ /** @description Default Response */
518
+ 200: {
519
+ headers: {
520
+ [name: string]: unknown;
521
+ };
522
+ content: {
523
+ "application/json": {
524
+ /**
525
+ * Format: uri
526
+ * @example ipfs://ipfs/Qmf9yDYuPTrp8NRUFf8xxDd5Ud24Dx9uYMwMn8o8G2cWPW/12200.json
527
+ */
528
+ token_uri?: string;
529
+ /** @example 6 */
530
+ decimals?: number;
531
+ /** @example 250 */
532
+ total_supply?: string;
533
+ /** Metadata */
534
+ metadata?: {
535
+ /** @example 16 */
536
+ sip: number;
537
+ /** @example Satoshi's Team #12200 */
538
+ name?: string;
539
+ /** @example Heavy hitters, all-stars and legends of the game join forces to create a collection of unique varsity jackets */
540
+ description?: string;
541
+ /**
542
+ * Format: uri
543
+ * @example ipfs://ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
544
+ */
545
+ image?: string;
546
+ /**
547
+ * Format: uri
548
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
549
+ */
550
+ cached_image?: string;
551
+ /**
552
+ * Format: uri
553
+ * @example https://ipfs.io/ipfs/QmZMqhh2ztwuZ3Y8PyEp2z5auyH3TCm3nnr5ZfjjgDjd5q/12199.png
554
+ */
555
+ cached_thumbnail_image?: string;
556
+ attributes?: {
557
+ /** @example Background */
558
+ trait_type: string;
559
+ /** @example string */
560
+ display_type?: string;
561
+ /**
562
+ * Metadata Value
563
+ * @example value
564
+ */
565
+ value: unknown;
566
+ }[];
567
+ /**
568
+ * Metadata Properties
569
+ * @example {
570
+ * "collection": "Foo Collection",
571
+ * "total_supply": "10000"
572
+ * }
573
+ */
574
+ properties?: {
575
+ [key: string]: unknown;
576
+ };
577
+ /** Metadata Localization */
578
+ localization?: {
579
+ /**
580
+ * Format: uri
581
+ * @example http://token.com/metadata?hl={locale}
582
+ */
583
+ uri: string;
584
+ /** @example en */
585
+ default: string;
586
+ /** @example [
587
+ * "en",
588
+ * "jp"
589
+ * ] */
590
+ locales: string[];
591
+ };
592
+ };
593
+ };
594
+ };
595
+ };
596
+ /** @description Default Response */
597
+ 404: {
598
+ headers: {
599
+ [name: string]: unknown;
600
+ };
601
+ content: {
602
+ "application/json": {
603
+ /** @enum {string} */
604
+ error: "Token not found";
605
+ } | {
606
+ /** @enum {string} */
607
+ error: "Contract not found";
608
+ };
609
+ };
610
+ };
611
+ /** @description Default Response */
612
+ 422: {
613
+ headers: {
614
+ [name: string]: unknown;
615
+ };
616
+ content: {
617
+ "application/json": {
618
+ /** @enum {string} */
619
+ error: "Token metadata fetch in progress";
620
+ } | {
621
+ /** @enum {string} */
622
+ error: "Locale not found";
623
+ } | {
624
+ /** @enum {string} */
625
+ error: "Token error";
626
+ message: string;
627
+ };
628
+ };
629
+ };
630
+ };
631
+ };
632
+ getApiStatus: {
633
+ parameters: {
634
+ query?: never;
635
+ header?: never;
636
+ path?: never;
637
+ cookie?: never;
638
+ };
639
+ requestBody?: never;
640
+ responses: {
641
+ /** @description Default Response */
642
+ 200: {
643
+ headers: {
644
+ [name: string]: unknown;
645
+ };
646
+ content: {
647
+ "application/json": {
648
+ /** @example token-metadata-api v0.0.1 (master:a1b2c3) */
649
+ server_version: string;
650
+ /** @example ready */
651
+ status: string;
652
+ chain_tip: {
653
+ /** @example 163541 */
654
+ block_height: number;
655
+ };
656
+ /** Api Token Count */
657
+ tokens?: {
658
+ /** @example 512 */
659
+ ft?: number;
660
+ /** @example 493452 */
661
+ nft?: number;
662
+ /** @example 44 */
663
+ sft?: number;
664
+ };
665
+ /** Api Token Contract Count */
666
+ token_contracts?: {
667
+ /** @example 3101 */
668
+ "sip-009"?: number;
669
+ /** @example 512 */
670
+ "sip-010"?: number;
671
+ /** @example 11 */
672
+ "sip-013"?: number;
673
+ };
674
+ /** Api Job Count */
675
+ job_queue?: {
676
+ /** @example 430562 */
677
+ pending?: number;
678
+ /** @example 512 */
679
+ queued?: number;
680
+ /** @example 12532 */
681
+ done?: number;
682
+ /** @example 11 */
683
+ failed?: number;
684
+ /** @example 20 */
685
+ invalid?: number;
686
+ };
687
+ };
688
+ };
689
+ };
690
+ };
691
+ };
692
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { ClientOptions } from "openapi-fetch";
2
+ import type { paths } from "./generated/schema";
3
+ export declare function createClient(options?: ClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
4
+ export * from 'openapi-fetch';