@medialane/ui 0.220.0 → 0.222.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/README.md +1 -1
- package/dist/components/account/email-code-entry.d.cts +1 -0
- package/dist/components/account/email-code-entry.d.ts +1 -0
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/creator-page.cjs +1 -1
- package/dist/components/creator-page.cjs.map +1 -1
- package/dist/components/creator-page.js +1 -1
- package/dist/components/creator-page.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +8 -8
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +8 -8
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/license-request-page.cjs +11 -13
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +11 -13
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.cjs +2 -2
- package/dist/components/media-wallet/media-wallet-activity.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.js +2 -2
- package/dist/components/media-wallet/media-wallet-activity.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.js +1 -1
- package/dist/components/media-wallet/media-wallet-send.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-token-detail.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-token-detail.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-token-detail.js +1 -1
- package/dist/components/media-wallet/media-wallet-token-detail.js.map +1 -1
- package/dist/components/remix-browse-page.cjs +2 -5
- package/dist/components/remix-browse-page.cjs.map +1 -1
- package/dist/components/remix-browse-page.js +2 -5
- package/dist/components/remix-browse-page.js.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/utils/app-wallet.d.cts +5 -5
- package/dist/utils/app-wallet.d.ts +5 -5
- package/dist/utils/drop/actions.cjs +7 -7
- package/dist/utils/drop/actions.cjs.map +1 -1
- package/dist/utils/drop/actions.js +7 -7
- package/dist/utils/drop/actions.js.map +1 -1
- package/dist/utils/ipfs-upload.cjs +3 -3
- package/dist/utils/ipfs-upload.cjs.map +1 -1
- package/dist/utils/ipfs-upload.js +3 -3
- package/dist/utils/ipfs-upload.js.map +1 -1
- package/dist/utils/run-intent-calls.cjs +1 -1
- package/dist/utils/run-intent-calls.cjs.map +1 -1
- package/dist/utils/run-intent-calls.d.cts +1 -3
- package/dist/utils/run-intent-calls.d.ts +1 -3
- package/dist/utils/run-intent-calls.js +1 -1
- package/dist/utils/run-intent-calls.js.map +1 -1
- package/dist/utils/sitemap-data.cjs +3 -3
- package/dist/utils/sitemap-data.cjs.map +1 -1
- package/dist/utils/sitemap-data.js +3 -3
- package/dist/utils/sitemap-data.js.map +1 -1
- package/dist/utils/use-activities.cjs +2 -2
- package/dist/utils/use-activities.cjs.map +1 -1
- package/dist/utils/use-activities.js +2 -2
- package/dist/utils/use-activities.js.map +1 -1
- package/dist/utils/use-coin-price.cjs +1 -1
- package/dist/utils/use-coin-price.cjs.map +1 -1
- package/dist/utils/use-coin-price.js +1 -1
- package/dist/utils/use-coin-price.js.map +1 -1
- package/dist/utils/use-collections.cjs +5 -5
- package/dist/utils/use-collections.cjs.map +1 -1
- package/dist/utils/use-collections.d.cts +439 -9
- package/dist/utils/use-collections.d.ts +439 -9
- package/dist/utils/use-collections.js +5 -5
- package/dist/utils/use-collections.js.map +1 -1
- package/dist/utils/use-comments.cjs +1 -1
- package/dist/utils/use-comments.cjs.map +1 -1
- package/dist/utils/use-comments.js +1 -1
- package/dist/utils/use-comments.js.map +1 -1
- package/dist/utils/use-creators.cjs +1 -1
- package/dist/utils/use-creators.cjs.map +1 -1
- package/dist/utils/use-creators.js +1 -1
- package/dist/utils/use-creators.js.map +1 -1
- package/dist/utils/use-drops.cjs +7 -7
- package/dist/utils/use-drops.cjs.map +1 -1
- package/dist/utils/use-drops.js +7 -7
- package/dist/utils/use-drops.js.map +1 -1
- package/dist/utils/use-email-code.cjs.map +1 -1
- package/dist/utils/use-email-code.d.cts +2 -4
- package/dist/utils/use-email-code.d.ts +2 -4
- package/dist/utils/use-email-code.js.map +1 -1
- package/dist/utils/use-full-token-data.cjs +1 -1
- package/dist/utils/use-full-token-data.cjs.map +1 -1
- package/dist/utils/use-full-token-data.js +1 -1
- package/dist/utils/use-full-token-data.js.map +1 -1
- package/dist/utils/use-orders.cjs +8 -8
- package/dist/utils/use-orders.cjs.map +1 -1
- package/dist/utils/use-orders.d.cts +36 -36
- package/dist/utils/use-orders.d.ts +36 -36
- package/dist/utils/use-orders.js +8 -8
- package/dist/utils/use-orders.js.map +1 -1
- package/dist/utils/use-platform-stats.cjs +1 -1
- package/dist/utils/use-platform-stats.cjs.map +1 -1
- package/dist/utils/use-platform-stats.js +1 -1
- package/dist/utils/use-platform-stats.js.map +1 -1
- package/dist/utils/use-pop.cjs +2 -2
- package/dist/utils/use-pop.cjs.map +1 -1
- package/dist/utils/use-pop.d.cts +113 -4
- package/dist/utils/use-pop.d.ts +113 -4
- package/dist/utils/use-pop.js +2 -2
- package/dist/utils/use-pop.js.map +1 -1
- package/dist/utils/use-profiles.cjs +3 -3
- package/dist/utils/use-profiles.cjs.map +1 -1
- package/dist/utils/use-profiles.js +3 -3
- package/dist/utils/use-profiles.js.map +1 -1
- package/dist/utils/use-remix-offers.cjs +1 -1
- package/dist/utils/use-remix-offers.cjs.map +1 -1
- package/dist/utils/use-remix-offers.js +1 -1
- package/dist/utils/use-remix-offers.js.map +1 -1
- package/dist/utils/use-rewards.cjs +5 -5
- package/dist/utils/use-rewards.cjs.map +1 -1
- package/dist/utils/use-rewards.js +5 -5
- package/dist/utils/use-rewards.js.map +1 -1
- package/dist/utils/use-sponsorship.cjs +6 -6
- package/dist/utils/use-sponsorship.cjs.map +1 -1
- package/dist/utils/use-sponsorship.js +6 -6
- package/dist/utils/use-sponsorship.js.map +1 -1
- package/dist/utils/use-tiers.cjs +8 -8
- package/dist/utils/use-tiers.cjs.map +1 -1
- package/dist/utils/use-tiers.d.cts +150 -5
- package/dist/utils/use-tiers.d.ts +150 -5
- package/dist/utils/use-tiers.js +8 -8
- package/dist/utils/use-tiers.js.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.cjs +1 -1
- package/dist/utils/use-tokens-by-ip-type.cjs.map +1 -1
- package/dist/utils/use-tokens-by-ip-type.d.cts +170 -3
- package/dist/utils/use-tokens-by-ip-type.d.ts +170 -3
- package/dist/utils/use-tokens-by-ip-type.js +1 -1
- package/dist/utils/use-tokens-by-ip-type.js.map +1 -1
- package/dist/utils/use-tokens.cjs +7 -7
- package/dist/utils/use-tokens.cjs.map +1 -1
- package/dist/utils/use-tokens.d.cts +339 -7
- package/dist/utils/use-tokens.d.ts +339 -7
- package/dist/utils/use-tokens.js +7 -7
- package/dist/utils/use-tokens.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,35 +1,465 @@
|
|
|
1
1
|
import * as swr from 'swr';
|
|
2
2
|
import * as _medialane_sdk from '@medialane/sdk';
|
|
3
|
-
import {
|
|
3
|
+
import { CollectionTokensSort, ApiResponse, ApiCollection } from '@medialane/sdk';
|
|
4
|
+
import * as zod from 'zod';
|
|
4
5
|
|
|
5
6
|
type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
|
|
6
7
|
declare function useCollections(page?: number, limit?: number, isFeatured?: boolean, sort?: CollectionSort, hideEmpty?: boolean, service?: string, standard?: string, fallback?: ApiCollection[]): {
|
|
7
|
-
collections:
|
|
8
|
+
collections: {
|
|
9
|
+
symbol: string | null;
|
|
10
|
+
chain: string;
|
|
11
|
+
owner: string | null;
|
|
12
|
+
collectionId: string | null;
|
|
13
|
+
name: string | null;
|
|
14
|
+
description: string | null;
|
|
15
|
+
image: string | null;
|
|
16
|
+
service: string | null;
|
|
17
|
+
contractAddress: string;
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
22
|
+
standard: "ERC721" | "ERC1155";
|
|
23
|
+
attributes: zod.objectOutputType<{
|
|
24
|
+
trait_type: zod.ZodString;
|
|
25
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
26
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
27
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
28
|
+
holderCount: number;
|
|
29
|
+
startBlock: string;
|
|
30
|
+
isFeatured: boolean;
|
|
31
|
+
isHidden: boolean;
|
|
32
|
+
claimedBy: string | null;
|
|
33
|
+
floorPrice: string | null;
|
|
34
|
+
totalVolume: string | null;
|
|
35
|
+
totalSupply: number;
|
|
36
|
+
profile: {
|
|
37
|
+
description: string | null;
|
|
38
|
+
image: string | null;
|
|
39
|
+
displayName: string | null;
|
|
40
|
+
gatedContentTitle: string | null;
|
|
41
|
+
hasGatedContent: boolean;
|
|
42
|
+
slug: string | null;
|
|
43
|
+
} | null;
|
|
44
|
+
}[];
|
|
8
45
|
meta: _medialane_sdk.ApiMeta | undefined;
|
|
9
46
|
isLoading: boolean;
|
|
10
47
|
error: any;
|
|
11
|
-
mutate: swr.KeyedMutator<ApiResponse<
|
|
48
|
+
mutate: swr.KeyedMutator<ApiResponse<{
|
|
49
|
+
symbol: string | null;
|
|
50
|
+
chain: string;
|
|
51
|
+
owner: string | null;
|
|
52
|
+
collectionId: string | null;
|
|
53
|
+
name: string | null;
|
|
54
|
+
description: string | null;
|
|
55
|
+
image: string | null;
|
|
56
|
+
service: string | null;
|
|
57
|
+
contractAddress: string;
|
|
58
|
+
id: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
62
|
+
standard: "ERC721" | "ERC1155";
|
|
63
|
+
attributes: zod.objectOutputType<{
|
|
64
|
+
trait_type: zod.ZodString;
|
|
65
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
66
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
67
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
68
|
+
holderCount: number;
|
|
69
|
+
startBlock: string;
|
|
70
|
+
isFeatured: boolean;
|
|
71
|
+
isHidden: boolean;
|
|
72
|
+
claimedBy: string | null;
|
|
73
|
+
floorPrice: string | null;
|
|
74
|
+
totalVolume: string | null;
|
|
75
|
+
totalSupply: number;
|
|
76
|
+
profile: {
|
|
77
|
+
description: string | null;
|
|
78
|
+
image: string | null;
|
|
79
|
+
displayName: string | null;
|
|
80
|
+
gatedContentTitle: string | null;
|
|
81
|
+
hasGatedContent: boolean;
|
|
82
|
+
slug: string | null;
|
|
83
|
+
} | null;
|
|
84
|
+
}[]>>;
|
|
12
85
|
};
|
|
13
86
|
declare function useCollection(contract: string | null): {
|
|
14
|
-
collection:
|
|
87
|
+
collection: {
|
|
88
|
+
symbol: string | null;
|
|
89
|
+
chain: string;
|
|
90
|
+
owner: string | null;
|
|
91
|
+
collectionId: string | null;
|
|
92
|
+
name: string | null;
|
|
93
|
+
description: string | null;
|
|
94
|
+
image: string | null;
|
|
95
|
+
service: string | null;
|
|
96
|
+
contractAddress: string;
|
|
97
|
+
id: string;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
101
|
+
standard: "ERC721" | "ERC1155";
|
|
102
|
+
attributes: zod.objectOutputType<{
|
|
103
|
+
trait_type: zod.ZodString;
|
|
104
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
105
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
106
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
107
|
+
holderCount: number;
|
|
108
|
+
startBlock: string;
|
|
109
|
+
isFeatured: boolean;
|
|
110
|
+
isHidden: boolean;
|
|
111
|
+
claimedBy: string | null;
|
|
112
|
+
floorPrice: string | null;
|
|
113
|
+
totalVolume: string | null;
|
|
114
|
+
totalSupply: number;
|
|
115
|
+
profile: {
|
|
116
|
+
description: string | null;
|
|
117
|
+
image: string | null;
|
|
118
|
+
displayName: string | null;
|
|
119
|
+
gatedContentTitle: string | null;
|
|
120
|
+
hasGatedContent: boolean;
|
|
121
|
+
slug: string | null;
|
|
122
|
+
} | null;
|
|
123
|
+
} | null;
|
|
15
124
|
isLoading: boolean;
|
|
16
125
|
error: any;
|
|
17
126
|
};
|
|
18
127
|
declare function useCollectionsByOwner(owner: string | null): {
|
|
19
|
-
collections:
|
|
128
|
+
collections: {
|
|
129
|
+
symbol: string | null;
|
|
130
|
+
chain: string;
|
|
131
|
+
owner: string | null;
|
|
132
|
+
collectionId: string | null;
|
|
133
|
+
name: string | null;
|
|
134
|
+
description: string | null;
|
|
135
|
+
image: string | null;
|
|
136
|
+
service: string | null;
|
|
137
|
+
contractAddress: string;
|
|
138
|
+
id: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
142
|
+
standard: "ERC721" | "ERC1155";
|
|
143
|
+
attributes: zod.objectOutputType<{
|
|
144
|
+
trait_type: zod.ZodString;
|
|
145
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
146
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
147
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
148
|
+
holderCount: number;
|
|
149
|
+
startBlock: string;
|
|
150
|
+
isFeatured: boolean;
|
|
151
|
+
isHidden: boolean;
|
|
152
|
+
claimedBy: string | null;
|
|
153
|
+
floorPrice: string | null;
|
|
154
|
+
totalVolume: string | null;
|
|
155
|
+
totalSupply: number;
|
|
156
|
+
profile: {
|
|
157
|
+
description: string | null;
|
|
158
|
+
image: string | null;
|
|
159
|
+
displayName: string | null;
|
|
160
|
+
gatedContentTitle: string | null;
|
|
161
|
+
hasGatedContent: boolean;
|
|
162
|
+
slug: string | null;
|
|
163
|
+
} | null;
|
|
164
|
+
}[];
|
|
20
165
|
isLoading: boolean;
|
|
21
166
|
error: any;
|
|
22
|
-
mutate: swr.KeyedMutator<ApiResponse<
|
|
167
|
+
mutate: swr.KeyedMutator<ApiResponse<{
|
|
168
|
+
symbol: string | null;
|
|
169
|
+
chain: string;
|
|
170
|
+
owner: string | null;
|
|
171
|
+
collectionId: string | null;
|
|
172
|
+
name: string | null;
|
|
173
|
+
description: string | null;
|
|
174
|
+
image: string | null;
|
|
175
|
+
service: string | null;
|
|
176
|
+
contractAddress: string;
|
|
177
|
+
id: string;
|
|
178
|
+
createdAt: string;
|
|
179
|
+
updatedAt: string;
|
|
180
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
181
|
+
standard: "ERC721" | "ERC1155";
|
|
182
|
+
attributes: zod.objectOutputType<{
|
|
183
|
+
trait_type: zod.ZodString;
|
|
184
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
185
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
186
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
187
|
+
holderCount: number;
|
|
188
|
+
startBlock: string;
|
|
189
|
+
isFeatured: boolean;
|
|
190
|
+
isHidden: boolean;
|
|
191
|
+
claimedBy: string | null;
|
|
192
|
+
floorPrice: string | null;
|
|
193
|
+
totalVolume: string | null;
|
|
194
|
+
totalSupply: number;
|
|
195
|
+
profile: {
|
|
196
|
+
description: string | null;
|
|
197
|
+
image: string | null;
|
|
198
|
+
displayName: string | null;
|
|
199
|
+
gatedContentTitle: string | null;
|
|
200
|
+
hasGatedContent: boolean;
|
|
201
|
+
slug: string | null;
|
|
202
|
+
} | null;
|
|
203
|
+
}[]>>;
|
|
23
204
|
};
|
|
24
205
|
declare function useCollectionTokens(contract: string | null, page?: number, limit?: number, sort?: CollectionTokensSort): {
|
|
25
|
-
tokens:
|
|
206
|
+
tokens: {
|
|
207
|
+
chain: string;
|
|
208
|
+
tokenId: string;
|
|
209
|
+
owner: string | null;
|
|
210
|
+
tokenUri: string | null;
|
|
211
|
+
contractAddress: string;
|
|
212
|
+
id: string;
|
|
213
|
+
createdAt: string;
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
216
|
+
standard: "ERC721" | "ERC1155" | null;
|
|
217
|
+
metadata: {
|
|
218
|
+
name: string | null;
|
|
219
|
+
description: string | null;
|
|
220
|
+
image: string | null;
|
|
221
|
+
author: string | null;
|
|
222
|
+
animationUrl: string | null;
|
|
223
|
+
attributes: zod.objectOutputType<{
|
|
224
|
+
trait_type: zod.ZodString;
|
|
225
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
226
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
227
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
228
|
+
ipType: string | null;
|
|
229
|
+
licenseType: string | null;
|
|
230
|
+
commercialUse: boolean | null;
|
|
231
|
+
};
|
|
232
|
+
balances: {
|
|
233
|
+
amount: string;
|
|
234
|
+
owner: string;
|
|
235
|
+
}[] | null;
|
|
236
|
+
activeOrders: {
|
|
237
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
238
|
+
chain: string;
|
|
239
|
+
offerer: string;
|
|
240
|
+
nftContract: string | null;
|
|
241
|
+
price: {
|
|
242
|
+
currency: string | null;
|
|
243
|
+
raw: string | null;
|
|
244
|
+
formatted: string | null;
|
|
245
|
+
decimals: number;
|
|
246
|
+
};
|
|
247
|
+
endTime: string;
|
|
248
|
+
fulfiller: string | null;
|
|
249
|
+
orderHash: string;
|
|
250
|
+
startTime: string;
|
|
251
|
+
txHash: {
|
|
252
|
+
created: string | null;
|
|
253
|
+
fulfilled: string | null;
|
|
254
|
+
cancelled: string | null;
|
|
255
|
+
};
|
|
256
|
+
token: {
|
|
257
|
+
name: string | null;
|
|
258
|
+
description: string | null;
|
|
259
|
+
image: string | null;
|
|
260
|
+
animationUrl: string | null;
|
|
261
|
+
} | null;
|
|
262
|
+
offer: {
|
|
263
|
+
token: string;
|
|
264
|
+
itemType: string;
|
|
265
|
+
identifier: string;
|
|
266
|
+
startAmount: string;
|
|
267
|
+
endAmount: string;
|
|
268
|
+
};
|
|
269
|
+
id: string;
|
|
270
|
+
consideration: {
|
|
271
|
+
recipient: string;
|
|
272
|
+
token: string;
|
|
273
|
+
itemType: string;
|
|
274
|
+
identifier: string;
|
|
275
|
+
startAmount: string;
|
|
276
|
+
endAmount: string;
|
|
277
|
+
};
|
|
278
|
+
nftTokenId: string | null;
|
|
279
|
+
createdBlockNumber: string;
|
|
280
|
+
remainingAmount: string | null;
|
|
281
|
+
createdAt: string;
|
|
282
|
+
updatedAt: string;
|
|
283
|
+
parentOrderHash?: string | null | undefined;
|
|
284
|
+
counterOfferMessage?: string | null | undefined;
|
|
285
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
286
|
+
}[];
|
|
287
|
+
holderCount?: number | undefined;
|
|
288
|
+
supply?: string | undefined;
|
|
289
|
+
}[];
|
|
26
290
|
meta: _medialane_sdk.ApiMeta | undefined;
|
|
27
291
|
isLoading: boolean;
|
|
28
292
|
error: any;
|
|
29
|
-
mutate: swr.KeyedMutator<ApiResponse<
|
|
293
|
+
mutate: swr.KeyedMutator<ApiResponse<{
|
|
294
|
+
chain: string;
|
|
295
|
+
tokenId: string;
|
|
296
|
+
owner: string | null;
|
|
297
|
+
tokenUri: string | null;
|
|
298
|
+
contractAddress: string;
|
|
299
|
+
id: string;
|
|
300
|
+
createdAt: string;
|
|
301
|
+
updatedAt: string;
|
|
302
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
303
|
+
standard: "ERC721" | "ERC1155" | null;
|
|
304
|
+
metadata: {
|
|
305
|
+
name: string | null;
|
|
306
|
+
description: string | null;
|
|
307
|
+
image: string | null;
|
|
308
|
+
author: string | null;
|
|
309
|
+
animationUrl: string | null;
|
|
310
|
+
attributes: zod.objectOutputType<{
|
|
311
|
+
trait_type: zod.ZodString;
|
|
312
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
313
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
314
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
315
|
+
ipType: string | null;
|
|
316
|
+
licenseType: string | null;
|
|
317
|
+
commercialUse: boolean | null;
|
|
318
|
+
};
|
|
319
|
+
balances: {
|
|
320
|
+
amount: string;
|
|
321
|
+
owner: string;
|
|
322
|
+
}[] | null;
|
|
323
|
+
activeOrders: {
|
|
324
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
325
|
+
chain: string;
|
|
326
|
+
offerer: string;
|
|
327
|
+
nftContract: string | null;
|
|
328
|
+
price: {
|
|
329
|
+
currency: string | null;
|
|
330
|
+
raw: string | null;
|
|
331
|
+
formatted: string | null;
|
|
332
|
+
decimals: number;
|
|
333
|
+
};
|
|
334
|
+
endTime: string;
|
|
335
|
+
fulfiller: string | null;
|
|
336
|
+
orderHash: string;
|
|
337
|
+
startTime: string;
|
|
338
|
+
txHash: {
|
|
339
|
+
created: string | null;
|
|
340
|
+
fulfilled: string | null;
|
|
341
|
+
cancelled: string | null;
|
|
342
|
+
};
|
|
343
|
+
token: {
|
|
344
|
+
name: string | null;
|
|
345
|
+
description: string | null;
|
|
346
|
+
image: string | null;
|
|
347
|
+
animationUrl: string | null;
|
|
348
|
+
} | null;
|
|
349
|
+
offer: {
|
|
350
|
+
token: string;
|
|
351
|
+
itemType: string;
|
|
352
|
+
identifier: string;
|
|
353
|
+
startAmount: string;
|
|
354
|
+
endAmount: string;
|
|
355
|
+
};
|
|
356
|
+
id: string;
|
|
357
|
+
consideration: {
|
|
358
|
+
recipient: string;
|
|
359
|
+
token: string;
|
|
360
|
+
itemType: string;
|
|
361
|
+
identifier: string;
|
|
362
|
+
startAmount: string;
|
|
363
|
+
endAmount: string;
|
|
364
|
+
};
|
|
365
|
+
nftTokenId: string | null;
|
|
366
|
+
createdBlockNumber: string;
|
|
367
|
+
remainingAmount: string | null;
|
|
368
|
+
createdAt: string;
|
|
369
|
+
updatedAt: string;
|
|
370
|
+
parentOrderHash?: string | null | undefined;
|
|
371
|
+
counterOfferMessage?: string | null | undefined;
|
|
372
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
373
|
+
}[];
|
|
374
|
+
holderCount?: number | undefined;
|
|
375
|
+
supply?: string | undefined;
|
|
376
|
+
}[]>>;
|
|
30
377
|
};
|
|
31
378
|
declare function useNearbyCollectionTokens(contract: string | null, currentTokenId: string | null, count?: number, poolSize?: number): {
|
|
32
|
-
tokens:
|
|
379
|
+
tokens: {
|
|
380
|
+
chain: string;
|
|
381
|
+
tokenId: string;
|
|
382
|
+
owner: string | null;
|
|
383
|
+
tokenUri: string | null;
|
|
384
|
+
contractAddress: string;
|
|
385
|
+
id: string;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
updatedAt: string;
|
|
388
|
+
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
389
|
+
standard: "ERC721" | "ERC1155" | null;
|
|
390
|
+
metadata: {
|
|
391
|
+
name: string | null;
|
|
392
|
+
description: string | null;
|
|
393
|
+
image: string | null;
|
|
394
|
+
author: string | null;
|
|
395
|
+
animationUrl: string | null;
|
|
396
|
+
attributes: zod.objectOutputType<{
|
|
397
|
+
trait_type: zod.ZodString;
|
|
398
|
+
value: zod.ZodUnion<[zod.ZodString, zod.ZodNumber, zod.ZodBoolean]>;
|
|
399
|
+
display_type: zod.ZodOptional<zod.ZodString>;
|
|
400
|
+
}, zod.ZodTypeAny, "passthrough">[] | null;
|
|
401
|
+
ipType: string | null;
|
|
402
|
+
licenseType: string | null;
|
|
403
|
+
commercialUse: boolean | null;
|
|
404
|
+
};
|
|
405
|
+
balances: {
|
|
406
|
+
amount: string;
|
|
407
|
+
owner: string;
|
|
408
|
+
}[] | null;
|
|
409
|
+
activeOrders: {
|
|
410
|
+
status: "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
|
|
411
|
+
chain: string;
|
|
412
|
+
offerer: string;
|
|
413
|
+
nftContract: string | null;
|
|
414
|
+
price: {
|
|
415
|
+
currency: string | null;
|
|
416
|
+
raw: string | null;
|
|
417
|
+
formatted: string | null;
|
|
418
|
+
decimals: number;
|
|
419
|
+
};
|
|
420
|
+
endTime: string;
|
|
421
|
+
fulfiller: string | null;
|
|
422
|
+
orderHash: string;
|
|
423
|
+
startTime: string;
|
|
424
|
+
txHash: {
|
|
425
|
+
created: string | null;
|
|
426
|
+
fulfilled: string | null;
|
|
427
|
+
cancelled: string | null;
|
|
428
|
+
};
|
|
429
|
+
token: {
|
|
430
|
+
name: string | null;
|
|
431
|
+
description: string | null;
|
|
432
|
+
image: string | null;
|
|
433
|
+
animationUrl: string | null;
|
|
434
|
+
} | null;
|
|
435
|
+
offer: {
|
|
436
|
+
token: string;
|
|
437
|
+
itemType: string;
|
|
438
|
+
identifier: string;
|
|
439
|
+
startAmount: string;
|
|
440
|
+
endAmount: string;
|
|
441
|
+
};
|
|
442
|
+
id: string;
|
|
443
|
+
consideration: {
|
|
444
|
+
recipient: string;
|
|
445
|
+
token: string;
|
|
446
|
+
itemType: string;
|
|
447
|
+
identifier: string;
|
|
448
|
+
startAmount: string;
|
|
449
|
+
endAmount: string;
|
|
450
|
+
};
|
|
451
|
+
nftTokenId: string | null;
|
|
452
|
+
createdBlockNumber: string;
|
|
453
|
+
remainingAmount: string | null;
|
|
454
|
+
createdAt: string;
|
|
455
|
+
updatedAt: string;
|
|
456
|
+
parentOrderHash?: string | null | undefined;
|
|
457
|
+
counterOfferMessage?: string | null | undefined;
|
|
458
|
+
hasActiveCounterOffer?: boolean | undefined;
|
|
459
|
+
}[];
|
|
460
|
+
holderCount?: number | undefined;
|
|
461
|
+
supply?: string | undefined;
|
|
462
|
+
}[];
|
|
33
463
|
isLoading: boolean;
|
|
34
464
|
error: any;
|
|
35
465
|
};
|
|
@@ -8,7 +8,7 @@ function useCollections(page = 1, limit = 20, isFeatured, sort = "recent", hideE
|
|
|
8
8
|
const { data, error, isLoading, mutate } = useSWR(
|
|
9
9
|
key,
|
|
10
10
|
async () => {
|
|
11
|
-
const res = await client.api.
|
|
11
|
+
const res = await client.api.collections.list({ page, limit, isFeatured, sort, service, standard });
|
|
12
12
|
return hideEmpty ? { ...res, data: res.data.filter((collection) => (collection.totalSupply ?? 0) > 0) } : res;
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -28,16 +28,16 @@ function useCollection(contract) {
|
|
|
28
28
|
const client = useMedialaneClient();
|
|
29
29
|
const { data, error, isLoading } = useSWR(
|
|
30
30
|
contract ? queryKeys.collection(contract) : null,
|
|
31
|
-
() => client.api.
|
|
31
|
+
() => client.api.collections.get(contract),
|
|
32
32
|
{ revalidateOnFocus: false }
|
|
33
33
|
);
|
|
34
|
-
return { collection: data
|
|
34
|
+
return { collection: data ?? null, isLoading, error };
|
|
35
35
|
}
|
|
36
36
|
function useCollectionsByOwner(owner) {
|
|
37
37
|
const client = useMedialaneClient();
|
|
38
38
|
const { data, error, isLoading, mutate } = useSWR(
|
|
39
39
|
owner ? queryKeys.collectionsOwner(owner) : null,
|
|
40
|
-
() => client.api.
|
|
40
|
+
() => client.api.collections.list({ owner, limit: 50 }),
|
|
41
41
|
{ revalidateOnFocus: false, refreshInterval: 6e4 }
|
|
42
42
|
);
|
|
43
43
|
return { collections: data?.data ?? [], isLoading, error, mutate };
|
|
@@ -46,7 +46,7 @@ function useCollectionTokens(contract, page = 1, limit = 24, sort = "recent") {
|
|
|
46
46
|
const client = useMedialaneClient();
|
|
47
47
|
const { data, error, isLoading, mutate } = useSWR(
|
|
48
48
|
contract ? queryKeys.collectionTokens(contract, page, limit, sort) : null,
|
|
49
|
-
() => client.api.
|
|
49
|
+
() => client.api.collections.tokens(contract, { page, limit, sort }),
|
|
50
50
|
{ revalidateOnFocus: false }
|
|
51
51
|
);
|
|
52
52
|
return { tokens: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-collections.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport type { ApiCollection, ApiResponse, CollectionTokensSort } from \"@medialane/sdk\";\nimport { queryKeys } from \"./query-keys.js\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport function useCollections(\n page = 1,\n limit = 20,\n isFeatured?: boolean,\n sort: CollectionSort = \"recent\",\n hideEmpty = true,\n service?: string,\n\n standard?: string,\n\n fallback?: ApiCollection[]\n) {\n const client = useMedialaneClient();\n const key = `${queryKeys.collections(page, limit, isFeatured, sort, hideEmpty, service)}-${standard ?? \"\"}`;\n\n const { data, error, isLoading, mutate } = useSWR<ApiResponse<ApiCollection[]>>(\n key,\n async () => {\n const res = await client.api.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-collections.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\nimport type { ApiCollection, ApiResponse, CollectionTokensSort } from \"@medialane/sdk\";\nimport { queryKeys } from \"./query-keys.js\";\n\nexport type CollectionSort = \"recent\" | \"supply\" | \"floor\" | \"volume\" | \"name\";\n\nexport function useCollections(\n page = 1,\n limit = 20,\n isFeatured?: boolean,\n sort: CollectionSort = \"recent\",\n hideEmpty = true,\n service?: string,\n\n standard?: string,\n\n fallback?: ApiCollection[]\n) {\n const client = useMedialaneClient();\n const key = `${queryKeys.collections(page, limit, isFeatured, sort, hideEmpty, service)}-${standard ?? \"\"}`;\n\n const { data, error, isLoading, mutate } = useSWR<ApiResponse<ApiCollection[]>>(\n key,\n async () => {\n const res = await client.api.collections.list({ page, limit, isFeatured, sort, service, standard });\n return hideEmpty\n ? { ...res, data: res.data.filter((collection) => (collection.totalSupply ?? 0) > 0) }\n : res;\n },\n {\n revalidateOnFocus: false,\n ...(fallback ? { fallbackData: { data: fallback } as ApiResponse<ApiCollection[]> } : {}),\n }\n );\n\n return {\n collections: data?.data ?? [],\n meta: data?.meta,\n isLoading,\n error,\n mutate,\n };\n}\n\nexport function useCollection( contract: string | null) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading } = useSWR(\n contract ? queryKeys.collection(contract) : null,\n () => client.api.collections.get(contract!),\n { revalidateOnFocus: false }\n );\n\n return { collection: data ?? null, isLoading, error };\n}\n\nexport function useCollectionsByOwner( owner: string | null) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, mutate } = useSWR(\n owner ? queryKeys.collectionsOwner(owner) : null,\n () => client.api.collections.list({ owner: owner!, limit: 50 }),\n { revalidateOnFocus: false, refreshInterval: 60_000 }\n );\n\n return { collections: data?.data ?? [], isLoading, error, mutate };\n}\n\nexport function useCollectionTokens(\n contract: string | null,\n page = 1,\n limit = 24,\n sort: CollectionTokensSort = \"recent\"\n) {\n const client = useMedialaneClient();\n\n const { data, error, isLoading, mutate } = useSWR(\n contract ? queryKeys.collectionTokens(contract, page, limit, sort) : null,\n () => client.api.collections.tokens(contract!, { page: page, limit: limit, sort: sort }),\n { revalidateOnFocus: false }\n );\n\n return { tokens: data?.data ?? [], meta: data?.meta, isLoading, error, mutate };\n}\n\nfunction pickNearbyTokens<T extends { tokenId: string }>(\n tokens: T[],\n currentTokenId: string | null,\n count: number\n): T[] {\n if (!currentTokenId) return tokens.slice(0, count);\n const idx = tokens.findIndex((t) => String(t.tokenId) === String(currentTokenId));\n if (idx === -1) return tokens.slice(0, count);\n\n const picked: T[] = [];\n let after = idx + 1;\n let before = idx - 1;\n while (picked.length < count && (after < tokens.length || before >= 0)) {\n if (after < tokens.length) picked.push(tokens[after++]);\n if (picked.length < count && before >= 0) picked.push(tokens[before--]);\n }\n return picked.sort((a, b) => Number(a.tokenId) - Number(b.tokenId));\n}\n\nexport function useNearbyCollectionTokens(\n contract: string | null,\n currentTokenId: string | null,\n count = 4,\n poolSize = 60\n) {\n const { tokens, isLoading, error } = useCollectionTokens(contract, 1, poolSize, \"oldest\");\n return { tokens: pickNearbyTokens(tokens, currentTokenId, count), isLoading, error };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AACnB,SAAS,0BAA0B;AAEnC,SAAS,iBAAiB;AAInB,SAAS,eACd,OAAO,GACP,QAAQ,IACR,YACA,OAAuB,UACvB,YAAY,MACZ,SAEA,UAEA,UACA;AACA,QAAM,SAAS,mBAAmB;AAClC,QAAM,MAAM,GAAG,UAAU,YAAY,MAAM,OAAO,YAAY,MAAM,WAAW,OAAO,CAAC,IAAI,YAAY,EAAE;AAEzG,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC;AAAA,IACA,YAAY;AACV,YAAM,MAAM,MAAM,OAAO,IAAI,YAAY,KAAK,EAAE,MAAM,OAAO,YAAY,MAAM,SAAS,SAAS,CAAC;AAClG,aAAO,YACH,EAAE,GAAG,KAAK,MAAM,IAAI,KAAK,OAAO,CAAC,gBAAgB,WAAW,eAAe,KAAK,CAAC,EAAE,IACnF;AAAA,IACN;AAAA,IACA;AAAA,MACE,mBAAmB;AAAA,MACnB,GAAI,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,EAAkC,IAAI,CAAC;AAAA,IACzF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,aAAa,MAAM,QAAQ,CAAC;AAAA,IAC5B,MAAM,MAAM;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,cAAe,UAAyB;AACtD,QAAM,SAAS,mBAAmB;AAElC,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI;AAAA,IACjC,WAAW,UAAU,WAAW,QAAQ,IAAI;AAAA,IAC5C,MAAM,OAAO,IAAI,YAAY,IAAI,QAAS;AAAA,IAC1C,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AAEA,SAAO,EAAE,YAAY,QAAQ,MAAM,WAAW,MAAM;AACtD;AAEO,SAAS,sBAAuB,OAAsB;AAC3D,QAAM,SAAS,mBAAmB;AAElC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,QAAQ,UAAU,iBAAiB,KAAK,IAAI;AAAA,IAC5C,MAAM,OAAO,IAAI,YAAY,KAAK,EAAE,OAAe,OAAO,GAAG,CAAC;AAAA,IAC9D,EAAE,mBAAmB,OAAO,iBAAiB,IAAO;AAAA,EACtD;AAEA,SAAO,EAAE,aAAa,MAAM,QAAQ,CAAC,GAAG,WAAW,OAAO,OAAO;AACnE;AAEO,SAAS,oBACd,UACA,OAAO,GACP,QAAQ,IACR,OAA6B,UAC7B;AACA,QAAM,SAAS,mBAAmB;AAElC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,WAAW,UAAU,iBAAiB,UAAU,MAAM,OAAO,IAAI,IAAI;AAAA,IACrE,MAAM,OAAO,IAAI,YAAY,OAAO,UAAW,EAAE,MAAY,OAAc,KAAW,CAAC;AAAA,IACvF,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AAEA,SAAO,EAAE,QAAQ,MAAM,QAAQ,CAAC,GAAG,MAAM,MAAM,MAAM,WAAW,OAAO,OAAO;AAChF;AAEA,SAAS,iBACP,QACA,gBACA,OACK;AACL,MAAI,CAAC,eAAgB,QAAO,OAAO,MAAM,GAAG,KAAK;AACjD,QAAM,MAAM,OAAO,UAAU,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,OAAO,cAAc,CAAC;AAChF,MAAI,QAAQ,GAAI,QAAO,OAAO,MAAM,GAAG,KAAK;AAE5C,QAAM,SAAc,CAAC;AACrB,MAAI,QAAQ,MAAM;AAClB,MAAI,SAAS,MAAM;AACnB,SAAO,OAAO,SAAS,UAAU,QAAQ,OAAO,UAAU,UAAU,IAAI;AACtE,QAAI,QAAQ,OAAO,OAAQ,QAAO,KAAK,OAAO,OAAO,CAAC;AACtD,QAAI,OAAO,SAAS,SAAS,UAAU,EAAG,QAAO,KAAK,OAAO,QAAQ,CAAC;AAAA,EACxE;AACA,SAAO,OAAO,KAAK,CAAC,GAAG,MAAM,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,OAAO,CAAC;AACpE;AAEO,SAAS,0BACd,UACA,gBACA,QAAQ,GACR,WAAW,IACX;AACA,QAAM,EAAE,QAAQ,WAAW,MAAM,IAAI,oBAAoB,UAAU,GAAG,UAAU,QAAQ;AACxF,SAAO,EAAE,QAAQ,iBAAiB,QAAQ,gBAAgB,KAAK,GAAG,WAAW,MAAM;AACrF;","names":[]}
|
|
@@ -38,7 +38,7 @@ function useComments(contract, tokenId, page = 1, limit = 20) {
|
|
|
38
38
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
39
39
|
const { data, error, isLoading, mutate } = (0, import_swr.default)(
|
|
40
40
|
contract && tokenId ? ["comments", contract, tokenId, page, limit] : null,
|
|
41
|
-
() => client.api.
|
|
41
|
+
() => client.api.tokens.comments(contract, tokenId, { page, limit }),
|
|
42
42
|
{ refreshInterval: 6e4, revalidateOnFocus: false, dedupingInterval: 1e4 }
|
|
43
43
|
);
|
|
44
44
|
return { comments: data?.data ?? [], total: data?.meta?.total ?? 0, isLoading, error, mutate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-comments.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiComment } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport interface UseCommentsResult {\n comments: ApiComment[];\n total: number;\n isLoading: boolean;\n error: unknown;\n mutate: () => void;\n}\n\nexport function useComments(contract: string, tokenId: string, page = 1, limit = 20): UseCommentsResult {\n const client = useMedialaneClient();\n const { data, error, isLoading, mutate } = useSWR(\n contract && tokenId ? [\"comments\", contract, tokenId, page, limit] : null,\n () => client.api.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-comments.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiComment } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport interface UseCommentsResult {\n comments: ApiComment[];\n total: number;\n isLoading: boolean;\n error: unknown;\n mutate: () => void;\n}\n\nexport function useComments(contract: string, tokenId: string, page = 1, limit = 20): UseCommentsResult {\n const client = useMedialaneClient();\n const { data, error, isLoading, mutate } = useSWR(\n contract && tokenId ? [\"comments\", contract, tokenId, page, limit] : null,\n () => client.api.tokens.comments(contract, tokenId, { page, limit }),\n { refreshInterval: 60_000, revalidateOnFocus: false, dedupingInterval: 10_000 },\n );\n return { comments: data?.data ?? [], total: data?.meta?.total ?? 0, isLoading, error, mutate };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAmB;AAEnB,kCAAmC;AAU5B,SAAS,YAAY,UAAkB,SAAiB,OAAO,GAAG,QAAQ,IAAuB;AACtG,QAAM,aAAS,gDAAmB;AAClC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,QAAI,WAAAA;AAAA,IACzC,YAAY,UAAU,CAAC,YAAY,UAAU,SAAS,MAAM,KAAK,IAAI;AAAA,IACrE,MAAM,OAAO,IAAI,OAAO,SAAS,UAAU,SAAS,EAAE,MAAM,MAAM,CAAC;AAAA,IACnE,EAAE,iBAAiB,KAAQ,mBAAmB,OAAO,kBAAkB,IAAO;AAAA,EAChF;AACA,SAAO,EAAE,UAAU,MAAM,QAAQ,CAAC,GAAG,OAAO,MAAM,MAAM,SAAS,GAAG,WAAW,OAAO,OAAO;AAC/F;","names":["useSWR"]}
|
|
@@ -5,7 +5,7 @@ function useComments(contract, tokenId, page = 1, limit = 20) {
|
|
|
5
5
|
const client = useMedialaneClient();
|
|
6
6
|
const { data, error, isLoading, mutate } = useSWR(
|
|
7
7
|
contract && tokenId ? ["comments", contract, tokenId, page, limit] : null,
|
|
8
|
-
() => client.api.
|
|
8
|
+
() => client.api.tokens.comments(contract, tokenId, { page, limit }),
|
|
9
9
|
{ refreshInterval: 6e4, revalidateOnFocus: false, dedupingInterval: 1e4 }
|
|
10
10
|
);
|
|
11
11
|
return { comments: data?.data ?? [], total: data?.meta?.total ?? 0, isLoading, error, mutate };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-comments.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiComment } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport interface UseCommentsResult {\n comments: ApiComment[];\n total: number;\n isLoading: boolean;\n error: unknown;\n mutate: () => void;\n}\n\nexport function useComments(contract: string, tokenId: string, page = 1, limit = 20): UseCommentsResult {\n const client = useMedialaneClient();\n const { data, error, isLoading, mutate } = useSWR(\n contract && tokenId ? [\"comments\", contract, tokenId, page, limit] : null,\n () => client.api.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-comments.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport type { ApiComment } from \"@medialane/sdk\";\nimport { useMedialaneClient } from \"./use-medialane-client.js\";\n\nexport interface UseCommentsResult {\n comments: ApiComment[];\n total: number;\n isLoading: boolean;\n error: unknown;\n mutate: () => void;\n}\n\nexport function useComments(contract: string, tokenId: string, page = 1, limit = 20): UseCommentsResult {\n const client = useMedialaneClient();\n const { data, error, isLoading, mutate } = useSWR(\n contract && tokenId ? [\"comments\", contract, tokenId, page, limit] : null,\n () => client.api.tokens.comments(contract, tokenId, { page, limit }),\n { refreshInterval: 60_000, revalidateOnFocus: false, dedupingInterval: 10_000 },\n );\n return { comments: data?.data ?? [], total: data?.meta?.total ?? 0, isLoading, error, mutate };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AAEnB,SAAS,0BAA0B;AAU5B,SAAS,YAAY,UAAkB,SAAiB,OAAO,GAAG,QAAQ,IAAuB;AACtG,QAAM,SAAS,mBAAmB;AAClC,QAAM,EAAE,MAAM,OAAO,WAAW,OAAO,IAAI;AAAA,IACzC,YAAY,UAAU,CAAC,YAAY,UAAU,SAAS,MAAM,KAAK,IAAI;AAAA,IACrE,MAAM,OAAO,IAAI,OAAO,SAAS,UAAU,SAAS,EAAE,MAAM,MAAM,CAAC;AAAA,IACnE,EAAE,iBAAiB,KAAQ,mBAAmB,OAAO,kBAAkB,IAAO;AAAA,EAChF;AACA,SAAO,EAAE,UAAU,MAAM,QAAQ,CAAC,GAAG,OAAO,MAAM,MAAM,SAAS,GAAG,WAAW,OAAO,OAAO;AAC/F;","names":[]}
|
|
@@ -38,7 +38,7 @@ function useCreators(search, page = 1, limit = 20) {
|
|
|
38
38
|
const { getClient } = (0, import_medialane_app.useMedialaneApp)();
|
|
39
39
|
const { data, error, isLoading } = (0, import_swr.default)(
|
|
40
40
|
`creators-${search ?? ""}-${page}-${limit}`,
|
|
41
|
-
() => getClient().api.
|
|
41
|
+
() => getClient().api.creators.list({ search, page, limit }),
|
|
42
42
|
{ revalidateOnFocus: false }
|
|
43
43
|
);
|
|
44
44
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-creators.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCreators(\n search?: string,\n page = 1,\n limit = 20\n) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading } = useSWR(\n `creators-${search ?? \"\"}-${page}-${limit}`,\n () => getClient().api.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-creators.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCreators(\n search?: string,\n page = 1,\n limit = 20\n) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading } = useSWR(\n `creators-${search ?? \"\"}-${page}-${limit}`,\n () => getClient().api.creators.list({ search, page, limit }),\n { revalidateOnFocus: false }\n );\n return {\n creators: data?.creators ?? [],\n total: data?.total ?? 0,\n isLoading,\n error,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAmB;AACnB,2BAAgC;AAEzB,SAAS,YACd,QACA,OAAO,GACP,QAAQ,IACR;AACA,QAAM,EAAE,UAAU,QAAI,sCAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,UAAU,QAAI,WAAAA;AAAA,IACjC,YAAY,UAAU,EAAE,IAAI,IAAI,IAAI,KAAK;AAAA,IACzC,MAAM,UAAU,EAAE,IAAI,SAAS,KAAK,EAAE,QAAQ,MAAM,MAAM,CAAC;AAAA,IAC3D,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO;AAAA,IACL,UAAU,MAAM,YAAY,CAAC;AAAA,IAC7B,OAAO,MAAM,SAAS;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AACF;","names":["useSWR"]}
|
|
@@ -5,7 +5,7 @@ function useCreators(search, page = 1, limit = 20) {
|
|
|
5
5
|
const { getClient } = useMedialaneApp();
|
|
6
6
|
const { data, error, isLoading } = useSWR(
|
|
7
7
|
`creators-${search ?? ""}-${page}-${limit}`,
|
|
8
|
-
() => getClient().api.
|
|
8
|
+
() => getClient().api.creators.list({ search, page, limit }),
|
|
9
9
|
{ revalidateOnFocus: false }
|
|
10
10
|
);
|
|
11
11
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-creators.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCreators(\n search?: string,\n page = 1,\n limit = 20\n) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading } = useSWR(\n `creators-${search ?? \"\"}-${page}-${limit}`,\n () => getClient().api.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-creators.ts"],"sourcesContent":["\"use client\";\n\nimport useSWR from \"swr\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\n\nexport function useCreators(\n search?: string,\n page = 1,\n limit = 20\n) {\n const { getClient } = useMedialaneApp();\n const { data, error, isLoading } = useSWR(\n `creators-${search ?? \"\"}-${page}-${limit}`,\n () => getClient().api.creators.list({ search, page, limit }),\n { revalidateOnFocus: false }\n );\n return {\n creators: data?.creators ?? [],\n total: data?.total ?? 0,\n isLoading,\n error,\n };\n}\n"],"mappings":";AAEA,OAAO,YAAY;AACnB,SAAS,uBAAuB;AAEzB,SAAS,YACd,QACA,OAAO,GACP,QAAQ,IACR;AACA,QAAM,EAAE,UAAU,IAAI,gBAAgB;AACtC,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI;AAAA,IACjC,YAAY,UAAU,EAAE,IAAI,IAAI,IAAI,KAAK;AAAA,IACzC,MAAM,UAAU,EAAE,IAAI,SAAS,KAAK,EAAE,QAAQ,MAAM,MAAM,CAAC;AAAA,IAC3D,EAAE,mBAAmB,MAAM;AAAA,EAC7B;AACA,SAAO;AAAA,IACL,UAAU,MAAM,YAAY,CAAC;AAAA,IAC7B,OAAO,MAAM,SAAS;AAAA,IACtB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
package/dist/utils/use-drops.cjs
CHANGED
|
@@ -46,36 +46,36 @@ var import_use_medialane_client = require("./use-medialane-client.js");
|
|
|
46
46
|
const quiet = { revalidateOnFocus: false, shouldRetryOnError: false };
|
|
47
47
|
function useDrops(status) {
|
|
48
48
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
49
|
-
const { data, error, isLoading } = (0, import_swr.default)(["drops", status], () => client.api.
|
|
49
|
+
const { data, error, isLoading } = (0, import_swr.default)(["drops", status], () => client.api.drops.list({ status, limit: 48 }), quiet);
|
|
50
50
|
return { drops: data?.data ?? [], isLoading, error };
|
|
51
51
|
}
|
|
52
52
|
function useMyDrops(organizer) {
|
|
53
53
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
54
|
-
const { data, error, isLoading } = (0, import_swr.default)(organizer ? ["my-drops", organizer] : null, () => client.api.
|
|
54
|
+
const { data, error, isLoading } = (0, import_swr.default)(organizer ? ["my-drops", organizer] : null, () => client.api.drops.list({ organizer, limit: 100 }), quiet);
|
|
55
55
|
return { drops: data?.data ?? [], isLoading, error };
|
|
56
56
|
}
|
|
57
57
|
function useDrop(contract) {
|
|
58
58
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
59
|
-
const { data, error, isLoading, mutate } = (0, import_swr.default)(contract ? ["drop", contract] : null, () => client.api.
|
|
59
|
+
const { data, error, isLoading, mutate } = (0, import_swr.default)(contract ? ["drop", contract] : null, () => client.api.drops.find(contract), { ...quiet, refreshInterval: 3e4 });
|
|
60
60
|
return { drop: data ?? null, isLoading, error, mutate };
|
|
61
61
|
}
|
|
62
62
|
function useDropMints(contract) {
|
|
63
63
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
64
|
-
const { data, isLoading, mutate } = (0, import_swr.default)(contract ? ["drop-mints", contract] : null, () => client.api.
|
|
64
|
+
const { data, isLoading, mutate } = (0, import_swr.default)(contract ? ["drop-mints", contract] : null, () => client.api.drops.mints(contract, { limit: 20 }), { ...quiet, refreshInterval: 3e4 });
|
|
65
65
|
return { mints: data?.data ?? [], isLoading, mutate };
|
|
66
66
|
}
|
|
67
67
|
function useDropFee() {
|
|
68
68
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
69
|
-
const { data } = (0, import_swr.default)("drop-fee", () => client.api.
|
|
69
|
+
const { data } = (0, import_swr.default)("drop-fee", () => client.api.drops.fee(), { revalidateOnFocus: false });
|
|
70
70
|
return data?.launchpadBps ?? null;
|
|
71
71
|
}
|
|
72
72
|
function useDropFile(baseUri, name) {
|
|
73
73
|
const client = (0, import_use_medialane_client.useMedialaneClient)();
|
|
74
|
-
const { data } = (0, import_swr.default)(baseUri ? ["drop-file", baseUri, name] : null, async () => (await client.api.
|
|
74
|
+
const { data } = (0, import_swr.default)(baseUri ? ["drop-file", baseUri, name] : null, async () => (await client.api.metadata.resolve(`${baseUri}${name}`)).data, quiet);
|
|
75
75
|
return data ?? null;
|
|
76
76
|
}
|
|
77
77
|
async function readDropState(client, contract, wallet) {
|
|
78
|
-
const drop = await client.api.
|
|
78
|
+
const drop = await client.api.chainReads.dropState(contract);
|
|
79
79
|
if (!drop) throw new Error("Drop not found");
|
|
80
80
|
const [claimed, balance] = await Promise.all([
|
|
81
81
|
wallet ? (0, import_starknet.dropClaimedBy)(client.provider, contract, wallet) : Promise.resolve(null),
|