@medialane/sdk 0.70.0 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1355 @@
1
+ import { z } from 'zod';
2
+ import { C as Chain } from './types-Cdwb6lXp.cjs';
3
+
4
+ interface RetryOptions {
5
+ maxAttempts?: number;
6
+ baseDelayMs?: number;
7
+ maxDelayMs?: number;
8
+ }
9
+
10
+ declare const FeeConfigSchema: z.ZodObject<{
11
+ enabled: z.ZodDefault<z.ZodBoolean>;
12
+ fundAddress: z.ZodOptional<z.ZodString>;
13
+ marketplaceBps: z.ZodDefault<z.ZodNumber>;
14
+ launchpadBps: z.ZodDefault<z.ZodNumber>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ enabled: boolean;
17
+ marketplaceBps: number;
18
+ launchpadBps: number;
19
+ fundAddress?: string | undefined;
20
+ }, {
21
+ enabled?: boolean | undefined;
22
+ fundAddress?: string | undefined;
23
+ marketplaceBps?: number | undefined;
24
+ launchpadBps?: number | undefined;
25
+ }>;
26
+ type FeeConfig = z.input<typeof FeeConfigSchema>;
27
+ interface ResolvedFeeConfig {
28
+ enabled: boolean;
29
+ fundAddress: string | undefined;
30
+ marketplaceBps: number;
31
+ launchpadBps: number;
32
+ }
33
+ declare function resolveFeeConfig(raw: FeeConfig | undefined): ResolvedFeeConfig;
34
+
35
+ declare const MedialaneConfigSchema: z.ZodObject<{
36
+ chain: z.ZodDefault<z.ZodEnum<["STARKNET", "ETHEREUM", "SOLANA", "BASE", "STELLAR", "BITCOIN"]>>;
37
+ rpcUrl: z.ZodOptional<z.ZodString>;
38
+ backendUrl: z.ZodOptional<z.ZodString>;
39
+ apiKey: z.ZodOptional<z.ZodString>;
40
+ marketplace721Contract: z.ZodOptional<z.ZodString>;
41
+ marketplaceContract: z.ZodOptional<z.ZodString>;
42
+ marketplace1155Contract: z.ZodOptional<z.ZodString>;
43
+ collection721Contract: z.ZodOptional<z.ZodString>;
44
+ collectionContract: z.ZodOptional<z.ZodString>;
45
+ collection1155Contract: z.ZodOptional<z.ZodString>;
46
+ retryOptions: z.ZodOptional<z.ZodObject<{
47
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
48
+ baseDelayMs: z.ZodOptional<z.ZodNumber>;
49
+ maxDelayMs: z.ZodOptional<z.ZodNumber>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ maxAttempts?: number | undefined;
52
+ baseDelayMs?: number | undefined;
53
+ maxDelayMs?: number | undefined;
54
+ }, {
55
+ maxAttempts?: number | undefined;
56
+ baseDelayMs?: number | undefined;
57
+ maxDelayMs?: number | undefined;
58
+ }>>;
59
+ feeConfig: z.ZodOptional<z.ZodObject<{
60
+ enabled: z.ZodDefault<z.ZodBoolean>;
61
+ fundAddress: z.ZodOptional<z.ZodString>;
62
+ marketplaceBps: z.ZodDefault<z.ZodNumber>;
63
+ launchpadBps: z.ZodDefault<z.ZodNumber>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ enabled: boolean;
66
+ marketplaceBps: number;
67
+ launchpadBps: number;
68
+ fundAddress?: string | undefined;
69
+ }, {
70
+ enabled?: boolean | undefined;
71
+ fundAddress?: string | undefined;
72
+ marketplaceBps?: number | undefined;
73
+ launchpadBps?: number | undefined;
74
+ }>>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ chain: "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "STELLAR" | "BITCOIN";
77
+ rpcUrl?: string | undefined;
78
+ backendUrl?: string | undefined;
79
+ apiKey?: string | undefined;
80
+ marketplace721Contract?: string | undefined;
81
+ marketplaceContract?: string | undefined;
82
+ marketplace1155Contract?: string | undefined;
83
+ collection721Contract?: string | undefined;
84
+ collectionContract?: string | undefined;
85
+ collection1155Contract?: string | undefined;
86
+ retryOptions?: {
87
+ maxAttempts?: number | undefined;
88
+ baseDelayMs?: number | undefined;
89
+ maxDelayMs?: number | undefined;
90
+ } | undefined;
91
+ feeConfig?: {
92
+ enabled: boolean;
93
+ marketplaceBps: number;
94
+ launchpadBps: number;
95
+ fundAddress?: string | undefined;
96
+ } | undefined;
97
+ }, {
98
+ rpcUrl?: string | undefined;
99
+ chain?: "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "STELLAR" | "BITCOIN" | undefined;
100
+ backendUrl?: string | undefined;
101
+ apiKey?: string | undefined;
102
+ marketplace721Contract?: string | undefined;
103
+ marketplaceContract?: string | undefined;
104
+ marketplace1155Contract?: string | undefined;
105
+ collection721Contract?: string | undefined;
106
+ collectionContract?: string | undefined;
107
+ collection1155Contract?: string | undefined;
108
+ retryOptions?: {
109
+ maxAttempts?: number | undefined;
110
+ baseDelayMs?: number | undefined;
111
+ maxDelayMs?: number | undefined;
112
+ } | undefined;
113
+ feeConfig?: {
114
+ enabled?: boolean | undefined;
115
+ fundAddress?: string | undefined;
116
+ marketplaceBps?: number | undefined;
117
+ launchpadBps?: number | undefined;
118
+ } | undefined;
119
+ }>;
120
+ type MedialaneConfig = z.input<typeof MedialaneConfigSchema>;
121
+ interface ResolvedConfig {
122
+ chain: Chain;
123
+ rpcUrl: string;
124
+ backendUrl: string | undefined;
125
+ apiKey: string | undefined;
126
+ marketplace721Contract: string;
127
+ marketplaceContract: string;
128
+ marketplace1155Contract: string;
129
+ collection721Contract: string;
130
+ collectionContract: string;
131
+ collection1155Contract: string;
132
+ retryOptions?: RetryOptions;
133
+ feeConfig: ResolvedFeeConfig;
134
+ }
135
+ declare function resolveConfig(raw: MedialaneConfig): ResolvedConfig;
136
+
137
+ type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
138
+ type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
139
+ type CollectionTokensSort = "recent" | "oldest" | "name" | "price";
140
+ /** Bounded capability set (05-service-model §III). Expand the union when a
141
+ * service needs behavior outside it — never make it free-form. */
142
+ type ServiceCapability = "list" | "buy" | "make_offer" | "cancel" | "transfer" | "burn" | "mint" | "claim" | "airdrop" | "remix" | "license" | "subscribe" | "redeem" | "launch" | "swap" | "sponsor";
143
+ /** A service that bakes enforcement into its own contract declares it here
144
+ * (04-licensing-model §V, 05-service-model §IV). Absence/all-falsey =
145
+ * soft enforcement (the 00-principles §9 default). */
146
+ interface EnforcementDeclaration {
147
+ royalty?: "erc2981" | "service-split" | "none";
148
+ escrow?: boolean;
149
+ timeLock?: boolean;
150
+ revocable?: boolean;
151
+ }
152
+ /** An on-chain event the service emits. The indexer consumes this list to
153
+ * decide what to poll and how to parse — the year-2 "data-driven event
154
+ * parser registry" foundation (02-protocol-app-split §V).
155
+ *
156
+ * The Cairo selector is derivable from `name` via
157
+ * `starknet.hash.getSelectorFromName(name)` — not stored to avoid
158
+ * duplication and keep the SDK runtime-free of pre-computed hashes.
159
+ */
160
+ interface ServiceEventDeclaration {
161
+ /** Cairo event struct name (e.g. "OrderCreated", "CollectionCreated"). */
162
+ name: string;
163
+ /**
164
+ * Where this event is emitted:
165
+ * - "factory": at the service's `onchain.factoryAddress` (fixed address).
166
+ * Examples: marketplace OrderCreated, factory CollectionCreated.
167
+ * - "instance": at the address of each deployed collection contract
168
+ * (variable; the indexer iterates discovered instances).
169
+ * Examples: ERC-721 Transfer, POP AllowlistUpdated.
170
+ */
171
+ emittedBy: "factory" | "instance";
172
+ /**
173
+ * Polling cadence the indexer should use:
174
+ * - "fast" (default): every indexer tick (~6s). Right for low-volume
175
+ * protocol events like order/factory events.
176
+ * - "slow": a separate slower loop (~2min). Right for
177
+ * high-volume per-instance events like Transfer
178
+ * and AllowlistUpdated — polling them every tick
179
+ * against every known instance is RPC-expensive.
180
+ */
181
+ poll?: "fast" | "slow";
182
+ }
183
+ /** Declarative description of a service (05-service-model §II).
184
+ * SDK-resident in v1; on-chain registry in year 2. */
185
+ interface ServiceDefinition {
186
+ /** Stable kebab-case id. NO version number (05 §II). */
187
+ id: string;
188
+ displayName: string;
189
+ description: string;
190
+ standard: "ERC721" | "ERC1155" | "ERC20" | "UNKNOWN";
191
+ provenance: "MEDIALANE" | "EXTERNAL";
192
+ onchain?: Partial<Record<Chain, {
193
+ factoryAddress?: string;
194
+ classHash?: string;
195
+ startBlock?: number;
196
+ }>>;
197
+ /** Drives the dapp asset/collection page variant. */
198
+ uiVariant: string;
199
+ capabilities: ServiceCapability[];
200
+ /** Events the indexer should poll + parse for this service.
201
+ * Optional during the year-1 transition — backend hand-coded pollers
202
+ * (medialane-backend/src/mirror/poller.ts) take precedence today.
203
+ * Populated here so consumers and the future data-driven indexer can
204
+ * read what events a service emits without code-spelunking. */
205
+ events?: ServiceEventDeclaration[];
206
+ metadataSchema?: {
207
+ requiredTraits?: string[];
208
+ /** Canonical platform default is "CC BY-SA" (04-licensing-model §III). */
209
+ licenseDefault?: string;
210
+ enforcement?: EnforcementDeclaration;
211
+ };
212
+ }
213
+ interface ApiCollectionsQuery {
214
+ page?: number;
215
+ limit?: number;
216
+ isKnown?: boolean;
217
+ sort?: CollectionSort;
218
+ owner?: string;
219
+ /** Filter by service id. */
220
+ service?: string;
221
+ }
222
+ /**
223
+ * Order lifecycle states. **Four canonical values** per `01-core-model §V`.
224
+ *
225
+ * The legacy `"COUNTER_OFFERED"` value was removed in 0.23.0 (audit P0-1
226
+ * Phase D). Counter-offers are linked orders via `parentOrderHash`, not a
227
+ * third lifecycle state on the parent bid. Use `ApiOrder.hasActiveCounterOffer`
228
+ * (added in 0.22.0) for the "this bid has been countered" affordance.
229
+ */
230
+ type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
231
+ type SortOrder = "price_asc" | "price_desc" | "recent";
232
+ type ActivityType = "mint" | "transfer" | "sale" | "listing" | "offer" | "cancelled";
233
+ type IntentType = "CREATE_LISTING" | "MAKE_OFFER" | "FULFILL_ORDER" | "CANCEL_ORDER" | "MINT" | "CREATE_COLLECTION" | "COUNTER_OFFER";
234
+ type IntentStatus = "PENDING" | "SIGNED" | "SUBMITTED" | "CONFIRMED" | "FAILED" | "EXPIRED";
235
+ type WebhookEventType = "ORDER_CREATED" | "ORDER_FULFILLED" | "ORDER_CANCELLED" | "TRANSFER";
236
+ type WebhookStatus = "ACTIVE" | "DISABLED";
237
+ type ApiKeyStatus = "ACTIVE" | "REVOKED";
238
+ type TenantPlan = "FREE" | "PREMIUM";
239
+ interface ApiMeta {
240
+ page: number;
241
+ limit: number;
242
+ total?: number;
243
+ }
244
+ interface ApiResponse<T> {
245
+ data: T;
246
+ meta?: ApiMeta;
247
+ }
248
+ /** Cross-chain read filter — a concrete chain, or "all" for aggregation
249
+ * (platform-federation spec §2.3). Omitted = the backend default (STARKNET). */
250
+ type ChainFilter = Chain | "all";
251
+ interface ApiOrdersQuery {
252
+ chain?: ChainFilter;
253
+ status?: OrderStatus;
254
+ collection?: string;
255
+ currency?: string;
256
+ sort?: SortOrder;
257
+ page?: number;
258
+ limit?: number;
259
+ offerer?: string;
260
+ minPrice?: string;
261
+ maxPrice?: string;
262
+ }
263
+ interface ApiOrderOffer {
264
+ itemType: string;
265
+ token: string;
266
+ identifier: string;
267
+ startAmount: string;
268
+ endAmount: string;
269
+ }
270
+ interface ApiOrderConsideration extends ApiOrderOffer {
271
+ recipient: string;
272
+ }
273
+ interface ApiOrderPrice {
274
+ raw: string | null;
275
+ formatted: string | null;
276
+ currency: string | null;
277
+ decimals: number;
278
+ }
279
+ interface ApiOrderTxHash {
280
+ created: string | null;
281
+ fulfilled: string | null;
282
+ cancelled: string | null;
283
+ }
284
+ interface ApiOrderTokenMeta {
285
+ name: string | null;
286
+ image: string | null;
287
+ description: string | null;
288
+ }
289
+ interface ApiOrder {
290
+ id: string;
291
+ chain: string;
292
+ orderHash: string;
293
+ offerer: string;
294
+ offer: ApiOrderOffer;
295
+ consideration: ApiOrderConsideration;
296
+ startTime: string;
297
+ endTime: string;
298
+ status: OrderStatus;
299
+ fulfiller: string | null;
300
+ nftContract: string | null;
301
+ nftTokenId: string | null;
302
+ price: ApiOrderPrice;
303
+ txHash: ApiOrderTxHash;
304
+ createdBlockNumber: string;
305
+ /** ERC-1155 only: units still available after the last partial fill. Null for ERC-721 or unfilled orders. */
306
+ remainingAmount: string | null;
307
+ createdAt: string;
308
+ updatedAt: string;
309
+ /** Embedded token metadata (name/image/description). Null when not yet indexed. */
310
+ token: ApiOrderTokenMeta | null;
311
+ /** Set when this is a counter-offer listing — points to the original buyer bid.
312
+ * Now always emitted by the backend (was conditional); kept optional in the
313
+ * type for back-compat with older response shapes. */
314
+ parentOrderHash?: string | null;
315
+ /** Optional seller message accompanying a counter-offer. */
316
+ counterOfferMessage?: string | null;
317
+ /** True when this order is a bid (ERC-20 offer) AND at least one ACTIVE counter
318
+ * exists with `parentOrderHash = this.orderHash`. Set by endpoints that compute
319
+ * it (currently `GET /v1/orders/user/:address` and `GET /v1/orders/:orderHash`);
320
+ * undefined on endpoints that don't.
321
+ *
322
+ * Use this instead of `status === "COUNTER_OFFERED"` for "this bid has been
323
+ * countered" affordances. The status pattern is being phased out per
324
+ * 01-core-model §V — counter-offers are linked orders, not a lifecycle state. */
325
+ hasActiveCounterOffer?: boolean;
326
+ }
327
+ /**
328
+ * A single OpenSea-compatible ERC-721 attribute.
329
+ * Medialane embeds licensing, provenance, and IP metadata as attributes.
330
+ */
331
+ interface IpAttribute {
332
+ trait_type: string;
333
+ value: string;
334
+ }
335
+ /**
336
+ * Full on-chain + IPFS metadata for a Medialane IP NFT.
337
+ * Conforms to the OpenSea ERC-721 metadata standard and embeds
338
+ * Berne Convention-compatible licensing data in `attributes`.
339
+ *
340
+ * Common licensing attributes (all optional — absent on pre-v2 tokens):
341
+ * License · Commercial Use · Derivatives · Attribution · Territory
342
+ * AI Policy · Royalty · Standard ("Berne Convention") · Registration
343
+ */
344
+ interface IpNftMetadata {
345
+ name: string;
346
+ description?: string;
347
+ image?: string | null;
348
+ external_url?: string;
349
+ attributes?: IpAttribute[];
350
+ /** Populated by the indexer for fast access — not stored in IPFS */
351
+ ipType?: string | null;
352
+ licenseType?: string | null;
353
+ commercialUse?: string | null;
354
+ derivatives?: string | null;
355
+ attribution?: string | null;
356
+ territory?: string | null;
357
+ aiPolicy?: string | null;
358
+ royalty?: string | null;
359
+ registration?: string | null;
360
+ }
361
+ /** Indexed token metadata as returned by the Medialane API. */
362
+ interface ApiTokenMetadata {
363
+ name: string | null;
364
+ description: string | null;
365
+ image: string | null;
366
+ /** Parsed OpenSea-standard attributes array. Null when metadata hasn't been fetched. */
367
+ attributes: IpAttribute[] | null;
368
+ /** Short-circuit fields extracted from attributes by the indexer */
369
+ ipType: string | null;
370
+ licenseType: string | null;
371
+ commercialUse: string | null;
372
+ derivatives: string | null;
373
+ attribution: string | null;
374
+ territory: string | null;
375
+ aiPolicy: string | null;
376
+ royalty: string | null;
377
+ registration: string | null;
378
+ author: string | null;
379
+ }
380
+ /** Per-holder balance entry. Present for ERC-1155 (multi-holder); single entry for ERC-721. */
381
+ interface ApiTokenBalance {
382
+ owner: string;
383
+ /** Quantity held. Always "1" for ERC-721. */
384
+ amount: string;
385
+ }
386
+ interface ApiToken {
387
+ id: string;
388
+ chain: string;
389
+ contractAddress: string;
390
+ tokenId: string;
391
+ /** @deprecated Use `balances` for ownership checks — always null after ERC-1155 migration. */
392
+ owner: string | null;
393
+ tokenUri: string | null;
394
+ metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
395
+ /** Token standard derived from the parent collection. Use this to determine ERC-721 vs ERC-1155 behavior. */
396
+ standard: "ERC721" | "ERC1155" | "UNKNOWN";
397
+ metadata: ApiTokenMetadata;
398
+ /** Current holders with amounts. Only present on single-token fetches; null on list responses. */
399
+ balances: ApiTokenBalance[] | null;
400
+ activeOrders: ApiOrder[];
401
+ createdAt: string;
402
+ updatedAt: string;
403
+ }
404
+ interface ApiCollection {
405
+ id: string;
406
+ chain: string;
407
+ contractAddress: string;
408
+ collectionId: string | null;
409
+ name: string | null;
410
+ symbol: string | null;
411
+ description: string | null;
412
+ image: string | null;
413
+ owner: string | null;
414
+ startBlock: string;
415
+ metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
416
+ /** Token standard detected via ERC-165. Collection is NFT-only since the
417
+ * 2026-06-14 coin split — fungible coins are `ApiCoin`, served by getCoins(). */
418
+ standard: "ERC721" | "ERC1155";
419
+ isKnown: boolean;
420
+ /** Hidden by ops/admin (content moderation). When true, list endpoints
421
+ * already filter the row out; single-collection fetches still return
422
+ * it so the UI can render a "hidden" banner instead of a 404. */
423
+ isHidden: boolean;
424
+ /** Promoted on homepage / browse surfaces. */
425
+ isFeatured: boolean;
426
+ /** Stable Medialane service ID, or null for external collections.
427
+ * Resolve via getService() (05-service-model). Primary field. */
428
+ service: string | null;
429
+ claimedBy: string | null;
430
+ profile?: ApiCollectionProfile | null;
431
+ floorPrice: string | null;
432
+ totalVolume: string | null;
433
+ holderCount: number | null;
434
+ totalSupply: number | null;
435
+ createdAt: string;
436
+ updatedAt: string;
437
+ }
438
+ /** A fungible coin (ERC-20 today; SPL/etc. later). Distinct from ApiCollection:
439
+ * a coin has a supply + decimals + a market price (read live from Ekubo), no
440
+ * tokens, no orders. Served by getCoins()/getCoin() (spec 2026-06-14). */
441
+ interface ApiCoin {
442
+ id: string;
443
+ chain: string;
444
+ contractAddress: string;
445
+ standard: "ERC20";
446
+ /** "creator-coin" | "external-erc20" */
447
+ service: string;
448
+ name: string | null;
449
+ symbol: string | null;
450
+ decimals: number;
451
+ /** Fungible supply as a decimal string — NOT an item count. */
452
+ totalSupply: string | null;
453
+ description: string | null;
454
+ image: string | null;
455
+ creator: string | null;
456
+ startBlock: string;
457
+ isHidden: boolean;
458
+ createdAt: string;
459
+ updatedAt: string;
460
+ }
461
+ interface ApiCoinsQuery {
462
+ chain?: ChainFilter;
463
+ page?: number;
464
+ limit?: number;
465
+ /** Filter by coin service id ("creator-coin" | "external-erc20"). */
466
+ service?: string;
467
+ }
468
+ interface ApiActivityPrice {
469
+ raw: string | null;
470
+ formatted: string | null;
471
+ currency: string | null;
472
+ }
473
+ interface ApiActivity {
474
+ type: ActivityType;
475
+ contractAddress?: string;
476
+ tokenId?: string;
477
+ from?: string;
478
+ to?: string;
479
+ blockNumber?: string;
480
+ /** ERC-1155 quantity (transfer/mint rows). "1" for ERC-721. */
481
+ amount?: string;
482
+ orderHash?: string;
483
+ nftContract?: string;
484
+ nftTokenId?: string;
485
+ offerer?: string;
486
+ fulfiller?: string | null;
487
+ price?: ApiActivityPrice;
488
+ /** Token standard — present on order rows. */
489
+ tokenStandard?: "ERC721" | "ERC1155";
490
+ txHash: string | null;
491
+ timestamp: string;
492
+ /** Batch-enriched token metadata — avoids per-row fetches. */
493
+ token?: {
494
+ name: string | null;
495
+ image: string | null;
496
+ } | null;
497
+ }
498
+ interface ApiActivitiesQuery {
499
+ chain?: ChainFilter;
500
+ type?: ActivityType;
501
+ page?: number;
502
+ limit?: number;
503
+ }
504
+ interface ApiComment {
505
+ id: string;
506
+ chain: string;
507
+ contractAddress: string;
508
+ tokenId: string;
509
+ author: string;
510
+ content: string;
511
+ txHash: string | null;
512
+ blockNumber: string;
513
+ postedAt: string;
514
+ }
515
+ interface ApiSearchTokenResult {
516
+ contractAddress: string;
517
+ tokenId: string;
518
+ name: string | null;
519
+ image: string | null;
520
+ owner: string;
521
+ metadataStatus: string;
522
+ }
523
+ interface ApiSearchCollectionResult {
524
+ contractAddress: string;
525
+ name: string | null;
526
+ image: string | null;
527
+ totalSupply: number | null;
528
+ floorPrice: string | null;
529
+ holderCount: number | null;
530
+ }
531
+ interface ApiSearchCreatorResult {
532
+ walletAddress: string;
533
+ username: string | null;
534
+ displayName: string | null;
535
+ bio: string | null;
536
+ avatarImage: string | null;
537
+ }
538
+ interface ApiSearchResult {
539
+ tokens: ApiSearchTokenResult[];
540
+ collections: ApiSearchCollectionResult[];
541
+ creators: ApiSearchCreatorResult[];
542
+ }
543
+ interface ApiIntent {
544
+ id: string;
545
+ chain: string;
546
+ type: IntentType;
547
+ status: IntentStatus;
548
+ requester: string;
549
+ typedData: unknown;
550
+ calls: unknown;
551
+ signature: string[];
552
+ txHash: string | null;
553
+ orderHash: string | null;
554
+ /** Set on COUNTER_OFFER intents — the original bid order hash being countered. */
555
+ parentOrderHash?: string | null;
556
+ /** Optional seller message on counter-offer intents. */
557
+ counterOfferMessage?: string | null;
558
+ expiresAt: string;
559
+ createdAt: string;
560
+ updatedAt: string;
561
+ }
562
+ /** A single Starknet call as returned in intent calldata. */
563
+ interface IntentCall {
564
+ contractAddress: string;
565
+ entrypoint: string;
566
+ calldata: string[];
567
+ }
568
+ /**
569
+ * Response from any `createXIntent` call. Discriminated on `requiresSignature`:
570
+ * • true — SNIP-12 intent (listing / offer / cancel / counter-offer). Sign
571
+ * `typedData`, then call `submitIntentSignature(id, sig)` to obtain
572
+ * the executable calls.
573
+ * • false — prebuilt intent (fulfill / mint / create-collection). `calls` are
574
+ * ready to execute directly; there is no signature step.
575
+ *
576
+ * The discriminant makes the wrong access a compile error: `typedData` does not
577
+ * exist on the `false` variant, nor `calls` on the `true` variant. Consumers
578
+ * MUST narrow on `requiresSignature` before reading either.
579
+ */
580
+ type ApiIntentCreated = {
581
+ id: string;
582
+ expiresAt: string;
583
+ requiresSignature: true;
584
+ typedData: unknown;
585
+ } | {
586
+ id: string;
587
+ expiresAt: string;
588
+ requiresSignature: false;
589
+ calls: IntentCall[];
590
+ };
591
+ interface CreateListingIntentParams {
592
+ offerer: string;
593
+ nftContract: string;
594
+ tokenId: string;
595
+ currency: string;
596
+ price: string;
597
+ endTime: number;
598
+ salt?: string;
599
+ /** Number of units to list — required for ERC-1155, omit for ERC-721. */
600
+ amount?: string;
601
+ }
602
+ interface MakeOfferIntentParams {
603
+ offerer: string;
604
+ nftContract: string;
605
+ tokenId: string;
606
+ currency: string;
607
+ price: string;
608
+ endTime: number;
609
+ salt?: string;
610
+ /** Caller hint — "ERC1155" creates the bid on the ERC-1155 marketplace. */
611
+ tokenStandard?: string;
612
+ /** ERC-1155 only: number of editions requested. Defaults to 1. */
613
+ quantity?: string;
614
+ }
615
+ interface FulfillOrderIntentParams {
616
+ fulfiller: string;
617
+ orderHash: string;
618
+ /** Caller hint — "ERC1155" forces 1155 routing even if the order isn't in the DB yet */
619
+ tokenStandard?: string;
620
+ /** ERC-1155 only: units to purchase (1 ≤ quantity ≤ remaining_amount). Defaults to 1. */
621
+ quantity?: string;
622
+ }
623
+ interface CancelOrderIntentParams {
624
+ offerer: string;
625
+ orderHash: string;
626
+ /** Caller hint — "ERC1155" forces 1155 routing even if the order isn't in the DB yet */
627
+ tokenStandard?: string;
628
+ }
629
+ interface CreateMintIntentParams {
630
+ /** Collection owner wallet address — must be the collection owner on-chain */
631
+ owner: string;
632
+ collectionId: string;
633
+ recipient: string;
634
+ tokenUri: string;
635
+ /**
636
+ * EIP-2981 secondary-sale royalty in basis points (0–10_000). Set once at mint;
637
+ * receiver is the immutable creator. Required since MIP v0.4.0 — pass 0 for none.
638
+ */
639
+ royaltyBps: number;
640
+ /** Optional: override the default collection contract address */
641
+ collectionContract?: string;
642
+ }
643
+ interface CreateCollectionIntentParams {
644
+ owner: string;
645
+ name: string;
646
+ symbol: string;
647
+ /** Optional description stored server-side and surfaced on the collection page. */
648
+ description?: string;
649
+ /** Optional IPFS image URI (ipfs://...) for the collection cover image. */
650
+ image?: string;
651
+ /** Base URI for token metadata. Defaults to empty string if not provided. */
652
+ baseUri?: string;
653
+ /** Optional: override the default collection contract address */
654
+ collectionContract?: string;
655
+ }
656
+ interface CreateCounterOfferIntentParams {
657
+ /** Wallet address of the NFT owner making the counter-offer. */
658
+ sellerAddress: string;
659
+ /** Order hash of the original buyer bid being countered. */
660
+ originalOrderHash: string;
661
+ /** Counter price as a raw wei integer string (not human-readable). */
662
+ priceRaw: string;
663
+ /** Duration in seconds the counter-offer will be valid (3600–2592000). */
664
+ durationSeconds: number;
665
+ /** Optional message from the seller to the buyer. Max 500 chars. */
666
+ message?: string;
667
+ }
668
+ interface ApiCounterOffersQuery {
669
+ /** Original bid order hash — returns the counter-offer for this specific bid. */
670
+ originalOrderHash?: string;
671
+ /** Seller address — returns all counter-offers sent by this seller. */
672
+ sellerAddress?: string;
673
+ page?: number;
674
+ limit?: number;
675
+ }
676
+ declare const OPEN_LICENSES: readonly ["CC0", "CC BY", "CC BY-SA", "CC BY-NC"];
677
+ type OpenLicense = (typeof OPEN_LICENSES)[number];
678
+ type RemixOfferStatus = "PENDING" | "AUTO_PENDING" | "APPROVED" | "COMPLETED" | "REJECTED" | "EXPIRED" | "SELF_MINTED";
679
+ interface ApiRemixOfferPrice {
680
+ raw: string;
681
+ formatted: string;
682
+ currency: string;
683
+ decimals: number;
684
+ }
685
+ interface ApiRemixOffer {
686
+ id: string;
687
+ status: RemixOfferStatus;
688
+ originalContract: string;
689
+ originalTokenId: string;
690
+ creatorAddress: string;
691
+ requesterAddress: string | null;
692
+ message?: string | null;
693
+ /** Visible only to creator and requester — includes formatted price */
694
+ price?: ApiRemixOfferPrice;
695
+ licenseType: string;
696
+ commercial: boolean;
697
+ derivatives: boolean;
698
+ royaltyPct: number | null;
699
+ approvedCollection: string | null;
700
+ remixContract: string | null;
701
+ remixTokenId: string | null;
702
+ orderHash: string | null;
703
+ createdAt: string;
704
+ expiresAt: string;
705
+ updatedAt: string;
706
+ }
707
+ /** Public remix record — price/currency omitted for non-participants */
708
+ interface ApiPublicRemix {
709
+ id: string;
710
+ remixContract: string | null;
711
+ remixTokenId: string | null;
712
+ licenseType: string;
713
+ commercial: boolean;
714
+ derivatives: boolean;
715
+ createdAt: string;
716
+ }
717
+ interface CreateRemixOfferParams {
718
+ originalContract: string;
719
+ originalTokenId: string;
720
+ licenseType: string;
721
+ commercial: boolean;
722
+ derivatives: boolean;
723
+ royaltyPct?: number;
724
+ proposedPrice?: string;
725
+ proposedCurrency?: string;
726
+ message?: string;
727
+ /** Offer validity in days (server default applies if omitted) */
728
+ expiresInDays?: number;
729
+ }
730
+ interface AutoRemixOfferParams {
731
+ originalContract: string;
732
+ originalTokenId: string;
733
+ licenseType: string;
734
+ }
735
+ interface ConfirmSelfRemixParams {
736
+ originalContract: string;
737
+ originalTokenId: string;
738
+ remixContract: string;
739
+ remixTokenId: string;
740
+ /** On-chain transaction hash of the mint tx */
741
+ txHash?: string;
742
+ licenseType: string;
743
+ commercial: boolean;
744
+ derivatives: boolean;
745
+ royaltyPct?: number;
746
+ }
747
+ interface ConfirmRemixOfferParams {
748
+ approvedCollection: string;
749
+ remixContract: string;
750
+ remixTokenId: string;
751
+ orderHash?: string;
752
+ }
753
+ interface ApiRemixOffersQuery {
754
+ /** "creator" = offers where you are the original creator; "requester" = offers you made */
755
+ role: "creator" | "requester";
756
+ page?: number;
757
+ limit?: number;
758
+ }
759
+ interface ApiMetadataSignedUrl {
760
+ url: string;
761
+ }
762
+ interface ApiMetadataUpload {
763
+ cid: string;
764
+ url: string;
765
+ }
766
+ interface ApiPortalMe {
767
+ id: string;
768
+ name: string;
769
+ email: string;
770
+ plan: TenantPlan;
771
+ status: string;
772
+ }
773
+ interface ApiPortalKey {
774
+ id: string;
775
+ prefix: string;
776
+ label: string;
777
+ status: ApiKeyStatus;
778
+ lastUsedAt: string | null;
779
+ createdAt: string;
780
+ }
781
+ interface ApiPortalKeyCreated {
782
+ id: string;
783
+ prefix: string;
784
+ label: string | null;
785
+ /** Plaintext key — shown ONCE at creation */
786
+ plaintext: string;
787
+ }
788
+ interface ApiUsageDay {
789
+ day: string;
790
+ requests: number;
791
+ }
792
+ interface ApiWebhookEndpoint {
793
+ id: string;
794
+ url: string;
795
+ events: WebhookEventType[];
796
+ status: WebhookStatus;
797
+ createdAt: string;
798
+ }
799
+ interface ApiWebhookCreated extends ApiWebhookEndpoint {
800
+ /** Signing secret — shown ONCE at creation, not stored in plaintext */
801
+ secret: string;
802
+ }
803
+ interface CreateWebhookParams {
804
+ url: string;
805
+ events: WebhookEventType[];
806
+ label?: string;
807
+ }
808
+ interface ApiCollectionProfile {
809
+ contractAddress: string;
810
+ chain: string;
811
+ displayName: string | null;
812
+ description: string | null;
813
+ image: string | null;
814
+ bannerImage: string | null;
815
+ websiteUrl: string | null;
816
+ twitterUrl: string | null;
817
+ discordUrl: string | null;
818
+ telegramUrl: string | null;
819
+ hasGatedContent: boolean;
820
+ gatedContentTitle: string | null;
821
+ slug: string | null;
822
+ updatedBy: string | null;
823
+ updatedAt: string;
824
+ }
825
+ interface ApiCollectionSlugClaim {
826
+ id: string;
827
+ slug: string;
828
+ contractAddress: string;
829
+ chain: string;
830
+ walletAddress: string;
831
+ status: "PENDING" | "APPROVED" | "REJECTED";
832
+ adminNotes: string | null;
833
+ notifyEmail: string | null;
834
+ reviewedAt: string | null;
835
+ createdAt: string;
836
+ updatedAt: string;
837
+ }
838
+ interface ApiCreatorProfile {
839
+ walletAddress: string;
840
+ chain: string;
841
+ username: string | null;
842
+ displayName: string | null;
843
+ bio: string | null;
844
+ avatarImage: string | null;
845
+ bannerImage: string | null;
846
+ /** Computed fallback used by the creator-list / creator-page endpoints
847
+ * ONLY when both `avatarImage` and `bannerImage` are null: image of
848
+ * any collection owned by this creator. Undefined on profile-detail
849
+ * endpoints where this lookup isn't performed. UI may use this to
850
+ * populate hero banners without an extra fetch. */
851
+ collectionImage?: string | null;
852
+ websiteUrl: string | null;
853
+ twitterUrl: string | null;
854
+ discordUrl: string | null;
855
+ telegramUrl: string | null;
856
+ updatedAt: string;
857
+ }
858
+ interface ApiCreatorListResult {
859
+ creators: ApiCreatorProfile[];
860
+ total: number;
861
+ page: number;
862
+ limit: number;
863
+ }
864
+ type ApiAppSource = "MEDIALANE_STARKNET" | "MEDIALANE_IO" | "MEDIALANE_PORTAL" | "MEDIALANE_SDK" | "MEDIALANE_DAPP";
865
+ type ApiChain = "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "BITCOIN";
866
+ interface ApiUserWallet {
867
+ walletAddress: string;
868
+ }
869
+ interface ApiCollectionClaim {
870
+ id: string;
871
+ contractAddress: string;
872
+ chain: string;
873
+ claimantAddress: string | null;
874
+ status: "PENDING" | "AUTO_APPROVED" | "APPROVED" | "REJECTED";
875
+ verificationMethod: "ONCHAIN" | "SIGNATURE" | "MANUAL";
876
+ createdAt: string;
877
+ }
878
+ interface ApiAdminCollectionClaim extends ApiCollectionClaim {
879
+ claimantEmail: string | null;
880
+ notes: string | null;
881
+ adminNotes: string | null;
882
+ reviewedBy: string | null;
883
+ reviewedAt: string | null;
884
+ updatedAt: string;
885
+ }
886
+ interface PopClaimStatus {
887
+ isEligible: boolean;
888
+ hasClaimed: boolean;
889
+ tokenId: string | null;
890
+ }
891
+ interface PopBatchEligibilityItem extends PopClaimStatus {
892
+ wallet: string;
893
+ }
894
+ type PopEventType = "Conference" | "Bootcamp" | "Workshop" | "Hackathon" | "Meetup" | "Course" | "Other";
895
+ interface DropMintStatus {
896
+ mintedByWallet: number;
897
+ totalMinted: number;
898
+ }
899
+ interface ApiRewardsBadge {
900
+ key: string;
901
+ name: string;
902
+ description: string;
903
+ icon: string;
904
+ color: string;
905
+ category: string;
906
+ }
907
+ interface ApiRewardsLevel {
908
+ level: number;
909
+ name: string;
910
+ xpRequired: number;
911
+ badgeColor: string;
912
+ description: string | null;
913
+ }
914
+ interface ApiUserRewards {
915
+ address: string;
916
+ accountId: string | null;
917
+ publicId: string | null;
918
+ totalXp: number;
919
+ currentLevel: number;
920
+ currentLevelName: string;
921
+ badgeColor: string;
922
+ nextLevel: {
923
+ level: number;
924
+ name: string;
925
+ xpRequired: number;
926
+ } | null;
927
+ progressPct: number;
928
+ breakdown: Record<string, number>;
929
+ badges: ApiRewardsBadge[];
930
+ computedAt: string | null;
931
+ }
932
+ interface ApiRewardsLeaderboardEntry {
933
+ rank: number;
934
+ address: string;
935
+ accountId: string | null;
936
+ publicId: string | null;
937
+ totalXp: number;
938
+ currentLevel: number;
939
+ currentLevelName: string;
940
+ badgeColor: string;
941
+ }
942
+ interface ApiRewardsConfig {
943
+ levels: ApiRewardsLevel[];
944
+ actions: {
945
+ type: string;
946
+ label: string;
947
+ xp: number;
948
+ dailyCap: number | null;
949
+ }[];
950
+ badges: ApiRewardsBadge[];
951
+ }
952
+ interface ApiRewardsBatchEntry {
953
+ address: string;
954
+ totalXp: number;
955
+ currentLevel: number;
956
+ currentLevelName: string;
957
+ badgeColor: string;
958
+ }
959
+ interface ApiPointEvent {
960
+ id: string;
961
+ actionType: string;
962
+ xp: number;
963
+ multiplier: number;
964
+ finalXp: number;
965
+ txHash: string | null;
966
+ createdAt: string;
967
+ }
968
+
969
+ type MedialaneErrorCode = "TOKEN_NOT_FOUND" | "COLLECTION_NOT_FOUND" | "ORDER_NOT_FOUND" | "INTENT_NOT_FOUND" | "INTENT_EXPIRED" | "RATE_LIMITED" | "NETWORK_NOT_SUPPORTED" | "APPROVAL_FAILED" | "TRANSACTION_FAILED" | "INVALID_PARAMS" | "UNAUTHORIZED" | "UNKNOWN";
970
+
971
+ declare class MedialaneApiError extends Error {
972
+ readonly status: number;
973
+ readonly code: MedialaneErrorCode;
974
+ constructor(status: number, message: string);
975
+ }
976
+ declare class ApiClient {
977
+ private readonly baseUrl;
978
+ private readonly chain;
979
+ private readonly baseHeaders;
980
+ private readonly retryOptions;
981
+ constructor(baseUrl: string, apiKey?: string, retryOptions?: RetryOptions, chain?: Chain);
982
+ /** Normalize an address for this client's chain (chain-scoped — Decision B). */
983
+ private addr;
984
+ /**
985
+ * The one HTTP path for the whole client: base headers (incl. x-api-key),
986
+ * JSON error unwrapping, and `withRetry` (5xx/network only — 4xx never
987
+ * retried). `allow404`/`allow403` turn those statuses into a `null` result
988
+ * instead of a throw, for "profile may not exist" / "not a holder" reads —
989
+ * so no method needs to hand-roll `fetch` to get that behavior.
990
+ */
991
+ private request;
992
+ private get;
993
+ private post;
994
+ private patch;
995
+ private del;
996
+ /** Bearer header for Clerk-JWT-authenticated routes. */
997
+ private bearer;
998
+ getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
999
+ getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
1000
+ getActiveOrdersForToken(contract: string, tokenId: string): Promise<ApiResponse<ApiOrder[]>>;
1001
+ getOrdersByUser(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiOrder[]>>;
1002
+ getToken(contract: string, tokenId: string, wait?: boolean): Promise<ApiResponse<ApiToken>>;
1003
+ getTokensByOwner(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
1004
+ getTokenHistory(contract: string, tokenId: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
1005
+ getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, service?: string, chain?: ChainFilter): Promise<ApiResponse<ApiCollection[]>>;
1006
+ getCollectionsByOwner(owner: string, page?: number, limit?: number): Promise<ApiResponse<ApiCollection[]>>;
1007
+ getCollection(contract: string): Promise<ApiResponse<ApiCollection>>;
1008
+ getCollectionTokens(contract: string, page?: number, limit?: number, sort?: CollectionTokensSort): Promise<ApiResponse<ApiToken[]>>;
1009
+ getActivities(query?: ApiActivitiesQuery): Promise<ApiResponse<ApiActivity[]>>;
1010
+ getActivitiesByAddress(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
1011
+ getTokenComments(contract: string, tokenId: string, opts?: {
1012
+ page?: number;
1013
+ limit?: number;
1014
+ }): Promise<ApiResponse<ApiComment[]>>;
1015
+ search(q: string, limit?: number, chain?: ChainFilter): Promise<ApiResponse<ApiSearchResult> & {
1016
+ query: string;
1017
+ }>;
1018
+ createListingIntent(params: CreateListingIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1019
+ createOfferIntent(params: MakeOfferIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1020
+ createFulfillIntent(params: FulfillOrderIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1021
+ createCancelIntent(params: CancelOrderIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1022
+ getIntent(id: string): Promise<ApiResponse<ApiIntent>>;
1023
+ submitIntentSignature(id: string, signature: string[]): Promise<ApiResponse<ApiIntent>>;
1024
+ confirmIntent(id: string, txHash: string): Promise<ApiResponse<ApiIntent>>;
1025
+ createMintIntent(params: CreateMintIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1026
+ createCollectionIntent(params: CreateCollectionIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1027
+ /**
1028
+ * Create a counter-offer intent. The seller proposes a new price in response
1029
+ * to a buyer's active bid. clerkToken is optional — the endpoint authenticates
1030
+ * via the tenant API key; pass a Clerk JWT only if your backend requires it.
1031
+ */
1032
+ createCounterOfferIntent(params: CreateCounterOfferIntentParams, clerkToken?: string): Promise<ApiResponse<ApiIntentCreated>>;
1033
+ /**
1034
+ * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
1035
+ * `sellerAddress` (seller view) — at least one is required.
1036
+ */
1037
+ getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
1038
+ getMetadataSignedUrl(): Promise<ApiResponse<ApiMetadataSignedUrl>>;
1039
+ uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
1040
+ resolveMetadata(uri: string): Promise<ApiResponse<unknown>>;
1041
+ uploadFile(file: File): Promise<ApiResponse<ApiMetadataUpload>>;
1042
+ getMe(): Promise<ApiResponse<ApiPortalMe>>;
1043
+ getApiKeys(): Promise<ApiResponse<ApiPortalKey[]>>;
1044
+ createApiKey(label?: string): Promise<ApiResponse<ApiPortalKeyCreated>>;
1045
+ deleteApiKey(id: string): Promise<ApiResponse<{
1046
+ id: string;
1047
+ status: string;
1048
+ }>>;
1049
+ getUsage(): Promise<ApiResponse<ApiUsageDay[]>>;
1050
+ getWebhooks(): Promise<ApiResponse<ApiWebhookEndpoint[]>>;
1051
+ createWebhook(params: CreateWebhookParams): Promise<ApiResponse<ApiWebhookCreated>>;
1052
+ deleteWebhook(id: string): Promise<ApiResponse<{
1053
+ id: string;
1054
+ status: string;
1055
+ }>>;
1056
+ /**
1057
+ * Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
1058
+ * Authorization: Bearer (Clerk JWT) simultaneously.
1059
+ */
1060
+ claimCollection(contractAddress: string, walletAddress: string, clerkToken: string): Promise<{
1061
+ verified: boolean;
1062
+ collection?: ApiCollection;
1063
+ reason?: string;
1064
+ }>;
1065
+ /**
1066
+ * Path 3: Manual off-chain claim request (email-based).
1067
+ */
1068
+ requestCollectionClaim(params: {
1069
+ contractAddress: string;
1070
+ walletAddress?: string;
1071
+ email: string;
1072
+ notes?: string;
1073
+ }): Promise<{
1074
+ claim: ApiCollectionClaim;
1075
+ }>;
1076
+ getCollectionProfile(contractAddress: string): Promise<ApiCollectionProfile | null>;
1077
+ /**
1078
+ * Update collection profile. Requires Clerk JWT for ownership check.
1079
+ */
1080
+ updateCollectionProfile(contractAddress: string, data: Partial<Omit<ApiCollectionProfile, "contractAddress" | "chain" | "updatedBy" | "updatedAt">>, clerkToken: string): Promise<ApiCollectionProfile>;
1081
+ getGatedContent(contractAddress: string, clerkToken: string): Promise<{
1082
+ title: string;
1083
+ url: string;
1084
+ type: string;
1085
+ } | null>;
1086
+ /** List all creators with an approved username. */
1087
+ getCreators(opts?: {
1088
+ search?: string;
1089
+ page?: number;
1090
+ limit?: number;
1091
+ }): Promise<ApiCreatorListResult>;
1092
+ getCreatorProfile(walletAddress: string): Promise<ApiCreatorProfile | null>;
1093
+ /** Resolve a username slug to a creator profile (public). */
1094
+ getCreatorByUsername(username: string): Promise<ApiCreatorProfile | null>;
1095
+ /**
1096
+ * Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
1097
+ */
1098
+ updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
1099
+ /** Check if a collection slug is available (public, no auth). */
1100
+ checkCollectionSlugAvailability(slug: string): Promise<{
1101
+ available: boolean;
1102
+ reason?: string;
1103
+ }>;
1104
+ /** Submit a slug claim for a collection. Requires Clerk JWT — caller must be the collection owner. */
1105
+ submitCollectionSlugClaim(contractAddress: string, slug: string, clerkToken: string, notifyEmail?: string): Promise<{
1106
+ claim: ApiCollectionSlugClaim;
1107
+ }>;
1108
+ /** Returns all slug claims submitted by the authenticated wallet. Requires Clerk JWT. */
1109
+ getMyCollectionSlugClaims(clerkToken: string): Promise<{
1110
+ claims: ApiCollectionSlugClaim[];
1111
+ }>;
1112
+ /** Resolve a collection slug to a full collection. Returns null if not found. */
1113
+ getCollectionBySlug(slug: string): Promise<ApiCollection | null>;
1114
+ /**
1115
+ * Upsert the authenticated user's wallet address in the backend DB.
1116
+ * Call after onboarding when ChipiPay confirms the wallet address.
1117
+ * Requires Clerk JWT; no tenant API key needed.
1118
+ */
1119
+ /**
1120
+ * Frictionless wallet registration. Tenant API key only (no Clerk JWT required).
1121
+ * Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
1122
+ * UNKNOWN walletType rows when a more specific value is supplied.
1123
+ */
1124
+ registerUser(params: {
1125
+ walletAddress: string;
1126
+ walletType?: string;
1127
+ appSource?: ApiAppSource;
1128
+ chain?: ApiChain;
1129
+ }): Promise<{
1130
+ accountId: string;
1131
+ publicId: string;
1132
+ walletAddress: string;
1133
+ chain: string;
1134
+ provider: string;
1135
+ appSource: ApiAppSource;
1136
+ createdAt: string;
1137
+ }>;
1138
+ upsertMyWallet(clerkToken: string, options?: {
1139
+ walletType?: string;
1140
+ appSource?: ApiAppSource;
1141
+ chain?: ApiChain;
1142
+ }): Promise<ApiUserWallet>;
1143
+ /**
1144
+ * Get the authenticated user's stored wallet address from the backend DB.
1145
+ * Returns null if the user has not completed onboarding yet.
1146
+ * Requires Clerk JWT; no tenant API key needed.
1147
+ */
1148
+ getMyWallet(clerkToken: string): Promise<ApiUserWallet | null>;
1149
+ /**
1150
+ * Get public remixes of a token (open to everyone).
1151
+ */
1152
+ getTokenRemixes(contract: string, tokenId: string, opts?: {
1153
+ page?: number;
1154
+ limit?: number;
1155
+ }): Promise<ApiResponse<ApiPublicRemix[]>>;
1156
+ /**
1157
+ * Submit a custom remix offer for a token. Requires Clerk JWT.
1158
+ */
1159
+ submitRemixOffer(params: CreateRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1160
+ /**
1161
+ * Submit an auto remix offer for a token with an open license. Requires Clerk JWT.
1162
+ */
1163
+ submitAutoRemixOffer(params: AutoRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1164
+ /**
1165
+ * Record a self-remix (owner remixing their own token). Requires Clerk JWT.
1166
+ */
1167
+ confirmSelfRemix(params: ConfirmSelfRemixParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1168
+ /**
1169
+ * List remix offers by role. Requires Clerk JWT.
1170
+ * role="creator" — offers where you are the original creator.
1171
+ * role="requester" — offers you made.
1172
+ */
1173
+ getRemixOffers(query: ApiRemixOffersQuery, clerkToken: string): Promise<ApiResponse<ApiRemixOffer[]>>;
1174
+ /**
1175
+ * Get a single remix offer. Clerk JWT optional (price/currency hidden for non-participants).
1176
+ */
1177
+ getRemixOffer(id: string, clerkToken?: string): Promise<ApiResponse<ApiRemixOffer>>;
1178
+ /**
1179
+ * Creator approves a remix offer (authorises the requester to mint). Requires Clerk JWT.
1180
+ */
1181
+ confirmRemixOffer(id: string, params: ConfirmRemixOfferParams, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1182
+ /**
1183
+ * Creator rejects a remix offer. Requires Clerk JWT.
1184
+ */
1185
+ rejectRemixOffer(id: string, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1186
+ /**
1187
+ * Requester extends the expiry of a pending remix offer by 1–30 days.
1188
+ * Requires Clerk JWT.
1189
+ */
1190
+ extendRemixOffer(id: string, days: number, clerkToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1191
+ getPopCollections(opts?: {
1192
+ page?: number;
1193
+ limit?: number;
1194
+ sort?: CollectionSort;
1195
+ }): Promise<ApiResponse<ApiCollection[]>>;
1196
+ getPopEligibility(collection: string, wallet: string): Promise<PopClaimStatus>;
1197
+ getPopEligibilityBatch(collection: string, wallets: string[]): Promise<PopBatchEligibilityItem[]>;
1198
+ getCoins(opts?: ApiCoinsQuery): Promise<ApiResponse<ApiCoin[]>>;
1199
+ getCoin(contract: string): Promise<{
1200
+ data: ApiCoin;
1201
+ }>;
1202
+ getDropCollections(opts?: {
1203
+ page?: number;
1204
+ limit?: number;
1205
+ sort?: CollectionSort;
1206
+ }): Promise<ApiResponse<ApiCollection[]>>;
1207
+ getDropMintStatus(collection: string, wallet: string): Promise<DropMintStatus>;
1208
+ /** Score + level + progress + badges for one address (zeroed for unknown). */
1209
+ getRewards(address: string): Promise<ApiUserRewards>;
1210
+ /** Paginated XP leaderboard. */
1211
+ getRewardsLeaderboard(page?: number, limit?: number): Promise<ApiResponse<ApiRewardsLeaderboardEntry[]>>;
1212
+ /** Point-event history for an address. */
1213
+ getRewardsEvents(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiPointEvent[]>>;
1214
+ /** Reward configuration: level ladder, enabled action XP values, badge catalog. */
1215
+ getRewardsConfig(): Promise<ApiRewardsConfig>;
1216
+ /** Minimal level info for up to 50 addresses — one call per list page. */
1217
+ getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
1218
+ }
1219
+
1220
+ interface OfferItem {
1221
+ item_type: string;
1222
+ token: string;
1223
+ identifier_or_criteria: string;
1224
+ amount: string;
1225
+ }
1226
+ interface ConsiderationItem extends OfferItem {
1227
+ recipient: string;
1228
+ }
1229
+ interface OrderParameters {
1230
+ offerer: string;
1231
+ marketplace: string;
1232
+ offer: OfferItem;
1233
+ consideration: ConsiderationItem;
1234
+ royalty_max_bps: string;
1235
+ start_time: string;
1236
+ end_time: string;
1237
+ salt: string;
1238
+ counter: string;
1239
+ }
1240
+ interface Order {
1241
+ parameters: OrderParameters;
1242
+ signature: string[];
1243
+ }
1244
+ interface TxResult {
1245
+ txHash: string;
1246
+ }
1247
+ interface OrderDetails {
1248
+ offerer: string;
1249
+ offer: OfferItem;
1250
+ consideration: ConsiderationItem;
1251
+ royalty_max_bps: string;
1252
+ start_time: bigint;
1253
+ end_time: bigint;
1254
+ order_status: string;
1255
+ /** The offerer's bulk-cancel epoch at registration; re-checked at fulfilment. */
1256
+ counter: string;
1257
+ /** ERC-1155 only — units still available. */
1258
+ remaining_amount?: string;
1259
+ }
1260
+
1261
+ interface CreatePopCollectionParams {
1262
+ name: string;
1263
+ symbol: string;
1264
+ baseUri: string;
1265
+ claimEndTime: number;
1266
+ eventType: PopEventType;
1267
+ }
1268
+ interface ClaimConditions {
1269
+ /** Unix timestamp when minting opens. 0 = open immediately. */
1270
+ startTime: number;
1271
+ /** Unix timestamp when minting closes. 0 = never closes. */
1272
+ endTime: number;
1273
+ /** Price per token in payment_token units. 0 = free mint. */
1274
+ price: bigint | string;
1275
+ /** ERC-20 token address for payment. Must be non-zero if price > 0. */
1276
+ paymentToken: string;
1277
+ /** Max tokens a single wallet may mint across all phases. 0 = unlimited. */
1278
+ maxQuantityPerWallet: bigint | string;
1279
+ }
1280
+ interface CreateDropParams {
1281
+ name: string;
1282
+ symbol: string;
1283
+ baseUri: string;
1284
+ maxSupply: bigint | string;
1285
+ initialConditions: ClaimConditions;
1286
+ }
1287
+ interface CreateTicketParams {
1288
+ /** Address of the deployed IPTicketCollection contract. */
1289
+ collection: string;
1290
+ maxSupply: bigint | string;
1291
+ /** Unix timestamp (seconds). Omit for "open immediately". */
1292
+ startTime?: number;
1293
+ /** Unix timestamp (seconds). Omit for "never expires". */
1294
+ endTime?: number;
1295
+ /** Basis points, 0–10000. */
1296
+ royaltyBps: number;
1297
+ /** ipfs:// or ar:// — enforced on-chain. */
1298
+ metadataUri: string;
1299
+ }
1300
+ interface MintTicketsParams {
1301
+ collection: string;
1302
+ tokenId: bigint | string;
1303
+ to: string;
1304
+ amount: bigint | string;
1305
+ }
1306
+ interface CreateMembershipParams {
1307
+ /** Address of the deployed IPClubCollection contract. */
1308
+ collection: string;
1309
+ maxSupply: bigint | string;
1310
+ /** Unix timestamp (seconds). Omit for "valid immediately". Gates membership, never minting. */
1311
+ startTime?: number;
1312
+ /** Unix timestamp (seconds). Omit for "lifetime membership". */
1313
+ endTime?: number;
1314
+ /** Basis points, 0–10000. */
1315
+ royaltyBps: number;
1316
+ /** ipfs:// or ar:// — enforced on-chain. */
1317
+ metadataUri: string;
1318
+ }
1319
+ interface MintMembershipsParams {
1320
+ collection: string;
1321
+ tokenId: bigint | string;
1322
+ to: string;
1323
+ amount: bigint | string;
1324
+ }
1325
+ interface CreateSponsorshipOfferParams {
1326
+ nftContract: string;
1327
+ tokenId: bigint | string;
1328
+ minAmount: bigint | string;
1329
+ /** Seconds, applied from acceptance (not from offer creation). */
1330
+ duration: number;
1331
+ paymentToken: string;
1332
+ licenseTermsUri: string;
1333
+ transferable: boolean;
1334
+ /** Basis points, 0–10000. EIP-2981 royalty to the author on license resale. */
1335
+ royaltyBps: bigint | string;
1336
+ /** Restricts acceptance to one sponsor address; omit for open bidding. */
1337
+ specificSponsor?: string;
1338
+ }
1339
+ /** Sponsor-initiated — the symmetric counterpart to CreateSponsorshipOfferParams. */
1340
+ interface ProposeSponsorshipParams {
1341
+ nftContract: string;
1342
+ tokenId: bigint | string;
1343
+ /** Fixed take-it-or-leave-it amount (not a bid floor). */
1344
+ amount: bigint | string;
1345
+ duration: number;
1346
+ /** Unix seconds; the deadline for the asset owner to accept. 0 = no deadline. */
1347
+ validUntil?: number;
1348
+ paymentToken: string;
1349
+ licenseTermsUri: string;
1350
+ transferable: boolean;
1351
+ /** Basis points, 0–10000. */
1352
+ royaltyBps: bigint | string;
1353
+ }
1354
+
1355
+ export { type ApiTokenBalance as $, type ActivityType as A, type ApiOrderConsideration as B, type ApiOrderOffer as C, type ApiOrderPrice as D, type ApiOrderTokenMeta as E, type ApiOrderTxHash as F, type ApiOrdersQuery as G, type ApiPointEvent as H, type ApiPortalKey as I, type ApiPortalKeyCreated as J, type ApiPortalMe as K, type ApiPublicRemix as L, type ApiRemixOffer as M, type ApiRemixOfferPrice as N, type ApiRemixOffersQuery as O, type ApiResponse as P, type ApiRewardsBadge as Q, type ApiRewardsBatchEntry as R, type ServiceDefinition as S, type ApiRewardsConfig as T, type ApiRewardsLeaderboardEntry as U, type ApiRewardsLevel as V, type ApiSearchCollectionResult as W, type ApiSearchCreatorResult as X, type ApiSearchResult as Y, type ApiSearchTokenResult as Z, type ApiToken as _, type ServiceCapability as a, type WebhookStatus as a$, type ApiTokenMetadata as a0, type ApiUsageDay as a1, type ApiUserRewards as a2, type ApiUserWallet as a3, type ApiWebhookCreated as a4, type ApiWebhookEndpoint as a5, type AutoRemixOfferParams as a6, type CancelOrderIntentParams as a7, type ChainFilter as a8, type ClaimConditions as a9, type IpNftMetadata as aA, type MakeOfferIntentParams as aB, MedialaneApiError as aC, type MedialaneConfig as aD, type MedialaneErrorCode as aE, type MintMembershipsParams as aF, type MintTicketsParams as aG, OPEN_LICENSES as aH, type OfferItem as aI, type OpenLicense as aJ, type Order as aK, type OrderDetails as aL, type OrderParameters as aM, type OrderStatus as aN, type PopBatchEligibilityItem as aO, type PopClaimStatus as aP, type PopEventType as aQ, type ProposeSponsorshipParams as aR, type RemixOfferStatus as aS, type ResolvedConfig as aT, type ResolvedFeeConfig as aU, type RetryOptions as aV, type ServiceEventDeclaration as aW, type SortOrder as aX, type TenantPlan as aY, type TxResult as aZ, type WebhookEventType as a_, type CollectionSort as aa, type CollectionTokensSort as ab, type ConfirmRemixOfferParams as ac, type ConfirmSelfRemixParams as ad, type ConsiderationItem as ae, type CreateCollectionIntentParams as af, type CreateCounterOfferIntentParams as ag, type CreateDropParams as ah, type CreateListingIntentParams as ai, type CreateMembershipParams as aj, type CreateMintIntentParams as ak, type CreatePopCollectionParams as al, type CreateRemixOfferParams as am, type CreateSponsorshipOfferParams as an, type CreateTicketParams as ao, type CreateWebhookParams as ap, type DropMintStatus as aq, type EnforcementDeclaration as ar, type FeeConfig as as, FeeConfigSchema as at, type FulfillOrderIntentParams as au, type IPType as av, type IntentCall as aw, type IntentStatus as ax, type IntentType as ay, type IpAttribute as az, type ApiActivitiesQuery as b, resolveConfig as b0, resolveFeeConfig as b1, type ApiActivity as c, type ApiActivityPrice as d, type ApiAdminCollectionClaim as e, type ApiAppSource as f, type ApiChain as g, ApiClient as h, type ApiCoin as i, type ApiCoinsQuery as j, type ApiCollection as k, type ApiCollectionClaim as l, type ApiCollectionProfile as m, type ApiCollectionSlugClaim as n, type ApiCollectionsQuery as o, type ApiComment as p, type ApiCounterOffersQuery as q, type ApiCreatorListResult as r, type ApiCreatorProfile as s, type ApiIntent as t, type ApiIntentCreated as u, type ApiKeyStatus as v, type ApiMeta as w, type ApiMetadataSignedUrl as x, type ApiMetadataUpload as y, type ApiOrder as z };