@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.
@@ -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,6 @@ 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
- */
735
659
  getTokenRemixes(contract, tokenId, opts = {}) {
736
660
  const params = new URLSearchParams();
737
661
  if (opts.page !== void 0) params.set("page", String(opts.page));
@@ -741,9 +665,6 @@ var ApiClient = class {
741
665
  `/v1/tokens/${this.addr(contract)}/${tokenId}/remixes${qs ? `?${qs}` : ""}`
742
666
  );
743
667
  }
744
- /**
745
- * Submit a custom remix offer for a token. Requires SIWS token.
746
- */
747
668
  submitRemixOffer(params, siwsToken) {
748
669
  return this.request("/v1/remix-offers", {
749
670
  method: "POST",
@@ -751,9 +672,6 @@ var ApiClient = class {
751
672
  headers: { "Authorization": `Bearer ${siwsToken}` }
752
673
  });
753
674
  }
754
- /**
755
- * Submit an auto remix offer for a token with an open license. Requires SIWS token.
756
- */
757
675
  submitAutoRemixOffer(params, siwsToken) {
758
676
  return this.request("/v1/remix-offers/auto", {
759
677
  method: "POST",
@@ -761,9 +679,6 @@ var ApiClient = class {
761
679
  headers: { "Authorization": `Bearer ${siwsToken}` }
762
680
  });
763
681
  }
764
- /**
765
- * Record a self-remix (owner remixing their own token). Requires SIWS token.
766
- */
767
682
  confirmSelfRemix(params, siwsToken) {
768
683
  return this.request("/v1/remix-offers/self/confirm", {
769
684
  method: "POST",
@@ -771,11 +686,6 @@ var ApiClient = class {
771
686
  headers: { "Authorization": `Bearer ${siwsToken}` }
772
687
  });
773
688
  }
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
689
  getRemixOffers(query, siwsToken) {
780
690
  const params = new URLSearchParams({ role: query.role });
781
691
  if (query.page !== void 0) params.set("page", String(query.page));
@@ -785,18 +695,12 @@ var ApiClient = class {
785
695
  headers: this.bearer(siwsToken)
786
696
  });
787
697
  }
788
- /**
789
- * Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
790
- */
791
698
  getRemixOffer(id, siwsToken) {
792
699
  return this.request(`/v1/remix-offers/${id}`, {
793
700
  method: "GET",
794
701
  headers: siwsToken ? this.bearer(siwsToken) : void 0
795
702
  });
796
703
  }
797
- /**
798
- * Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
799
- */
800
704
  confirmRemixOffer(id, params, siwsToken) {
801
705
  return this.request(`/v1/remix-offers/${id}/confirm`, {
802
706
  method: "POST",
@@ -804,9 +708,6 @@ var ApiClient = class {
804
708
  headers: { "Authorization": `Bearer ${siwsToken}` }
805
709
  });
806
710
  }
807
- /**
808
- * Creator rejects a remix offer. Requires SIWS token.
809
- */
810
711
  rejectRemixOffer(id, siwsToken) {
811
712
  return this.request(`/v1/remix-offers/${id}/reject`, {
812
713
  method: "POST",
@@ -814,10 +715,6 @@ var ApiClient = class {
814
715
  headers: { "Authorization": `Bearer ${siwsToken}` }
815
716
  });
816
717
  }
817
- /**
818
- * Requester extends the expiry of a pending remix offer by 1–30 days.
819
- * Requires SIWS token.
820
- */
821
718
  extendRemixOffer(id, days, siwsToken) {
822
719
  return this.request(`/v1/remix-offers/${id}/extend`, {
823
720
  method: "POST",
@@ -825,7 +722,6 @@ var ApiClient = class {
825
722
  headers: { "Authorization": `Bearer ${siwsToken}` }
826
723
  });
827
724
  }
828
- // ─── POP Protocol ──────────────────────────────────────────────────────────
829
725
  getPopCollections(opts = {}) {
830
726
  return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "POP_PROTOCOL");
831
727
  }
@@ -842,9 +738,6 @@ var ApiClient = class {
842
738
  );
843
739
  return res.data;
844
740
  }
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
741
  getCoins(opts = {}) {
849
742
  const params = new URLSearchParams();
850
743
  if (opts.page) params.set("page", String(opts.page));
@@ -857,11 +750,6 @@ var ApiClient = class {
857
750
  getCoin(contract) {
858
751
  return this.get(`/v1/coins/${this.addr(contract)}`);
859
752
  }
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
753
  updateCoinProfile(contract, data, siwsToken) {
866
754
  return this.request(`/v1/coins/${this.addr(contract)}`, {
867
755
  method: "PATCH",
@@ -869,7 +757,6 @@ var ApiClient = class {
869
757
  headers: this.bearer(siwsToken)
870
758
  });
871
759
  }
872
- // ─── Collection Drop ────────────────────────────────────────────────────────
873
760
  getDropCollections(opts = {}) {
874
761
  return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
875
762
  }
@@ -879,29 +766,22 @@ var ApiClient = class {
879
766
  );
880
767
  return res.data;
881
768
  }
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
769
  async getRewards(address) {
886
770
  const res = await this.get(`/v1/rewards/${this.addr(address)}`);
887
771
  return res.data;
888
772
  }
889
- /** Paginated XP leaderboard. */
890
773
  getRewardsLeaderboard(page = 1, limit = 50) {
891
774
  return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
892
775
  }
893
- /** Point-event history for an address. */
894
776
  getRewardsEvents(address, page = 1, limit = 20) {
895
777
  return this.get(
896
778
  `/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
897
779
  );
898
780
  }
899
- /** Reward configuration: level ladder, enabled action XP values, badge catalog. */
900
781
  async getRewardsConfig() {
901
782
  const res = await this.get(`/v1/rewards/config`);
902
783
  return res.data;
903
784
  }
904
- /** Minimal level info for up to 50 addresses — one call per list page. */
905
785
  async getRewardsBatch(addresses) {
906
786
  if (addresses.length === 0) return [];
907
787
  const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
@@ -946,7 +826,6 @@ SN.creatorCoinStartBlock;
946
826
  SN.ekuboCore;
947
827
  var SUPPORTED_TOKENS = [
948
828
  {
949
- // Circle-native USDC on Starknet (canonical)
950
829
  symbol: "USDC",
951
830
  address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
952
831
  decimals: 6,
@@ -10295,24 +10174,12 @@ var ERC1155CollectionService = class {
10295
10174
  account
10296
10175
  );
10297
10176
  }
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
10177
  async deployCollection(account, params) {
10305
10178
  const factory = this._factory(account);
10306
10179
  const call = factory.populate("deploy_collection", [params.name, params.symbol, params.baseUri]);
10307
10180
  const res = await account.execute([call]);
10308
10181
  return { txHash: res.transaction_hash };
10309
10182
  }
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
10183
  async mintEdition(account, params) {
10317
10184
  const collection = this._collection(params.collection, account);
10318
10185
  const call = collection.populate("mint_edition", [
@@ -10323,11 +10190,6 @@ var ERC1155CollectionService = class {
10323
10190
  const res = await account.execute([call]);
10324
10191
  return { txHash: res.transaction_hash };
10325
10192
  }
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
10193
  async batchMintEdition(account, params) {
10332
10194
  const collection = this._collection(params.collection, account);
10333
10195
  const values = params.items.map((i) => BigInt(i.value));
@@ -10340,11 +10202,6 @@ var ERC1155CollectionService = class {
10340
10202
  const res = await account.execute([call]);
10341
10203
  return { txHash: res.transaction_hash };
10342
10204
  }
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
10205
  async addSupply(account, params) {
10349
10206
  const collection = this._collection(params.collection, account);
10350
10207
  const call = collection.populate("add_supply", [
@@ -10355,11 +10212,6 @@ var ERC1155CollectionService = class {
10355
10212
  const res = await account.execute([call]);
10356
10213
  return { txHash: res.transaction_hash };
10357
10214
  }
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
10215
  async setDefaultRoyalty(account, params) {
10364
10216
  const collection = this._collection(params.collection, account);
10365
10217
  const call = collection.populate("set_default_royalty", [
@@ -10369,10 +10221,6 @@ var ERC1155CollectionService = class {
10369
10221
  const res = await account.execute([call]);
10370
10222
  return { txHash: res.transaction_hash };
10371
10223
  }
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
10224
  async setTokenRoyalty(account, params) {
10377
10225
  const collection = this._collection(params.collection, account);
10378
10226
  const call = collection.populate("set_token_royalty", [
@@ -10383,10 +10231,6 @@ var ERC1155CollectionService = class {
10383
10231
  const res = await account.execute([call]);
10384
10232
  return { txHash: res.transaction_hash };
10385
10233
  }
10386
- /**
10387
- * Approve the Medialane1155 marketplace (or any operator) to transfer
10388
- * all tokens on behalf of `account`. Required before listing.
10389
- */
10390
10234
  async setApprovalForAll(account, params) {
10391
10235
  const collection = this._collection(params.collection, account);
10392
10236
  const call = collection.populate("set_approval_for_all", [
@@ -10581,27 +10425,18 @@ var CreatorCoinService = class {
10581
10425
  _factory(account) {
10582
10426
  return newContract(CreatorCoinFactoryABI, this.factoryAddress, account);
10583
10427
  }
10584
- /** Deploy a fixed-supply CreatorCoin (full supply minted to the Factory). */
10585
10428
  async createCreatorCoin(account, params) {
10586
10429
  const res = await account.execute([buildCreateCreatorCoinCall(params)]);
10587
10430
  return { txHash: res.transaction_hash };
10588
10431
  }
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
10432
  async launchOnEkubo(account, params) {
10595
10433
  const res = await account.execute(buildLaunchOnEkuboCalls(params));
10596
10434
  return { txHash: res.transaction_hash };
10597
10435
  }
10598
- /** View: is this address a Factory-deployed Creator Coin? */
10599
10436
  async isCreatorCoin(address, account) {
10600
10437
  const r = await this._factory(account).is_creator_coin(address);
10601
10438
  return BigInt(r) === 1n;
10602
10439
  }
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
10440
  async getPrice(coinAddress) {
10606
10441
  return getCreatorCoinPrice(coinAddress, new RpcProvider({ nodeUrl: this.config.rpcUrl }));
10607
10442
  }
@@ -10623,11 +10458,6 @@ var TicketService = class {
10623
10458
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10624
10459
  return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
10625
10460
  }
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
10461
  async deployCollection(account, params) {
10632
10462
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
10633
10463
  params.name,
@@ -10637,7 +10467,6 @@ var TicketService = class {
10637
10467
  const res = await account.execute([call]);
10638
10468
  return { txHash: res.transaction_hash };
10639
10469
  }
10640
- /** Owner-only. Creates a new ticket inside the caller's deployed collection. */
10641
10470
  async createTicket(account, params) {
10642
10471
  const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
10643
10472
  const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
@@ -10651,7 +10480,6 @@ var TicketService = class {
10651
10480
  const res = await account.execute([call]);
10652
10481
  return { txHash: res.transaction_hash };
10653
10482
  }
10654
- /** Owner-only. Mints `amount` of `tokenId` to `to`. */
10655
10483
  async mint(account, params) {
10656
10484
  const call = this._collection(params.collection, account).populate("mint", [
10657
10485
  params.to,
@@ -10661,7 +10489,6 @@ var TicketService = class {
10661
10489
  const res = await account.execute([call]);
10662
10490
  return { txHash: res.transaction_hash };
10663
10491
  }
10664
- /** Read — true if holder has balance > 0 and current time is within the ticket window. */
10665
10492
  async isValid(params) {
10666
10493
  const result = await this._collectionRead(params.collection).call("is_valid", [
10667
10494
  cairo.uint256(params.tokenId),
@@ -10669,12 +10496,10 @@ var TicketService = class {
10669
10496
  ]);
10670
10497
  return Boolean(result);
10671
10498
  }
10672
- /** Read — number of tickets created so far (ids are sequential from 1). */
10673
10499
  async getTicketCount(params) {
10674
10500
  const result = await this._collectionRead(params.collection).call("ticket_count", []);
10675
10501
  return BigInt(result);
10676
10502
  }
10677
- /** Read — returns the Ticket record for a token ID. */
10678
10503
  async getTicket(params) {
10679
10504
  const t = await this._collectionRead(params.collection).call("get_ticket", [
10680
10505
  cairo.uint256(params.tokenId)
@@ -10706,11 +10531,6 @@ var ClubService = class {
10706
10531
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10707
10532
  return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
10708
10533
  }
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
10534
  async deployCollection(account, params) {
10715
10535
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
10716
10536
  params.name,
@@ -10720,7 +10540,6 @@ var ClubService = class {
10720
10540
  const res = await account.execute([call]);
10721
10541
  return { txHash: res.transaction_hash };
10722
10542
  }
10723
- /** Owner-only. Creates a new membership tier inside the caller's deployed collection. */
10724
10543
  async createMembership(account, params) {
10725
10544
  const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
10726
10545
  const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
@@ -10734,10 +10553,6 @@ var ClubService = class {
10734
10553
  const res = await account.execute([call]);
10735
10554
  return { txHash: res.transaction_hash };
10736
10555
  }
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
10556
  async mint(account, params) {
10742
10557
  const call = this._collection(params.collection, account).populate("mint", [
10743
10558
  params.to,
@@ -10747,14 +10562,12 @@ var ClubService = class {
10747
10562
  const res = await account.execute([call]);
10748
10563
  return { txHash: res.transaction_hash };
10749
10564
  }
10750
- /** Read — true if holder holds any tier currently inside its validity window. */
10751
10565
  async isMember(params) {
10752
10566
  const result = await this._collectionRead(params.collection).call("is_member", [
10753
10567
  params.holder
10754
10568
  ]);
10755
10569
  return Boolean(result);
10756
10570
  }
10757
- /** Read — true if holder holds `tokenId` and the current time is inside its window. */
10758
10571
  async isMemberOf(params) {
10759
10572
  const result = await this._collectionRead(params.collection).call("is_member_of", [
10760
10573
  cairo.uint256(params.tokenId),
@@ -10762,7 +10575,6 @@ var ClubService = class {
10762
10575
  ]);
10763
10576
  return Boolean(result);
10764
10577
  }
10765
- /** Read — returns the Membership record for a token ID. */
10766
10578
  async getMembership(params) {
10767
10579
  const m = await this._collectionRead(params.collection).call("get_membership", [
10768
10580
  cairo.uint256(params.tokenId)
@@ -10797,8 +10609,6 @@ var SponsorshipService = class {
10797
10609
  const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
10798
10610
  return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
10799
10611
  }
10800
- // ── Offers (owner-initiated) ───────────────────────────────────────────────
10801
- /** The offer author must currently own (nftContract, tokenId) — enforced on-chain at create and accept. */
10802
10612
  async createOffer(account, params) {
10803
10613
  const specificSponsor = params.specificSponsor ? new CairoOption(CairoOptionVariant.Some, params.specificSponsor) : new CairoOption(CairoOptionVariant.None);
10804
10614
  const call = this._contract(account, params.sponsorshipAddress).populate("create_offer", [
@@ -10815,7 +10625,6 @@ var SponsorshipService = class {
10815
10625
  const res = await account.execute([call]);
10816
10626
  return { txHash: res.transaction_hash };
10817
10627
  }
10818
- /** Reversible — gates new bids/acceptance only. */
10819
10628
  async setOfferOpen(account, params) {
10820
10629
  const call = this._contract(account, params.sponsorshipAddress).populate("set_offer_open", [
10821
10630
  cairo.uint256(params.offerId),
@@ -10824,7 +10633,6 @@ var SponsorshipService = class {
10824
10633
  const res = await account.execute([call]);
10825
10634
  return { txHash: res.transaction_hash };
10826
10635
  }
10827
- /** A bid is a signal plus an open ERC-20 allowance — no tokens move until accepted. Prepends the approve. */
10828
10636
  async placeBid(account, params) {
10829
10637
  const sponsorshipAddress = params.sponsorshipAddress ?? this.sponsorshipAddress;
10830
10638
  if (!sponsorshipAddress) {
@@ -10850,11 +10658,6 @@ var SponsorshipService = class {
10850
10658
  const res = await account.execute([call]);
10851
10659
  return { txHash: res.transaction_hash };
10852
10660
  }
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
10661
  async acceptBid(account, params) {
10859
10662
  const call = this._contract(account, params.sponsorshipAddress).populate("accept_bid", [
10860
10663
  cairo.uint256(params.offerId),
@@ -10863,12 +10666,6 @@ var SponsorshipService = class {
10863
10666
  const res = await account.execute([call]);
10864
10667
  return { txHash: res.transaction_hash };
10865
10668
  }
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
10669
  async proposeSponsorship(account, params) {
10873
10670
  const call = this._contract(account, params.sponsorshipAddress).populate("propose_sponsorship", [
10874
10671
  params.nftContract,
@@ -10884,7 +10681,6 @@ var SponsorshipService = class {
10884
10681
  const res = await account.execute([call]);
10885
10682
  return { txHash: res.transaction_hash };
10886
10683
  }
10887
- /** Proposer-only. Advisory against an acceptance in flight in the same block. */
10888
10684
  async withdrawProposal(account, params) {
10889
10685
  const call = this._contract(account, params.sponsorshipAddress).populate("withdraw_proposal", [
10890
10686
  cairo.uint256(params.proposalId)
@@ -10892,12 +10688,6 @@ var SponsorshipService = class {
10892
10688
  const res = await account.execute([call]);
10893
10689
  return { txHash: res.transaction_hash };
10894
10690
  }
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
10691
  async acceptProposal(account, params) {
10902
10692
  const call = this._contract(account, params.sponsorshipAddress).populate("accept_proposal", [
10903
10693
  cairo.uint256(params.proposalId)
@@ -10905,7 +10695,6 @@ var SponsorshipService = class {
10905
10695
  const res = await account.execute([call]);
10906
10696
  return { txHash: res.transaction_hash };
10907
10697
  }
10908
- /** Asset-owner-only. */
10909
10698
  async rejectProposal(account, params) {
10910
10699
  const call = this._contract(account, params.sponsorshipAddress).populate("reject_proposal", [
10911
10700
  cairo.uint256(params.proposalId)
@@ -10913,7 +10702,6 @@ var SponsorshipService = class {
10913
10702
  const res = await account.execute([call]);
10914
10703
  return { txHash: res.transaction_hash };
10915
10704
  }
10916
- // ── Reads ───────────────────────────────────────────────────────────────────
10917
10705
  async getOffer(params) {
10918
10706
  const o = await this._contractRead(params.sponsorshipAddress).call("get_offer", [
10919
10707
  cairo.uint256(params.offerId)
@@ -10969,7 +10757,6 @@ var SponsorshipService = class {
10969
10757
  const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_license_id", []);
10970
10758
  return BigInt(result);
10971
10759
  }
10972
- /** EIP-2981 — royalty recipient (the license's issuing author) and amount owed on a resale at `salePrice`. */
10973
10760
  async royaltyInfo(params) {
10974
10761
  const [recipient, amount] = await this._contractRead(params.sponsorshipAddress).call("royalty_info", [
10975
10762
  cairo.uint256(params.licenseId),
@@ -11449,7 +11236,6 @@ var StarknetVenue = class {
11449
11236
  const orderRef = await this.orderRefFromReceipt(txHash);
11450
11237
  return { txHash, orderRef };
11451
11238
  }
11452
- // ─── reads (all on deps.provider) ─────────────────────────────────────────
11453
11239
  async readCounter(marketplace, address) {
11454
11240
  const res = await this.deps.provider.callContract({
11455
11241
  contractAddress: marketplace,
@@ -11458,7 +11244,6 @@ var StarknetVenue = class {
11458
11244
  });
11459
11245
  return BigInt(res[0] ?? "0");
11460
11246
  }
11461
- /** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
11462
11247
  async approval721ForListing(_owner, nftContract, tokenId) {
11463
11248
  const id = cairo.uint256(tokenId);
11464
11249
  const approve = {
@@ -11478,7 +11263,6 @@ var StarknetVenue = class {
11478
11263
  }
11479
11264
  return { approvalNeeded: !approved, approve };
11480
11265
  }
11481
- /** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
11482
11266
  async approval1155ForListing(owner, nftContract) {
11483
11267
  const approve = {
11484
11268
  contractAddress: nftContract,
@@ -11497,7 +11281,6 @@ var StarknetVenue = class {
11497
11281
  }
11498
11282
  return { approvalNeeded: !approved, approve };
11499
11283
  }
11500
- /** Offers always approve the ERC-20 spend (no read). */
11501
11284
  approvalForErc20(token, amountWei, marketplace) {
11502
11285
  const u = cairo.uint256(amountWei);
11503
11286
  return {
@@ -11509,8 +11292,6 @@ var StarknetVenue = class {
11509
11292
  }
11510
11293
  };
11511
11294
  }
11512
- /** The canonical Starknet order id = the contract-emitted `OrderCreated`
11513
- * hash (`keys[1]`), which is exactly what the indexer stores. */
11514
11295
  async orderRefFromReceipt(txHash) {
11515
11296
  const receipt = await this.deps.provider.getTransactionReceipt(txHash);
11516
11297
  const selector = hash.getSelectorFromName("OrderCreated");