@medialane/sdk 0.85.4 → 0.85.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/evm/index.cjs +0 -7
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +1 -23
- package/dist/evm/index.d.ts +1 -23
- package/dist/evm/index.js +0 -7
- package/dist/evm/index.js.map +1 -1
- package/dist/index.cjs +2 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -146
- package/dist/index.d.ts +4 -146
- package/dist/index.js +2 -140
- package/dist/index.js.map +1 -1
- package/dist/{services-CovenF1m.d.ts → services-CQKFABiG.d.cts} +4 -327
- package/dist/{services-D8saJqJw.d.cts → services-okgZ2AMD.d.ts} +4 -327
- package/dist/solana/index.cjs +0 -5
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +1 -14
- package/dist/solana/index.d.ts +1 -14
- package/dist/solana/index.js +0 -5
- package/dist/solana/index.js.map +1 -1
- package/dist/starknet/index.cjs +2 -220
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -334
- package/dist/starknet/index.d.ts +2 -334
- package/dist/starknet/index.js +2 -220
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.cjs +0 -5
- package/dist/stellar/index.cjs.map +1 -1
- package/dist/stellar/index.d.cts +1 -9
- package/dist/stellar/index.d.ts +1 -9
- package/dist/stellar/index.js +0 -5
- package/dist/stellar/index.js.map +1 -1
- package/dist/{types-sIc3OCpo.d.cts → types-nPIXtCF5.d.cts} +0 -45
- package/dist/{types-sIc3OCpo.d.ts → types-nPIXtCF5.d.ts} +0 -45
- package/package.json +1 -1
package/dist/starknet/index.js
CHANGED
|
@@ -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,13 +350,13 @@ var ApiClient = class {
|
|
|
369
350
|
`/v1/tokens/${contract}/${tokenId}/history?page=${page}&limit=${limit}`
|
|
370
351
|
);
|
|
371
352
|
}
|
|
372
|
-
|
|
373
|
-
getCollections(page = 1, limit = 20, isKnown, sort, service, chain) {
|
|
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));
|
|
376
356
|
if (sort) params.set("sort", sort);
|
|
377
357
|
if (service) params.set("service", service);
|
|
378
358
|
if (chain) params.set("chain", chain);
|
|
359
|
+
if (standard) params.set("standard", standard);
|
|
379
360
|
return this.get(`/v1/collections?${params}`);
|
|
380
361
|
}
|
|
381
362
|
getCollectionsByOwner(owner, page = 1, limit = 50) {
|
|
@@ -390,7 +371,6 @@ var ApiClient = class {
|
|
|
390
371
|
`/v1/collections/${this.addr(contract)}/tokens?page=${page}&limit=${limit}&sort=${sort}`
|
|
391
372
|
);
|
|
392
373
|
}
|
|
393
|
-
// ─── Activities ────────────────────────────────────────────────────────────
|
|
394
374
|
getActivities(query = {}) {
|
|
395
375
|
const params = new URLSearchParams();
|
|
396
376
|
if (query.type) params.set("type", query.type);
|
|
@@ -406,7 +386,6 @@ var ApiClient = class {
|
|
|
406
386
|
`/v1/activities/${this.addr(address)}?page=${page}&limit=${limit}`
|
|
407
387
|
);
|
|
408
388
|
}
|
|
409
|
-
// ─── Comments ──────────────────────────────────────────────────────────────
|
|
410
389
|
getTokenComments(contract, tokenId, opts = {}) {
|
|
411
390
|
const params = new URLSearchParams();
|
|
412
391
|
if (opts.page !== void 0) params.set("page", String(opts.page));
|
|
@@ -416,7 +395,6 @@ var ApiClient = class {
|
|
|
416
395
|
`/v1/tokens/${this.addr(contract)}/${tokenId}/comments${qs ? `?${qs}` : ""}`
|
|
417
396
|
);
|
|
418
397
|
}
|
|
419
|
-
// ─── Search ────────────────────────────────────────────────────────────────
|
|
420
398
|
search(q, limit = 10, chain) {
|
|
421
399
|
const params = new URLSearchParams({ q, limit: String(limit) });
|
|
422
400
|
if (chain) params.set("chain", chain);
|
|
@@ -424,7 +402,6 @@ var ApiClient = class {
|
|
|
424
402
|
`/v1/search?${params.toString()}`
|
|
425
403
|
);
|
|
426
404
|
}
|
|
427
|
-
// ─── Intents ───────────────────────────────────────────────────────────────
|
|
428
405
|
createListingIntent(params) {
|
|
429
406
|
return this.post("/v1/intents/listing", params);
|
|
430
407
|
}
|
|
@@ -491,11 +468,6 @@ var ApiClient = class {
|
|
|
491
468
|
rejectSponsorshipProposalIntent(params) {
|
|
492
469
|
return this.post("/v1/intents/sponsorship-proposal-reject", params);
|
|
493
470
|
}
|
|
494
|
-
/**
|
|
495
|
-
* Create a counter-offer intent. The seller proposes a new price in response
|
|
496
|
-
* to a buyer's active bid. siwsToken is optional — the endpoint authenticates
|
|
497
|
-
* via the tenant API key; pass a SIWS token only if your backend requires it.
|
|
498
|
-
*/
|
|
499
471
|
createCounterOfferIntent(params, siwsToken) {
|
|
500
472
|
const extraHeaders = siwsToken ? { "Authorization": `Bearer ${siwsToken}` } : {};
|
|
501
473
|
return this.request("/v1/intents/counter-offer", {
|
|
@@ -504,10 +476,6 @@ var ApiClient = class {
|
|
|
504
476
|
headers: extraHeaders
|
|
505
477
|
});
|
|
506
478
|
}
|
|
507
|
-
/**
|
|
508
|
-
* Fetch counter-offers. Pass `originalOrderHash` (buyer view) or
|
|
509
|
-
* `sellerAddress` (seller view) — at least one is required.
|
|
510
|
-
*/
|
|
511
479
|
getCounterOffers(query) {
|
|
512
480
|
const params = new URLSearchParams();
|
|
513
481
|
if (query.originalOrderHash) params.set("originalOrderHash", query.originalOrderHash);
|
|
@@ -516,7 +484,6 @@ var ApiClient = class {
|
|
|
516
484
|
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
517
485
|
return this.get(`/v1/orders/counter-offers?${params}`);
|
|
518
486
|
}
|
|
519
|
-
// ─── Metadata ──────────────────────────────────────────────────────────────
|
|
520
487
|
getMetadataSignedUrl() {
|
|
521
488
|
return this.get("/v1/metadata/signed-url");
|
|
522
489
|
}
|
|
@@ -535,7 +502,6 @@ var ApiClient = class {
|
|
|
535
502
|
body: formData
|
|
536
503
|
});
|
|
537
504
|
}
|
|
538
|
-
// ─── Portal (tenant self-service) ──────────────────────────────────────────
|
|
539
505
|
getMe() {
|
|
540
506
|
return this.get("/v1/portal/me");
|
|
541
507
|
}
|
|
@@ -562,11 +528,6 @@ var ApiClient = class {
|
|
|
562
528
|
`/v1/portal/webhooks/${id}`
|
|
563
529
|
);
|
|
564
530
|
}
|
|
565
|
-
// ─── Collection Claims ──────────────────────────────────────────────────────
|
|
566
|
-
/**
|
|
567
|
-
* Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
|
|
568
|
-
* Authorization: Bearer (SIWS token) simultaneously.
|
|
569
|
-
*/
|
|
570
531
|
async claimCollection(contractAddress, walletAddress, siwsToken) {
|
|
571
532
|
return this.request("/v1/collections/claim", {
|
|
572
533
|
method: "POST",
|
|
@@ -574,23 +535,18 @@ var ApiClient = class {
|
|
|
574
535
|
headers: this.bearer(siwsToken)
|
|
575
536
|
});
|
|
576
537
|
}
|
|
577
|
-
/**
|
|
578
|
-
* Path 3: Manual off-chain claim request (email-based).
|
|
579
|
-
*/
|
|
580
538
|
requestCollectionClaim(params) {
|
|
581
539
|
return this.request("/v1/collections/claim/request", {
|
|
582
540
|
method: "POST",
|
|
583
541
|
body: JSON.stringify(params)
|
|
584
542
|
});
|
|
585
543
|
}
|
|
586
|
-
// ─── Business Provisioning ──────────────────────────────────────────────────
|
|
587
544
|
registerBusinessProvisioning(params) {
|
|
588
545
|
return this.post("/v1/business/provisioning", params);
|
|
589
546
|
}
|
|
590
547
|
completeBusinessProvisioning(id) {
|
|
591
548
|
return this.post(`/v1/business/provisioning/${id}/complete`, {});
|
|
592
549
|
}
|
|
593
|
-
// ─── Collection Profiles ────────────────────────────────────────────────────
|
|
594
550
|
getCollectionProfile(contractAddress) {
|
|
595
551
|
return this.request(
|
|
596
552
|
`/v1/collections/${this.addr(contractAddress)}/profile`,
|
|
@@ -598,16 +554,12 @@ var ApiClient = class {
|
|
|
598
554
|
{ allow404: true }
|
|
599
555
|
);
|
|
600
556
|
}
|
|
601
|
-
/**
|
|
602
|
-
* Update collection profile. Requires SIWS token for ownership check.
|
|
603
|
-
*/
|
|
604
557
|
updateCollectionProfile(contractAddress, data, siwsToken) {
|
|
605
558
|
return this.request(
|
|
606
559
|
`/v1/collections/${this.addr(contractAddress)}/profile`,
|
|
607
560
|
{ method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
|
|
608
561
|
);
|
|
609
562
|
}
|
|
610
|
-
/** No signature required — wallet activity is public on-chain data, read like any other /v1 GET. */
|
|
611
563
|
getWalletActivity(address, chain = "STARKNET") {
|
|
612
564
|
return this.get(
|
|
613
565
|
`/v1/wallet-activity?address=${this.addr(address)}&chain=${chain}`
|
|
@@ -620,8 +572,6 @@ var ApiClient = class {
|
|
|
620
572
|
{ allow404: true, allow403: true }
|
|
621
573
|
);
|
|
622
574
|
}
|
|
623
|
-
// ─── Creator Profiles ───────────────────────────────────────────────────────
|
|
624
|
-
/** List all creators with an approved username. */
|
|
625
575
|
getCreators(opts = {}) {
|
|
626
576
|
const params = new URLSearchParams();
|
|
627
577
|
if (opts.search) params.set("search", opts.search);
|
|
@@ -637,7 +587,6 @@ var ApiClient = class {
|
|
|
637
587
|
{ allow404: true }
|
|
638
588
|
);
|
|
639
589
|
}
|
|
640
|
-
/** Resolve a username slug to a creator profile (public). */
|
|
641
590
|
getCreatorByUsername(username) {
|
|
642
591
|
return this.request(
|
|
643
592
|
`/v1/creators/by-username/${encodeURIComponent(username.toLowerCase().trim())}`,
|
|
@@ -645,23 +594,17 @@ var ApiClient = class {
|
|
|
645
594
|
{ allow404: true }
|
|
646
595
|
);
|
|
647
596
|
}
|
|
648
|
-
/**
|
|
649
|
-
* Update creator profile. Requires SIWS token; wallet must match authenticated user.
|
|
650
|
-
*/
|
|
651
597
|
updateCreatorProfile(walletAddress, data, siwsToken) {
|
|
652
598
|
return this.request(
|
|
653
599
|
`/v1/creators/${this.addr(walletAddress)}/profile`,
|
|
654
600
|
{ method: "PATCH", body: JSON.stringify(data), headers: this.bearer(siwsToken) }
|
|
655
601
|
);
|
|
656
602
|
}
|
|
657
|
-
// ─── Collection Slug Claims ───────────────────────────────────────────────────
|
|
658
|
-
/** Check if a collection slug is available (public, no auth). */
|
|
659
603
|
checkCollectionSlugAvailability(slug) {
|
|
660
604
|
return this.get(
|
|
661
605
|
`/v1/collection-slug-claims/check/${encodeURIComponent(slug.toLowerCase().trim())}`
|
|
662
606
|
);
|
|
663
607
|
}
|
|
664
|
-
/** Submit a slug claim for a collection. Requires SIWS token — caller must be the collection owner. */
|
|
665
608
|
submitCollectionSlugClaim(contractAddress, slug, siwsToken, notifyEmail) {
|
|
666
609
|
return this.request("/v1/collection-slug-claims", {
|
|
667
610
|
method: "POST",
|
|
@@ -669,14 +612,12 @@ var ApiClient = class {
|
|
|
669
612
|
headers: this.bearer(siwsToken)
|
|
670
613
|
});
|
|
671
614
|
}
|
|
672
|
-
/** Returns all slug claims submitted by the authenticated wallet. Requires SIWS token. */
|
|
673
615
|
getMyCollectionSlugClaims(siwsToken) {
|
|
674
616
|
return this.request("/v1/collection-slug-claims/me", {
|
|
675
617
|
method: "GET",
|
|
676
618
|
headers: this.bearer(siwsToken)
|
|
677
619
|
});
|
|
678
620
|
}
|
|
679
|
-
/** Resolve a collection slug to a full collection. Returns null if not found. */
|
|
680
621
|
getCollectionBySlug(slug) {
|
|
681
622
|
return this.request(
|
|
682
623
|
`/v1/collections/by-slug/${encodeURIComponent(slug.toLowerCase().trim())}`,
|
|
@@ -684,12 +625,6 @@ var ApiClient = class {
|
|
|
684
625
|
{ allow404: true }
|
|
685
626
|
);
|
|
686
627
|
}
|
|
687
|
-
// ─── User Wallet ─────────────────────────────────────────────────────────────
|
|
688
|
-
/**
|
|
689
|
-
* Frictionless wallet registration. Tenant API key only (no SIWS token required).
|
|
690
|
-
* Idempotent — backend's ensureAccountForWallet upserts and upgrades existing
|
|
691
|
-
* UNKNOWN walletType rows when a more specific value is supplied.
|
|
692
|
-
*/
|
|
693
628
|
async registerUser(params) {
|
|
694
629
|
return this.post("/v1/users/register", params);
|
|
695
630
|
}
|
|
@@ -708,18 +643,12 @@ var ApiClient = class {
|
|
|
708
643
|
headers: this.bearer(siwsToken)
|
|
709
644
|
});
|
|
710
645
|
}
|
|
711
|
-
/** 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. */
|
|
712
646
|
async checkEmailExists(email) {
|
|
713
647
|
const { exists } = await this.get(
|
|
714
648
|
`/v1/auth/email/exists?email=${encodeURIComponent(email)}`
|
|
715
649
|
);
|
|
716
650
|
return exists;
|
|
717
651
|
}
|
|
718
|
-
/**
|
|
719
|
-
* Get the authenticated user's stored wallet address from the backend DB.
|
|
720
|
-
* Returns null if the user has not completed onboarding yet.
|
|
721
|
-
* Requires SIWS token; no tenant API key needed.
|
|
722
|
-
*/
|
|
723
652
|
getMyWallet(siwsToken) {
|
|
724
653
|
return this.request(
|
|
725
654
|
"/v1/users/me",
|
|
@@ -727,10 +656,6 @@ var ApiClient = class {
|
|
|
727
656
|
{ allow404: true }
|
|
728
657
|
);
|
|
729
658
|
}
|
|
730
|
-
// ─── Remix Licensing ─────────────────────────────────────────────────────────
|
|
731
|
-
/**
|
|
732
|
-
* Get public remixes of a token (open to everyone).
|
|
733
|
-
*/
|
|
734
659
|
getTokenRemixes(contract, tokenId, opts = {}) {
|
|
735
660
|
const params = new URLSearchParams();
|
|
736
661
|
if (opts.page !== void 0) params.set("page", String(opts.page));
|
|
@@ -740,9 +665,6 @@ var ApiClient = class {
|
|
|
740
665
|
`/v1/tokens/${this.addr(contract)}/${tokenId}/remixes${qs ? `?${qs}` : ""}`
|
|
741
666
|
);
|
|
742
667
|
}
|
|
743
|
-
/**
|
|
744
|
-
* Submit a custom remix offer for a token. Requires SIWS token.
|
|
745
|
-
*/
|
|
746
668
|
submitRemixOffer(params, siwsToken) {
|
|
747
669
|
return this.request("/v1/remix-offers", {
|
|
748
670
|
method: "POST",
|
|
@@ -750,9 +672,6 @@ var ApiClient = class {
|
|
|
750
672
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
751
673
|
});
|
|
752
674
|
}
|
|
753
|
-
/**
|
|
754
|
-
* Submit an auto remix offer for a token with an open license. Requires SIWS token.
|
|
755
|
-
*/
|
|
756
675
|
submitAutoRemixOffer(params, siwsToken) {
|
|
757
676
|
return this.request("/v1/remix-offers/auto", {
|
|
758
677
|
method: "POST",
|
|
@@ -760,9 +679,6 @@ var ApiClient = class {
|
|
|
760
679
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
761
680
|
});
|
|
762
681
|
}
|
|
763
|
-
/**
|
|
764
|
-
* Record a self-remix (owner remixing their own token). Requires SIWS token.
|
|
765
|
-
*/
|
|
766
682
|
confirmSelfRemix(params, siwsToken) {
|
|
767
683
|
return this.request("/v1/remix-offers/self/confirm", {
|
|
768
684
|
method: "POST",
|
|
@@ -770,11 +686,6 @@ var ApiClient = class {
|
|
|
770
686
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
771
687
|
});
|
|
772
688
|
}
|
|
773
|
-
/**
|
|
774
|
-
* List remix offers by role. Requires SIWS token.
|
|
775
|
-
* role="creator" — offers where you are the original creator.
|
|
776
|
-
* role="requester" — offers you made.
|
|
777
|
-
*/
|
|
778
689
|
getRemixOffers(query, siwsToken) {
|
|
779
690
|
const params = new URLSearchParams({ role: query.role });
|
|
780
691
|
if (query.page !== void 0) params.set("page", String(query.page));
|
|
@@ -784,18 +695,12 @@ var ApiClient = class {
|
|
|
784
695
|
headers: this.bearer(siwsToken)
|
|
785
696
|
});
|
|
786
697
|
}
|
|
787
|
-
/**
|
|
788
|
-
* Get a single remix offer. SIWS token optional (price/currency hidden for non-participants).
|
|
789
|
-
*/
|
|
790
698
|
getRemixOffer(id, siwsToken) {
|
|
791
699
|
return this.request(`/v1/remix-offers/${id}`, {
|
|
792
700
|
method: "GET",
|
|
793
701
|
headers: siwsToken ? this.bearer(siwsToken) : void 0
|
|
794
702
|
});
|
|
795
703
|
}
|
|
796
|
-
/**
|
|
797
|
-
* Creator approves a remix offer (authorises the requester to mint). Requires SIWS token.
|
|
798
|
-
*/
|
|
799
704
|
confirmRemixOffer(id, params, siwsToken) {
|
|
800
705
|
return this.request(`/v1/remix-offers/${id}/confirm`, {
|
|
801
706
|
method: "POST",
|
|
@@ -803,9 +708,6 @@ var ApiClient = class {
|
|
|
803
708
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
804
709
|
});
|
|
805
710
|
}
|
|
806
|
-
/**
|
|
807
|
-
* Creator rejects a remix offer. Requires SIWS token.
|
|
808
|
-
*/
|
|
809
711
|
rejectRemixOffer(id, siwsToken) {
|
|
810
712
|
return this.request(`/v1/remix-offers/${id}/reject`, {
|
|
811
713
|
method: "POST",
|
|
@@ -813,10 +715,6 @@ var ApiClient = class {
|
|
|
813
715
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
814
716
|
});
|
|
815
717
|
}
|
|
816
|
-
/**
|
|
817
|
-
* Requester extends the expiry of a pending remix offer by 1–30 days.
|
|
818
|
-
* Requires SIWS token.
|
|
819
|
-
*/
|
|
820
718
|
extendRemixOffer(id, days, siwsToken) {
|
|
821
719
|
return this.request(`/v1/remix-offers/${id}/extend`, {
|
|
822
720
|
method: "POST",
|
|
@@ -824,7 +722,6 @@ var ApiClient = class {
|
|
|
824
722
|
headers: { "Authorization": `Bearer ${siwsToken}` }
|
|
825
723
|
});
|
|
826
724
|
}
|
|
827
|
-
// ─── POP Protocol ──────────────────────────────────────────────────────────
|
|
828
725
|
getPopCollections(opts = {}) {
|
|
829
726
|
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "POP_PROTOCOL");
|
|
830
727
|
}
|
|
@@ -841,9 +738,6 @@ var ApiClient = class {
|
|
|
841
738
|
);
|
|
842
739
|
return res.data;
|
|
843
740
|
}
|
|
844
|
-
// ─── Coins (fungible — ERC-20 etc.) ───────────────────────────────────────────
|
|
845
|
-
// Coins are a separate model from Collections (spec 2026-06-14). Price/liquidity
|
|
846
|
-
// is read live from Ekubo (CreatorCoinService.getPrice), never from these.
|
|
847
741
|
getCoins(opts = {}) {
|
|
848
742
|
const params = new URLSearchParams();
|
|
849
743
|
if (opts.page) params.set("page", String(opts.page));
|
|
@@ -856,11 +750,6 @@ var ApiClient = class {
|
|
|
856
750
|
getCoin(contract) {
|
|
857
751
|
return this.get(`/v1/coins/${this.addr(contract)}`);
|
|
858
752
|
}
|
|
859
|
-
/**
|
|
860
|
-
* Creator-authed coin profile edit (image/description). Backend authorizes
|
|
861
|
-
* via `coin.creator` (trustless — from the factory event), not a body param;
|
|
862
|
-
* `siwsToken` is the caller's SIWS bearer token for `identityAuth`.
|
|
863
|
-
*/
|
|
864
753
|
updateCoinProfile(contract, data, siwsToken) {
|
|
865
754
|
return this.request(`/v1/coins/${this.addr(contract)}`, {
|
|
866
755
|
method: "PATCH",
|
|
@@ -868,7 +757,6 @@ var ApiClient = class {
|
|
|
868
757
|
headers: this.bearer(siwsToken)
|
|
869
758
|
});
|
|
870
759
|
}
|
|
871
|
-
// ─── Collection Drop ────────────────────────────────────────────────────────
|
|
872
760
|
getDropCollections(opts = {}) {
|
|
873
761
|
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "COLLECTION_DROP");
|
|
874
762
|
}
|
|
@@ -878,29 +766,22 @@ var ApiClient = class {
|
|
|
878
766
|
);
|
|
879
767
|
return res.data;
|
|
880
768
|
}
|
|
881
|
-
// ─── Rewards (v0.49.0) ─────────────────────────────────────────────────────
|
|
882
|
-
// Scores are recomputed on a schedule by the backend (~15 min) — reads only.
|
|
883
|
-
/** Score + level + progress + badges for one address (zeroed for unknown). */
|
|
884
769
|
async getRewards(address) {
|
|
885
770
|
const res = await this.get(`/v1/rewards/${this.addr(address)}`);
|
|
886
771
|
return res.data;
|
|
887
772
|
}
|
|
888
|
-
/** Paginated XP leaderboard. */
|
|
889
773
|
getRewardsLeaderboard(page = 1, limit = 50) {
|
|
890
774
|
return this.get(`/v1/rewards?page=${page}&limit=${limit}`);
|
|
891
775
|
}
|
|
892
|
-
/** Point-event history for an address. */
|
|
893
776
|
getRewardsEvents(address, page = 1, limit = 20) {
|
|
894
777
|
return this.get(
|
|
895
778
|
`/v1/rewards/${this.addr(address)}/events?page=${page}&limit=${limit}`
|
|
896
779
|
);
|
|
897
780
|
}
|
|
898
|
-
/** Reward configuration: level ladder, enabled action XP values, badge catalog. */
|
|
899
781
|
async getRewardsConfig() {
|
|
900
782
|
const res = await this.get(`/v1/rewards/config`);
|
|
901
783
|
return res.data;
|
|
902
784
|
}
|
|
903
|
-
/** Minimal level info for up to 50 addresses — one call per list page. */
|
|
904
785
|
async getRewardsBatch(addresses) {
|
|
905
786
|
if (addresses.length === 0) return [];
|
|
906
787
|
const params = new URLSearchParams({ addresses: addresses.map((a) => this.addr(a)).join(",") });
|
|
@@ -945,7 +826,6 @@ SN.creatorCoinStartBlock;
|
|
|
945
826
|
SN.ekuboCore;
|
|
946
827
|
var SUPPORTED_TOKENS = [
|
|
947
828
|
{
|
|
948
|
-
// Circle-native USDC on Starknet (canonical)
|
|
949
829
|
symbol: "USDC",
|
|
950
830
|
address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
|
|
951
831
|
decimals: 6,
|
|
@@ -10294,24 +10174,12 @@ var ERC1155CollectionService = class {
|
|
|
10294
10174
|
account
|
|
10295
10175
|
);
|
|
10296
10176
|
}
|
|
10297
|
-
/**
|
|
10298
|
-
* Deploy a new ERC-1155 IP collection.
|
|
10299
|
-
* Caller becomes the collection owner and can mint items.
|
|
10300
|
-
* Returns the transaction hash; the deployed collection address is emitted
|
|
10301
|
-
* in the `CollectionDeployed` event of the factory.
|
|
10302
|
-
*/
|
|
10303
10177
|
async deployCollection(account, params) {
|
|
10304
10178
|
const factory = this._factory(account);
|
|
10305
10179
|
const call = factory.populate("deploy_collection", [params.name, params.symbol, params.baseUri]);
|
|
10306
10180
|
const res = await account.execute([call]);
|
|
10307
10181
|
return { txHash: res.transaction_hash };
|
|
10308
10182
|
}
|
|
10309
|
-
/**
|
|
10310
|
-
* Mint a new edition into an existing ERC-1155 collection.
|
|
10311
|
-
* Caller must be the collection owner. The token id is assigned on-chain
|
|
10312
|
-
* (sequential from 1) — read it from the `IPMinted` event of the returned tx.
|
|
10313
|
-
* The `tokenUri` is immutable.
|
|
10314
|
-
*/
|
|
10315
10183
|
async mintEdition(account, params) {
|
|
10316
10184
|
const collection = this._collection(params.collection, account);
|
|
10317
10185
|
const call = collection.populate("mint_edition", [
|
|
@@ -10322,11 +10190,6 @@ var ERC1155CollectionService = class {
|
|
|
10322
10190
|
const res = await account.execute([call]);
|
|
10323
10191
|
return { txHash: res.transaction_hash };
|
|
10324
10192
|
}
|
|
10325
|
-
/**
|
|
10326
|
-
* Batch-mint multiple new editions into an existing ERC-1155 collection.
|
|
10327
|
-
* All editions go to the same `to` address; ids are assigned sequentially
|
|
10328
|
-
* on-chain. Caller must be the collection owner.
|
|
10329
|
-
*/
|
|
10330
10193
|
async batchMintEdition(account, params) {
|
|
10331
10194
|
const collection = this._collection(params.collection, account);
|
|
10332
10195
|
const values = params.items.map((i) => BigInt(i.value));
|
|
@@ -10339,11 +10202,6 @@ var ERC1155CollectionService = class {
|
|
|
10339
10202
|
const res = await account.execute([call]);
|
|
10340
10203
|
return { txHash: res.transaction_hash };
|
|
10341
10204
|
}
|
|
10342
|
-
/**
|
|
10343
|
-
* Mint additional copies of an EXISTING edition into an ERC-1155 collection.
|
|
10344
|
-
* Reverts on-chain if `tokenId` has never been minted. Provenance/URI unchanged.
|
|
10345
|
-
* Caller must be the collection owner.
|
|
10346
|
-
*/
|
|
10347
10205
|
async addSupply(account, params) {
|
|
10348
10206
|
const collection = this._collection(params.collection, account);
|
|
10349
10207
|
const call = collection.populate("add_supply", [
|
|
@@ -10354,11 +10212,6 @@ var ERC1155CollectionService = class {
|
|
|
10354
10212
|
const res = await account.execute([call]);
|
|
10355
10213
|
return { txHash: res.transaction_hash };
|
|
10356
10214
|
}
|
|
10357
|
-
/**
|
|
10358
|
-
* Set the default ERC-2981 royalty for the entire collection.
|
|
10359
|
-
* `feeNumerator` is out of 10 000 (e.g. 500 = 5%).
|
|
10360
|
-
* Caller must be the collection owner.
|
|
10361
|
-
*/
|
|
10362
10215
|
async setDefaultRoyalty(account, params) {
|
|
10363
10216
|
const collection = this._collection(params.collection, account);
|
|
10364
10217
|
const call = collection.populate("set_default_royalty", [
|
|
@@ -10368,10 +10221,6 @@ var ERC1155CollectionService = class {
|
|
|
10368
10221
|
const res = await account.execute([call]);
|
|
10369
10222
|
return { txHash: res.transaction_hash };
|
|
10370
10223
|
}
|
|
10371
|
-
/**
|
|
10372
|
-
* Set a per-token ERC-2981 royalty override.
|
|
10373
|
-
* `feeNumerator` is out of 10 000. Caller must be the collection owner.
|
|
10374
|
-
*/
|
|
10375
10224
|
async setTokenRoyalty(account, params) {
|
|
10376
10225
|
const collection = this._collection(params.collection, account);
|
|
10377
10226
|
const call = collection.populate("set_token_royalty", [
|
|
@@ -10382,10 +10231,6 @@ var ERC1155CollectionService = class {
|
|
|
10382
10231
|
const res = await account.execute([call]);
|
|
10383
10232
|
return { txHash: res.transaction_hash };
|
|
10384
10233
|
}
|
|
10385
|
-
/**
|
|
10386
|
-
* Approve the Medialane1155 marketplace (or any operator) to transfer
|
|
10387
|
-
* all tokens on behalf of `account`. Required before listing.
|
|
10388
|
-
*/
|
|
10389
10234
|
async setApprovalForAll(account, params) {
|
|
10390
10235
|
const collection = this._collection(params.collection, account);
|
|
10391
10236
|
const call = collection.populate("set_approval_for_all", [
|
|
@@ -10580,27 +10425,18 @@ var CreatorCoinService = class {
|
|
|
10580
10425
|
_factory(account) {
|
|
10581
10426
|
return newContract(CreatorCoinFactoryABI, this.factoryAddress, account);
|
|
10582
10427
|
}
|
|
10583
|
-
/** Deploy a fixed-supply CreatorCoin (full supply minted to the Factory). */
|
|
10584
10428
|
async createCreatorCoin(account, params) {
|
|
10585
10429
|
const res = await account.execute([buildCreateCreatorCoinCall(params)]);
|
|
10586
10430
|
return { txHash: res.transaction_hash };
|
|
10587
10431
|
}
|
|
10588
|
-
/**
|
|
10589
|
-
* Launch a coin on Ekubo (owner-only). Optionally pre-funds the Factory with
|
|
10590
|
-
* quote (for the buyback) in the same multicall. Liquidity is permanently
|
|
10591
|
-
* locked in the EkuboLauncher.
|
|
10592
|
-
*/
|
|
10593
10432
|
async launchOnEkubo(account, params) {
|
|
10594
10433
|
const res = await account.execute(buildLaunchOnEkuboCalls(params));
|
|
10595
10434
|
return { txHash: res.transaction_hash };
|
|
10596
10435
|
}
|
|
10597
|
-
/** View: is this address a Factory-deployed Creator Coin? */
|
|
10598
10436
|
async isCreatorCoin(address, account) {
|
|
10599
10437
|
const r = await this._factory(account).is_creator_coin(address);
|
|
10600
10438
|
return BigInt(r) === 1n;
|
|
10601
10439
|
}
|
|
10602
|
-
/** Read a coin's live Ekubo spot price (quote-per-coin) via the configured RPC.
|
|
10603
|
-
* Read-only; returns null if the coin isn't launched on Ekubo. */
|
|
10604
10440
|
async getPrice(coinAddress) {
|
|
10605
10441
|
return getCreatorCoinPrice(coinAddress, new RpcProvider({ nodeUrl: this.config.rpcUrl }));
|
|
10606
10442
|
}
|
|
@@ -10622,11 +10458,6 @@ var TicketService = class {
|
|
|
10622
10458
|
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10623
10459
|
return newContract(IPTicketCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
10624
10460
|
}
|
|
10625
|
-
/**
|
|
10626
|
-
* Deploys a new IPTicketCollection via the factory. Caller becomes owner.
|
|
10627
|
-
* `baseUri` is the collection-level metadata URI, embedded on-chain in the
|
|
10628
|
-
* deploy transaction.
|
|
10629
|
-
*/
|
|
10630
10461
|
async deployCollection(account, params) {
|
|
10631
10462
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
10632
10463
|
params.name,
|
|
@@ -10636,7 +10467,6 @@ var TicketService = class {
|
|
|
10636
10467
|
const res = await account.execute([call]);
|
|
10637
10468
|
return { txHash: res.transaction_hash };
|
|
10638
10469
|
}
|
|
10639
|
-
/** Owner-only. Creates a new ticket inside the caller's deployed collection. */
|
|
10640
10470
|
async createTicket(account, params) {
|
|
10641
10471
|
const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
|
|
10642
10472
|
const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
|
|
@@ -10650,7 +10480,6 @@ var TicketService = class {
|
|
|
10650
10480
|
const res = await account.execute([call]);
|
|
10651
10481
|
return { txHash: res.transaction_hash };
|
|
10652
10482
|
}
|
|
10653
|
-
/** Owner-only. Mints `amount` of `tokenId` to `to`. */
|
|
10654
10483
|
async mint(account, params) {
|
|
10655
10484
|
const call = this._collection(params.collection, account).populate("mint", [
|
|
10656
10485
|
params.to,
|
|
@@ -10660,7 +10489,6 @@ var TicketService = class {
|
|
|
10660
10489
|
const res = await account.execute([call]);
|
|
10661
10490
|
return { txHash: res.transaction_hash };
|
|
10662
10491
|
}
|
|
10663
|
-
/** Read — true if holder has balance > 0 and current time is within the ticket window. */
|
|
10664
10492
|
async isValid(params) {
|
|
10665
10493
|
const result = await this._collectionRead(params.collection).call("is_valid", [
|
|
10666
10494
|
cairo.uint256(params.tokenId),
|
|
@@ -10668,12 +10496,10 @@ var TicketService = class {
|
|
|
10668
10496
|
]);
|
|
10669
10497
|
return Boolean(result);
|
|
10670
10498
|
}
|
|
10671
|
-
/** Read — number of tickets created so far (ids are sequential from 1). */
|
|
10672
10499
|
async getTicketCount(params) {
|
|
10673
10500
|
const result = await this._collectionRead(params.collection).call("ticket_count", []);
|
|
10674
10501
|
return BigInt(result);
|
|
10675
10502
|
}
|
|
10676
|
-
/** Read — returns the Ticket record for a token ID. */
|
|
10677
10503
|
async getTicket(params) {
|
|
10678
10504
|
const t = await this._collectionRead(params.collection).call("get_ticket", [
|
|
10679
10505
|
cairo.uint256(params.tokenId)
|
|
@@ -10705,11 +10531,6 @@ var ClubService = class {
|
|
|
10705
10531
|
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10706
10532
|
return newContract(IPClubCollectionABI, normalizeAddress("STARKNET", address), provider);
|
|
10707
10533
|
}
|
|
10708
|
-
/**
|
|
10709
|
-
* Deploys a new IPClubCollection via the factory. Caller becomes owner.
|
|
10710
|
-
* `baseUri` is the collection-level metadata URI, embedded on-chain in the
|
|
10711
|
-
* deploy transaction.
|
|
10712
|
-
*/
|
|
10713
10534
|
async deployCollection(account, params) {
|
|
10714
10535
|
const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
|
|
10715
10536
|
params.name,
|
|
@@ -10719,7 +10540,6 @@ var ClubService = class {
|
|
|
10719
10540
|
const res = await account.execute([call]);
|
|
10720
10541
|
return { txHash: res.transaction_hash };
|
|
10721
10542
|
}
|
|
10722
|
-
/** Owner-only. Creates a new membership tier inside the caller's deployed collection. */
|
|
10723
10543
|
async createMembership(account, params) {
|
|
10724
10544
|
const startTime = params.startTime != null ? new CairoOption(CairoOptionVariant.Some, params.startTime) : new CairoOption(CairoOptionVariant.None);
|
|
10725
10545
|
const endTime = params.endTime != null ? new CairoOption(CairoOptionVariant.Some, params.endTime) : new CairoOption(CairoOptionVariant.None);
|
|
@@ -10733,10 +10553,6 @@ var ClubService = class {
|
|
|
10733
10553
|
const res = await account.execute([call]);
|
|
10734
10554
|
return { txHash: res.transaction_hash };
|
|
10735
10555
|
}
|
|
10736
|
-
/**
|
|
10737
|
-
* Owner-only. Mints `amount` of `tokenId` to `to`. The validity window
|
|
10738
|
-
* gates membership, never minting — future-window tiers mint fine.
|
|
10739
|
-
*/
|
|
10740
10556
|
async mint(account, params) {
|
|
10741
10557
|
const call = this._collection(params.collection, account).populate("mint", [
|
|
10742
10558
|
params.to,
|
|
@@ -10746,14 +10562,12 @@ var ClubService = class {
|
|
|
10746
10562
|
const res = await account.execute([call]);
|
|
10747
10563
|
return { txHash: res.transaction_hash };
|
|
10748
10564
|
}
|
|
10749
|
-
/** Read — true if holder holds any tier currently inside its validity window. */
|
|
10750
10565
|
async isMember(params) {
|
|
10751
10566
|
const result = await this._collectionRead(params.collection).call("is_member", [
|
|
10752
10567
|
params.holder
|
|
10753
10568
|
]);
|
|
10754
10569
|
return Boolean(result);
|
|
10755
10570
|
}
|
|
10756
|
-
/** Read — true if holder holds `tokenId` and the current time is inside its window. */
|
|
10757
10571
|
async isMemberOf(params) {
|
|
10758
10572
|
const result = await this._collectionRead(params.collection).call("is_member_of", [
|
|
10759
10573
|
cairo.uint256(params.tokenId),
|
|
@@ -10761,7 +10575,6 @@ var ClubService = class {
|
|
|
10761
10575
|
]);
|
|
10762
10576
|
return Boolean(result);
|
|
10763
10577
|
}
|
|
10764
|
-
/** Read — returns the Membership record for a token ID. */
|
|
10765
10578
|
async getMembership(params) {
|
|
10766
10579
|
const m = await this._collectionRead(params.collection).call("get_membership", [
|
|
10767
10580
|
cairo.uint256(params.tokenId)
|
|
@@ -10796,8 +10609,6 @@ var SponsorshipService = class {
|
|
|
10796
10609
|
const provider = new RpcProvider({ nodeUrl: this.config.rpcUrl });
|
|
10797
10610
|
return newContract(IPSponsorshipABI, normalizeAddress("STARKNET", resolved), provider);
|
|
10798
10611
|
}
|
|
10799
|
-
// ── Offers (owner-initiated) ───────────────────────────────────────────────
|
|
10800
|
-
/** The offer author must currently own (nftContract, tokenId) — enforced on-chain at create and accept. */
|
|
10801
10612
|
async createOffer(account, params) {
|
|
10802
10613
|
const specificSponsor = params.specificSponsor ? new CairoOption(CairoOptionVariant.Some, params.specificSponsor) : new CairoOption(CairoOptionVariant.None);
|
|
10803
10614
|
const call = this._contract(account, params.sponsorshipAddress).populate("create_offer", [
|
|
@@ -10814,7 +10625,6 @@ var SponsorshipService = class {
|
|
|
10814
10625
|
const res = await account.execute([call]);
|
|
10815
10626
|
return { txHash: res.transaction_hash };
|
|
10816
10627
|
}
|
|
10817
|
-
/** Reversible — gates new bids/acceptance only. */
|
|
10818
10628
|
async setOfferOpen(account, params) {
|
|
10819
10629
|
const call = this._contract(account, params.sponsorshipAddress).populate("set_offer_open", [
|
|
10820
10630
|
cairo.uint256(params.offerId),
|
|
@@ -10823,7 +10633,6 @@ var SponsorshipService = class {
|
|
|
10823
10633
|
const res = await account.execute([call]);
|
|
10824
10634
|
return { txHash: res.transaction_hash };
|
|
10825
10635
|
}
|
|
10826
|
-
/** A bid is a signal plus an open ERC-20 allowance — no tokens move until accepted. Prepends the approve. */
|
|
10827
10636
|
async placeBid(account, params) {
|
|
10828
10637
|
const sponsorshipAddress = params.sponsorshipAddress ?? this.sponsorshipAddress;
|
|
10829
10638
|
if (!sponsorshipAddress) {
|
|
@@ -10849,11 +10658,6 @@ var SponsorshipService = class {
|
|
|
10849
10658
|
const res = await account.execute([call]);
|
|
10850
10659
|
return { txHash: res.transaction_hash };
|
|
10851
10660
|
}
|
|
10852
|
-
/**
|
|
10853
|
-
* Author-only. Re-verifies IP ownership, settles the sponsor's payment
|
|
10854
|
-
* (allowance pull, no escrow), and mints the license — a real ERC-721 on
|
|
10855
|
-
* this same contract — to the sponsor, all atomically in one call.
|
|
10856
|
-
*/
|
|
10857
10661
|
async acceptBid(account, params) {
|
|
10858
10662
|
const call = this._contract(account, params.sponsorshipAddress).populate("accept_bid", [
|
|
10859
10663
|
cairo.uint256(params.offerId),
|
|
@@ -10862,12 +10666,6 @@ var SponsorshipService = class {
|
|
|
10862
10666
|
const res = await account.execute([call]);
|
|
10863
10667
|
return { txHash: res.transaction_hash };
|
|
10864
10668
|
}
|
|
10865
|
-
// ── Proposals (sponsor-initiated) ──────────────────────────────────────────
|
|
10866
|
-
// The symmetric counterpart to offers/bids: a sponsor proposes fixed terms
|
|
10867
|
-
// on an asset with no open offer yet; only the asset's current owner may
|
|
10868
|
-
// accept or reject. Unlike an offer, the SPONSOR chooses `paymentToken` here
|
|
10869
|
-
// — an accepting owner's UI should surface only recognized tokens, since a
|
|
10870
|
-
// bad-faith ERC-20 could return `true` on `transfer_from` without moving funds.
|
|
10871
10669
|
async proposeSponsorship(account, params) {
|
|
10872
10670
|
const call = this._contract(account, params.sponsorshipAddress).populate("propose_sponsorship", [
|
|
10873
10671
|
params.nftContract,
|
|
@@ -10883,7 +10681,6 @@ var SponsorshipService = class {
|
|
|
10883
10681
|
const res = await account.execute([call]);
|
|
10884
10682
|
return { txHash: res.transaction_hash };
|
|
10885
10683
|
}
|
|
10886
|
-
/** Proposer-only. Advisory against an acceptance in flight in the same block. */
|
|
10887
10684
|
async withdrawProposal(account, params) {
|
|
10888
10685
|
const call = this._contract(account, params.sponsorshipAddress).populate("withdraw_proposal", [
|
|
10889
10686
|
cairo.uint256(params.proposalId)
|
|
@@ -10891,12 +10688,6 @@ var SponsorshipService = class {
|
|
|
10891
10688
|
const res = await account.execute([call]);
|
|
10892
10689
|
return { txHash: res.transaction_hash };
|
|
10893
10690
|
}
|
|
10894
|
-
/**
|
|
10895
|
-
* Asset-owner-only (re-verified on-chain — a proposal binds to the asset,
|
|
10896
|
-
* not a person: whoever owns it at acceptance time is paid and issues the
|
|
10897
|
-
* license). Settles payment and mints the license atomically, same as
|
|
10898
|
-
* `acceptBid`.
|
|
10899
|
-
*/
|
|
10900
10691
|
async acceptProposal(account, params) {
|
|
10901
10692
|
const call = this._contract(account, params.sponsorshipAddress).populate("accept_proposal", [
|
|
10902
10693
|
cairo.uint256(params.proposalId)
|
|
@@ -10904,7 +10695,6 @@ var SponsorshipService = class {
|
|
|
10904
10695
|
const res = await account.execute([call]);
|
|
10905
10696
|
return { txHash: res.transaction_hash };
|
|
10906
10697
|
}
|
|
10907
|
-
/** Asset-owner-only. */
|
|
10908
10698
|
async rejectProposal(account, params) {
|
|
10909
10699
|
const call = this._contract(account, params.sponsorshipAddress).populate("reject_proposal", [
|
|
10910
10700
|
cairo.uint256(params.proposalId)
|
|
@@ -10912,7 +10702,6 @@ var SponsorshipService = class {
|
|
|
10912
10702
|
const res = await account.execute([call]);
|
|
10913
10703
|
return { txHash: res.transaction_hash };
|
|
10914
10704
|
}
|
|
10915
|
-
// ── Reads ───────────────────────────────────────────────────────────────────
|
|
10916
10705
|
async getOffer(params) {
|
|
10917
10706
|
const o = await this._contractRead(params.sponsorshipAddress).call("get_offer", [
|
|
10918
10707
|
cairo.uint256(params.offerId)
|
|
@@ -10968,7 +10757,6 @@ var SponsorshipService = class {
|
|
|
10968
10757
|
const result = await this._contractRead(params?.sponsorshipAddress).call("get_last_license_id", []);
|
|
10969
10758
|
return BigInt(result);
|
|
10970
10759
|
}
|
|
10971
|
-
/** EIP-2981 — royalty recipient (the license's issuing author) and amount owed on a resale at `salePrice`. */
|
|
10972
10760
|
async royaltyInfo(params) {
|
|
10973
10761
|
const [recipient, amount] = await this._contractRead(params.sponsorshipAddress).call("royalty_info", [
|
|
10974
10762
|
cairo.uint256(params.licenseId),
|
|
@@ -11448,7 +11236,6 @@ var StarknetVenue = class {
|
|
|
11448
11236
|
const orderRef = await this.orderRefFromReceipt(txHash);
|
|
11449
11237
|
return { txHash, orderRef };
|
|
11450
11238
|
}
|
|
11451
|
-
// ─── reads (all on deps.provider) ─────────────────────────────────────────
|
|
11452
11239
|
async readCounter(marketplace, address) {
|
|
11453
11240
|
const res = await this.deps.provider.callContract({
|
|
11454
11241
|
contractAddress: marketplace,
|
|
@@ -11457,7 +11244,6 @@ var StarknetVenue = class {
|
|
|
11457
11244
|
});
|
|
11458
11245
|
return BigInt(res[0] ?? "0");
|
|
11459
11246
|
}
|
|
11460
|
-
/** 721 listing approval: `get_approved(tokenId) == marketplace` ⇒ no approve. */
|
|
11461
11247
|
async approval721ForListing(_owner, nftContract, tokenId) {
|
|
11462
11248
|
const id = cairo.uint256(tokenId);
|
|
11463
11249
|
const approve = {
|
|
@@ -11477,7 +11263,6 @@ var StarknetVenue = class {
|
|
|
11477
11263
|
}
|
|
11478
11264
|
return { approvalNeeded: !approved, approve };
|
|
11479
11265
|
}
|
|
11480
|
-
/** 1155 listing approval: `is_approved_for_all(owner, marketplace)`. */
|
|
11481
11266
|
async approval1155ForListing(owner, nftContract) {
|
|
11482
11267
|
const approve = {
|
|
11483
11268
|
contractAddress: nftContract,
|
|
@@ -11496,7 +11281,6 @@ var StarknetVenue = class {
|
|
|
11496
11281
|
}
|
|
11497
11282
|
return { approvalNeeded: !approved, approve };
|
|
11498
11283
|
}
|
|
11499
|
-
/** Offers always approve the ERC-20 spend (no read). */
|
|
11500
11284
|
approvalForErc20(token, amountWei, marketplace) {
|
|
11501
11285
|
const u = cairo.uint256(amountWei);
|
|
11502
11286
|
return {
|
|
@@ -11508,8 +11292,6 @@ var StarknetVenue = class {
|
|
|
11508
11292
|
}
|
|
11509
11293
|
};
|
|
11510
11294
|
}
|
|
11511
|
-
/** The canonical Starknet order id = the contract-emitted `OrderCreated`
|
|
11512
|
-
* hash (`keys[1]`), which is exactly what the indexer stores. */
|
|
11513
11295
|
async orderRefFromReceipt(txHash) {
|
|
11514
11296
|
const receipt = await this.deps.provider.getTransactionReceipt(txHash);
|
|
11515
11297
|
const selector = hash.getSelectorFromName("OrderCreated");
|