@zoralabs/coins-sdk 0.0.2-sdkalpha.2 → 0.0.2-sdkalpha.3

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,18 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { ClientOptions } from './types.gen';
4
+ import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
5
+
6
+ /**
7
+ * The `createClientConfig()` function will be called on client initialization
8
+ * and the returned object will become the client's initial configuration.
9
+ *
10
+ * You may want to initialize your client this way instead of calling
11
+ * `setConfig()`. This is useful for example if you're using Next.js
12
+ * to ensure your client always has the correct values.
13
+ */
14
+ export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
15
+
16
+ export const client = createClient(createConfig<ClientOptions>({
17
+ baseUrl: 'https://api-sdk.zora.engineering/'
18
+ }));
@@ -0,0 +1,55 @@
1
+ import { getExplore } from "./sdk.gen";
2
+ import type { GetExploreData } from "./types.gen";
3
+ import { Options } from "@hey-api/client-fetch";
4
+
5
+ type QueryInnerType = {
6
+ query: Omit<GetExploreData["query"], "listType">;
7
+ } & Omit<GetExploreData, "query">;
8
+
9
+ export const getTopGainers = <ThrowOnError extends boolean = false>(
10
+ options?: Options<QueryInnerType, ThrowOnError>,
11
+ ) =>
12
+ getExplore({
13
+ ...options,
14
+ query: { ...options?.query, listType: "TOP_GAINERS" },
15
+ });
16
+
17
+ export const getTopVolume24h = <ThrowOnError extends boolean = false>(
18
+ options?: Options<QueryInnerType, ThrowOnError>,
19
+ ) =>
20
+ getExplore({
21
+ ...options,
22
+ query: { ...options?.query, listType: "TOP_VOLUME_24H" },
23
+ });
24
+
25
+ export const getMostValuable = <ThrowOnError extends boolean = false>(
26
+ options?: Options<QueryInnerType, ThrowOnError>,
27
+ ) =>
28
+ getExplore({
29
+ ...options,
30
+ query: { ...options?.query, listType: "MOST_VALUABLE" },
31
+ });
32
+
33
+ export const getNew = <ThrowOnError extends boolean = false>(
34
+ options?: Options<QueryInnerType, ThrowOnError>,
35
+ ) =>
36
+ getExplore({
37
+ ...options,
38
+ query: { ...options?.query, listType: "NEW" },
39
+ });
40
+
41
+ export const getLastTraded = <ThrowOnError extends boolean = false>(
42
+ options?: Options<QueryInnerType, ThrowOnError>,
43
+ ) =>
44
+ getExplore({
45
+ ...options,
46
+ query: { ...options?.query, listType: "LAST_TRADED" },
47
+ });
48
+
49
+ export const getLastTradedUnique = <ThrowOnError extends boolean = false>(
50
+ options?: Options<QueryInnerType, ThrowOnError>,
51
+ ) =>
52
+ getExplore({
53
+ ...options,
54
+ query: { ...options?.query, listType: "LAST_TRADED_UNIQUE" },
55
+ });
@@ -0,0 +1,3 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export * from './types.gen';
3
+ export * from './sdk.gen';
@@ -0,0 +1,40 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
4
+ import type { GetCoinDetailsData, GetCoinDetailsResponse, GetCoinCommentsData, GetCoinCommentsResponse, GetExploreData, GetExploreResponse } from './types.gen';
5
+ import { client as _heyApiClient } from './client.gen';
6
+
7
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
8
+ /**
9
+ * You can provide a client instance returned by `createClient()` instead of
10
+ * individual options. This might be also useful if you want to implement a
11
+ * custom client.
12
+ */
13
+ client?: Client;
14
+ /**
15
+ * You can pass arbitrary values through the `meta` object. This can be
16
+ * used to access values that aren't defined as part of the SDK function.
17
+ */
18
+ meta?: Record<string, unknown>;
19
+ };
20
+
21
+ export const getCoinDetails = <ThrowOnError extends boolean = false>(options: Options<GetCoinDetailsData, ThrowOnError>) => {
22
+ return (options.client ?? _heyApiClient).get<GetCoinDetailsResponse, unknown, ThrowOnError>({
23
+ url: '/coinDetails',
24
+ ...options
25
+ });
26
+ };
27
+
28
+ export const getCoinComments = <ThrowOnError extends boolean = false>(options: Options<GetCoinCommentsData, ThrowOnError>) => {
29
+ return (options.client ?? _heyApiClient).get<GetCoinCommentsResponse, unknown, ThrowOnError>({
30
+ url: '/coinComments',
31
+ ...options
32
+ });
33
+ };
34
+
35
+ export const getExplore = <ThrowOnError extends boolean = false>(options: Options<GetExploreData, ThrowOnError>) => {
36
+ return (options.client ?? _heyApiClient).get<GetExploreResponse, unknown, ThrowOnError>({
37
+ url: '/explore',
38
+ ...options
39
+ });
40
+ };
@@ -0,0 +1,229 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ export type GetCoinDetailsData = {
4
+ body?: never;
5
+ path?: never;
6
+ query: {
7
+ address: string;
8
+ chain?: number;
9
+ };
10
+ url: '/coinDetails';
11
+ };
12
+
13
+ export type GetCoinDetailsResponses = {
14
+ /**
15
+ * response
16
+ */
17
+ 200: {
18
+ zora20Token?: {
19
+ /**
20
+ * The Globally Unique ID of this object
21
+ */
22
+ id?: string;
23
+ name?: string;
24
+ description?: string;
25
+ address?: string;
26
+ symbol?: string;
27
+ totalSupply?: string;
28
+ totalVolume?: string;
29
+ volume24h?: string;
30
+ createdAt?: string;
31
+ creatorAddress?: string;
32
+ creatorEarnings?: Array<{
33
+ amount?: {
34
+ currency?: {
35
+ address?: string;
36
+ };
37
+ amountRaw?: string;
38
+ amountDecimal?: number;
39
+ };
40
+ amountUsd?: string;
41
+ }>;
42
+ marketCap?: string;
43
+ marketCapDelta24h?: string;
44
+ chainId?: number;
45
+ chainName?: 'EthereumMainnet' | 'EthereumRopsten' | 'EthereumRinkeby' | 'EthereumGoerli' | 'EthereumSepolia' | 'OptimismMainnet' | 'OptimismGoerli' | 'ZoraGoerli' | 'ZoraSepolia' | 'ZoraMainnet' | 'BaseMainnet' | 'BaseGoerli' | 'BaseSepolia' | 'BaseAnvil' | 'PGNMainnet' | 'ArbitrumMainnet' | 'BlastMainnet';
46
+ creatorProfile?: string;
47
+ handle?: string;
48
+ avatar?: {
49
+ small?: string;
50
+ medium?: string;
51
+ blurhash?: string;
52
+ };
53
+ bio?: string;
54
+ media?: {
55
+ mimeType?: string;
56
+ originalUri?: string;
57
+ format?: string;
58
+ previewImage?: string;
59
+ medium?: string;
60
+ blurhash?: string;
61
+ };
62
+ transfers?: {
63
+ count?: number;
64
+ };
65
+ uniqueHolders?: number;
66
+ };
67
+ };
68
+ };
69
+
70
+ export type GetCoinDetailsResponse = GetCoinDetailsResponses[keyof GetCoinDetailsResponses];
71
+
72
+ export type GetCoinCommentsData = {
73
+ body?: never;
74
+ path?: never;
75
+ query: {
76
+ address: string;
77
+ chain?: number;
78
+ after?: string;
79
+ count?: number;
80
+ };
81
+ url: '/coinComments';
82
+ };
83
+
84
+ export type GetCoinCommentsResponses = {
85
+ /**
86
+ * response
87
+ */
88
+ 200: {
89
+ zora20Token?: {
90
+ zoraComments?: {
91
+ /**
92
+ * Information to aid in pagination.
93
+ */
94
+ pageInfo?: {
95
+ /**
96
+ * When paginating forwards, the cursor to continue.
97
+ */
98
+ endCursor?: string;
99
+ /**
100
+ * When paginating forwards, are there more items?
101
+ */
102
+ hasNextPage?: boolean;
103
+ };
104
+ count?: number;
105
+ edges?: Array<{
106
+ node?: string;
107
+ txHash?: string;
108
+ comment?: string;
109
+ userAddress?: string;
110
+ timestamp?: number;
111
+ userProfile?: string;
112
+ /**
113
+ * The Globally Unique ID of this object
114
+ */
115
+ id?: string;
116
+ handle?: string;
117
+ avatar?: {
118
+ previewImage?: string;
119
+ blurhash?: string;
120
+ small?: string;
121
+ };
122
+ replies?: {
123
+ count?: number;
124
+ edges?: Array<{
125
+ node?: {
126
+ txHash?: string;
127
+ comment?: string;
128
+ userAddress?: string;
129
+ timestamp?: number;
130
+ userProfile?: string;
131
+ /**
132
+ * The Globally Unique ID of this object
133
+ */
134
+ id?: string;
135
+ handle?: string;
136
+ avatar?: {
137
+ previewImage?: string;
138
+ blurhash?: string;
139
+ small?: string;
140
+ };
141
+ };
142
+ }>;
143
+ };
144
+ }>;
145
+ };
146
+ };
147
+ };
148
+ };
149
+
150
+ export type GetCoinCommentsResponse = GetCoinCommentsResponses[keyof GetCoinCommentsResponses];
151
+
152
+ export type GetExploreData = {
153
+ body?: never;
154
+ path?: never;
155
+ query: {
156
+ listType: 'TOP_GAINERS' | 'TOP_VOLUME_24H' | 'MOST_VALUABLE' | 'NEW' | 'LAST_TRADED' | 'LAST_TRADED_UNIQUE';
157
+ count?: number;
158
+ after?: string;
159
+ };
160
+ url: '/explore';
161
+ };
162
+
163
+ export type GetExploreResponses = {
164
+ /**
165
+ * response
166
+ */
167
+ 200: {
168
+ exploreList?: {
169
+ edges?: Array<{
170
+ node?: {
171
+ /**
172
+ * The Globally Unique ID of this object
173
+ */
174
+ id?: string;
175
+ address?: string;
176
+ chainId?: number;
177
+ creatorProfile?: string;
178
+ profileId?: string;
179
+ handle?: string;
180
+ avatar?: {
181
+ mimeType?: string;
182
+ downloadableUri?: string;
183
+ height?: number;
184
+ width?: number;
185
+ blurhash?: string;
186
+ };
187
+ name?: string;
188
+ symbol?: string;
189
+ volume24h?: string;
190
+ uniqueHolders?: number;
191
+ createdAt?: string;
192
+ zoraComments?: {
193
+ count?: number;
194
+ };
195
+ mediaContent?: string;
196
+ mimeType?: string;
197
+ originalUri?: string;
198
+ downloadableUri?: string;
199
+ previewImage?: string;
200
+ height?: number;
201
+ width?: number;
202
+ blurhash?: string;
203
+ marketCap?: string;
204
+ marketCapDelta24h?: string;
205
+ };
206
+ cursor?: string;
207
+ }>;
208
+ /**
209
+ * Information to aid in pagination.
210
+ */
211
+ pageInfo?: {
212
+ /**
213
+ * When paginating forwards, the cursor to continue.
214
+ */
215
+ endCursor?: string;
216
+ /**
217
+ * When paginating forwards, are there more items?
218
+ */
219
+ hasNextPage?: boolean;
220
+ };
221
+ };
222
+ };
223
+ };
224
+
225
+ export type GetExploreResponse = GetExploreResponses[keyof GetExploreResponses];
226
+
227
+ export type ClientOptions = {
228
+ baseUrl: 'https://api-sdk.zora.engineering/' | 'https://api-sdk-staging.zora.engineering/' | (string & {});
229
+ };
package/src/index.ts CHANGED
@@ -1,5 +1,9 @@
1
1
 
2
2
  export { createCoin, createCoinCall, getCoinCreateFromLogs } from "./actions/createCoin";
3
3
  export { tradeCoin, tradeCoinCall, getTradeFromLogs } from "./actions/tradeCoin";
4
- export { getCoinDetails, type CoinDetails } from "./actions/getCoinDetails";
4
+ export { getOnchainCoinDetails, type OnchainCoinDetails } from "./actions/getOnchainCoinDetails";
5
5
  export { updateCoinURI, updateCoinURICall } from "./actions/updateCoinURI";
6
+
7
+ // API Read Actions
8
+ export * from './client/sdk.gen';
9
+ export * as explore from './client/explore';
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCoinDetails.d.ts","sourceRoot":"","sources":["../../src/actions/getCoinDetails.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAyC,YAAY,EAAe,MAAM,MAAM,CAAC;AAGjG,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0BAA0B,EAAE,MAAM,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACJ,IAAkB,EAClB,YAAY,GACb,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,YAAY,CAAC;CAC5B,GAAG,OAAO,CAAC,WAAW,CAAC,CA+FvB"}