@zoralabs/coins-sdk 0.5.1 → 0.6.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/CHANGELOG.md +22 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/queries.d.ts +13 -1
- package/dist/api/queries.d.ts.map +1 -1
- package/dist/api/social.d.ts +8 -0
- package/dist/api/social.d.ts.map +1 -0
- package/dist/client/sdk.gen.d.ts +256 -4
- package/dist/client/sdk.gen.d.ts.map +1 -1
- package/dist/client/types.gen.d.ts +835 -102
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/index.cjs +129 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +128 -18
- package/dist/index.js.map +1 -1
- package/dist/uploader/providers/zora.d.ts +6 -3
- package/dist/uploader/providers/zora.d.ts.map +1 -1
- package/dist/uploader/types.d.ts +10 -1
- package/dist/uploader/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/index.ts +4 -0
- package/src/api/queries.ts +58 -0
- package/src/api/social.ts +23 -0
- package/src/client/sdk.gen.ts +98 -0
- package/src/client/types.gen.ts +847 -94
- package/src/index.ts +4 -0
- package/src/uploader/providers/zora.ts +61 -19
- package/src/uploader/tests/providers.test.ts +169 -49
- package/src/uploader/types.ts +11 -1
package/src/api/queries.ts
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
GetCoinData,
|
|
5
5
|
GetCoinHoldersData,
|
|
6
6
|
GetCoinHoldersResponse,
|
|
7
|
+
GetCoinPriceHistoryData,
|
|
8
|
+
GetCoinPriceHistoryResponse,
|
|
7
9
|
GetCoinResponse,
|
|
8
10
|
GetCoinsData,
|
|
9
11
|
GetCoinsResponse,
|
|
@@ -27,12 +29,17 @@ import {
|
|
|
27
29
|
GetContentCoinPoolConfigResponse,
|
|
28
30
|
GetCreatorCoinPoolConfigData,
|
|
29
31
|
GetCreatorCoinPoolConfigResponse,
|
|
32
|
+
GetCreatorLivestreamCommentsData,
|
|
33
|
+
GetCreatorLivestreamCommentsResponse,
|
|
34
|
+
GetWalletTradeActivityData,
|
|
35
|
+
GetWalletTradeActivityResponse,
|
|
30
36
|
} from "../client/types.gen";
|
|
31
37
|
import {
|
|
32
38
|
getCoin as getCoinSDK,
|
|
33
39
|
getCoins as getCoinsSDK,
|
|
34
40
|
getCoinComments as getCoinCommentsSDK,
|
|
35
41
|
getCoinHolders as getCoinHoldersSDK,
|
|
42
|
+
getCoinPriceHistory as getCoinPriceHistorySDK,
|
|
36
43
|
getCoinSwaps as getCoinSwapsSDK,
|
|
37
44
|
getProfile as getProfileSDK,
|
|
38
45
|
getProfileBalances as getProfileBalancesSDK,
|
|
@@ -43,6 +50,8 @@ import {
|
|
|
43
50
|
getTraderLeaderboard as getTraderLeaderboardSDK,
|
|
44
51
|
getContentCoinPoolConfig as getContentCoinPoolConfigSDK,
|
|
45
52
|
getCreatorCoinPoolConfig as getCreatorCoinPoolConfigSDK,
|
|
53
|
+
getCreatorLivestreamComments as getCreatorLivestreamCommentsSDK,
|
|
54
|
+
getWalletTradeActivity as getWalletTradeActivitySDK,
|
|
46
55
|
} from "../client/sdk.gen";
|
|
47
56
|
import { getApiKeyMeta } from "./api-key";
|
|
48
57
|
import { RequestOptionsType } from "./query-types";
|
|
@@ -99,6 +108,21 @@ export const getCoinHolders = async (
|
|
|
99
108
|
});
|
|
100
109
|
};
|
|
101
110
|
|
|
111
|
+
type GetCoinPriceHistoryQuery = GetCoinPriceHistoryData["query"];
|
|
112
|
+
export type { GetCoinPriceHistoryQuery, GetCoinPriceHistoryData };
|
|
113
|
+
export type { GetCoinPriceHistoryResponse } from "../client/types.gen";
|
|
114
|
+
|
|
115
|
+
export const getCoinPriceHistory = async (
|
|
116
|
+
query: GetCoinPriceHistoryQuery,
|
|
117
|
+
options?: RequestOptionsType<GetCoinPriceHistoryData>,
|
|
118
|
+
): Promise<RequestResult<GetCoinPriceHistoryResponse>> => {
|
|
119
|
+
return await getCoinPriceHistorySDK({
|
|
120
|
+
query,
|
|
121
|
+
...getApiKeyMeta(),
|
|
122
|
+
...options,
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
102
126
|
type GetCoinSwapsQuery = GetCoinSwapsData["query"];
|
|
103
127
|
export type { GetCoinSwapsQuery, GetCoinSwapsData };
|
|
104
128
|
export type { GetCoinSwapsResponse } from "../client/types.gen";
|
|
@@ -263,3 +287,37 @@ export const getCreatorCoinPoolConfig = async (
|
|
|
263
287
|
...options,
|
|
264
288
|
});
|
|
265
289
|
};
|
|
290
|
+
|
|
291
|
+
type GetCreatorLivestreamCommentsQuery =
|
|
292
|
+
GetCreatorLivestreamCommentsData["query"];
|
|
293
|
+
export type {
|
|
294
|
+
GetCreatorLivestreamCommentsQuery,
|
|
295
|
+
GetCreatorLivestreamCommentsData,
|
|
296
|
+
};
|
|
297
|
+
export type { GetCreatorLivestreamCommentsResponse } from "../client/types.gen";
|
|
298
|
+
|
|
299
|
+
export const getCreatorLivestreamComments = async (
|
|
300
|
+
query: GetCreatorLivestreamCommentsQuery,
|
|
301
|
+
options?: RequestOptionsType<GetCreatorLivestreamCommentsData>,
|
|
302
|
+
): Promise<RequestResult<GetCreatorLivestreamCommentsResponse>> => {
|
|
303
|
+
return await getCreatorLivestreamCommentsSDK({
|
|
304
|
+
query,
|
|
305
|
+
...getApiKeyMeta(),
|
|
306
|
+
...options,
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
type GetWalletTradeActivityQuery = GetWalletTradeActivityData["query"];
|
|
311
|
+
export type { GetWalletTradeActivityQuery, GetWalletTradeActivityData };
|
|
312
|
+
export type { GetWalletTradeActivityResponse } from "../client/types.gen";
|
|
313
|
+
|
|
314
|
+
export const getWalletTradeActivity = async (
|
|
315
|
+
query: GetWalletTradeActivityQuery,
|
|
316
|
+
options?: RequestOptionsType<GetWalletTradeActivityData>,
|
|
317
|
+
): Promise<RequestResult<GetWalletTradeActivityResponse>> => {
|
|
318
|
+
return await getWalletTradeActivitySDK({
|
|
319
|
+
query,
|
|
320
|
+
...getApiKeyMeta(),
|
|
321
|
+
...options,
|
|
322
|
+
});
|
|
323
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GetProfileBySocialHandleData,
|
|
3
|
+
GetProfileBySocialHandleResponse,
|
|
4
|
+
} from "../client/types.gen";
|
|
5
|
+
import { getProfileBySocialHandle as getProfileBySocialHandleSDK } from "../client/sdk.gen";
|
|
6
|
+
import { getApiKeyMeta } from "./api-key";
|
|
7
|
+
import { RequestOptionsType } from "./query-types";
|
|
8
|
+
import { RequestResult } from "@hey-api/client-fetch";
|
|
9
|
+
|
|
10
|
+
type GetProfileBySocialHandleQuery = GetProfileBySocialHandleData["query"];
|
|
11
|
+
export type { GetProfileBySocialHandleQuery, GetProfileBySocialHandleData };
|
|
12
|
+
export type { GetProfileBySocialHandleResponse } from "../client/types.gen";
|
|
13
|
+
|
|
14
|
+
export const getProfileBySocialHandle = async (
|
|
15
|
+
query: GetProfileBySocialHandleQuery,
|
|
16
|
+
options?: RequestOptionsType<GetProfileBySocialHandleData>,
|
|
17
|
+
): Promise<RequestResult<GetProfileBySocialHandleResponse>> => {
|
|
18
|
+
return await getProfileBySocialHandleSDK({
|
|
19
|
+
...options,
|
|
20
|
+
query,
|
|
21
|
+
...getApiKeyMeta(),
|
|
22
|
+
});
|
|
23
|
+
};
|
package/src/client/sdk.gen.ts
CHANGED
|
@@ -14,6 +14,8 @@ import type {
|
|
|
14
14
|
GetCoinCommentsResponse,
|
|
15
15
|
GetCoinHoldersData,
|
|
16
16
|
GetCoinHoldersResponse,
|
|
17
|
+
GetCoinPriceHistoryData,
|
|
18
|
+
GetCoinPriceHistoryResponse,
|
|
17
19
|
GetCoinSwapsData,
|
|
18
20
|
GetCoinSwapsResponse,
|
|
19
21
|
GetCoinsData,
|
|
@@ -26,6 +28,8 @@ import type {
|
|
|
26
28
|
SetCreateUploadJwtResponse,
|
|
27
29
|
GetCreatorCoinPoolConfigData,
|
|
28
30
|
GetCreatorCoinPoolConfigResponse,
|
|
31
|
+
GetCreatorLivestreamCommentsData,
|
|
32
|
+
GetCreatorLivestreamCommentsResponse,
|
|
29
33
|
GetExploreData,
|
|
30
34
|
GetExploreResponse,
|
|
31
35
|
GetFeaturedCreatorsData,
|
|
@@ -36,6 +40,8 @@ import type {
|
|
|
36
40
|
GetProfileResponse,
|
|
37
41
|
GetProfileBalancesData,
|
|
38
42
|
GetProfileBalancesResponse,
|
|
43
|
+
GetProfileBySocialHandleData,
|
|
44
|
+
GetProfileBySocialHandleResponse,
|
|
39
45
|
GetProfileCoinsData,
|
|
40
46
|
GetProfileCoinsResponse,
|
|
41
47
|
GetProfileSocialData,
|
|
@@ -50,6 +56,8 @@ import type {
|
|
|
50
56
|
GetTrendCoinResponse,
|
|
51
57
|
GetTrendsByNameData,
|
|
52
58
|
GetTrendsByNameResponse,
|
|
59
|
+
GetWalletTradeActivityData,
|
|
60
|
+
GetWalletTradeActivityResponse,
|
|
53
61
|
PostQuoteData,
|
|
54
62
|
PostQuoteResponse,
|
|
55
63
|
PostQuoteError,
|
|
@@ -164,6 +172,28 @@ export const getCoinHolders = <ThrowOnError extends boolean = false>(
|
|
|
164
172
|
});
|
|
165
173
|
};
|
|
166
174
|
|
|
175
|
+
/**
|
|
176
|
+
* zoraSDK_coinPriceHistory query
|
|
177
|
+
*/
|
|
178
|
+
export const getCoinPriceHistory = <ThrowOnError extends boolean = false>(
|
|
179
|
+
options: Options<GetCoinPriceHistoryData, ThrowOnError>,
|
|
180
|
+
) => {
|
|
181
|
+
return (options.client ?? _heyApiClient).get<
|
|
182
|
+
GetCoinPriceHistoryResponse,
|
|
183
|
+
unknown,
|
|
184
|
+
ThrowOnError
|
|
185
|
+
>({
|
|
186
|
+
security: [
|
|
187
|
+
{
|
|
188
|
+
name: "api-key",
|
|
189
|
+
type: "apiKey",
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
url: "/coinPriceHistory",
|
|
193
|
+
...options,
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
167
197
|
/**
|
|
168
198
|
* zoraSDK_coinSwaps query
|
|
169
199
|
*/
|
|
@@ -300,6 +330,30 @@ export const getCreatorCoinPoolConfig = <ThrowOnError extends boolean = false>(
|
|
|
300
330
|
});
|
|
301
331
|
};
|
|
302
332
|
|
|
333
|
+
/**
|
|
334
|
+
* zoraSDK_creatorLivestreamComments query
|
|
335
|
+
*/
|
|
336
|
+
export const getCreatorLivestreamComments = <
|
|
337
|
+
ThrowOnError extends boolean = false,
|
|
338
|
+
>(
|
|
339
|
+
options: Options<GetCreatorLivestreamCommentsData, ThrowOnError>,
|
|
340
|
+
) => {
|
|
341
|
+
return (options.client ?? _heyApiClient).get<
|
|
342
|
+
GetCreatorLivestreamCommentsResponse,
|
|
343
|
+
unknown,
|
|
344
|
+
ThrowOnError
|
|
345
|
+
>({
|
|
346
|
+
security: [
|
|
347
|
+
{
|
|
348
|
+
name: "api-key",
|
|
349
|
+
type: "apiKey",
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
url: "/creatorLivestreamComments",
|
|
353
|
+
...options,
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
|
|
303
357
|
/**
|
|
304
358
|
* zoraSDK_explore query
|
|
305
359
|
*/
|
|
@@ -410,6 +464,28 @@ export const getProfileBalances = <ThrowOnError extends boolean = false>(
|
|
|
410
464
|
});
|
|
411
465
|
};
|
|
412
466
|
|
|
467
|
+
/**
|
|
468
|
+
* zoraSDK_profileBySocialHandle query
|
|
469
|
+
*/
|
|
470
|
+
export const getProfileBySocialHandle = <ThrowOnError extends boolean = false>(
|
|
471
|
+
options: Options<GetProfileBySocialHandleData, ThrowOnError>,
|
|
472
|
+
) => {
|
|
473
|
+
return (options.client ?? _heyApiClient).get<
|
|
474
|
+
GetProfileBySocialHandleResponse,
|
|
475
|
+
unknown,
|
|
476
|
+
ThrowOnError
|
|
477
|
+
>({
|
|
478
|
+
security: [
|
|
479
|
+
{
|
|
480
|
+
name: "api-key",
|
|
481
|
+
type: "apiKey",
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
url: "/profileBySocialHandle",
|
|
485
|
+
...options,
|
|
486
|
+
});
|
|
487
|
+
};
|
|
488
|
+
|
|
413
489
|
/**
|
|
414
490
|
* zoraSDK_profileCoins query
|
|
415
491
|
*/
|
|
@@ -564,6 +640,28 @@ export const getTrendsByName = <ThrowOnError extends boolean = false>(
|
|
|
564
640
|
});
|
|
565
641
|
};
|
|
566
642
|
|
|
643
|
+
/**
|
|
644
|
+
* zoraSDK_walletTradeActivity query
|
|
645
|
+
*/
|
|
646
|
+
export const getWalletTradeActivity = <ThrowOnError extends boolean = false>(
|
|
647
|
+
options: Options<GetWalletTradeActivityData, ThrowOnError>,
|
|
648
|
+
) => {
|
|
649
|
+
return (options.client ?? _heyApiClient).get<
|
|
650
|
+
GetWalletTradeActivityResponse,
|
|
651
|
+
unknown,
|
|
652
|
+
ThrowOnError
|
|
653
|
+
>({
|
|
654
|
+
security: [
|
|
655
|
+
{
|
|
656
|
+
name: "api-key",
|
|
657
|
+
type: "apiKey",
|
|
658
|
+
},
|
|
659
|
+
],
|
|
660
|
+
url: "/walletTradeActivity",
|
|
661
|
+
...options,
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
|
|
567
665
|
export const postQuote = <ThrowOnError extends boolean = false>(
|
|
568
666
|
options?: Options<PostQuoteData, ThrowOnError>,
|
|
569
667
|
) => {
|