@medialane/sdk 0.78.0 → 0.80.0
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/index.cjs +69 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/index.js +67 -1
- package/dist/index.js.map +1 -1
- package/dist/{services-gpLj6m2X.d.cts → services-1U8xO9JM.d.cts} +58 -8
- package/dist/{services-L8rbm-gZ.d.ts → services-vRjBk3Zn.d.ts} +58 -8
- package/dist/starknet/index.cjs +6 -0
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/dist/starknet/index.js +6 -0
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as ActivityType, b as ApiActivitiesQuery, c as ApiActivity, d as ApiActivityPrice, e as ApiAdminCollectionClaim, f as ApiAppSource, g as ApiBusinessProvisioning, h as ApiChain, i as
|
|
1
|
+
import { S as ServiceDefinition, a as ServiceCapability } from './services-1U8xO9JM.cjs';
|
|
2
|
+
export { A as ActivityType, b as ApiActivitiesQuery, c as ApiActivity, d as ApiActivityPrice, e as ApiAdminCollectionClaim, f as ApiAppSource, g as ApiBusinessProvisioning, h as ApiChain, i as ApiCheckoutIntentResult, j as ApiClient, k as ApiCoin, l as ApiCoinsQuery, m as ApiCollection, n as ApiCollectionClaim, o as ApiCollectionProfile, p as ApiCollectionSlugClaim, q as ApiCollectionsQuery, r as ApiComment, s as ApiCounterOffersQuery, t as ApiCreatorListResult, u as ApiCreatorProfile, v as ApiIntent, w as ApiIntentCreated, x as ApiKeyStatus, y as ApiMeta, z as ApiMetadataSignedUrl, B as ApiMetadataUpload, C as ApiOrder, D as ApiOrderConsideration, E as ApiOrderOffer, F as ApiOrderPrice, G as ApiOrderTokenMeta, H as ApiOrderTxHash, I as ApiOrdersQuery, J as ApiPointEvent, K as ApiPortalKey, L as ApiPortalKeyCreated, M as ApiPortalMe, N as ApiPublicRemix, O as ApiRemixOffer, P as ApiRemixOfferPrice, Q as ApiRemixOffersQuery, R as ApiResponse, T as ApiRewardsBadge, U as ApiRewardsBatchEntry, V as ApiRewardsConfig, W as ApiRewardsLeaderboardEntry, X as ApiRewardsLevel, Y as ApiSearchCollectionResult, Z as ApiSearchCreatorResult, _ as ApiSearchResult, $ as ApiSearchTokenResult, a0 as ApiToken, a1 as ApiTokenBalance, a2 as ApiTokenMetadata, a3 as ApiUsageDay, a4 as ApiUserRewards, a5 as ApiUserWallet, a6 as ApiWalletActivity, a7 as ApiWebhookCreated, a8 as ApiWebhookEndpoint, a9 as AutoRemixOfferParams, aa as CancelOrderIntentParams, ab as ChainFilter, ac as ClaimConditions, ad as CollectionSort, ae as CollectionTokensSort, af as ConfirmRemixOfferParams, ag as ConfirmSelfRemixParams, ah as ConsiderationItem, ai as CreateCheckoutIntentParams, aj as CreateCollectionIntentParams, ak as CreateCounterOfferIntentParams, al as CreateDropParams, am as CreateListingIntentParams, an as CreateMembershipParams, ao as CreateMintIntentParams, ap as CreatePopCollectionParams, aq as CreateRemixOfferParams, ar as CreateSponsorshipOfferParams, as as CreateTicketParams, at as CreateTierIntentParams, au as CreateWebhookParams, av as DropMintStatus, aw as EnforcementDeclaration, ax as FactoryFamilyServiceId, ay as FeeConfig, az as FeeConfigSchema, aA as FulfillOrderIntentParams, aB as IPType, aC as IntentCall, aD as IntentStatus, aE as IntentType, aF as IpAttribute, aG as IpNftMetadata, aH as MakeOfferIntentParams, aI as MedialaneApiError, aJ as MedialaneConfig, aK as MedialaneErrorCode, aL as MintMembershipsParams, aM as MintTicketsParams, aN as OPEN_LICENSES, aO as OfferItem, aP as OpenLicense, aQ as Order, aR as OrderDetails, aS as OrderParameters, aT as OrderStatus, aU as PopBatchEligibilityItem, aV as PopClaimStatus, aW as PopEventType, aX as ProposeSponsorshipParams, aY as RemixOfferStatus, aZ as ResolvedConfig, a_ as ResolvedFeeConfig, a$ as RetryOptions, b0 as ServiceEventDeclaration, b1 as SortOrder, b2 as TenantPlan, b3 as TierServiceId, b4 as TxResult, b5 as WebhookEventType, b6 as WebhookStatus, b7 as resolveConfig, b8 as resolveFeeConfig } from './services-1U8xO9JM.cjs';
|
|
3
3
|
import { C as Chain } from './types-sIc3OCpo.cjs';
|
|
4
4
|
export { A as AdapterTxResult, a as AssetRef, b as CHAINS, c as ChainCoordinates, d as CoordinatesByChain, e as CreateCollectionInput, D as DEFAULT_CHAIN, E as EvmCoordinates, I as IssuanceAdapter, M as MintInput, O as OrderRef, R as RegisterOrderParams, S as SolanaCoordinates, f as StarknetCoordinates, g as StellarCoordinates, V as VenueAdapter, h as getCoordinates, i as getStarknetCoordinates } from './types-sIc3OCpo.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -472,6 +472,8 @@ declare function stringifyBigInts(obj: unknown): unknown;
|
|
|
472
472
|
* Convert a u256 represented as { low: string; high: string } to a single BigInt.
|
|
473
473
|
*/
|
|
474
474
|
declare function u256ToBigInt(low: string, high: string): bigint;
|
|
475
|
+
/** Split a bigint into low/high felt252 halves for a Cairo u256 (inverse of `u256ToBigInt`). */
|
|
476
|
+
declare function encodeU256(n: bigint): [string, string];
|
|
475
477
|
|
|
476
478
|
/**
|
|
477
479
|
* Resilient Starknet RPC helpers — the single source of truth for "what counts
|
|
@@ -533,4 +535,47 @@ interface FailoverFetchOptions {
|
|
|
533
535
|
*/
|
|
534
536
|
declare function createFailoverFetch(urls: string[], options?: FailoverFetchOptions): typeof fetch;
|
|
535
537
|
|
|
536
|
-
|
|
538
|
+
/**
|
|
539
|
+
* Shared OpenSea-ERC721 + Berne-Convention metadata builder.
|
|
540
|
+
*
|
|
541
|
+
* Single source of truth for how a Medialane asset's metadata JSON is shaped.
|
|
542
|
+
* Pure function — no network calls, no FormData. Server-safe and chain-neutral.
|
|
543
|
+
*/
|
|
544
|
+
type AssetAttribute = {
|
|
545
|
+
trait_type: string;
|
|
546
|
+
value: string;
|
|
547
|
+
};
|
|
548
|
+
interface AssetMetadata {
|
|
549
|
+
name: string;
|
|
550
|
+
description: string;
|
|
551
|
+
image: string | null;
|
|
552
|
+
external_url: string;
|
|
553
|
+
attributes: AssetAttribute[];
|
|
554
|
+
}
|
|
555
|
+
interface BuildAssetMetadataInput {
|
|
556
|
+
name: string;
|
|
557
|
+
description?: string | null;
|
|
558
|
+
externalUrl?: string | null;
|
|
559
|
+
imageUri?: string | null;
|
|
560
|
+
creator?: string | null;
|
|
561
|
+
ipType?: string | null;
|
|
562
|
+
licenseType?: string | null;
|
|
563
|
+
commercialUse?: string | null;
|
|
564
|
+
derivatives?: string | null;
|
|
565
|
+
attribution?: string | null;
|
|
566
|
+
geographicScope?: string | null;
|
|
567
|
+
aiPolicy?: string | null;
|
|
568
|
+
royalty?: string | null;
|
|
569
|
+
edition?: string | null;
|
|
570
|
+
/** Already-extracted `tmpl_*` template/custom traits (reserved names are filtered here). */
|
|
571
|
+
templateTraits?: {
|
|
572
|
+
traitType: string;
|
|
573
|
+
value: string;
|
|
574
|
+
}[];
|
|
575
|
+
/** ISO date (YYYY-MM-DD) stamped as the Berne registration trait. Defaults to today. */
|
|
576
|
+
registrationDate?: string;
|
|
577
|
+
}
|
|
578
|
+
declare const RESERVED_TRAITS: Set<string>;
|
|
579
|
+
declare function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata;
|
|
580
|
+
|
|
581
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_COLLECTION_CLASS_HASH, STARKNET_IP_CLUB_FACTORY_CONTRACT, STARKNET_IP_SPONSORSHIP_CLASS_HASH, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, SUPPORTED_URL_CHAINS, ServiceCapability, ServiceDefinition, type ServiceId, type SupportedToken, type SupportedTokenSymbol, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createFailoverFetch, encodeU256, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as ActivityType, b as ApiActivitiesQuery, c as ApiActivity, d as ApiActivityPrice, e as ApiAdminCollectionClaim, f as ApiAppSource, g as ApiBusinessProvisioning, h as ApiChain, i as
|
|
1
|
+
import { S as ServiceDefinition, a as ServiceCapability } from './services-vRjBk3Zn.js';
|
|
2
|
+
export { A as ActivityType, b as ApiActivitiesQuery, c as ApiActivity, d as ApiActivityPrice, e as ApiAdminCollectionClaim, f as ApiAppSource, g as ApiBusinessProvisioning, h as ApiChain, i as ApiCheckoutIntentResult, j as ApiClient, k as ApiCoin, l as ApiCoinsQuery, m as ApiCollection, n as ApiCollectionClaim, o as ApiCollectionProfile, p as ApiCollectionSlugClaim, q as ApiCollectionsQuery, r as ApiComment, s as ApiCounterOffersQuery, t as ApiCreatorListResult, u as ApiCreatorProfile, v as ApiIntent, w as ApiIntentCreated, x as ApiKeyStatus, y as ApiMeta, z as ApiMetadataSignedUrl, B as ApiMetadataUpload, C as ApiOrder, D as ApiOrderConsideration, E as ApiOrderOffer, F as ApiOrderPrice, G as ApiOrderTokenMeta, H as ApiOrderTxHash, I as ApiOrdersQuery, J as ApiPointEvent, K as ApiPortalKey, L as ApiPortalKeyCreated, M as ApiPortalMe, N as ApiPublicRemix, O as ApiRemixOffer, P as ApiRemixOfferPrice, Q as ApiRemixOffersQuery, R as ApiResponse, T as ApiRewardsBadge, U as ApiRewardsBatchEntry, V as ApiRewardsConfig, W as ApiRewardsLeaderboardEntry, X as ApiRewardsLevel, Y as ApiSearchCollectionResult, Z as ApiSearchCreatorResult, _ as ApiSearchResult, $ as ApiSearchTokenResult, a0 as ApiToken, a1 as ApiTokenBalance, a2 as ApiTokenMetadata, a3 as ApiUsageDay, a4 as ApiUserRewards, a5 as ApiUserWallet, a6 as ApiWalletActivity, a7 as ApiWebhookCreated, a8 as ApiWebhookEndpoint, a9 as AutoRemixOfferParams, aa as CancelOrderIntentParams, ab as ChainFilter, ac as ClaimConditions, ad as CollectionSort, ae as CollectionTokensSort, af as ConfirmRemixOfferParams, ag as ConfirmSelfRemixParams, ah as ConsiderationItem, ai as CreateCheckoutIntentParams, aj as CreateCollectionIntentParams, ak as CreateCounterOfferIntentParams, al as CreateDropParams, am as CreateListingIntentParams, an as CreateMembershipParams, ao as CreateMintIntentParams, ap as CreatePopCollectionParams, aq as CreateRemixOfferParams, ar as CreateSponsorshipOfferParams, as as CreateTicketParams, at as CreateTierIntentParams, au as CreateWebhookParams, av as DropMintStatus, aw as EnforcementDeclaration, ax as FactoryFamilyServiceId, ay as FeeConfig, az as FeeConfigSchema, aA as FulfillOrderIntentParams, aB as IPType, aC as IntentCall, aD as IntentStatus, aE as IntentType, aF as IpAttribute, aG as IpNftMetadata, aH as MakeOfferIntentParams, aI as MedialaneApiError, aJ as MedialaneConfig, aK as MedialaneErrorCode, aL as MintMembershipsParams, aM as MintTicketsParams, aN as OPEN_LICENSES, aO as OfferItem, aP as OpenLicense, aQ as Order, aR as OrderDetails, aS as OrderParameters, aT as OrderStatus, aU as PopBatchEligibilityItem, aV as PopClaimStatus, aW as PopEventType, aX as ProposeSponsorshipParams, aY as RemixOfferStatus, aZ as ResolvedConfig, a_ as ResolvedFeeConfig, a$ as RetryOptions, b0 as ServiceEventDeclaration, b1 as SortOrder, b2 as TenantPlan, b3 as TierServiceId, b4 as TxResult, b5 as WebhookEventType, b6 as WebhookStatus, b7 as resolveConfig, b8 as resolveFeeConfig } from './services-vRjBk3Zn.js';
|
|
3
3
|
import { C as Chain } from './types-sIc3OCpo.js';
|
|
4
4
|
export { A as AdapterTxResult, a as AssetRef, b as CHAINS, c as ChainCoordinates, d as CoordinatesByChain, e as CreateCollectionInput, D as DEFAULT_CHAIN, E as EvmCoordinates, I as IssuanceAdapter, M as MintInput, O as OrderRef, R as RegisterOrderParams, S as SolanaCoordinates, f as StarknetCoordinates, g as StellarCoordinates, V as VenueAdapter, h as getCoordinates, i as getStarknetCoordinates } from './types-sIc3OCpo.js';
|
|
5
5
|
import 'zod';
|
|
@@ -472,6 +472,8 @@ declare function stringifyBigInts(obj: unknown): unknown;
|
|
|
472
472
|
* Convert a u256 represented as { low: string; high: string } to a single BigInt.
|
|
473
473
|
*/
|
|
474
474
|
declare function u256ToBigInt(low: string, high: string): bigint;
|
|
475
|
+
/** Split a bigint into low/high felt252 halves for a Cairo u256 (inverse of `u256ToBigInt`). */
|
|
476
|
+
declare function encodeU256(n: bigint): [string, string];
|
|
475
477
|
|
|
476
478
|
/**
|
|
477
479
|
* Resilient Starknet RPC helpers — the single source of truth for "what counts
|
|
@@ -533,4 +535,47 @@ interface FailoverFetchOptions {
|
|
|
533
535
|
*/
|
|
534
536
|
declare function createFailoverFetch(urls: string[], options?: FailoverFetchOptions): typeof fetch;
|
|
535
537
|
|
|
536
|
-
|
|
538
|
+
/**
|
|
539
|
+
* Shared OpenSea-ERC721 + Berne-Convention metadata builder.
|
|
540
|
+
*
|
|
541
|
+
* Single source of truth for how a Medialane asset's metadata JSON is shaped.
|
|
542
|
+
* Pure function — no network calls, no FormData. Server-safe and chain-neutral.
|
|
543
|
+
*/
|
|
544
|
+
type AssetAttribute = {
|
|
545
|
+
trait_type: string;
|
|
546
|
+
value: string;
|
|
547
|
+
};
|
|
548
|
+
interface AssetMetadata {
|
|
549
|
+
name: string;
|
|
550
|
+
description: string;
|
|
551
|
+
image: string | null;
|
|
552
|
+
external_url: string;
|
|
553
|
+
attributes: AssetAttribute[];
|
|
554
|
+
}
|
|
555
|
+
interface BuildAssetMetadataInput {
|
|
556
|
+
name: string;
|
|
557
|
+
description?: string | null;
|
|
558
|
+
externalUrl?: string | null;
|
|
559
|
+
imageUri?: string | null;
|
|
560
|
+
creator?: string | null;
|
|
561
|
+
ipType?: string | null;
|
|
562
|
+
licenseType?: string | null;
|
|
563
|
+
commercialUse?: string | null;
|
|
564
|
+
derivatives?: string | null;
|
|
565
|
+
attribution?: string | null;
|
|
566
|
+
geographicScope?: string | null;
|
|
567
|
+
aiPolicy?: string | null;
|
|
568
|
+
royalty?: string | null;
|
|
569
|
+
edition?: string | null;
|
|
570
|
+
/** Already-extracted `tmpl_*` template/custom traits (reserved names are filtered here). */
|
|
571
|
+
templateTraits?: {
|
|
572
|
+
traitType: string;
|
|
573
|
+
value: string;
|
|
574
|
+
}[];
|
|
575
|
+
/** ISO date (YYYY-MM-DD) stamped as the Berne registration trait. Defaults to today. */
|
|
576
|
+
registrationDate?: string;
|
|
577
|
+
}
|
|
578
|
+
declare const RESERVED_TRAITS: Set<string>;
|
|
579
|
+
declare function buildAssetMetadata(input: BuildAssetMetadataInput): AssetMetadata;
|
|
580
|
+
|
|
581
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_COLLECTION_CLASS_HASH, STARKNET_IP_CLUB_FACTORY_CONTRACT, STARKNET_IP_SPONSORSHIP_CLASS_HASH, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, SUPPORTED_URL_CHAINS, ServiceCapability, ServiceDefinition, type ServiceId, type SupportedToken, type SupportedTokenSymbol, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createFailoverFetch, encodeU256, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.js
CHANGED
|
@@ -443,6 +443,9 @@ var ApiClient = class {
|
|
|
443
443
|
createCancelIntent(params) {
|
|
444
444
|
return this.post("/v1/intents/cancel", params);
|
|
445
445
|
}
|
|
446
|
+
createCheckoutIntent(params) {
|
|
447
|
+
return this.post("/v1/intents/checkout", params);
|
|
448
|
+
}
|
|
446
449
|
getIntent(id) {
|
|
447
450
|
return this.get(`/v1/intents/${id}`);
|
|
448
451
|
}
|
|
@@ -458,6 +461,9 @@ var ApiClient = class {
|
|
|
458
461
|
createCollectionIntent(params) {
|
|
459
462
|
return this.post("/v1/intents/create-collection", params);
|
|
460
463
|
}
|
|
464
|
+
createTierIntent(params) {
|
|
465
|
+
return this.post("/v1/intents/create-tier", params);
|
|
466
|
+
}
|
|
461
467
|
/**
|
|
462
468
|
* Create a counter-offer intent. The seller proposes a new price in response
|
|
463
469
|
* to a buyer's active bid. clerkToken is optional — the endpoint authenticates
|
|
@@ -1303,6 +1309,12 @@ function stringifyBigInts(obj) {
|
|
|
1303
1309
|
function u256ToBigInt(low, high) {
|
|
1304
1310
|
return BigInt(low) + (BigInt(high) << 128n);
|
|
1305
1311
|
}
|
|
1312
|
+
function encodeU256(n) {
|
|
1313
|
+
return [
|
|
1314
|
+
(n & 0xffffffffffffffffffffffffffffffffn).toString(),
|
|
1315
|
+
(n >> 128n).toString()
|
|
1316
|
+
];
|
|
1317
|
+
}
|
|
1306
1318
|
|
|
1307
1319
|
// src/utils/rpc.ts
|
|
1308
1320
|
var PUBLIC_RPC_FALLBACKS = [
|
|
@@ -1357,6 +1369,60 @@ function createFailoverFetch(urls, options = {}) {
|
|
|
1357
1369
|
return failover;
|
|
1358
1370
|
}
|
|
1359
1371
|
|
|
1360
|
-
|
|
1372
|
+
// src/metadata.ts
|
|
1373
|
+
var RESERVED_TRAITS = /* @__PURE__ */ new Set([
|
|
1374
|
+
"Creator",
|
|
1375
|
+
"IP Type",
|
|
1376
|
+
"License",
|
|
1377
|
+
"Commercial Use",
|
|
1378
|
+
"Derivatives",
|
|
1379
|
+
"Attribution",
|
|
1380
|
+
"Territory",
|
|
1381
|
+
"AI Policy",
|
|
1382
|
+
"Royalty",
|
|
1383
|
+
"Edition",
|
|
1384
|
+
"Standard",
|
|
1385
|
+
"Registration"
|
|
1386
|
+
]);
|
|
1387
|
+
var RESERVED_TRAITS_NORMALIZED = new Set([...RESERVED_TRAITS].map((t) => t.toLowerCase()));
|
|
1388
|
+
function buildAssetMetadata(input) {
|
|
1389
|
+
const attributes = [];
|
|
1390
|
+
if (input.creator) attributes.push({ trait_type: "Creator", value: input.creator });
|
|
1391
|
+
if (input.ipType) attributes.push({ trait_type: "IP Type", value: input.ipType });
|
|
1392
|
+
if (input.licenseType) attributes.push({ trait_type: "License", value: input.licenseType });
|
|
1393
|
+
if (input.commercialUse) attributes.push({ trait_type: "Commercial Use", value: input.commercialUse });
|
|
1394
|
+
if (input.derivatives) attributes.push({ trait_type: "Derivatives", value: input.derivatives });
|
|
1395
|
+
if (input.attribution) attributes.push({ trait_type: "Attribution", value: input.attribution });
|
|
1396
|
+
if (input.geographicScope) attributes.push({ trait_type: "Territory", value: input.geographicScope });
|
|
1397
|
+
if (input.aiPolicy) attributes.push({ trait_type: "AI Policy", value: input.aiPolicy });
|
|
1398
|
+
if (input.royalty) {
|
|
1399
|
+
const num = parseFloat(String(input.royalty).replace("%", ""));
|
|
1400
|
+
if (!isNaN(num) && num > 0) attributes.push({ trait_type: "Royalty", value: `${num}%` });
|
|
1401
|
+
}
|
|
1402
|
+
if (input.edition) attributes.push({ trait_type: "Edition", value: input.edition });
|
|
1403
|
+
for (const t of input.templateTraits ?? []) {
|
|
1404
|
+
const traitType = t.traitType?.trim() ?? "";
|
|
1405
|
+
const traitValue = String(t.value ?? "").trim();
|
|
1406
|
+
if (!traitType || !traitValue || RESERVED_TRAITS_NORMALIZED.has(traitType.toLowerCase())) continue;
|
|
1407
|
+
if (traitType.length > 64 || traitValue.length > 512) continue;
|
|
1408
|
+
attributes.push({ trait_type: traitType, value: traitValue });
|
|
1409
|
+
}
|
|
1410
|
+
if (input.licenseType) {
|
|
1411
|
+
attributes.push({ trait_type: "Standard", value: "Berne Convention" });
|
|
1412
|
+
attributes.push({
|
|
1413
|
+
trait_type: "Registration",
|
|
1414
|
+
value: input.registrationDate ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
return {
|
|
1418
|
+
name: input.name,
|
|
1419
|
+
description: input.description ?? "",
|
|
1420
|
+
image: input.imageUri ?? null,
|
|
1421
|
+
external_url: input.externalUrl || "https://medialane.io",
|
|
1422
|
+
attributes
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
export { ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY, FeeConfigSchema, MedialaneApiError, OPEN_LICENSES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, STARKNET_COLLECTION_1155_CLASS_HASH, STARKNET_COLLECTION_1155_CONTRACT, STARKNET_COLLECTION_1155_FACTORY_CLASS_HASH, STARKNET_COLLECTION_1155_START_BLOCK, STARKNET_COLLECTION_721_CONTRACT, STARKNET_COLLECTION_721_START_BLOCK, STARKNET_CREATOR_COIN_CLASS_HASH, STARKNET_CREATOR_COIN_EKUBO_LAUNCHER, STARKNET_CREATOR_COIN_FACTORY_CLASS_HASH, STARKNET_CREATOR_COIN_FACTORY_CONTRACT, STARKNET_CREATOR_COIN_START_BLOCK, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_IPCOLLECTION_CLASS_HASH, STARKNET_IPNFT_CLASS_HASH, STARKNET_IP_CLUB_COLLECTION_CLASS_HASH, STARKNET_IP_CLUB_FACTORY_CONTRACT, STARKNET_IP_SPONSORSHIP_CLASS_HASH, STARKNET_IP_SPONSORSHIP_CONTRACT, STARKNET_IP_TICKETS_FACTORY_CONTRACT, STARKNET_IP_TICKET_COLLECTION_CLASS_HASH, STARKNET_MARKETPLACE_1155_CLASS_HASH, STARKNET_MARKETPLACE_1155_CONTRACT, STARKNET_MARKETPLACE_1155_START_BLOCK, STARKNET_MARKETPLACE_721_CLASS_HASH, STARKNET_MARKETPLACE_721_CONTRACT, STARKNET_MARKETPLACE_721_START_BLOCK, STARKNET_NFTCOMMENTS_CONTRACT, STARKNET_POP_COLLECTION_CLASS_HASH, STARKNET_POP_FACTORY_CONTRACT, SUPPORTED_TOKENS, SUPPORTED_URL_CHAINS, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createFailoverFetch, encodeU256, formatAmount, getCoordinates, getListableTokens, getService, getServicesByCapability, getStarknetCoordinates, getTokenByAddress, getTokenBySymbol, hasCapability, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1361
1427
|
//# sourceMappingURL=index.js.map
|
|
1362
1428
|
//# sourceMappingURL=index.js.map
|