@medialane/sdk 0.85.4 → 0.85.6

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.
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { C as Chain } from './types-sIc3OCpo.js';
2
+ import { C as Chain } from './types-nPIXtCF5.cjs';
3
3
 
4
4
  interface RetryOptions {
5
5
  maxAttempts?: number;
@@ -146,53 +146,19 @@ declare function resolveConfig(raw: MedialaneConfig): ResolvedConfig;
146
146
  type IPType = "Audio" | "Art" | "Documents" | "NFT" | "Video" | "Photography" | "Patents" | "Posts" | "Publications" | "RWA" | "Software" | "Custom";
147
147
  type CollectionSort = "recent" | "supply" | "floor" | "volume" | "name";
148
148
  type CollectionTokensSort = "recent" | "oldest" | "name" | "price";
149
- /** Bounded capability set (05-service-model §III). Expand the union when a
150
- * service needs behavior outside it — never make it free-form. */
151
149
  type ServiceCapability = "list" | "buy" | "make_offer" | "cancel" | "transfer" | "burn" | "mint" | "claim" | "airdrop" | "remix" | "license" | "subscribe" | "redeem" | "launch" | "swap" | "sponsor";
152
- /** A service that bakes enforcement into its own contract declares it here
153
- * (04-licensing-model §V, 05-service-model §IV). Absence/all-falsey =
154
- * soft enforcement (the 00-principles §9 default). */
155
150
  interface EnforcementDeclaration {
156
151
  royalty?: "erc2981" | "service-split" | "none";
157
152
  escrow?: boolean;
158
153
  timeLock?: boolean;
159
154
  revocable?: boolean;
160
155
  }
161
- /** An on-chain event the service emits. The indexer consumes this list to
162
- * decide what to poll and how to parse — the year-2 "data-driven event
163
- * parser registry" foundation (02-protocol-app-split §V).
164
- *
165
- * The Cairo selector is derivable from `name` via
166
- * `starknet.hash.getSelectorFromName(name)` — not stored to avoid
167
- * duplication and keep the SDK runtime-free of pre-computed hashes.
168
- */
169
156
  interface ServiceEventDeclaration {
170
- /** Cairo event struct name (e.g. "OrderCreated", "CollectionCreated"). */
171
157
  name: string;
172
- /**
173
- * Where this event is emitted:
174
- * - "factory": at the service's `onchain.factoryAddress` (fixed address).
175
- * Examples: marketplace OrderCreated, factory CollectionCreated.
176
- * - "instance": at the address of each deployed collection contract
177
- * (variable; the indexer iterates discovered instances).
178
- * Examples: ERC-721 Transfer, POP AllowlistUpdated.
179
- */
180
158
  emittedBy: "factory" | "instance";
181
- /**
182
- * Polling cadence the indexer should use:
183
- * - "fast" (default): every indexer tick (~6s). Right for low-volume
184
- * protocol events like order/factory events.
185
- * - "slow": a separate slower loop (~2min). Right for
186
- * high-volume per-instance events like Transfer
187
- * and AllowlistUpdated — polling them every tick
188
- * against every known instance is RPC-expensive.
189
- */
190
159
  poll?: "fast" | "slow";
191
160
  }
192
- /** Declarative description of a service (05-service-model §II).
193
- * SDK-resident in v1; on-chain registry in year 2. */
194
161
  interface ServiceDefinition {
195
- /** Stable kebab-case id. NO version number (05 §II). */
196
162
  id: string;
197
163
  displayName: string;
198
164
  description: string;
@@ -203,18 +169,11 @@ interface ServiceDefinition {
203
169
  classHash?: string;
204
170
  startBlock?: number;
205
171
  }>>;
206
- /** Drives the dapp asset/collection page variant. */
207
172
  uiVariant: string;
208
173
  capabilities: ServiceCapability[];
209
- /** Events the indexer should poll + parse for this service.
210
- * Optional during the year-1 transition — backend hand-coded pollers
211
- * (medialane-backend/src/mirror/poller.ts) take precedence today.
212
- * Populated here so consumers and the future data-driven indexer can
213
- * read what events a service emits without code-spelunking. */
214
174
  events?: ServiceEventDeclaration[];
215
175
  metadataSchema?: {
216
176
  requiredTraits?: string[];
217
- /** Canonical platform default is "CC BY-SA" (04-licensing-model §III). */
218
177
  licenseDefault?: string;
219
178
  enforcement?: EnforcementDeclaration;
220
179
  };
@@ -225,17 +184,8 @@ interface ApiCollectionsQuery {
225
184
  isKnown?: boolean;
226
185
  sort?: CollectionSort;
227
186
  owner?: string;
228
- /** Filter by service id. */
229
187
  service?: string;
230
188
  }
231
- /**
232
- * Order lifecycle states. **Four canonical values** per `01-core-model §V`.
233
- *
234
- * The legacy `"COUNTER_OFFERED"` value was removed in 0.23.0 (audit P0-1
235
- * Phase D). Counter-offers are linked orders via `parentOrderHash`, not a
236
- * third lifecycle state on the parent bid. Use `ApiOrder.hasActiveCounterOffer`
237
- * (added in 0.22.0) for the "this bid has been countered" affordance.
238
- */
239
189
  type OrderStatus = "ACTIVE" | "FULFILLED" | "CANCELLED" | "EXPIRED";
240
190
  type SortOrder = "price_asc" | "price_desc" | "recent";
241
191
  type ActivityType = "mint" | "transfer" | "sale" | "listing" | "offer" | "cancelled";
@@ -254,8 +204,6 @@ interface ApiResponse<T> {
254
204
  data: T;
255
205
  meta?: ApiMeta;
256
206
  }
257
- /** Cross-chain read filter — a concrete chain, or "all" for aggregation
258
- * (platform-federation spec §2.3). Omitted = the backend default (STARKNET). */
259
207
  type ChainFilter = Chain | "all";
260
208
  interface ApiOrdersQuery {
261
209
  chain?: ChainFilter;
@@ -312,52 +260,24 @@ interface ApiOrder {
312
260
  price: ApiOrderPrice;
313
261
  txHash: ApiOrderTxHash;
314
262
  createdBlockNumber: string;
315
- /** ERC-1155 only: units still available after the last partial fill. Null for ERC-721 or unfilled orders. */
316
263
  remainingAmount: string | null;
317
264
  createdAt: string;
318
265
  updatedAt: string;
319
- /** Embedded token metadata (name/image/description). Null when not yet indexed. */
320
266
  token: ApiOrderTokenMeta | null;
321
- /** Set when this is a counter-offer listing — points to the original buyer bid.
322
- * Now always emitted by the backend (was conditional); kept optional in the
323
- * type for back-compat with older response shapes. */
324
267
  parentOrderHash?: string | null;
325
- /** Optional seller message accompanying a counter-offer. */
326
268
  counterOfferMessage?: string | null;
327
- /** True when this order is a bid (ERC-20 offer) AND at least one ACTIVE counter
328
- * exists with `parentOrderHash = this.orderHash`. Set by endpoints that compute
329
- * it (currently `GET /v1/orders/user/:address` and `GET /v1/orders/:orderHash`);
330
- * undefined on endpoints that don't.
331
- *
332
- * Use this instead of `status === "COUNTER_OFFERED"` for "this bid has been
333
- * countered" affordances. The status pattern is being phased out per
334
- * 01-core-model §V — counter-offers are linked orders, not a lifecycle state. */
335
269
  hasActiveCounterOffer?: boolean;
336
270
  }
337
- /**
338
- * A single OpenSea-compatible ERC-721 attribute.
339
- * Medialane embeds licensing, provenance, and IP metadata as attributes.
340
- */
341
271
  interface IpAttribute {
342
272
  trait_type: string;
343
273
  value: string;
344
274
  }
345
- /**
346
- * Full on-chain + IPFS metadata for a Medialane IP NFT.
347
- * Conforms to the OpenSea ERC-721 metadata standard and embeds
348
- * Berne Convention-compatible licensing data in `attributes`.
349
- *
350
- * Common licensing attributes (all optional — absent on pre-v2 tokens):
351
- * License · Commercial Use · Derivatives · Attribution · Territory
352
- * AI Policy · Royalty · Standard ("Berne Convention") · Registration
353
- */
354
275
  interface IpNftMetadata {
355
276
  name: string;
356
277
  description?: string;
357
278
  image?: string | null;
358
279
  external_url?: string;
359
280
  attributes?: IpAttribute[];
360
- /** Populated by the indexer for fast access — not stored in IPFS */
361
281
  ipType?: string | null;
362
282
  licenseType?: string | null;
363
283
  commercialUse?: string | null;
@@ -368,16 +288,12 @@ interface IpNftMetadata {
368
288
  royalty?: string | null;
369
289
  registration?: string | null;
370
290
  }
371
- /** Indexed token metadata as returned by the Medialane API. */
372
291
  interface ApiTokenMetadata {
373
292
  name: string | null;
374
293
  description: string | null;
375
294
  image: string | null;
376
- /** data: or ipfs:// URI to a fully self-contained animated/interactive renderer (OpenSea-baseline `animation_url`). Null until indexed. */
377
295
  animationUrl: string | null;
378
- /** Parsed OpenSea-standard attributes array. Null when metadata hasn't been fetched. */
379
296
  attributes: IpAttribute[] | null;
380
- /** Short-circuit fields extracted from attributes by the indexer */
381
297
  ipType: string | null;
382
298
  licenseType: string | null;
383
299
  commercialUse: string | null;
@@ -389,10 +305,8 @@ interface ApiTokenMetadata {
389
305
  registration: string | null;
390
306
  author: string | null;
391
307
  }
392
- /** Per-holder balance entry. Present for ERC-1155 (multi-holder); single entry for ERC-721. */
393
308
  interface ApiTokenBalance {
394
309
  owner: string;
395
- /** Quantity held. Always "1" for ERC-721. */
396
310
  amount: string;
397
311
  }
398
312
  interface ApiToken {
@@ -400,14 +314,11 @@ interface ApiToken {
400
314
  chain: string;
401
315
  contractAddress: string;
402
316
  tokenId: string;
403
- /** @deprecated Use `balances` for ownership checks — always null after ERC-1155 migration. */
404
317
  owner: string | null;
405
318
  tokenUri: string | null;
406
319
  metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
407
- /** Token standard derived from the parent collection. Use this to determine ERC-721 vs ERC-1155 behavior. */
408
320
  standard: "ERC721" | "ERC1155" | "UNKNOWN";
409
321
  metadata: ApiTokenMetadata;
410
- /** Current holders with amounts. Only present on single-token fetches; null on list responses. */
411
322
  balances: ApiTokenBalance[] | null;
412
323
  activeOrders: ApiOrder[];
413
324
  createdAt: string;
@@ -425,18 +336,10 @@ interface ApiCollection {
425
336
  owner: string | null;
426
337
  startBlock: string;
427
338
  metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
428
- /** Token standard detected via ERC-165. Collection is NFT-only since the
429
- * 2026-06-14 coin split — fungible coins are `ApiCoin`, served by getCoins(). */
430
339
  standard: "ERC721" | "ERC1155";
431
340
  isKnown: boolean;
432
- /** Hidden by ops/admin (content moderation). When true, list endpoints
433
- * already filter the row out; single-collection fetches still return
434
- * it so the UI can render a "hidden" banner instead of a 404. */
435
341
  isHidden: boolean;
436
- /** Promoted on homepage / browse surfaces. */
437
342
  isFeatured: boolean;
438
- /** Stable Medialane service ID, or null for external collections.
439
- * Resolve via getService() (05-service-model). Primary field. */
440
343
  service: string | null;
441
344
  claimedBy: string | null;
442
345
  profile?: ApiCollectionProfile | null;
@@ -447,20 +350,15 @@ interface ApiCollection {
447
350
  createdAt: string;
448
351
  updatedAt: string;
449
352
  }
450
- /** A fungible coin (ERC-20 today; SPL/etc. later). Distinct from ApiCollection:
451
- * a coin has a supply + decimals + a market price (read live from Ekubo), no
452
- * tokens, no orders. Served by getCoins()/getCoin() (spec 2026-06-14). */
453
353
  interface ApiCoin {
454
354
  id: string;
455
355
  chain: string;
456
356
  contractAddress: string;
457
357
  standard: "ERC20";
458
- /** "creator-coin" | "external-erc20" */
459
358
  service: string;
460
359
  name: string | null;
461
360
  symbol: string | null;
462
361
  decimals: number;
463
- /** Fungible supply as a decimal string — NOT an item count. */
464
362
  totalSupply: string | null;
465
363
  description: string | null;
466
364
  image: string | null;
@@ -474,7 +372,6 @@ interface ApiCoinsQuery {
474
372
  chain?: ChainFilter;
475
373
  page?: number;
476
374
  limit?: number;
477
- /** Filter by coin service id ("creator-coin" | "external-erc20"). */
478
375
  service?: string;
479
376
  }
480
377
  interface ApiActivityPrice {
@@ -490,7 +387,6 @@ interface ApiActivity {
490
387
  from?: string;
491
388
  to?: string;
492
389
  blockNumber?: string;
493
- /** ERC-1155 quantity (transfer/mint rows). "1" for ERC-721. */
494
390
  amount?: string;
495
391
  orderHash?: string;
496
392
  nftContract?: string;
@@ -498,11 +394,9 @@ interface ApiActivity {
498
394
  offerer?: string;
499
395
  fulfiller?: string | null;
500
396
  price?: ApiActivityPrice;
501
- /** Token standard — present on order rows. */
502
397
  tokenStandard?: "ERC721" | "ERC1155";
503
398
  txHash: string | null;
504
399
  timestamp: string;
505
- /** Batch-enriched token metadata — avoids per-row fetches. */
506
400
  token?: {
507
401
  name: string | null;
508
402
  image: string | null;
@@ -512,7 +406,6 @@ interface ApiActivity {
512
406
  interface ApiActivitiesQuery {
513
407
  chain?: ChainFilter;
514
408
  type?: ActivityType;
515
- /** Scope the feed to one collection's contract address instead of the global/per-address feed. */
516
409
  contract?: string;
517
410
  page?: number;
518
411
  limit?: number;
@@ -567,32 +460,17 @@ interface ApiIntent {
567
460
  signature: string[];
568
461
  txHash: string | null;
569
462
  orderHash: string | null;
570
- /** Set on COUNTER_OFFER intents — the original bid order hash being countered. */
571
463
  parentOrderHash?: string | null;
572
- /** Optional seller message on counter-offer intents. */
573
464
  counterOfferMessage?: string | null;
574
465
  expiresAt: string;
575
466
  createdAt: string;
576
467
  updatedAt: string;
577
468
  }
578
- /** A single Starknet call as returned in intent calldata. */
579
469
  interface IntentCall {
580
470
  contractAddress: string;
581
471
  entrypoint: string;
582
472
  calldata: string[];
583
473
  }
584
- /**
585
- * Response from any `createXIntent` call. Discriminated on `requiresSignature`:
586
- * • true — SNIP-12 intent (listing / offer / cancel / counter-offer). Sign
587
- * `typedData`, then call `submitIntentSignature(id, sig)` to obtain
588
- * the executable calls.
589
- * • false — prebuilt intent (fulfill / mint / create-collection). `calls` are
590
- * ready to execute directly; there is no signature step.
591
- *
592
- * The discriminant makes the wrong access a compile error: `typedData` does not
593
- * exist on the `false` variant, nor `calls` on the `true` variant. Consumers
594
- * MUST narrow on `requiresSignature` before reading either.
595
- */
596
474
  type ApiIntentCreated = {
597
475
  id: string;
598
476
  expiresAt: string;
@@ -612,7 +490,6 @@ interface CreateListingIntentParams {
612
490
  price: string;
613
491
  endTime: number;
614
492
  salt?: string;
615
- /** Number of units to list — required for ERC-1155, omit for ERC-721. */
616
493
  amount?: string;
617
494
  }
618
495
  interface MakeOfferIntentParams {
@@ -623,79 +500,46 @@ interface MakeOfferIntentParams {
623
500
  price: string;
624
501
  endTime: number;
625
502
  salt?: string;
626
- /** Caller hint — "ERC1155" creates the bid on the ERC-1155 marketplace. */
627
503
  tokenStandard?: string;
628
- /** ERC-1155 only: number of editions requested. Defaults to 1. */
629
504
  quantity?: string;
630
505
  }
631
506
  interface FulfillOrderIntentParams {
632
507
  fulfiller: string;
633
508
  orderHash: string;
634
- /** Caller hint — "ERC1155" forces 1155 routing even if the order isn't in the DB yet */
635
509
  tokenStandard?: string;
636
- /** ERC-1155 only: units to purchase (1 ≤ quantity ≤ remaining_amount). Defaults to 1. */
637
510
  quantity?: string;
638
511
  }
639
512
  interface CancelOrderIntentParams {
640
513
  offerer: string;
641
514
  orderHash: string;
642
- /** Caller hint — "ERC1155" forces 1155 routing even if the order isn't in the DB yet */
643
515
  tokenStandard?: string;
644
516
  }
645
- /** Per-creator-factory services the intents API can create-collection/mint through. */
646
517
  type FactoryFamilyServiceId = "mip-erc1155" | "ip-tickets" | "ip-club";
647
- /** The subset of FactoryFamilyServiceId that supports CREATE_TIER (ip-tickets, ip-club). */
648
518
  type TierServiceId = "ip-tickets" | "ip-club";
649
- /** Services CREATE_COLLECTION can deploy — the factory-family ones plus pop-protocol/drop-collection,
650
- * which take extra service-specific fields (see CreateCollectionIntentParams) since their factories
651
- * don't share the uniform `deploy_collection(name, symbol, baseUri)` entrypoint. */
652
519
  type CollectionServiceId = FactoryFamilyServiceId | "pop-protocol" | "drop-collection";
653
520
  interface CreateMintIntentParams {
654
- /** Collection owner wallet address — must be the collection owner on-chain */
655
521
  owner: string;
656
522
  recipient: string;
657
- /** Registry mint (mip-erc721/ip-erc721, the default): required together with tokenUri. */
658
523
  collectionId?: string;
659
- /** Registry mint: token metadata URI. mip-erc1155: required together with `value`. */
660
524
  tokenUri?: string;
661
- /**
662
- * EIP-2981 secondary-sale royalty in basis points (0–10_000). Registry mint only —
663
- * has no effect (and the backend rejects it) on mip-erc1155/ip-tickets/ip-club mints.
664
- */
665
525
  royaltyBps?: number;
666
- /** ip-tickets/ip-club mint: the existing tier's token id (create it first via createTierIntent). */
667
526
  tokenId?: string;
668
- /** ip-tickets/ip-club mint: copies to mint into `tokenId`. */
669
527
  amount?: string;
670
- /** mip-erc1155 mint: edition count for the newly-minted token. */
671
528
  value?: string;
672
- /** Required for every factory-family mint (mip-erc1155/ip-tickets/ip-club); omit for registry mint. */
673
529
  collectionContract?: string;
674
530
  }
675
531
  interface CreateCollectionIntentParams {
676
532
  owner: string;
677
533
  name: string;
678
534
  symbol: string;
679
- /** Optional description stored server-side and surfaced on the collection page. */
680
535
  description?: string;
681
- /** Optional IPFS image URI (ipfs://...) for the collection cover image. */
682
536
  image?: string;
683
- /** Base URI for token metadata. Defaults to empty string if not provided. */
684
537
  baseUri?: string;
685
- /** Optional: override the default collection contract address (registry path only). */
686
538
  collectionContract?: string;
687
- /**
688
- * Omit for the registry path (mip-erc721/ip-erc721). Pass a collection-service id to
689
- * deploy a new per-creator contract via that service's factory instead.
690
- */
691
539
  service?: CollectionServiceId;
692
- /** pop-protocol only: unix seconds after which `claim()` stops working. */
693
540
  claimEndTimestamp?: number;
694
- /** pop-protocol only: the POPFactory's EventType variant name (e.g. "Conference"). */
695
541
  eventType?: PopEventType;
696
- /** drop-collection only: total mintable supply across the whole drop. */
697
542
  maxSupply?: string;
698
- /** drop-collection only: the initial claim window/price/per-wallet cap. */
699
543
  conditions?: {
700
544
  startTime: number;
701
545
  endTime: number;
@@ -706,11 +550,6 @@ interface CreateCollectionIntentParams {
706
550
  }
707
551
  interface CreateCheckoutIntentParams {
708
552
  fulfiller: string;
709
- /**
710
- * Order hashes to check out (1–20). The backend builds one FULFILL_ORDER
711
- * intent per hash, not one atomic multi-item order — the client concatenates
712
- * each result's `calls` into a single multicall.
713
- */
714
553
  orderHashes: string[];
715
554
  }
716
555
  interface ApiCheckoutIntentResult {
@@ -719,12 +558,10 @@ interface ApiCheckoutIntentResult {
719
558
  requiresSignature?: false;
720
559
  calls?: unknown;
721
560
  expiresAt?: string;
722
- /** Set instead of the above when this specific order couldn't be built (e.g. not yet indexed). */
723
561
  error?: string;
724
562
  }
725
563
  interface CreateTierIntentParams {
726
564
  owner: string;
727
- /** The ip-tickets/ip-club collection contract to define the tier on. */
728
565
  collection: string;
729
566
  service: TierServiceId;
730
567
  maxSupply: string;
@@ -734,57 +571,40 @@ interface CreateTierIntentParams {
734
571
  metadataUri: string;
735
572
  }
736
573
  interface CreateCoinIntentParams {
737
- /** Owner of the new coin — the only address allowed to launch it. */
738
574
  owner: string;
739
575
  name: string;
740
576
  symbol: string;
741
- /** Full fixed supply (raw, 18 decimals). Minted to the Factory until launch. */
742
577
  initialSupply: string;
743
- /** Deterministic deploy salt. Omitted = timestamp-derived. */
744
578
  salt?: string;
745
579
  }
746
580
  interface LaunchCoinIntentParams {
747
- /** Wallet that must own the coin — the contract itself is the authority; an
748
- * unauthorized caller simply reverts. */
749
581
  owner: string;
750
- /** The deployed CreatorCoin contract (from a prior createCoinIntent deploy). */
751
582
  creatorCoin: string;
752
- /** Quote token (e.g. STRK). Must NOT itself be a Creator Coin. */
753
583
  quoteToken: string;
754
- /** Team-allocation recipients (≤10% of supply, summed). */
755
584
  initialHolders: string[];
756
585
  initialHoldersAmounts: string[];
757
- /** Anti-snipe window in seconds. Omitted = none. */
758
586
  transferRestrictionDelay?: number;
759
- /** Max % of supply buyable per tx during the window, in bps. Omitted = the SDK default. */
760
587
  maxPercentageBuyLaunch?: number;
761
- /** Quote (raw units) to transfer to the Factory in the same multicall, to fund the team-allocation buyback. */
762
588
  quoteFundAmount?: string;
763
589
  }
764
590
  interface CreateSponsorshipOfferIntentParams {
765
- /** The offer author — must currently own (nftContract, tokenId) on-chain. */
766
591
  author: string;
767
592
  nftContract: string;
768
593
  tokenId: string;
769
594
  minAmount: string;
770
- /** Seconds, applied from acceptance (not from offer creation). */
771
595
  duration: number;
772
596
  paymentToken: string;
773
597
  licenseTermsUri: string;
774
598
  transferable: boolean;
775
- /** Basis points, 0–10000. EIP-2981 royalty to the author on license resale. */
776
599
  royaltyBps: number;
777
- /** Restricts acceptance to one sponsor address; omit for open bidding. */
778
600
  specificSponsor?: string;
779
601
  }
780
602
  interface SetSponsorshipOfferOpenIntentParams {
781
- /** Must be the offer's author. */
782
603
  author: string;
783
604
  offerId: string;
784
605
  open: boolean;
785
606
  }
786
607
  interface PlaceSponsorshipBidIntentParams {
787
- /** The sponsor placing the bid — becomes the ERC-20 approve + place_bid caller. */
788
608
  sponsor: string;
789
609
  offerId: string;
790
610
  amount: string;
@@ -795,21 +615,16 @@ interface RetractSponsorshipBidIntentParams {
795
615
  offerId: string;
796
616
  }
797
617
  interface AcceptSponsorshipBidIntentParams {
798
- /** Must be the offer's author — re-verified on-chain. */
799
618
  author: string;
800
619
  offerId: string;
801
- /** The bidder whose bid is being accepted. */
802
620
  sponsor: string;
803
621
  }
804
622
  interface CreateSponsorshipProposalIntentParams {
805
- /** The sponsor proposing terms — pays if accepted. */
806
623
  proposer: string;
807
624
  nftContract: string;
808
625
  tokenId: string;
809
- /** Fixed take-it-or-leave-it amount (not a bid floor). */
810
626
  amount: string;
811
627
  duration: number;
812
- /** Unix seconds; the deadline for the asset owner to accept. Omit/0 = no deadline. */
813
628
  validUntil?: number;
814
629
  paymentToken: string;
815
630
  licenseTermsUri: string;
@@ -821,7 +636,6 @@ interface WithdrawSponsorshipProposalIntentParams {
821
636
  proposalId: string;
822
637
  }
823
638
  interface AcceptSponsorshipProposalIntentParams {
824
- /** Must currently own the asset — re-verified on-chain (binds to the asset, not a person). */
825
639
  owner: string;
826
640
  proposalId: string;
827
641
  }
@@ -830,21 +644,14 @@ interface RejectSponsorshipProposalIntentParams {
830
644
  proposalId: string;
831
645
  }
832
646
  interface CreateCounterOfferIntentParams {
833
- /** Wallet address of the NFT owner making the counter-offer. */
834
647
  sellerAddress: string;
835
- /** Order hash of the original buyer bid being countered. */
836
648
  originalOrderHash: string;
837
- /** Counter price as a raw wei integer string (not human-readable). */
838
649
  priceRaw: string;
839
- /** Duration in seconds the counter-offer will be valid (3600–2592000). */
840
650
  durationSeconds: number;
841
- /** Optional message from the seller to the buyer. Max 500 chars. */
842
651
  message?: string;
843
652
  }
844
653
  interface ApiCounterOffersQuery {
845
- /** Original bid order hash — returns the counter-offer for this specific bid. */
846
654
  originalOrderHash?: string;
847
- /** Seller address — returns all counter-offers sent by this seller. */
848
655
  sellerAddress?: string;
849
656
  page?: number;
850
657
  limit?: number;
@@ -866,7 +673,6 @@ interface ApiRemixOffer {
866
673
  creatorAddress: string;
867
674
  requesterAddress: string | null;
868
675
  message?: string | null;
869
- /** Visible only to creator and requester — includes formatted price */
870
676
  price?: ApiRemixOfferPrice;
871
677
  licenseType: string;
872
678
  commercial: boolean;
@@ -880,7 +686,6 @@ interface ApiRemixOffer {
880
686
  expiresAt: string;
881
687
  updatedAt: string;
882
688
  }
883
- /** Public remix record — price/currency omitted for non-participants */
884
689
  interface ApiPublicRemix {
885
690
  id: string;
886
691
  remixContract: string | null;
@@ -900,7 +705,6 @@ interface CreateRemixOfferParams {
900
705
  proposedPrice?: string;
901
706
  proposedCurrency?: string;
902
707
  message?: string;
903
- /** Offer validity in days (server default applies if omitted) */
904
708
  expiresInDays?: number;
905
709
  }
906
710
  interface AutoRemixOfferParams {
@@ -913,7 +717,6 @@ interface ConfirmSelfRemixParams {
913
717
  originalTokenId: string;
914
718
  remixContract: string;
915
719
  remixTokenId: string;
916
- /** On-chain transaction hash of the mint tx */
917
720
  txHash?: string;
918
721
  licenseType: string;
919
722
  commercial: boolean;
@@ -927,7 +730,6 @@ interface ConfirmRemixOfferParams {
927
730
  orderHash?: string;
928
731
  }
929
732
  interface ApiRemixOffersQuery {
930
- /** "creator" = offers where you are the original creator; "requester" = offers you made */
931
733
  role: "creator" | "requester";
932
734
  page?: number;
933
735
  limit?: number;
@@ -958,7 +760,6 @@ interface ApiPortalKeyCreated {
958
760
  id: string;
959
761
  prefix: string;
960
762
  label: string | null;
961
- /** Plaintext key — shown ONCE at creation */
962
763
  plaintext: string;
963
764
  }
964
765
  interface ApiUsageDay {
@@ -973,7 +774,6 @@ interface ApiWebhookEndpoint {
973
774
  createdAt: string;
974
775
  }
975
776
  interface ApiWebhookCreated extends ApiWebhookEndpoint {
976
- /** Signing secret — shown ONCE at creation, not stored in plaintext */
977
777
  secret: string;
978
778
  }
979
779
  interface CreateWebhookParams {
@@ -1018,11 +818,6 @@ interface ApiCreatorProfile {
1018
818
  displayName: string | null;
1019
819
  bio: string | null;
1020
820
  avatarImage: string | null;
1021
- /** Computed fallback used by the creator-list / creator-page endpoints
1022
- * ONLY when `avatarImage` is null: image of any collection owned by
1023
- * this creator. Undefined on profile-detail endpoints where this
1024
- * lookup isn't performed. UI may use this to populate hero banners
1025
- * without an extra fetch. */
1026
821
  collectionImage?: string | null;
1027
822
  websiteUrl: string | null;
1028
823
  twitterUrl: string | null;
@@ -1042,6 +837,7 @@ interface ApiUserWallet {
1042
837
  walletAddress: string;
1043
838
  email?: string | null;
1044
839
  emailVerified?: boolean;
840
+ requiresEmailVerification?: boolean;
1045
841
  }
1046
842
  interface ApiCollectionClaim {
1047
843
  id: string;
@@ -1065,9 +861,6 @@ interface ApiBusinessProvisioning {
1065
861
  accountId: string;
1066
862
  chain: string;
1067
863
  walletAddress: string;
1068
- /** Free-form (mirrors Identity.scheme) — "email" is the only scheme the backend
1069
- * delivers a claim link for on its own; any other scheme still registers, the
1070
- * business gets `claimUrl` back on the register response and delivers it itself. */
1071
864
  recipientScheme: string;
1072
865
  recipientValue: string;
1073
866
  interimOwnerPubkey: string;
@@ -1177,12 +970,9 @@ type MedialaneErrorCode = "TOKEN_NOT_FOUND" | "COLLECTION_NOT_FOUND" | "ORDER_NO
1177
970
 
1178
971
  declare class MedialaneApiError extends Error {
1179
972
  readonly status: number;
1180
- /** Parsed `Retry-After` (ms) when the server sent one — used by withRetry on 429. */
1181
973
  readonly retryAfterMs?: number | undefined;
1182
974
  readonly code: MedialaneErrorCode;
1183
- constructor(status: number, message: string,
1184
- /** Parsed `Retry-After` (ms) when the server sent one — used by withRetry on 429. */
1185
- retryAfterMs?: number | undefined);
975
+ constructor(status: number, message: string, retryAfterMs?: number | undefined);
1186
976
  }
1187
977
  declare class ApiClient {
1188
978
  private readonly baseUrl;
@@ -1190,21 +980,12 @@ declare class ApiClient {
1190
980
  private readonly baseHeaders;
1191
981
  private readonly retryOptions;
1192
982
  constructor(baseUrl: string, apiKey?: string, retryOptions?: RetryOptions, chain?: Chain);
1193
- /** Normalize an address for this client's chain (chain-scoped — Decision B). */
1194
983
  private addr;
1195
- /**
1196
- * The one HTTP path for the whole client: base headers (incl. x-api-key),
1197
- * JSON error unwrapping, and `withRetry` (5xx/network only — 4xx never
1198
- * retried). `allow404`/`allow403` turn those statuses into a `null` result
1199
- * instead of a throw, for "profile may not exist" / "not a holder" reads —
1200
- * so no method needs to hand-roll `fetch` to get that behavior.
1201
- */
1202
984
  private request;
1203
985
  private get;
1204
986
  private post;
1205
987
  private patch;
1206
988
  private del;
1207
- /** Bearer header for SIWS-token-authenticated routes. */
1208
989
  private bearer;
1209
990
  getOrders(query?: ApiOrdersQuery): Promise<ApiResponse<ApiOrder[]>>;
1210
991
  getOrder(orderHash: string): Promise<ApiResponse<ApiOrder>>;
@@ -1213,7 +994,7 @@ declare class ApiClient {
1213
994
  getToken(contract: string, tokenId: string, wait?: boolean): Promise<ApiResponse<ApiToken>>;
1214
995
  getTokensByOwner(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiToken[]>>;
1215
996
  getTokenHistory(contract: string, tokenId: string, page?: number, limit?: number): Promise<ApiResponse<ApiActivity[]>>;
1216
- getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, service?: string, chain?: ChainFilter): Promise<ApiResponse<ApiCollection[]>>;
997
+ getCollections(page?: number, limit?: number, isKnown?: boolean, sort?: CollectionSort, service?: string, chain?: ChainFilter, standard?: string): Promise<ApiResponse<ApiCollection[]>>;
1217
998
  getCollectionsByOwner(owner: string, page?: number, limit?: number): Promise<ApiResponse<ApiCollection[]>>;
1218
999
  getCollection(contract: string): Promise<ApiResponse<ApiCollection>>;
1219
1000
  getCollectionTokens(contract: string, page?: number, limit?: number, sort?: CollectionTokensSort): Promise<ApiResponse<ApiToken[]>>;
@@ -1250,16 +1031,7 @@ declare class ApiClient {
1250
1031
  withdrawSponsorshipProposalIntent(params: WithdrawSponsorshipProposalIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1251
1032
  acceptSponsorshipProposalIntent(params: AcceptSponsorshipProposalIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1252
1033
  rejectSponsorshipProposalIntent(params: RejectSponsorshipProposalIntentParams): Promise<ApiResponse<ApiIntentCreated>>;
1253
- /**
1254
- * Create a counter-offer intent. The seller proposes a new price in response
1255
- * to a buyer's active bid. siwsToken is optional — the endpoint authenticates
1256
- * via the tenant API key; pass a SIWS token only if your backend requires it.
1257
- */
1258
1034
  createCounterOfferIntent(params: CreateCounterOfferIntentParams, siwsToken?: string): Promise<ApiResponse<ApiIntentCreated>>;
1259
- /**
1260
- * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
1261
- * `sellerAddress` (seller view) — at least one is required.
1262
- */
1263
1035
  getCounterOffers(query: ApiCounterOffersQuery): Promise<ApiResponse<ApiOrder[]>>;
1264
1036
  getMetadataSignedUrl(): Promise<ApiResponse<ApiMetadataSignedUrl>>;
1265
1037
  uploadMetadata(metadata: Record<string, unknown>): Promise<ApiResponse<ApiMetadataUpload>>;
@@ -1279,18 +1051,11 @@ declare class ApiClient {
1279
1051
  id: string;
1280
1052
  status: string;
1281
1053
  }>>;
1282
- /**
1283
- * Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
1284
- * Authorization: Bearer (SIWS token) simultaneously.
1285
- */
1286
1054
  claimCollection(contractAddress: string, walletAddress: string, siwsToken: string): Promise<{
1287
1055
  verified: boolean;
1288
1056
  collection?: ApiCollection;
1289
1057
  reason?: string;
1290
1058
  }>;
1291
- /**
1292
- * Path 3: Manual off-chain claim request (email-based).
1293
- */
1294
1059
  requestCollectionClaim(params: {
1295
1060
  contractAddress: string;
1296
1061
  walletAddress?: string;
@@ -1310,50 +1075,32 @@ declare class ApiClient {
1310
1075
  }>>;
1311
1076
  completeBusinessProvisioning(id: string): Promise<ApiResponse<ApiBusinessProvisioning>>;
1312
1077
  getCollectionProfile(contractAddress: string): Promise<ApiCollectionProfile | null>;
1313
- /**
1314
- * Update collection profile. Requires SIWS token for ownership check.
1315
- */
1316
1078
  updateCollectionProfile(contractAddress: string, data: Partial<Omit<ApiCollectionProfile, "contractAddress" | "chain" | "updatedBy" | "updatedAt">>, siwsToken: string): Promise<ApiCollectionProfile>;
1317
- /** No signature required — wallet activity is public on-chain data, read like any other /v1 GET. */
1318
1079
  getWalletActivity(address: string, chain?: "STARKNET"): Promise<ApiResponse<ApiWalletActivity[]>>;
1319
1080
  getGatedContent(contractAddress: string, siwsToken: string): Promise<{
1320
1081
  title: string;
1321
1082
  url: string;
1322
1083
  type: string;
1323
1084
  } | null>;
1324
- /** List all creators with an approved username. */
1325
1085
  getCreators(opts?: {
1326
1086
  search?: string;
1327
1087
  page?: number;
1328
1088
  limit?: number;
1329
1089
  }): Promise<ApiCreatorListResult>;
1330
1090
  getCreatorProfile(walletAddress: string): Promise<ApiCreatorProfile | null>;
1331
- /** Resolve a username slug to a creator profile (public). */
1332
1091
  getCreatorByUsername(username: string): Promise<ApiCreatorProfile | null>;
1333
- /**
1334
- * Update creator profile. Requires SIWS token; wallet must match authenticated user.
1335
- */
1336
1092
  updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, siwsToken: string): Promise<ApiCreatorProfile>;
1337
- /** Check if a collection slug is available (public, no auth). */
1338
1093
  checkCollectionSlugAvailability(slug: string): Promise<{
1339
1094
  available: boolean;
1340
1095
  reason?: string;
1341
1096
  }>;
1342
- /** Submit a slug claim for a collection. Requires SIWS token — caller must be the collection owner. */
1343
1097
  submitCollectionSlugClaim(contractAddress: string, slug: string, siwsToken: string, notifyEmail?: string): Promise<{
1344
1098
  claim: ApiCollectionSlugClaim;
1345
1099
  }>;
1346
- /** Returns all slug claims submitted by the authenticated wallet. Requires SIWS token. */
1347
1100
  getMyCollectionSlugClaims(siwsToken: string): Promise<{
1348
1101
  claims: ApiCollectionSlugClaim[];
1349
1102
  }>;
1350
- /** Resolve a collection slug to a full collection. Returns null if not found. */
1351
1103
  getCollectionBySlug(slug: string): Promise<ApiCollection | null>;
1352
- /**
1353
- * Frictionless wallet registration. Tenant API key only (no SIWS token required).
1354
- * Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
1355
- * UNKNOWN walletType rows when a more specific value is supplied.
1356
- */
1357
1104
  registerUser(params: {
1358
1105
  walletAddress: string;
1359
1106
  walletType?: string;
@@ -1376,55 +1123,19 @@ declare class ApiClient {
1376
1123
  email?: string;
1377
1124
  accountToken?: string;
1378
1125
  }): Promise<ApiUserWallet>;
1379
- /** Whether an email already has an account attached — used by io's onboarding to branch into an "already exists" message instead of creating a duplicate account. */
1380
1126
  checkEmailExists(email: string): Promise<boolean>;
1381
- /**
1382
- * Get the authenticated user's stored wallet address from the backend DB.
1383
- * Returns null if the user has not completed onboarding yet.
1384
- * Requires SIWS token; no tenant API key needed.
1385
- */
1386
1127
  getMyWallet(siwsToken: string): Promise<ApiUserWallet | null>;
1387
- /**
1388
- * Get public remixes of a token (open to everyone).
1389
- */
1390
1128
  getTokenRemixes(contract: string, tokenId: string, opts?: {
1391
1129
  page?: number;
1392
1130
  limit?: number;
1393
1131
  }): Promise<ApiResponse<ApiPublicRemix[]>>;
1394
- /**
1395
- * Submit a custom remix offer for a token. Requires SIWS token.
1396
- */
1397
1132
  submitRemixOffer(params: CreateRemixOfferParams, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1398
- /**
1399
- * Submit an auto remix offer for a token with an open license. Requires SIWS token.
1400
- */
1401
1133
  submitAutoRemixOffer(params: AutoRemixOfferParams, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1402
- /**
1403
- * Record a self-remix (owner remixing their own token). Requires SIWS token.
1404
- */
1405
1134
  confirmSelfRemix(params: ConfirmSelfRemixParams, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1406
- /**
1407
- * List remix offers by role. Requires SIWS token.
1408
- * role="creator" — offers where you are the original creator.
1409
- * role="requester" — offers you made.
1410
- */
1411
1135
  getRemixOffers(query: ApiRemixOffersQuery, siwsToken: string): Promise<ApiResponse<ApiRemixOffer[]>>;
1412
- /**
1413
- * Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
1414
- */
1415
1136
  getRemixOffer(id: string, siwsToken?: string): Promise<ApiResponse<ApiRemixOffer>>;
1416
- /**
1417
- * Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
1418
- */
1419
1137
  confirmRemixOffer(id: string, params: ConfirmRemixOfferParams, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1420
- /**
1421
- * Creator rejects a remix offer. Requires SIWS token.
1422
- */
1423
1138
  rejectRemixOffer(id: string, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1424
- /**
1425
- * Requester extends the expiry of a pending remix offer by 1–30 days.
1426
- * Requires SIWS token.
1427
- */
1428
1139
  extendRemixOffer(id: string, days: number, siwsToken: string): Promise<ApiResponse<ApiRemixOffer>>;
1429
1140
  getPopCollections(opts?: {
1430
1141
  page?: number;
@@ -1437,11 +1148,6 @@ declare class ApiClient {
1437
1148
  getCoin(contract: string): Promise<{
1438
1149
  data: ApiCoin;
1439
1150
  }>;
1440
- /**
1441
- * Creator-authed coin profile edit (image/description). Backend authorizes
1442
- * via `coin.creator` (trustless — from the factory event), not a body param;
1443
- * `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
1444
- */
1445
1151
  updateCoinProfile(contract: string, data: {
1446
1152
  image?: string;
1447
1153
  description?: string;
@@ -1452,15 +1158,10 @@ declare class ApiClient {
1452
1158
  sort?: CollectionSort;
1453
1159
  }): Promise<ApiResponse<ApiCollection[]>>;
1454
1160
  getDropMintStatus(collection: string, wallet: string): Promise<DropMintStatus>;
1455
- /** Score + level + progress + badges for one address (zeroed for unknown). */
1456
1161
  getRewards(address: string): Promise<ApiUserRewards>;
1457
- /** Paginated XP leaderboard. */
1458
1162
  getRewardsLeaderboard(page?: number, limit?: number): Promise<ApiResponse<ApiRewardsLeaderboardEntry[]>>;
1459
- /** Point-event history for an address. */
1460
1163
  getRewardsEvents(address: string, page?: number, limit?: number): Promise<ApiResponse<ApiPointEvent[]>>;
1461
- /** Reward configuration: level ladder, enabled action XP values, badge catalog. */
1462
1164
  getRewardsConfig(): Promise<ApiRewardsConfig>;
1463
- /** Minimal level info for up to 50 addresses — one call per list page. */
1464
1165
  getRewardsBatch(addresses: string[]): Promise<ApiRewardsBatchEntry[]>;
1465
1166
  }
1466
1167
 
@@ -1499,9 +1200,7 @@ interface OrderDetails {
1499
1200
  start_time: bigint;
1500
1201
  end_time: bigint;
1501
1202
  order_status: string;
1502
- /** The offerer's bulk-cancel epoch at registration; re-checked at fulfilment. */
1503
1203
  counter: string;
1504
- /** ERC-1155 only — units still available. */
1505
1204
  remaining_amount?: string;
1506
1205
  }
1507
1206
 
@@ -1513,15 +1212,10 @@ interface CreatePopCollectionParams {
1513
1212
  eventType: PopEventType;
1514
1213
  }
1515
1214
  interface ClaimConditions {
1516
- /** Unix timestamp when minting opens. 0 = open immediately. */
1517
1215
  startTime: number;
1518
- /** Unix timestamp when minting closes. 0 = never closes. */
1519
1216
  endTime: number;
1520
- /** Price per token in payment_token units. 0 = free mint. */
1521
1217
  price: bigint | string;
1522
- /** ERC-20 token address for payment. Must be non-zero if price > 0. */
1523
1218
  paymentToken: string;
1524
- /** Max tokens a single wallet may mint across all phases. 0 = unlimited. */
1525
1219
  maxQuantityPerWallet: bigint | string;
1526
1220
  }
1527
1221
  interface CreateDropParams {
@@ -1532,16 +1226,11 @@ interface CreateDropParams {
1532
1226
  initialConditions: ClaimConditions;
1533
1227
  }
1534
1228
  interface CreateTicketParams {
1535
- /** Address of the deployed IPTicketCollection contract. */
1536
1229
  collection: string;
1537
1230
  maxSupply: bigint | string;
1538
- /** Unix timestamp (seconds). Omit for "open immediately". */
1539
1231
  startTime?: number;
1540
- /** Unix timestamp (seconds). Omit for "never expires". */
1541
1232
  endTime?: number;
1542
- /** Basis points, 0–10000. */
1543
1233
  royaltyBps: number;
1544
- /** ipfs:// or ar:// — enforced on-chain. */
1545
1234
  metadataUri: string;
1546
1235
  }
1547
1236
  interface MintTicketsParams {
@@ -1551,16 +1240,11 @@ interface MintTicketsParams {
1551
1240
  amount: bigint | string;
1552
1241
  }
1553
1242
  interface CreateMembershipParams {
1554
- /** Address of the deployed IPClubCollection contract. */
1555
1243
  collection: string;
1556
1244
  maxSupply: bigint | string;
1557
- /** Unix timestamp (seconds). Omit for "valid immediately". Gates membership, never minting. */
1558
1245
  startTime?: number;
1559
- /** Unix timestamp (seconds). Omit for "lifetime membership". */
1560
1246
  endTime?: number;
1561
- /** Basis points, 0–10000. */
1562
1247
  royaltyBps: number;
1563
- /** ipfs:// or ar:// — enforced on-chain. */
1564
1248
  metadataUri: string;
1565
1249
  }
1566
1250
  interface MintMembershipsParams {
@@ -1573,29 +1257,22 @@ interface CreateSponsorshipOfferParams {
1573
1257
  nftContract: string;
1574
1258
  tokenId: bigint | string;
1575
1259
  minAmount: bigint | string;
1576
- /** Seconds, applied from acceptance (not from offer creation). */
1577
1260
  duration: number;
1578
1261
  paymentToken: string;
1579
1262
  licenseTermsUri: string;
1580
1263
  transferable: boolean;
1581
- /** Basis points, 0–10000. EIP-2981 royalty to the author on license resale. */
1582
1264
  royaltyBps: bigint | string;
1583
- /** Restricts acceptance to one sponsor address; omit for open bidding. */
1584
1265
  specificSponsor?: string;
1585
1266
  }
1586
- /** Sponsor-initiated — the symmetric counterpart to CreateSponsorshipOfferParams. */
1587
1267
  interface ProposeSponsorshipParams {
1588
1268
  nftContract: string;
1589
1269
  tokenId: bigint | string;
1590
- /** Fixed take-it-or-leave-it amount (not a bid floor). */
1591
1270
  amount: bigint | string;
1592
1271
  duration: number;
1593
- /** Unix seconds; the deadline for the asset owner to accept. 0 = no deadline. */
1594
1272
  validUntil?: number;
1595
1273
  paymentToken: string;
1596
1274
  licenseTermsUri: string;
1597
1275
  transferable: boolean;
1598
- /** Basis points, 0–10000. */
1599
1276
  royaltyBps: bigint | string;
1600
1277
  }
1601
1278