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