@hirosystems/token-metadata-api-client 1.2.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/api.ts DELETED
@@ -1,1061 +0,0 @@
1
- /// <reference path="./custom.d.ts" />
2
- // tslint:disable
3
- /**
4
- * Token Metadata API
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
- *
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
-
15
- import * as url from "url";
16
- import * as isomorphicFetch from "isomorphic-fetch";
17
- import { Configuration } from "./configuration";
18
-
19
- const BASE_PATH = "https://api.hiro.so/".replace(/\/+$/, "");
20
-
21
- /**
22
- *
23
- * @export
24
- */
25
- export const COLLECTION_FORMATS = {
26
- csv: ",",
27
- ssv: " ",
28
- tsv: "\t",
29
- pipes: "|",
30
- };
31
-
32
- /**
33
- *
34
- * @export
35
- * @interface FetchAPI
36
- */
37
- export interface FetchAPI {
38
- (url: string, init?: any): Promise<Response>;
39
- }
40
-
41
- /**
42
- *
43
- * @export
44
- * @interface FetchArgs
45
- */
46
- export interface FetchArgs {
47
- url: string;
48
- options: any;
49
- }
50
-
51
- /**
52
- *
53
- * @export
54
- * @class BaseAPI
55
- */
56
- export class BaseAPI {
57
- protected configuration: Configuration;
58
-
59
- constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = isomorphicFetch) {
60
- if (configuration) {
61
- this.configuration = configuration;
62
- this.basePath = configuration.basePath || this.basePath;
63
- }
64
- }
65
- };
66
-
67
- /**
68
- *
69
- * @export
70
- * @class RequiredError
71
- * @extends {Error}
72
- */
73
- export class RequiredError extends Error {
74
- name: "RequiredError"
75
- constructor(public field: string, msg?: string) {
76
- super(msg);
77
- }
78
- }
79
-
80
- /**
81
- *
82
- * @export
83
- * @interface ApiJobCount
84
- */
85
- export interface ApiJobCount {
86
- /**
87
- *
88
- * @type {number}
89
- * @memberof ApiJobCount
90
- */
91
- pending?: number;
92
- /**
93
- *
94
- * @type {number}
95
- * @memberof ApiJobCount
96
- */
97
- queued?: number;
98
- /**
99
- *
100
- * @type {number}
101
- * @memberof ApiJobCount
102
- */
103
- done?: number;
104
- /**
105
- *
106
- * @type {number}
107
- * @memberof ApiJobCount
108
- */
109
- failed?: number;
110
- }
111
- /**
112
- *
113
- * @export
114
- * @interface ApiStatusResponse
115
- */
116
- export interface ApiStatusResponse {
117
- /**
118
- *
119
- * @type {string}
120
- * @memberof ApiStatusResponse
121
- */
122
- server_version: string;
123
- /**
124
- *
125
- * @type {string}
126
- * @memberof ApiStatusResponse
127
- */
128
- status: string;
129
- /**
130
- *
131
- * @type {ApiTokenCount}
132
- * @memberof ApiStatusResponse
133
- */
134
- tokens?: ApiTokenCount;
135
- /**
136
- *
137
- * @type {ApiTokenContractCount}
138
- * @memberof ApiStatusResponse
139
- */
140
- token_contracts?: ApiTokenContractCount;
141
- /**
142
- *
143
- * @type {ApiJobCount}
144
- * @memberof ApiStatusResponse
145
- */
146
- job_queue?: ApiJobCount;
147
- }
148
- /**
149
- *
150
- * @export
151
- * @interface ApiTokenContractCount
152
- */
153
- export interface ApiTokenContractCount {
154
- /**
155
- *
156
- * @type {number}
157
- * @memberof ApiTokenContractCount
158
- */
159
- sip_009?: number;
160
- /**
161
- *
162
- * @type {number}
163
- * @memberof ApiTokenContractCount
164
- */
165
- sip_010?: number;
166
- /**
167
- *
168
- * @type {number}
169
- * @memberof ApiTokenContractCount
170
- */
171
- sip_013?: number;
172
- }
173
- /**
174
- *
175
- * @export
176
- * @interface ApiTokenCount
177
- */
178
- export interface ApiTokenCount {
179
- /**
180
- *
181
- * @type {number}
182
- * @memberof ApiTokenCount
183
- */
184
- ft?: number;
185
- /**
186
- *
187
- * @type {number}
188
- * @memberof ApiTokenCount
189
- */
190
- nft?: number;
191
- /**
192
- *
193
- * @type {number}
194
- * @memberof ApiTokenCount
195
- */
196
- sft?: number;
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
- /**
272
- *
273
- * @type {string}
274
- * @memberof FtBasicMetadataResponse
275
- */
276
- contract_principal: string;
277
- }
278
- /**
279
- *
280
- * @export
281
- * @interface FtMetadataResponse
282
- */
283
- export interface FtMetadataResponse {
284
- /**
285
- *
286
- * @type {string}
287
- * @memberof FtMetadataResponse
288
- */
289
- name?: string;
290
- /**
291
- *
292
- * @type {string}
293
- * @memberof FtMetadataResponse
294
- */
295
- symbol?: string;
296
- /**
297
- *
298
- * @type {number}
299
- * @memberof FtMetadataResponse
300
- */
301
- decimals?: number;
302
- /**
303
- *
304
- * @type {string}
305
- * @memberof FtMetadataResponse
306
- */
307
- total_supply?: string;
308
- /**
309
- *
310
- * @type {string}
311
- * @memberof FtMetadataResponse
312
- */
313
- token_uri?: string;
314
- /**
315
- *
316
- * @type {string}
317
- * @memberof FtMetadataResponse
318
- */
319
- description?: string;
320
- /**
321
- *
322
- * @type {string}
323
- * @memberof FtMetadataResponse
324
- */
325
- image_uri?: string;
326
- /**
327
- *
328
- * @type {string}
329
- * @memberof FtMetadataResponse
330
- */
331
- image_canonical_uri?: string;
332
- /**
333
- *
334
- * @type {string}
335
- * @memberof FtMetadataResponse
336
- */
337
- tx_id: string;
338
- /**
339
- *
340
- * @type {string}
341
- * @memberof FtMetadataResponse
342
- */
343
- sender_address: string;
344
- /**
345
- *
346
- * @type {Metadata}
347
- * @memberof FtMetadataResponse
348
- */
349
- metadata?: Metadata;
350
- }
351
- /**
352
- *
353
- * @export
354
- * @interface Metadata
355
- */
356
- export interface Metadata {
357
- /**
358
- *
359
- * @type {number}
360
- * @memberof Metadata
361
- */
362
- sip: number;
363
- /**
364
- *
365
- * @type {string}
366
- * @memberof Metadata
367
- */
368
- name?: string;
369
- /**
370
- *
371
- * @type {string}
372
- * @memberof Metadata
373
- */
374
- description?: string;
375
- /**
376
- *
377
- * @type {string}
378
- * @memberof Metadata
379
- */
380
- image?: string;
381
- /**
382
- *
383
- * @type {string}
384
- * @memberof Metadata
385
- */
386
- cached_image?: string;
387
- /**
388
- *
389
- * @type {Array<MetadataAttribute>}
390
- * @memberof Metadata
391
- */
392
- attributes?: Array<MetadataAttribute>;
393
- /**
394
- *
395
- * @type {{ [key: string]: any; }}
396
- * @memberof Metadata
397
- */
398
- properties?: { [key: string]: any; };
399
- /**
400
- *
401
- * @type {MetadataLocalization}
402
- * @memberof Metadata
403
- */
404
- localization?: MetadataLocalization;
405
- }
406
- /**
407
- *
408
- * @export
409
- * @interface MetadataAttribute
410
- */
411
- export interface MetadataAttribute {
412
- /**
413
- *
414
- * @type {string}
415
- * @memberof MetadataAttribute
416
- */
417
- trait_type: string;
418
- /**
419
- *
420
- * @type {string}
421
- * @memberof MetadataAttribute
422
- */
423
- display_type?: string;
424
- /**
425
- *
426
- * @type {any}
427
- * @memberof MetadataAttribute
428
- */
429
- value: any;
430
- }
431
- /**
432
- *
433
- * @export
434
- * @interface MetadataLocalization
435
- */
436
- export interface MetadataLocalization {
437
- /**
438
- *
439
- * @type {string}
440
- * @memberof MetadataLocalization
441
- */
442
- uri: string;
443
- /**
444
- *
445
- * @type {string}
446
- * @memberof MetadataLocalization
447
- */
448
- _default: string;
449
- /**
450
- *
451
- * @type {Array<string>}
452
- * @memberof MetadataLocalization
453
- */
454
- locales: Array<string>;
455
- }
456
- /**
457
- *
458
- * @export
459
- * @interface NftMetadataResponse
460
- */
461
- export interface NftMetadataResponse {
462
- /**
463
- *
464
- * @type {string}
465
- * @memberof NftMetadataResponse
466
- */
467
- token_uri?: string;
468
- /**
469
- *
470
- * @type {Metadata}
471
- * @memberof NftMetadataResponse
472
- */
473
- metadata?: Metadata;
474
- }
475
- /**
476
- *
477
- * @export
478
- * @interface NotFoundErrorResponse
479
- */
480
- export interface NotFoundErrorResponse {
481
- }
482
- /**
483
- *
484
- * @export
485
- * @interface Order
486
- */
487
- export enum Order {
488
- asc = 'asc',
489
- desc = 'desc',
490
- }
491
- /**
492
- *
493
- * @export
494
- * @interface OrderBy
495
- */
496
- export enum OrderBy {
497
- name = 'name',
498
- symbol = 'symbol',
499
- }
500
- /**
501
- *
502
- * @export
503
- * @interface PaginatedFtBasicMetadataResponse
504
- */
505
- export interface PaginatedFtBasicMetadataResponse {
506
- /**
507
- *
508
- * @type {number}
509
- * @memberof PaginatedFtBasicMetadataResponse
510
- */
511
- limit: number;
512
- /**
513
- *
514
- * @type {number}
515
- * @memberof PaginatedFtBasicMetadataResponse
516
- */
517
- offset: number;
518
- /**
519
- *
520
- * @type {number}
521
- * @memberof PaginatedFtBasicMetadataResponse
522
- */
523
- total: number;
524
- /**
525
- *
526
- * @type {Array<FtBasicMetadataResponse>}
527
- * @memberof PaginatedFtBasicMetadataResponse
528
- */
529
- results: Array<FtBasicMetadataResponse>;
530
- }
531
- /**
532
- *
533
- * @export
534
- * @interface SftMetadataResponse
535
- */
536
- export interface SftMetadataResponse {
537
- /**
538
- *
539
- * @type {string}
540
- * @memberof SftMetadataResponse
541
- */
542
- token_uri?: string;
543
- /**
544
- *
545
- * @type {number}
546
- * @memberof SftMetadataResponse
547
- */
548
- decimals?: number;
549
- /**
550
- *
551
- * @type {string}
552
- * @memberof SftMetadataResponse
553
- */
554
- total_supply?: string;
555
- /**
556
- *
557
- * @type {Metadata}
558
- * @memberof SftMetadataResponse
559
- */
560
- metadata?: Metadata;
561
- }
562
- /**
563
- * StatusApi - fetch parameter creator
564
- * @export
565
- */
566
- export const StatusApiFetchParamCreator = function (configuration?: Configuration) {
567
- return {
568
- /**
569
- * Displays the status of the API and its current workload
570
- * @summary API Status
571
- * @param {*} [options] Override http request option.
572
- * @throws {RequiredError}
573
- */
574
- getApiStatus(options: any = {}): FetchArgs {
575
- const localVarPath = `/metadata/v1/`;
576
- const localVarUrlObj = url.parse(localVarPath, true);
577
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
578
- const localVarHeaderParameter = {} as any;
579
- const localVarQueryParameter = {} as any;
580
-
581
- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
582
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
583
- delete localVarUrlObj.search;
584
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
585
-
586
- return {
587
- url: url.format(localVarUrlObj),
588
- options: localVarRequestOptions,
589
- };
590
- },
591
- }
592
- };
593
-
594
- /**
595
- * StatusApi - functional programming interface
596
- * @export
597
- */
598
- export const StatusApiFp = function(configuration?: Configuration) {
599
- return {
600
- /**
601
- * Displays the status of the API and its current workload
602
- * @summary API Status
603
- * @param {*} [options] Override http request option.
604
- * @throws {RequiredError}
605
- */
606
- getApiStatus(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<ApiStatusResponse> {
607
- const localVarFetchArgs = StatusApiFetchParamCreator(configuration).getApiStatus(options);
608
- return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
609
- return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
610
- if (response.status >= 200 && response.status < 300) {
611
- return response.json();
612
- } else {
613
- throw response;
614
- }
615
- });
616
- };
617
- },
618
- }
619
- };
620
-
621
- /**
622
- * StatusApi - factory interface
623
- * @export
624
- */
625
- export const StatusApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
626
- return {
627
- /**
628
- * Displays the status of the API and its current workload
629
- * @summary API Status
630
- * @param {*} [options] Override http request option.
631
- * @throws {RequiredError}
632
- */
633
- getApiStatus(options?: any) {
634
- return StatusApiFp(configuration).getApiStatus(options)(fetch, basePath);
635
- },
636
- };
637
- };
638
-
639
- /**
640
- * StatusApi - object-oriented interface
641
- * @export
642
- * @class StatusApi
643
- * @extends {BaseAPI}
644
- */
645
- export class StatusApi extends BaseAPI {
646
- /**
647
- * Displays the status of the API and its current workload
648
- * @summary API Status
649
- * @param {*} [options] Override http request option.
650
- * @throws {RequiredError}
651
- * @memberof StatusApi
652
- */
653
- public getApiStatus(options?: any) {
654
- return StatusApiFp(this.configuration).getApiStatus(options)(this.fetch, this.basePath);
655
- }
656
-
657
- }
658
- /**
659
- * TokensApi - fetch parameter creator
660
- * @export
661
- */
662
- export const TokensApiFetchParamCreator = function (configuration?: Configuration) {
663
- return {
664
- /**
665
- * Retrieves metadata for a SIP-010 Fungible Token
666
- * @summary Fungible Token Metadata
667
- * @param {string} principal Principal for the contract which owns the SIP-010 token
668
- * @param {string} [locale] Metadata localization to retrieve
669
- * @param {*} [options] Override http request option.
670
- * @throws {RequiredError}
671
- */
672
- getFtMetadata(principal: string, locale?: string, options: any = {}): FetchArgs {
673
- // verify required parameter 'principal' is not null or undefined
674
- if (principal === null || principal === undefined) {
675
- throw new RequiredError('principal','Required parameter principal was null or undefined when calling getFtMetadata.');
676
- }
677
- const localVarPath = `/metadata/v1/ft/{principal}`
678
- .replace(`{${"principal"}}`, encodeURIComponent(String(principal)));
679
- const localVarUrlObj = url.parse(localVarPath, true);
680
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
681
- const localVarHeaderParameter = {} as any;
682
- const localVarQueryParameter = {} as any;
683
-
684
- if (locale !== undefined) {
685
- localVarQueryParameter['locale'] = locale;
686
- }
687
-
688
- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
689
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
690
- delete localVarUrlObj.search;
691
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
692
-
693
- return {
694
- url: url.format(localVarUrlObj),
695
- options: localVarRequestOptions,
696
- };
697
- },
698
- /**
699
- * Retrieves a list of Fungible Tokens
700
- * @summary Fungible Tokens
701
- * @param {string} [name]
702
- * @param {string} [symbol]
703
- * @param {string} [address] Stacks Address
704
- * @param {number} [offset] Result offset
705
- * @param {number} [limit] Results per page
706
- * @param {OrderBy} [order_by] Parameter to order results by
707
- * @param {Order} [order] Results order
708
- * @param {*} [options] Override http request option.
709
- * @throws {RequiredError}
710
- */
711
- getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options: any = {}): FetchArgs {
712
- const localVarPath = `/metadata/v1/ft`;
713
- const localVarUrlObj = url.parse(localVarPath, true);
714
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
715
- const localVarHeaderParameter = {} as any;
716
- const localVarQueryParameter = {} as any;
717
-
718
- if (name !== undefined) {
719
- localVarQueryParameter['name'] = name;
720
- }
721
-
722
- if (symbol !== undefined) {
723
- localVarQueryParameter['symbol'] = symbol;
724
- }
725
-
726
- if (address !== undefined) {
727
- localVarQueryParameter['address'] = address;
728
- }
729
-
730
- if (offset !== undefined) {
731
- localVarQueryParameter['offset'] = offset;
732
- }
733
-
734
- if (limit !== undefined) {
735
- localVarQueryParameter['limit'] = limit;
736
- }
737
-
738
- if (order_by !== undefined) {
739
- localVarQueryParameter['order_by'] = order_by;
740
- }
741
-
742
- if (order !== undefined) {
743
- localVarQueryParameter['order'] = order;
744
- }
745
-
746
- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
747
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
748
- delete localVarUrlObj.search;
749
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
750
-
751
- return {
752
- url: url.format(localVarUrlObj),
753
- options: localVarRequestOptions,
754
- };
755
- },
756
- /**
757
- * Retrieves metadata for a SIP-009 Non-Fungible Token
758
- * @summary Non-Fungible Token Metadata
759
- * @param {string} principal SIP-009 compliant smart contract principal
760
- * @param {number} token_id Token ID to retrieve
761
- * @param {string} [locale] Metadata localization to retrieve
762
- * @param {*} [options] Override http request option.
763
- * @throws {RequiredError}
764
- */
765
- getNftMetadata(principal: string, token_id: number, locale?: string, options: any = {}): FetchArgs {
766
- // verify required parameter 'principal' is not null or undefined
767
- if (principal === null || principal === undefined) {
768
- throw new RequiredError('principal','Required parameter principal was null or undefined when calling getNftMetadata.');
769
- }
770
- // verify required parameter 'token_id' is not null or undefined
771
- if (token_id === null || token_id === undefined) {
772
- throw new RequiredError('token_id','Required parameter token_id was null or undefined when calling getNftMetadata.');
773
- }
774
- const localVarPath = `/metadata/v1/nft/{principal}/{token_id}`
775
- .replace(`{${"principal"}}`, encodeURIComponent(String(principal)))
776
- .replace(`{${"token_id"}}`, encodeURIComponent(String(token_id)));
777
- const localVarUrlObj = url.parse(localVarPath, true);
778
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
779
- const localVarHeaderParameter = {} as any;
780
- const localVarQueryParameter = {} as any;
781
-
782
- if (locale !== undefined) {
783
- localVarQueryParameter['locale'] = locale;
784
- }
785
-
786
- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
787
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
788
- delete localVarUrlObj.search;
789
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
790
-
791
- return {
792
- url: url.format(localVarUrlObj),
793
- options: localVarRequestOptions,
794
- };
795
- },
796
- /**
797
- * Retrieves metadata for a SIP-013 Semi-Fungible Token
798
- * @summary Semi-Fungible Token Metadata
799
- * @param {string} principal SIP-013 compliant smart contract principal
800
- * @param {number} token_id Token ID to retrieve
801
- * @param {string} [locale] Metadata localization to retrieve
802
- * @param {*} [options] Override http request option.
803
- * @throws {RequiredError}
804
- */
805
- getSftMetadata(principal: string, token_id: number, locale?: string, options: any = {}): FetchArgs {
806
- // verify required parameter 'principal' is not null or undefined
807
- if (principal === null || principal === undefined) {
808
- throw new RequiredError('principal','Required parameter principal was null or undefined when calling getSftMetadata.');
809
- }
810
- // verify required parameter 'token_id' is not null or undefined
811
- if (token_id === null || token_id === undefined) {
812
- throw new RequiredError('token_id','Required parameter token_id was null or undefined when calling getSftMetadata.');
813
- }
814
- const localVarPath = `/metadata/v1/sft/{principal}/{token_id}`
815
- .replace(`{${"principal"}}`, encodeURIComponent(String(principal)))
816
- .replace(`{${"token_id"}}`, encodeURIComponent(String(token_id)));
817
- const localVarUrlObj = url.parse(localVarPath, true);
818
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
819
- const localVarHeaderParameter = {} as any;
820
- const localVarQueryParameter = {} as any;
821
-
822
- if (locale !== undefined) {
823
- localVarQueryParameter['locale'] = locale;
824
- }
825
-
826
- localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
827
- // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
828
- delete localVarUrlObj.search;
829
- localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
830
-
831
- return {
832
- url: url.format(localVarUrlObj),
833
- options: localVarRequestOptions,
834
- };
835
- },
836
- }
837
- };
838
-
839
- /**
840
- * TokensApi - functional programming interface
841
- * @export
842
- */
843
- export const TokensApiFp = function(configuration?: Configuration) {
844
- return {
845
- /**
846
- * Retrieves metadata for a SIP-010 Fungible Token
847
- * @summary Fungible Token Metadata
848
- * @param {string} principal Principal for the contract which owns the SIP-010 token
849
- * @param {string} [locale] Metadata localization to retrieve
850
- * @param {*} [options] Override http request option.
851
- * @throws {RequiredError}
852
- */
853
- getFtMetadata(principal: string, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<FtMetadataResponse> {
854
- const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getFtMetadata(principal, locale, options);
855
- return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
856
- return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
857
- if (response.status >= 200 && response.status < 300) {
858
- return response.json();
859
- } else {
860
- throw response;
861
- }
862
- });
863
- };
864
- },
865
- /**
866
- * Retrieves a list of Fungible Tokens
867
- * @summary Fungible Tokens
868
- * @param {string} [name]
869
- * @param {string} [symbol]
870
- * @param {string} [address] Stacks Address
871
- * @param {number} [offset] Result offset
872
- * @param {number} [limit] Results per page
873
- * @param {OrderBy} [order_by] Parameter to order results by
874
- * @param {Order} [order] Results order
875
- * @param {*} [options] Override http request option.
876
- * @throws {RequiredError}
877
- */
878
- getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<PaginatedFtBasicMetadataResponse> {
879
- const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options);
880
- return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
881
- return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
882
- if (response.status >= 200 && response.status < 300) {
883
- return response.json();
884
- } else {
885
- throw response;
886
- }
887
- });
888
- };
889
- },
890
- /**
891
- * Retrieves metadata for a SIP-009 Non-Fungible Token
892
- * @summary Non-Fungible Token Metadata
893
- * @param {string} principal SIP-009 compliant smart contract principal
894
- * @param {number} token_id Token ID to retrieve
895
- * @param {string} [locale] Metadata localization to retrieve
896
- * @param {*} [options] Override http request option.
897
- * @throws {RequiredError}
898
- */
899
- getNftMetadata(principal: string, token_id: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<NftMetadataResponse> {
900
- const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getNftMetadata(principal, token_id, locale, options);
901
- return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
902
- return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
903
- if (response.status >= 200 && response.status < 300) {
904
- return response.json();
905
- } else {
906
- throw response;
907
- }
908
- });
909
- };
910
- },
911
- /**
912
- * Retrieves metadata for a SIP-013 Semi-Fungible Token
913
- * @summary Semi-Fungible Token Metadata
914
- * @param {string} principal SIP-013 compliant smart contract principal
915
- * @param {number} token_id Token ID to retrieve
916
- * @param {string} [locale] Metadata localization to retrieve
917
- * @param {*} [options] Override http request option.
918
- * @throws {RequiredError}
919
- */
920
- getSftMetadata(principal: string, token_id: number, locale?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<SftMetadataResponse> {
921
- const localVarFetchArgs = TokensApiFetchParamCreator(configuration).getSftMetadata(principal, token_id, locale, options);
922
- return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
923
- return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
924
- if (response.status >= 200 && response.status < 300) {
925
- return response.json();
926
- } else {
927
- throw response;
928
- }
929
- });
930
- };
931
- },
932
- }
933
- };
934
-
935
- /**
936
- * TokensApi - factory interface
937
- * @export
938
- */
939
- export const TokensApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
940
- return {
941
- /**
942
- * Retrieves metadata for a SIP-010 Fungible Token
943
- * @summary Fungible Token Metadata
944
- * @param {string} principal Principal for the contract which owns the SIP-010 token
945
- * @param {string} [locale] Metadata localization to retrieve
946
- * @param {*} [options] Override http request option.
947
- * @throws {RequiredError}
948
- */
949
- getFtMetadata(principal: string, locale?: string, options?: any) {
950
- return TokensApiFp(configuration).getFtMetadata(principal, locale, options)(fetch, basePath);
951
- },
952
- /**
953
- * Retrieves a list of Fungible Tokens
954
- * @summary Fungible Tokens
955
- * @param {string} [name]
956
- * @param {string} [symbol]
957
- * @param {string} [address] Stacks Address
958
- * @param {number} [offset] Result offset
959
- * @param {number} [limit] Results per page
960
- * @param {OrderBy} [order_by] Parameter to order results by
961
- * @param {Order} [order] Results order
962
- * @param {*} [options] Override http request option.
963
- * @throws {RequiredError}
964
- */
965
- getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
966
- return TokensApiFp(configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(fetch, basePath);
967
- },
968
- /**
969
- * Retrieves metadata for a SIP-009 Non-Fungible Token
970
- * @summary Non-Fungible Token Metadata
971
- * @param {string} principal SIP-009 compliant smart contract principal
972
- * @param {number} token_id Token ID to retrieve
973
- * @param {string} [locale] Metadata localization to retrieve
974
- * @param {*} [options] Override http request option.
975
- * @throws {RequiredError}
976
- */
977
- getNftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
978
- return TokensApiFp(configuration).getNftMetadata(principal, token_id, locale, options)(fetch, basePath);
979
- },
980
- /**
981
- * Retrieves metadata for a SIP-013 Semi-Fungible Token
982
- * @summary Semi-Fungible Token Metadata
983
- * @param {string} principal SIP-013 compliant smart contract principal
984
- * @param {number} token_id Token ID to retrieve
985
- * @param {string} [locale] Metadata localization to retrieve
986
- * @param {*} [options] Override http request option.
987
- * @throws {RequiredError}
988
- */
989
- getSftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
990
- return TokensApiFp(configuration).getSftMetadata(principal, token_id, locale, options)(fetch, basePath);
991
- },
992
- };
993
- };
994
-
995
- /**
996
- * TokensApi - object-oriented interface
997
- * @export
998
- * @class TokensApi
999
- * @extends {BaseAPI}
1000
- */
1001
- export class TokensApi extends BaseAPI {
1002
- /**
1003
- * Retrieves metadata for a SIP-010 Fungible Token
1004
- * @summary Fungible Token Metadata
1005
- * @param {string} principal Principal for the contract which owns the SIP-010 token
1006
- * @param {string} [locale] Metadata localization to retrieve
1007
- * @param {*} [options] Override http request option.
1008
- * @throws {RequiredError}
1009
- * @memberof TokensApi
1010
- */
1011
- public getFtMetadata(principal: string, locale?: string, options?: any) {
1012
- return TokensApiFp(this.configuration).getFtMetadata(principal, locale, options)(this.fetch, this.basePath);
1013
- }
1014
-
1015
- /**
1016
- * Retrieves a list of Fungible Tokens
1017
- * @summary Fungible Tokens
1018
- * @param {string} [name]
1019
- * @param {string} [symbol]
1020
- * @param {string} [address] Stacks Address
1021
- * @param {number} [offset] Result offset
1022
- * @param {number} [limit] Results per page
1023
- * @param {OrderBy} [order_by] Parameter to order results by
1024
- * @param {Order} [order] Results order
1025
- * @param {*} [options] Override http request option.
1026
- * @throws {RequiredError}
1027
- * @memberof TokensApi
1028
- */
1029
- public getFungibleTokens(name?: string, symbol?: string, address?: string, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
1030
- return TokensApiFp(this.configuration).getFungibleTokens(name, symbol, address, offset, limit, order_by, order, options)(this.fetch, this.basePath);
1031
- }
1032
-
1033
- /**
1034
- * Retrieves metadata for a SIP-009 Non-Fungible Token
1035
- * @summary Non-Fungible Token Metadata
1036
- * @param {string} principal SIP-009 compliant smart contract principal
1037
- * @param {number} token_id Token ID to retrieve
1038
- * @param {string} [locale] Metadata localization to retrieve
1039
- * @param {*} [options] Override http request option.
1040
- * @throws {RequiredError}
1041
- * @memberof TokensApi
1042
- */
1043
- public getNftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
1044
- return TokensApiFp(this.configuration).getNftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
1045
- }
1046
-
1047
- /**
1048
- * Retrieves metadata for a SIP-013 Semi-Fungible Token
1049
- * @summary Semi-Fungible Token Metadata
1050
- * @param {string} principal SIP-013 compliant smart contract principal
1051
- * @param {number} token_id Token ID to retrieve
1052
- * @param {string} [locale] Metadata localization to retrieve
1053
- * @param {*} [options] Override http request option.
1054
- * @throws {RequiredError}
1055
- * @memberof TokensApi
1056
- */
1057
- public getSftMetadata(principal: string, token_id: number, locale?: string, options?: any) {
1058
- return TokensApiFp(this.configuration).getSftMetadata(principal, token_id, locale, options)(this.fetch, this.basePath);
1059
- }
1060
-
1061
- }