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