@medialane/sdk 0.85.5 → 0.85.7

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.
@@ -45,11 +45,6 @@ var COORDINATES = {
45
45
  ipClubFactoryClassHash: "0x05d9d431bd3532b1fa4d5bab572f49c5ad8034ee3cc83951aa41ae82c9cad266",
46
46
  ipClubCollectionClassHash: "0x05b8477c72e6bf0cf64967d71155021fd4d77d9a57e8805c6b40709121c002c5",
47
47
  ipClubFactoryStartBlock: 11928775,
48
- // v3 redesign (deployed 2026-07-15): single contract is both the
49
- // offer/bid/proposal registry and the license collection (embeds
50
- // ERC721Component directly) — no separate receipt contract, no
51
- // set_minter bootstrap. Supersedes the 2026-07-02 v2 address, which had
52
- // zero offers/licenses ever issued (clean cutover, no reclassification).
53
48
  ipSponsorship: "0x03729ebe0fedf29ec97fca34db09174772af7f870af26a26e024a61040143e5c",
54
49
  ipSponsorshipClassHash: "0x0626daac2ed7e2bf630ef5b10104b3202db1559216c0c1a504c0e99be2fbfec3",
55
50
  ipSponsorshipStartBlock: 11896456,
@@ -88,13 +83,10 @@ function resolveFeeConfig(raw) {
88
83
 
89
84
  // src/config.ts
90
85
  var MedialaneConfigSchema = z.object({
91
- // Chain-scoped client (spec 2026-06-13 Decision B): one client per chain,
92
- // coordinates resolved from the registry. Replaces the removed `network` axis.
93
86
  chain: z.enum(CHAINS).default(DEFAULT_CHAIN),
94
87
  rpcUrl: z.string().url().optional(),
95
88
  backendUrl: z.string().url().optional(),
96
89
  apiKey: z.string().optional(),
97
- // Per-contract overrides remain for tests/forks; default from the registry.
98
90
  marketplace721Contract: z.string().optional(),
99
91
  marketplaceContract: z.string().optional(),
100
92
  marketplace1155Contract: z.string().optional(),
@@ -272,17 +264,9 @@ var ApiClient = class {
272
264
  this.baseHeaders = apiKey ? { "x-api-key": apiKey } : {};
273
265
  this.retryOptions = retryOptions;
274
266
  }
275
- /** Normalize an address for this client's chain (chain-scoped — Decision B). */
276
267
  addr(a) {
277
268
  return normalizeAddress(this.chain, a);
278
269
  }
279
- /**
280
- * The one HTTP path for the whole client: base headers (incl. x-api-key),
281
- * JSON error unwrapping, and `withRetry` (5xx/network only — 4xx never
282
- * retried). `allow404`/`allow403` turn those statuses into a `null` result
283
- * instead of a throw, for "profile may not exist" / "not a holder" reads —
284
- * so no method needs to hand-roll `fetch` to get that behavior.
285
- */
286
270
  async request(path, init, opts) {
287
271
  const url = `${this.baseUrl.replace(/\/$/, "")}${path}`;
288
272
  const headers = { ...this.baseHeaders };
@@ -322,11 +306,9 @@ var ApiClient = class {
322
306
  del(path) {
323
307
  return this.request(path, { method: "DELETE" });
324
308
  }
325
- /** Bearer header for SIWS-token-authenticated routes. */
326
309
  bearer(siwsToken) {
327
310
  return { Authorization: `Bearer ${siwsToken}` };
328
311
  }
329
- // ─── Orders ────────────────────────────────────────────────────────────────
330
312
  getOrders(query = {}) {
331
313
  const params = new URLSearchParams();
332
314
  if (query.status) params.set("status", query.status);
@@ -353,7 +335,6 @@ var ApiClient = class {
353
335
  `/v1/orders/user/${this.addr(address)}?page=${page}&limit=${limit}`
354
336
  );
355
337
  }
356
- // ─── Tokens ────────────────────────────────────────────────────────────────
357
338
  getToken(contract, tokenId, wait = false) {
358
339
  return this.get(
359
340
  `/v1/tokens/${contract}/${tokenId}${wait ? "?wait=true" : ""}`
@@ -369,7 +350,6 @@ var ApiClient = class {
369
350
  `/v1/tokens/${contract}/${tokenId}/history?page=${page}&limit=${limit}`
370
351
  );
371
352
  }
372
- // ─── Collections ───────────────────────────────────────────────────────────
373
353
  getCollections(page = 1, limit = 20, isKnown, sort, service, chain, standard) {
374
354
  const params = new URLSearchParams({ page: String(page), limit: String(limit) });
375
355
  if (isKnown !== void 0) params.set("isKnown", String(isKnown));
@@ -391,7 +371,6 @@ var ApiClient = class {
391
371
  `/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}&sort=${sort}`
392
372
  );
393
373
  }
394
- // ─── Activities ────────────────────────────────────────────────────────────
395
374
  getActivities(query = {}) {
396
375
  const params = new URLSearchParams();
397
376
  if (query.type) params.set("type", query.type);
@@ -407,7 +386,6 @@ var ApiClient = class {
407
386
  `/v1/activities/${this.addr(address)}?page=${page}&limit=${limit}`
408
387
  );
409
388
  }
410
- // ─── Comments ──────────────────────────────────────────────────────────────
411
389
  getTokenComments(contract, tokenId, opts = {}) {
412
390
  const params = new URLSearchParams();
413
391
  if (opts.page !== void 0) params.set("page", String(opts.page));
@@ -417,7 +395,6 @@ var ApiClient = class {
417
395
  `/v1/tokens/${this.addr(contract)}/${tokenId}/comments${qs ? `?${qs}` : ""}`
418
396
  );
419
397
  }
420
- // ─── Search ────────────────────────────────────────────────────────────────
421
398
  search(q, limit = 10, chain) {
422
399
  const params = new URLSearchParams({ q, limit: String(limit) });
423
400
  if (chain) params.set("chain", chain);
@@ -425,7 +402,6 @@ var ApiClient = class {
425
402
  `/v1/search?${params.toString()}`
426
403
  );
427
404
  }
428
- // ─── Intents ───────────────────────────────────────────────────────────────
429
405
  createListingIntent(params) {
430
406
  return this.post("/v1/intents/listing", params);
431
407
  }
@@ -492,11 +468,6 @@ var ApiClient = class {
492
468
  rejectSponsorshipProposalIntent(params) {
493
469
  return this.post("/v1/intents/sponsorship-proposal-reject", params);
494
470
  }
495
- /**
496
- * Create a counter-offer intent. The seller proposes a new price in response
497
- * to a buyer's active bid. siwsToken is optional — the endpoint authenticates
498
- * via the tenant API key; pass a SIWS token only if your backend requires it.
499
- */
500
471
  createCounterOfferIntent(params, siwsToken) {
501
472
  const extraHeaders = siwsToken ? { "Authorization": `Bearer ${siwsToken}` } : {};
502
473
  return this.request("/v1/intents/counter-offer", {
@@ -505,10 +476,6 @@ var ApiClient = class {
505
476
  headers: extraHeaders
506
477
  });
507
478
  }
508
- /**
509
- * Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
510
- * `sellerAddress` (seller view) — at least one is required.
511
- */
512
479
  getCounterOffers(query) {
513
480
  const params = new URLSearchParams();
514
481
  if (query.originalOrderHash) params.set("originalOrderHash", query.originalOrderHash);
@@ -517,7 +484,6 @@ var ApiClient = class {
517
484
  if (query.limit !== void 0) params.set("limit", String(query.limit));
518
485
  return this.get(`/v1/orders/counter-offers?${params}`);
519
486
  }
520
- // ─── Metadata ──────────────────────────────────────────────────────────────
521
487
  getMetadataSignedUrl() {
522
488
  return this.get("/v1/metadata/signed-url");
523
489
  }
@@ -536,7 +502,6 @@ var ApiClient = class {
536
502
  body: formData
537
503
  });
538
504
  }
539
- // ─── Portal (tenant self-service) ──────────────────────────────────────────
540
505
  getMe() {
541
506
  return this.get("/v1/portal/me");
542
507
  }
@@ -563,11 +528,6 @@ var ApiClient = class {
563
528
  `/v1/portal/webhooks/${id}`
564
529
  );
565
530
  }
566
- // ─── Collection Claims ──────────────────────────────────────────────────────
567
- /**
568
- * Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
569
- * Authorization: Bearer (SIWS token) simultaneously.
570
- */
571
531
  async claimCollection(contractAddress, walletAddress, siwsToken) {
572
532
  return this.request("/v1/collections/claim", {
573
533
  method: "POST",
@@ -575,23 +535,18 @@ var ApiClient = class {
575
535
  headers: this.bearer(siwsToken)
576
536
  });
577
537
  }
578
- /**
579
- * Path 3: Manual off-chain claim request (email-based).
580
- */
581
538
  requestCollectionClaim(params) {
582
539
  return this.request("/v1/collections/claim/request", {
583
540
  method: "POST",
584
541
  body: JSON.stringify(params)
585
542
  });
586
543
  }
587
- // ─── Business Provisioning ──────────────────────────────────────────────────
588
544
  registerBusinessProvisioning(params) {
589
545
  return this.post("/v1/business/provisioning", params);
590
546
  }
591
547
  completeBusinessProvisioning(id) {
592
548
  return this.post(`/v1/business/provisioning/${id}/complete`, {});
593
549
  }
594
- // ─── Collection Profiles ────────────────────────────────────────────────────
595
550
  getCollectionProfile(contractAddress) {
596
551
  return this.request(
597
552
  `/v1/collections/${this.addr(contractAddress)}/profile`,
@@ -599,16 +554,12 @@ var ApiClient = class {
599
554
  { allow404: true }
600
555
  );
601
556
  }
602
- /**
603
- * Update collection profile. Requires SIWS token for ownership check.
604
- */
605
557
  updateCollectionProfile(contractAddress, data, siwsToken) {
606
558
  return this.request(
607
559
  `/v1/collections/${this.addr(contractAddress)}/profile`,
608
560
  { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
609
561
  );
610
562
  }
611
- /** No signature required — wallet activity is public on-chain data, read like any other /v1 GET. */
612
563
  getWalletActivity(address, chain = "STARKNET") {
613
564
  return this.get(
614
565
  `/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`
@@ -621,8 +572,6 @@ var ApiClient = class {
621
572
  { allow404: true, allow403: true }
622
573
  );
623
574
  }
624
- // ─── Creator Profiles ───────────────────────────────────────────────────────
625
- /** List all creators with an approved username. */
626
575
  getCreators(opts = {}) {
627
576
  const params = new URLSearchParams();
628
577
  if (opts.search) params.set("search", opts.search);
@@ -638,7 +587,6 @@ var ApiClient = class {
638
587
  { allow404: true }
639
588
  );
640
589
  }
641
- /** Resolve a username slug to a creator profile (public). */
642
590
  getCreatorByUsername(username) {
643
591
  return this.request(
644
592
  `/v1/creators/by-username/${encodeURIComponent(username.toLowerCase().trim())}`,
@@ -646,23 +594,17 @@ var ApiClient = class {
646
594
  { allow404: true }
647
595
  );
648
596
  }
649
- /**
650
- * Update creator profile. Requires SIWS token; wallet must match authenticated user.
651
- */
652
597
  updateCreatorProfile(walletAddress, data, siwsToken) {
653
598
  return this.request(
654
599
  `/v1/creators/${this.addr(walletAddress)}/profile`,
655
600
  { method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
656
601
  );
657
602
  }
658
- // ─── Collection Slug Claims ───────────────────────────────────────────────────
659
- /** Check if a collection slug is available (public, no auth). */
660
603
  checkCollectionSlugAvailability(slug) {
661
604
  return this.get(
662
605
  `/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`
663
606
  );
664
607
  }
665
- /** Submit a slug claim for a collection. Requires SIWS token — caller must be the collection owner. */
666
608
  submitCollectionSlugClaim(contractAddress, slug, siwsToken, notifyEmail) {
667
609
  return this.request("/v1/collection-slug-claims", {
668
610
  method: "POST",
@@ -670,14 +612,12 @@ var ApiClient = class {
670
612
  headers: this.bearer(siwsToken)
671
613
  });
672
614
  }
673
- /** Returns all slug claims submitted by the authenticated wallet. Requires SIWS token. */
674
615
  getMyCollectionSlugClaims(siwsToken) {
675
616
  return this.request("/v1/collection-slug-claims/me", {
676
617
  method: "GET",
677
618
  headers: this.bearer(siwsToken)
678
619
  });
679
620
  }
680
- /** Resolve a collection slug to a full collection. Returns null if not found. */
681
621
  getCollectionBySlug(slug) {
682
622
  return this.request(
683
623
  `/v1/collections/by-slug/${encodeURIComponent(slug.toLowerCase().trim())}`,
@@ -685,12 +625,6 @@ var ApiClient = class {
685
625
  { allow404: true }
686
626
  );
687
627
  }
688
- // ─── User Wallet ─────────────────────────────────────────────────────────────
689
- /**
690
- * Frictionless wallet registration. Tenant API key only (no SIWS token required).
691
- * Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
692
- * UNKNOWN walletType rows when a more specific value is supplied.
693
- */
694
628
  async registerUser(params) {
695
629
  return this.post("/v1/users/register", params);
696
630
  }
@@ -709,18 +643,12 @@ var ApiClient = class {
709
643
  headers: this.bearer(siwsToken)
710
644
  });
711
645
  }
712
- /** 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. */
713
646
  async checkEmailExists(email) {
714
647
  const { exists } = await this.get(
715
648
  `/v1/auth/email/exists?email=${encodeURIComponent(email)}`
716
649
  );
717
650
  return exists;
718
651
  }
719
- /**
720
- * Get the authenticated user's stored wallet address from the backend DB.
721
- * Returns null if the user has not completed onboarding yet.
722
- * Requires SIWS token; no tenant API key needed.
723
- */
724
652
  getMyWallet(siwsToken) {
725
653
  return this.request(
726
654
  "/v1/users/me",
@@ -728,10 +656,13 @@ var ApiClient = class {
728
656
  { allow404: true }
729
657
  );
730
658
  }
731
- // ─── Remix Licensing ─────────────────────────────────────────────────────────
732
- /**
733
- * Get public remixes of a token (open to everyone).
734
- */
659
+ changeMyEmail(email, siwsToken) {
660
+ return this.request("/v1/users/me/email", {
661
+ method: "POST",
662
+ headers: this.bearer(siwsToken),
663
+ body: JSON.stringify({ email })
664
+ });
665
+ }
735
666
  getTokenRemixes(contract, tokenId, opts = {}) {
736
667
  const params = new URLSearchParams();
737
668
  if (opts.page !== void 0) params.set("page", String(opts.page));
@@ -741,9 +672,6 @@ var ApiClient = class {
741
672
  `/v1/tokens/${this.addr(contract)}/${tokenId}/remixes${qs ? `?${qs}` : ""}`
742
673
  );
743
674
  }
744
- /**
745
- * Submit a custom remix offer for a token. Requires SIWS token.
746
- */
747
675
  submitRemixOffer(params, siwsToken) {
748
676
  return this.request("/v1/remix-offers", {
749
677
  method: "POST",
@@ -751,9 +679,6 @@ var ApiClient = class {
751
679
  headers: { "Authorization": `Bearer ${siwsToken}` }
752
680
  });
753
681
  }
754
- /**
755
- * Submit an auto remix offer for a token with an open license. Requires SIWS token.
756
- */
757
682
  submitAutoRemixOffer(params, siwsToken) {
758
683
  return this.request("/v1/remix-offers/auto", {
759
684
  method: "POST",
@@ -761,9 +686,6 @@ var ApiClient = class {
761
686
  headers: { "Authorization": `Bearer ${siwsToken}` }
762
687
  });
763
688
  }
764
- /**
765
- * Record a self-remix (owner remixing their own token). Requires SIWS token.
766
- */
767
689
  confirmSelfRemix(params, siwsToken) {
768
690
  return this.request("/v1/remix-offers/self/confirm", {
769
691
  method: "POST",
@@ -771,11 +693,6 @@ var ApiClient = class {
771
693
  headers: { "Authorization": `Bearer ${siwsToken}` }
772
694
  });
773
695
  }
774
- /**
775
- * List remix offers by role. Requires SIWS token.
776
- * role="creator" — offers where you are the original creator.
777
- * role="requester" — offers you made.
778
- */
779
696
  getRemixOffers(query, siwsToken) {
780
697
  const params = new URLSearchParams({ role: query.role });
781
698
  if (query.page !== void 0) params.set("page", String(query.page));
@@ -785,18 +702,12 @@ var ApiClient = class {
785
702
  headers: this.bearer(siwsToken)
786
703
  });
787
704
  }
788
- /**
789
- * Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
790
- */
791
705
  getRemixOffer(id, siwsToken) {
792
706
  return this.request(`/v1/remix-offers/${id}`, {
793
707
  method: "GET",
794
708
  headers: siwsToken ? this.bearer(siwsToken) : void 0
795
709
  });
796
710
  }
797
- /**
798
- * Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
799
- */
800
711
  confirmRemixOffer(id, params, siwsToken) {
801
712
  return this.request(`/v1/remix-offers/${id}/confirm`, {
802
713
  method: "POST",
@@ -804,9 +715,6 @@ var ApiClient = class {
804
715
  headers: { "Authorization": `Bearer ${siwsToken}` }
805
716
  });
806
717
  }
807
- /**
808
- * Creator rejects a remix offer. Requires SIWS token.
809
- */
810
718
  rejectRemixOffer(id, siwsToken) {
811
719
  return this.request(`/v1/remix-offers/${id}/reject`, {
812
720
  method: "POST",
@@ -814,10 +722,6 @@ var ApiClient = class {
814
722
  headers: { "Authorization": `Bearer ${siwsToken}` }
815
723
  });
816
724
  }
817
- /**
818
- * Requester extends the expiry of a pending remix offer by 1–30 days.
819
- * Requires SIWS token.
820
- */
821
725
  extendRemixOffer(id, days, siwsToken) {
822
726
  return this.request(`/v1/remix-offers/${id}/extend`, {
823
727
  method: "POST",
@@ -825,7 +729,6 @@ var ApiClient = class {
825
729
  headers: { "Authorization": `Bearer ${siwsToken}` }
826
730
  });
827
731
  }
828
- // ─── POP Protocol ──────────────────────────────────────────────────────────
829
732
  getPopCollections(opts = {}) {
830
733
  return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "POP_PROTOCOL");
831
734
  }
@@ -842,9 +745,6 @@ var ApiClient = class {
842
745
  );
843
746
  return res.data;
844
747
  }
845
- // ─── Coins (fungible — ERC-20 etc.) ───────────────────────────────────────────
846
- // Coins are a separate model from Collections (spec 2026-06-14). Price/liquidity
847
- // is read live from Ekubo (CreatorCoinService.getPrice), never from these.
848
748
  getCoins(opts = {}) {
849
749
  const params = new URLSearchParams();
850
750
  if (opts.page) params.set("page", String(opts.page));
@@ -857,11 +757,6 @@ var ApiClient = class {
857
757
  getCoin(contract) {
858
758
  return this.get(`/v1/coins/${this.addr(contract)}`);
859
759
  }
860
- /**
861
- * Creator-authed coin profile edit (image/description). Backend authorizes
862
- * via `coin.creator` (trustless — from the factory event), not a body param;
863
- * `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
864
- */
865
760
  updateCoinProfile(contract, data, siwsToken) {
866
761
  return this.request(`/v1/coins/${this.addr(contract)}`, {
867
762
  method: "PATCH",
@@ -869,7 +764,6 @@ var ApiClient = class {
869
764
  headers: this.bearer(siwsToken)
870
765
  });
871
766
  }
872
- // ─── Collection Drop ────────────────────────────────────────────────────────
873
767
  getDropCollections(opts = {}) {
874
768
  return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
875
769
  }
@@ -879,29 +773,22 @@ var ApiClient = class {
879
773
  );
880
774
  return res.data;
881
775
  }
882
- // ─── Rewards (v0.49.0) ─────────────────────────────────────────────────────
883
- // Scores are recomputed on a schedule by the backend (~15 min) — reads only.
884
- /** Score + level + progress + badges for one address (zeroed for unknown). */
885
776
  async getRewards(address) {
886
777
  const res = await this.get(`/v1/rewards/${this.addr(address)}`);
887
778
  return res.data;
888
779
  }
889
- /** Paginated XP leaderboard. */
890
780
  getRewardsLeaderboard(page = 1, limit = 50) {
891
781
  return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
892
782
  }
893
- /** Point-event history for an address. */
894
783
  getRewardsEvents(address, page = 1, limit = 20) {
895
784
  return this.get(
896
785
  `/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
897
786
  );
898
787
  }
899
- /** Reward configuration: level ladder, enabled action XP values, badge catalog. */
900
788
  async getRewardsConfig() {
901
789
  const res = await this.get(`/v1/rewards/config`);
902
790
  return res.data;
903
791
  }
904
- /** Minimal level info for up to 50 addresses — one call per list page. */
905
792
  async getRewardsBatch(addresses) {
906
793
  if (addresses.length === 0) return [];
907
794
  const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
@@ -946,7 +833,6 @@ SN.creatorCoinStartBlock;
946
833
  SN.ekuboCore;
947
834
  var SUPPORTED_TOKENS = [
948
835
  {
949
- // Circle-native USDC on Starknet (canonical)
950
836
  symbol: "USDC",
951
837
  address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
952
838
  decimals: 6,
@@ -10295,24 +10181,12 @@ var ERC1155CollectionService = class {
10295
10181
  account
10296
10182
  );
10297
10183
  }
10298
- /**
10299
- * Deploy a new ERC-1155 IP collection.
10300
- * Caller becomes the collection owner and can mint items.
10301
- * Returns the transaction hash; the deployed collection address is emitted
10302
- * in the `CollectionDeployed` event of the factory.
10303
- */
10304
10184
  async deployCollection(account, params) {
10305
10185
  const factory = this._factory(account);
10306
10186
  const call = factory.populate("deploy_collection", [params.name, params.symbol, params.baseUri]);
10307
10187
  const res = await account.execute([call]);
10308
10188
  return { txHash: res.transaction_hash };
10309
10189
  }
10310
- /**
10311
- * Mint a new edition into an existing ERC-1155 collection.
10312
- * Caller must be the collection owner. The token id is assigned on-chain
10313
- * (sequential from 1) — read it from the `IPMinted` event of the returned tx.
10314
- * The `tokenUri` is immutable.
10315
- */
10316
10190
  async mintEdition(account, params) {
10317
10191
  const collection = this._collection(params.collection, account);
10318
10192
  const call = collection.populate("mint_edition", [
@@ -10323,11 +10197,6 @@ var ERC1155CollectionService = class {
10323
10197
  const res = await account.execute([call]);
10324
10198
  return { txHash: res.transaction_hash };
10325
10199
  }
10326
- /**
10327
- * Batch-mint multiple new editions into an existing ERC-1155 collection.
10328
- * All editions go to the same `to` address; ids are assigned sequentially
10329
- * on-chain. Caller must be the collection owner.
10330
- */
10331
10200
  async batchMintEdition(account, params) {
10332
10201
  const collection = this._collection(params.collection, account);
10333
10202
  const values = params.items.map((i) => BigInt(i.value));
@@ -10340,11 +10209,6 @@ var ERC1155CollectionService = class {
10340
10209
  const res = await account.execute([call]);
10341
10210
  return { txHash: res.transaction_hash };
10342
10211
  }
10343
- /**
10344
- * Mint additional copies of an EXISTING edition into an ERC-1155 collection.
10345
- * Reverts on-chain if `tokenId` has never been minted. Provenance/URI unchanged.
10346
- * Caller must be the collection owner.
10347
- */
10348
10212
  async addSupply(account, params) {
10349
10213
  const collection = this._collection(params.collection, account);
10350
10214
  const call = collection.populate("add_supply", [
@@ -10355,11 +10219,6 @@ var ERC1155CollectionService = class {
10355
10219
  const res = await account.execute([call]);
10356
10220
  return { txHash: res.transaction_hash };
10357
10221
  }
10358
- /**
10359
- * Set the default ERC-2981 royalty for the entire collection.
10360
- * `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
10361
- * Caller must be the collection owner.
10362
- */
10363
10222
  async setDefaultRoyalty(account, params) {
10364
10223
  const collection = this._collection(params.collection, account);
10365
10224
  const call = collection.populate("set_default_royalty", [
@@ -10369,10 +10228,6 @@ var ERC1155CollectionService = class {
10369
10228
  const res = await account.execute([call]);
10370
10229
  return { txHash: res.transaction_hash };
10371
10230
  }
10372
- /**
10373
- * Set a per-token ERC-2981 royalty override.
10374
- * `feeNumerator` is out of 10 000. Caller must be the collection owner.
10375
- */
10376
10231
  async setTokenRoyalty(account, params) {
10377
10232
  const collection = this._collection(params.collection, account);
10378
10233
  const call = collection.populate("set_token_royalty", [
@@ -10383,10 +10238,6 @@ var ERC1155CollectionService = class {
10383
10238
  const res = await account.execute([call]);
10384
10239
  return { txHash: res.transaction_hash };
10385
10240
  }
10386
- /**
10387
- * Approve the Medialane1155 marketplace (or any operator) to transfer
10388
- * all tokens on behalf of `account`. Required before listing.
10389
- */
10390
10241
  async setApprovalForAll(account, params) {
10391
10242
  const collection = this._collection(params.collection, account);
10392
10243
  const call = collection.populate("set_approval_for_all", [
@@ -10581,27 +10432,18 @@ var CreatorCoinService = class {
10581
10432
  _factory(account) {
10582
10433
  return newContract(CreatorCoinFactoryABI, this.factoryAddress, account);
10583
10434
  }
10584
- /** Deploy a fixed-supply CreatorCoin (full supply minted to the Factory). */
10585
10435
  async createCreatorCoin(account, params) {
10586
10436
  const res = await account.execute([buildCreateCreatorCoinCall(params)]);
10587
10437
  return { txHash: res.transaction_hash };
10588
10438
  }
10589
- /**
10590
- * Launch a coin on Ekubo (owner-only). Optionally pre-funds the Factory with
10591
- * quote (for the buyback) in the same multicall. Liquidity is permanently
10592
- * locked in the EkuboLauncher.
10593
- */
10594
10439
  async launchOnEkubo(account, params) {
10595
10440
  const res = await account.execute(buildLaunchOnEkuboCalls(params));
10596
10441
  return { txHash: res.transaction_hash };
10597
10442
  }
10598
- /** View: is this address a Factory-deployed Creator Coin? */
10599
10443
  async isCreatorCoin(address, account) {
10600
10444
  const r = await this._factory(account).is_creator_coin(address);
10601
10445
  return BigInt(r) === 1n;
10602
10446
  }
10603
- /** Read a coin's live Ekubo spot price (quote-per-coin) via the configured RPC.
10604
- * Read-only; returns null if the coin isn't launched on Ekubo. */
10605
10447
  async getPrice(coinAddress) {
10606
10448
  return getCreatorCoinPrice(coinAddress, new RpcProvider({ nodeUrl: this.config.rpcUrl }));
10607
10449
  }
@@ -10623,11 +10465,6 @@ var TicketService = class {
10623
10465
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10624
10466
  return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
10625
10467
  }
10626
- /**
10627
- * Deploys a new IPTicketCollection via the factory. Caller becomes owner.
10628
- * `baseUri` is the collection-level metadata URI, embedded on-chain in the
10629
- * deploy transaction.
10630
- */
10631
10468
  async deployCollection(account, params) {
10632
10469
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
10633
10470
  params.name,
@@ -10637,7 +10474,6 @@ var TicketService = class {
10637
10474
  const res = await account.execute([call]);
10638
10475
  return { txHash: res.transaction_hash };
10639
10476
  }
10640
- /** Owner-only. Creates a new ticket inside the caller's deployed collection. */
10641
10477
  async createTicket(account, params) {
10642
10478
  const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
10643
10479
  const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
@@ -10651,7 +10487,6 @@ var TicketService = class {
10651
10487
  const res = await account.execute([call]);
10652
10488
  return { txHash: res.transaction_hash };
10653
10489
  }
10654
- /** Owner-only. Mints `amount` of `tokenId` to `to`. */
10655
10490
  async mint(account, params) {
10656
10491
  const call = this._collection(params.collection, account).populate("mint", [
10657
10492
  params.to,
@@ -10661,7 +10496,6 @@ var TicketService = class {
10661
10496
  const res = await account.execute([call]);
10662
10497
  return { txHash: res.transaction_hash };
10663
10498
  }
10664
- /** Read — true if holder has balance > 0 and current time is within the ticket window. */
10665
10499
  async isValid(params) {
10666
10500
  const result = await this._collectionRead(params.collection).call("is_valid", [
10667
10501
  cairo.uint256(params.tokenId),
@@ -10669,12 +10503,10 @@ var TicketService = class {
10669
10503
  ]);
10670
10504
  return Boolean(result);
10671
10505
  }
10672
- /** Read — number of tickets created so far (ids are sequential from 1). */
10673
10506
  async getTicketCount(params) {
10674
10507
  const result = await this._collectionRead(params.collection).call("ticket_count", []);
10675
10508
  return BigInt(result);
10676
10509
  }
10677
- /** Read — returns the Ticket record for a token ID. */
10678
10510
  async getTicket(params) {
10679
10511
  const t = await this._collectionRead(params.collection).call("get_ticket", [
10680
10512
  cairo.uint256(params.tokenId)
@@ -10706,11 +10538,6 @@ var ClubService = class {
10706
10538
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10707
10539
  return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
10708
10540
  }
10709
- /**
10710
- * Deploys a new IPClubCollection via the factory. Caller becomes owner.
10711
- * `baseUri` is the collection-level metadata URI, embedded on-chain in the
10712
- * deploy transaction.
10713
- */
10714
10541
  async deployCollection(account, params) {
10715
10542
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
10716
10543
  params.name,
@@ -10720,7 +10547,6 @@ var ClubService = class {
10720
10547
  const res = await account.execute([call]);
10721
10548
  return { txHash: res.transaction_hash };
10722
10549
  }
10723
- /** Owner-only. Creates a new membership tier inside the caller's deployed collection. */
10724
10550
  async createMembership(account, params) {
10725
10551
  const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
10726
10552
  const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
@@ -10734,10 +10560,6 @@ var ClubService = class {
10734
10560
  const res = await account.execute([call]);
10735
10561
  return { txHash: res.transaction_hash };
10736
10562
  }
10737
- /**
10738
- * Owner-only. Mints `amount` of `tokenId` to `to`. The validity window
10739
- * gates membership, never minting — future-window tiers mint fine.
10740
- */
10741
10563
  async mint(account, params) {
10742
10564
  const call = this._collection(params.collection, account).populate("mint", [
10743
10565
  params.to,
@@ -10747,14 +10569,12 @@ var ClubService = class {
10747
10569
  const res = await account.execute([call]);
10748
10570
  return { txHash: res.transaction_hash };
10749
10571
  }
10750
- /** Read — true if holder holds any tier currently inside its validity window. */
10751
10572
  async isMember(params) {
10752
10573
  const result = await this._collectionRead(params.collection).call("is_member", [
10753
10574
  params.holder
10754
10575
  ]);
10755
10576
  return Boolean(result);
10756
10577
  }
10757
- /** Read — true if holder holds `tokenId` and the current time is inside its window. */
10758
10578
  async isMemberOf(params) {
10759
10579
  const result = await this._collectionRead(params.collection).call("is_member_of", [
10760
10580
  cairo.uint256(params.tokenId),
@@ -10762,7 +10582,6 @@ var ClubService = class {
10762
10582
  ]);
10763
10583
  return Boolean(result);
10764
10584
  }
10765
- /** Read — returns the Membership record for a token ID. */
10766
10585
  async getMembership(params) {
10767
10586
  const m = await this._collectionRead(params.collection).call("get_membership", [
10768
10587
  cairo.uint256(params.tokenId)
@@ -10797,8 +10616,6 @@ var SponsorshipService = class {
10797
10616
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10798
10617
  return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
10799
10618
  }
10800
- // ── Offers (owner-initiated) ───────────────────────────────────────────────
10801
- /** The offer author must currently own (nftContract, tokenId) — enforced on-chain at create and accept. */
10802
10619
  async createOffer(account, params) {
10803
10620
  const specificSponsor = params.specificSponsor ? new CairoOption(CairoOptionVariant.Some, params.specificSponsor) : new CairoOption(CairoOptionVariant.None);
10804
10621
  const call = this._contract(account, params.sponsorshipAddress).populate("create_offer", [
@@ -10815,7 +10632,6 @@ var SponsorshipService = class {
10815
10632
  const res = await account.execute([call]);
10816
10633
  return { txHash: res.transaction_hash };
10817
10634
  }
10818
- /** Reversible — gates new bids/acceptance only. */
10819
10635
  async setOfferOpen(account, params) {
10820
10636
  const call = this._contract(account, params.sponsorshipAddress).populate("set_offer_open", [
10821
10637
  cairo.uint256(params.offerId),
@@ -10824,7 +10640,6 @@ var SponsorshipService = class {
10824
10640
  const res = await account.execute([call]);
10825
10641
  return { txHash: res.transaction_hash };
10826
10642
  }
10827
- /** A bid is a signal plus an open ERC-20 allowance — no tokens move until accepted. Prepends the approve. */
10828
10643
  async placeBid(account, params) {
10829
10644
  const sponsorshipAddress = params.sponsorshipAddress ?? this.sponsorshipAddress;
10830
10645
  if (!sponsorshipAddress) {
@@ -10850,11 +10665,6 @@ var SponsorshipService = class {
10850
10665
  const res = await account.execute([call]);
10851
10666
  return { txHash: res.transaction_hash };
10852
10667
  }
10853
- /**
10854
- * Author-only. Re-verifies IP ownership, settles the sponsor's payment
10855
- * (allowance pull, no escrow), and mints the license — a real ERC-721 on
10856
- * this same contract — to the sponsor, all atomically in one call.
10857
- */
10858
10668
  async acceptBid(account, params) {
10859
10669
  const call = this._contract(account, params.sponsorshipAddress).populate("accept_bid", [
10860
10670
  cairo.uint256(params.offerId),
@@ -10863,12 +10673,6 @@ var SponsorshipService = class {
10863
10673
  const res = await account.execute([call]);
10864
10674
  return { txHash: res.transaction_hash };
10865
10675
  }
10866
- // ── Proposals (sponsor-initiated) ──────────────────────────────────────────
10867
- // The symmetric counterpart to offers/bids: a sponsor proposes fixed terms
10868
- // on an asset with no open offer yet; only the asset's current owner may
10869
- // accept or reject. Unlike an offer, the SPONSOR chooses `paymentToken` here
10870
- // — an accepting owner's UI should surface only recognized tokens, since a
10871
- // bad-faith ERC-20 could return `true` on `transfer_from` without moving funds.
10872
10676
  async proposeSponsorship(account, params) {
10873
10677
  const call = this._contract(account, params.sponsorshipAddress).populate("propose_sponsorship", [
10874
10678
  params.nftContract,
@@ -10884,7 +10688,6 @@ var SponsorshipService = class {
10884
10688
  const res = await account.execute([call]);
10885
10689
  return { txHash: res.transaction_hash };
10886
10690
  }
10887
- /** Proposer-only. Advisory against an acceptance in flight in the same block. */
10888
10691
  async withdrawProposal(account, params) {
10889
10692
  const call = this._contract(account, params.sponsorshipAddress).populate("withdraw_proposal", [
10890
10693
  cairo.uint256(params.proposalId)
@@ -10892,12 +10695,6 @@ var SponsorshipService = class {
10892
10695
  const res = await account.execute([call]);
10893
10696
  return { txHash: res.transaction_hash };
10894
10697
  }
10895
- /**
10896
- * Asset-owner-only (re-verified on-chain — a proposal binds to the asset,
10897
- * not a person: whoever owns it at acceptance time is paid and issues the
10898
- * license). Settles payment and mints the license atomically, same as
10899
- * `acceptBid`.
10900
- */
10901
10698
  async acceptProposal(account, params) {
10902
10699
  const call = this._contract(account, params.sponsorshipAddress).populate("accept_proposal", [
10903
10700
  cairo.uint256(params.proposalId)
@@ -10905,7 +10702,6 @@ var SponsorshipService = class {
10905
10702
  const res = await account.execute([call]);
10906
10703
  return { txHash: res.transaction_hash };
10907
10704
  }
10908
- /** Asset-owner-only. */
10909
10705
  async rejectProposal(account, params) {
10910
10706
  const call = this._contract(account, params.sponsorshipAddress).populate("reject_proposal", [
10911
10707
  cairo.uint256(params.proposalId)
@@ -10913,7 +10709,6 @@ var SponsorshipService = class {
10913
10709
  const res = await account.execute([call]);
10914
10710
  return { txHash: res.transaction_hash };
10915
10711
  }
10916
- // ── Reads ───────────────────────────────────────────────────────────────────
10917
10712
  async getOffer(params) {
10918
10713
  const o = await this._contractRead(params.sponsorshipAddress).call("get_offer", [
10919
10714
  cairo.uint256(params.offerId)
@@ -10969,7 +10764,6 @@ var SponsorshipService = class {
10969
10764
  const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_license_id", []);
10970
10765
  return BigInt(result);
10971
10766
  }
10972
- /** EIP-2981 — royalty recipient (the license's issuing author) and amount owed on a resale at `salePrice`. */
10973
10767
  async royaltyInfo(params) {
10974
10768
  const [recipient, amount] = await this._contractRead(params.sponsorshipAddress).call("royalty_info", [
10975
10769
  cairo.uint256(params.licenseId),
@@ -11449,7 +11243,6 @@ var StarknetVenue = class {
11449
11243
  const orderRef = await this.orderRefFromReceipt(txHash);
11450
11244
  return { txHash, orderRef };
11451
11245
  }
11452
- // ─── reads (all on deps.provider) ─────────────────────────────────────────
11453
11246
  async readCounter(marketplace, address) {
11454
11247
  const res = await this.deps.provider.callContract({
11455
11248
  contractAddress: marketplace,
@@ -11458,7 +11251,6 @@ var StarknetVenue = class {
11458
11251
  });
11459
11252
  return BigInt(res[0] ?? "0");
11460
11253
  }
11461
- /** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
11462
11254
  async approval721ForListing(_owner, nftContract, tokenId) {
11463
11255
  const id = cairo.uint256(tokenId);
11464
11256
  const approve = {
@@ -11478,7 +11270,6 @@ var StarknetVenue = class {
11478
11270
  }
11479
11271
  return { approvalNeeded: !approved, approve };
11480
11272
  }
11481
- /** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
11482
11273
  async approval1155ForListing(owner, nftContract) {
11483
11274
  const approve = {
11484
11275
  contractAddress: nftContract,
@@ -11497,7 +11288,6 @@ var StarknetVenue = class {
11497
11288
  }
11498
11289
  return { approvalNeeded: !approved, approve };
11499
11290
  }
11500
- /** Offers always approve the ERC-20 spend (no read). */
11501
11291
  approvalForErc20(token, amountWei, marketplace) {
11502
11292
  const u = cairo.uint256(amountWei);
11503
11293
  return {
@@ -11509,8 +11299,6 @@ var StarknetVenue = class {
11509
11299
  }
11510
11300
  };
11511
11301
  }
11512
- /** The canonical Starknet order id = the contract-emitted `OrderCreated`
11513
- * hash (`keys[1]`), which is exactly what the indexer stores. */
11514
11302
  async orderRefFromReceipt(txHash) {
11515
11303
  const receipt = await this.deps.provider.getTransactionReceipt(txHash);
11516
11304
  const selector = hash.getSelectorFromName("OrderCreated");