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