@medialane/sdk 0.4.0 → 0.4.2
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/README.md +41 -21
- package/dist/index.cjs +92 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -5
- package/dist/index.d.ts +92 -5
- package/dist/index.js +92 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,22 +7,27 @@ declare const SUPPORTED_TOKENS: readonly [{
|
|
|
7
7
|
readonly symbol: "USDC";
|
|
8
8
|
readonly address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb";
|
|
9
9
|
readonly decimals: 6;
|
|
10
|
-
|
|
11
|
-
readonly symbol: "USDC.e";
|
|
12
|
-
readonly address: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";
|
|
13
|
-
readonly decimals: 6;
|
|
10
|
+
readonly listable: true;
|
|
14
11
|
}, {
|
|
15
12
|
readonly symbol: "USDT";
|
|
16
13
|
readonly address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8";
|
|
17
14
|
readonly decimals: 6;
|
|
15
|
+
readonly listable: true;
|
|
18
16
|
}, {
|
|
19
17
|
readonly symbol: "ETH";
|
|
20
18
|
readonly address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";
|
|
21
19
|
readonly decimals: 18;
|
|
20
|
+
readonly listable: true;
|
|
22
21
|
}, {
|
|
23
22
|
readonly symbol: "STRK";
|
|
24
23
|
readonly address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d";
|
|
25
24
|
readonly decimals: 18;
|
|
25
|
+
readonly listable: true;
|
|
26
|
+
}, {
|
|
27
|
+
readonly symbol: "WBTC";
|
|
28
|
+
readonly address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac";
|
|
29
|
+
readonly decimals: 8;
|
|
30
|
+
readonly listable: true;
|
|
26
31
|
}];
|
|
27
32
|
type SupportedTokenSymbol = (typeof SUPPORTED_TOKENS)[number]["symbol"];
|
|
28
33
|
declare const SUPPORTED_NETWORKS: readonly ["mainnet", "sepolia"];
|
|
@@ -361,6 +366,9 @@ interface ApiCollection {
|
|
|
361
366
|
startBlock: string;
|
|
362
367
|
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
363
368
|
isKnown: boolean;
|
|
369
|
+
source: "MEDIALANE_REGISTRY" | "EXTERNAL" | "PARTNERSHIP" | "IP_TICKET" | "IP_CLUB" | "GAME";
|
|
370
|
+
claimedBy: string | null;
|
|
371
|
+
profile?: ApiCollectionProfile | null;
|
|
364
372
|
floorPrice: string | null;
|
|
365
373
|
totalVolume: string | null;
|
|
366
374
|
holderCount: number | null;
|
|
@@ -532,6 +540,50 @@ interface CreateWebhookParams {
|
|
|
532
540
|
events: WebhookEventType[];
|
|
533
541
|
label?: string;
|
|
534
542
|
}
|
|
543
|
+
interface ApiCollectionProfile {
|
|
544
|
+
contractAddress: string;
|
|
545
|
+
chain: string;
|
|
546
|
+
displayName: string | null;
|
|
547
|
+
description: string | null;
|
|
548
|
+
image: string | null;
|
|
549
|
+
bannerImage: string | null;
|
|
550
|
+
websiteUrl: string | null;
|
|
551
|
+
twitterUrl: string | null;
|
|
552
|
+
discordUrl: string | null;
|
|
553
|
+
telegramUrl: string | null;
|
|
554
|
+
updatedBy: string | null;
|
|
555
|
+
updatedAt: string;
|
|
556
|
+
}
|
|
557
|
+
interface ApiCreatorProfile {
|
|
558
|
+
walletAddress: string;
|
|
559
|
+
chain: string;
|
|
560
|
+
displayName: string | null;
|
|
561
|
+
bio: string | null;
|
|
562
|
+
avatarImage: string | null;
|
|
563
|
+
bannerImage: string | null;
|
|
564
|
+
websiteUrl: string | null;
|
|
565
|
+
twitterUrl: string | null;
|
|
566
|
+
discordUrl: string | null;
|
|
567
|
+
telegramUrl: string | null;
|
|
568
|
+
updatedAt: string;
|
|
569
|
+
}
|
|
570
|
+
interface ApiCollectionClaim {
|
|
571
|
+
id: string;
|
|
572
|
+
contractAddress: string;
|
|
573
|
+
chain: string;
|
|
574
|
+
claimantAddress: string | null;
|
|
575
|
+
status: "PENDING" | "AUTO_APPROVED" | "APPROVED" | "REJECTED";
|
|
576
|
+
verificationMethod: "ONCHAIN" | "SIGNATURE" | "MANUAL";
|
|
577
|
+
createdAt: string;
|
|
578
|
+
}
|
|
579
|
+
interface ApiAdminCollectionClaim extends ApiCollectionClaim {
|
|
580
|
+
claimantEmail: string | null;
|
|
581
|
+
notes: string | null;
|
|
582
|
+
adminNotes: string | null;
|
|
583
|
+
reviewedBy: string | null;
|
|
584
|
+
reviewedAt: string | null;
|
|
585
|
+
updatedAt: string;
|
|
586
|
+
}
|
|
535
587
|
|
|
536
588
|
declare class MedialaneApiError extends Error {
|
|
537
589
|
readonly status: number;
|
|
@@ -590,6 +642,36 @@ declare class ApiClient {
|
|
|
590
642
|
id: string;
|
|
591
643
|
status: string;
|
|
592
644
|
}>>;
|
|
645
|
+
/**
|
|
646
|
+
* Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
|
|
647
|
+
* Authorization: Bearer (Clerk JWT) simultaneously.
|
|
648
|
+
*/
|
|
649
|
+
claimCollection(contractAddress: string, walletAddress: string, clerkToken: string): Promise<{
|
|
650
|
+
verified: boolean;
|
|
651
|
+
collection?: ApiCollection;
|
|
652
|
+
reason?: string;
|
|
653
|
+
}>;
|
|
654
|
+
/**
|
|
655
|
+
* Path 3: Manual off-chain claim request (email-based).
|
|
656
|
+
*/
|
|
657
|
+
requestCollectionClaim(params: {
|
|
658
|
+
contractAddress: string;
|
|
659
|
+
walletAddress?: string;
|
|
660
|
+
email: string;
|
|
661
|
+
notes?: string;
|
|
662
|
+
}): Promise<{
|
|
663
|
+
claim: ApiCollectionClaim;
|
|
664
|
+
}>;
|
|
665
|
+
getCollectionProfile(contractAddress: string): Promise<ApiCollectionProfile | null>;
|
|
666
|
+
/**
|
|
667
|
+
* Update collection profile. Requires Clerk JWT for ownership check.
|
|
668
|
+
*/
|
|
669
|
+
updateCollectionProfile(contractAddress: string, data: Partial<Omit<ApiCollectionProfile, "contractAddress" | "chain" | "updatedBy" | "updatedAt">>, clerkToken: string): Promise<ApiCollectionProfile>;
|
|
670
|
+
getCreatorProfile(walletAddress: string): Promise<ApiCreatorProfile | null>;
|
|
671
|
+
/**
|
|
672
|
+
* Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
|
|
673
|
+
*/
|
|
674
|
+
updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
|
|
593
675
|
}
|
|
594
676
|
|
|
595
677
|
declare class MedialaneClient {
|
|
@@ -1006,6 +1088,11 @@ declare function getTokenByAddress(address: string): SupportedToken | undefined;
|
|
|
1006
1088
|
* Find a supported token by its symbol (case-insensitive).
|
|
1007
1089
|
*/
|
|
1008
1090
|
declare function getTokenBySymbol(symbol: string): SupportedToken | undefined;
|
|
1091
|
+
/**
|
|
1092
|
+
* Return all tokens available for use in listing and offer dialogs.
|
|
1093
|
+
* Tokens with listable: false appear only as marketplace filter chips.
|
|
1094
|
+
*/
|
|
1095
|
+
declare function getListableTokens(): ReadonlyArray<SupportedToken>;
|
|
1009
1096
|
|
|
1010
1097
|
/**
|
|
1011
1098
|
* Recursively convert all BigInt values to their decimal string representations.
|
|
@@ -1032,4 +1119,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
|
|
|
1032
1119
|
*/
|
|
1033
1120
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
1034
1121
|
|
|
1035
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, ApiClient, type ApiCollection, type ApiCollectionsQuery, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1122
|
+
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,22 +7,27 @@ declare const SUPPORTED_TOKENS: readonly [{
|
|
|
7
7
|
readonly symbol: "USDC";
|
|
8
8
|
readonly address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb";
|
|
9
9
|
readonly decimals: 6;
|
|
10
|
-
|
|
11
|
-
readonly symbol: "USDC.e";
|
|
12
|
-
readonly address: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8";
|
|
13
|
-
readonly decimals: 6;
|
|
10
|
+
readonly listable: true;
|
|
14
11
|
}, {
|
|
15
12
|
readonly symbol: "USDT";
|
|
16
13
|
readonly address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8";
|
|
17
14
|
readonly decimals: 6;
|
|
15
|
+
readonly listable: true;
|
|
18
16
|
}, {
|
|
19
17
|
readonly symbol: "ETH";
|
|
20
18
|
readonly address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";
|
|
21
19
|
readonly decimals: 18;
|
|
20
|
+
readonly listable: true;
|
|
22
21
|
}, {
|
|
23
22
|
readonly symbol: "STRK";
|
|
24
23
|
readonly address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d";
|
|
25
24
|
readonly decimals: 18;
|
|
25
|
+
readonly listable: true;
|
|
26
|
+
}, {
|
|
27
|
+
readonly symbol: "WBTC";
|
|
28
|
+
readonly address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac";
|
|
29
|
+
readonly decimals: 8;
|
|
30
|
+
readonly listable: true;
|
|
26
31
|
}];
|
|
27
32
|
type SupportedTokenSymbol = (typeof SUPPORTED_TOKENS)[number]["symbol"];
|
|
28
33
|
declare const SUPPORTED_NETWORKS: readonly ["mainnet", "sepolia"];
|
|
@@ -361,6 +366,9 @@ interface ApiCollection {
|
|
|
361
366
|
startBlock: string;
|
|
362
367
|
metadataStatus: "PENDING" | "FETCHING" | "FETCHED" | "FAILED";
|
|
363
368
|
isKnown: boolean;
|
|
369
|
+
source: "MEDIALANE_REGISTRY" | "EXTERNAL" | "PARTNERSHIP" | "IP_TICKET" | "IP_CLUB" | "GAME";
|
|
370
|
+
claimedBy: string | null;
|
|
371
|
+
profile?: ApiCollectionProfile | null;
|
|
364
372
|
floorPrice: string | null;
|
|
365
373
|
totalVolume: string | null;
|
|
366
374
|
holderCount: number | null;
|
|
@@ -532,6 +540,50 @@ interface CreateWebhookParams {
|
|
|
532
540
|
events: WebhookEventType[];
|
|
533
541
|
label?: string;
|
|
534
542
|
}
|
|
543
|
+
interface ApiCollectionProfile {
|
|
544
|
+
contractAddress: string;
|
|
545
|
+
chain: string;
|
|
546
|
+
displayName: string | null;
|
|
547
|
+
description: string | null;
|
|
548
|
+
image: string | null;
|
|
549
|
+
bannerImage: string | null;
|
|
550
|
+
websiteUrl: string | null;
|
|
551
|
+
twitterUrl: string | null;
|
|
552
|
+
discordUrl: string | null;
|
|
553
|
+
telegramUrl: string | null;
|
|
554
|
+
updatedBy: string | null;
|
|
555
|
+
updatedAt: string;
|
|
556
|
+
}
|
|
557
|
+
interface ApiCreatorProfile {
|
|
558
|
+
walletAddress: string;
|
|
559
|
+
chain: string;
|
|
560
|
+
displayName: string | null;
|
|
561
|
+
bio: string | null;
|
|
562
|
+
avatarImage: string | null;
|
|
563
|
+
bannerImage: string | null;
|
|
564
|
+
websiteUrl: string | null;
|
|
565
|
+
twitterUrl: string | null;
|
|
566
|
+
discordUrl: string | null;
|
|
567
|
+
telegramUrl: string | null;
|
|
568
|
+
updatedAt: string;
|
|
569
|
+
}
|
|
570
|
+
interface ApiCollectionClaim {
|
|
571
|
+
id: string;
|
|
572
|
+
contractAddress: string;
|
|
573
|
+
chain: string;
|
|
574
|
+
claimantAddress: string | null;
|
|
575
|
+
status: "PENDING" | "AUTO_APPROVED" | "APPROVED" | "REJECTED";
|
|
576
|
+
verificationMethod: "ONCHAIN" | "SIGNATURE" | "MANUAL";
|
|
577
|
+
createdAt: string;
|
|
578
|
+
}
|
|
579
|
+
interface ApiAdminCollectionClaim extends ApiCollectionClaim {
|
|
580
|
+
claimantEmail: string | null;
|
|
581
|
+
notes: string | null;
|
|
582
|
+
adminNotes: string | null;
|
|
583
|
+
reviewedBy: string | null;
|
|
584
|
+
reviewedAt: string | null;
|
|
585
|
+
updatedAt: string;
|
|
586
|
+
}
|
|
535
587
|
|
|
536
588
|
declare class MedialaneApiError extends Error {
|
|
537
589
|
readonly status: number;
|
|
@@ -590,6 +642,36 @@ declare class ApiClient {
|
|
|
590
642
|
id: string;
|
|
591
643
|
status: string;
|
|
592
644
|
}>>;
|
|
645
|
+
/**
|
|
646
|
+
* Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
|
|
647
|
+
* Authorization: Bearer (Clerk JWT) simultaneously.
|
|
648
|
+
*/
|
|
649
|
+
claimCollection(contractAddress: string, walletAddress: string, clerkToken: string): Promise<{
|
|
650
|
+
verified: boolean;
|
|
651
|
+
collection?: ApiCollection;
|
|
652
|
+
reason?: string;
|
|
653
|
+
}>;
|
|
654
|
+
/**
|
|
655
|
+
* Path 3: Manual off-chain claim request (email-based).
|
|
656
|
+
*/
|
|
657
|
+
requestCollectionClaim(params: {
|
|
658
|
+
contractAddress: string;
|
|
659
|
+
walletAddress?: string;
|
|
660
|
+
email: string;
|
|
661
|
+
notes?: string;
|
|
662
|
+
}): Promise<{
|
|
663
|
+
claim: ApiCollectionClaim;
|
|
664
|
+
}>;
|
|
665
|
+
getCollectionProfile(contractAddress: string): Promise<ApiCollectionProfile | null>;
|
|
666
|
+
/**
|
|
667
|
+
* Update collection profile. Requires Clerk JWT for ownership check.
|
|
668
|
+
*/
|
|
669
|
+
updateCollectionProfile(contractAddress: string, data: Partial<Omit<ApiCollectionProfile, "contractAddress" | "chain" | "updatedBy" | "updatedAt">>, clerkToken: string): Promise<ApiCollectionProfile>;
|
|
670
|
+
getCreatorProfile(walletAddress: string): Promise<ApiCreatorProfile | null>;
|
|
671
|
+
/**
|
|
672
|
+
* Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
|
|
673
|
+
*/
|
|
674
|
+
updateCreatorProfile(walletAddress: string, data: Partial<Omit<ApiCreatorProfile, "walletAddress" | "chain" | "updatedAt">>, clerkToken: string): Promise<ApiCreatorProfile>;
|
|
593
675
|
}
|
|
594
676
|
|
|
595
677
|
declare class MedialaneClient {
|
|
@@ -1006,6 +1088,11 @@ declare function getTokenByAddress(address: string): SupportedToken | undefined;
|
|
|
1006
1088
|
* Find a supported token by its symbol (case-insensitive).
|
|
1007
1089
|
*/
|
|
1008
1090
|
declare function getTokenBySymbol(symbol: string): SupportedToken | undefined;
|
|
1091
|
+
/**
|
|
1092
|
+
* Return all tokens available for use in listing and offer dialogs.
|
|
1093
|
+
* Tokens with listable: false appear only as marketplace filter chips.
|
|
1094
|
+
*/
|
|
1095
|
+
declare function getListableTokens(): ReadonlyArray<SupportedToken>;
|
|
1009
1096
|
|
|
1010
1097
|
/**
|
|
1011
1098
|
* Recursively convert all BigInt values to their decimal string representations.
|
|
@@ -1032,4 +1119,4 @@ declare function buildFulfillmentTypedData(message: Record<string, unknown>, cha
|
|
|
1032
1119
|
*/
|
|
1033
1120
|
declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId): TypedData;
|
|
1034
1121
|
|
|
1035
|
-
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, ApiClient, type ApiCollection, type ApiCollectionsQuery, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1122
|
+
export { type ActivityType, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionsQuery, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenMetadata, type ApiUsageDay, type ApiWebhookCreated, type ApiWebhookEndpoint, COLLECTION_CONTRACT_MAINNET, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type CollectionSort, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreateWebhookParams, DEFAULT_RPC_URLS, type FulfillOrderIntentParams, type FulfillOrderParams, type Fulfillment, IPMarketplaceABI, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_CONTRACT_MAINNET, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintParams, type Network, type OfferItem, type Order, type OrderParameters, type OrderStatus, type ResolvedConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, type WebhookEventType, type WebhookStatus, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.js
CHANGED
|
@@ -10,31 +10,35 @@ var MARKETPLACE_CONTRACT_SEPOLIA = "";
|
|
|
10
10
|
var COLLECTION_CONTRACT_SEPOLIA = "";
|
|
11
11
|
var SUPPORTED_TOKENS = [
|
|
12
12
|
{
|
|
13
|
-
// Circle-native USDC on Starknet (canonical
|
|
13
|
+
// Circle-native USDC on Starknet (canonical)
|
|
14
14
|
symbol: "USDC",
|
|
15
15
|
address: "0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb",
|
|
16
|
-
decimals: 6
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
// Bridged USDC.e (Ethereum USDC bridged via Starkgate)
|
|
20
|
-
symbol: "USDC.e",
|
|
21
|
-
address: "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
|
|
22
|
-
decimals: 6
|
|
16
|
+
decimals: 6,
|
|
17
|
+
listable: true
|
|
23
18
|
},
|
|
24
19
|
{
|
|
25
20
|
symbol: "USDT",
|
|
26
21
|
address: "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
|
|
27
|
-
decimals: 6
|
|
22
|
+
decimals: 6,
|
|
23
|
+
listable: true
|
|
28
24
|
},
|
|
29
25
|
{
|
|
30
26
|
symbol: "ETH",
|
|
31
27
|
address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
|
|
32
|
-
decimals: 18
|
|
28
|
+
decimals: 18,
|
|
29
|
+
listable: true
|
|
33
30
|
},
|
|
34
31
|
{
|
|
35
32
|
symbol: "STRK",
|
|
36
33
|
address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
|
|
37
|
-
decimals: 18
|
|
34
|
+
decimals: 18,
|
|
35
|
+
listable: true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
symbol: "WBTC",
|
|
39
|
+
address: "0x03fe2b97c1fd336e750087d68b9b867997fd64a2661ff3ca5a7c771641e8e7ac",
|
|
40
|
+
decimals: 8,
|
|
41
|
+
listable: true
|
|
38
42
|
}
|
|
39
43
|
];
|
|
40
44
|
var DEFAULT_CURRENCY = "USDC";
|
|
@@ -396,6 +400,9 @@ function getTokenBySymbol(symbol) {
|
|
|
396
400
|
const upper = symbol.toUpperCase();
|
|
397
401
|
return SUPPORTED_TOKENS.find((t) => t.symbol === upper);
|
|
398
402
|
}
|
|
403
|
+
function getListableTokens() {
|
|
404
|
+
return SUPPORTED_TOKENS.filter((t) => t.listable);
|
|
405
|
+
}
|
|
399
406
|
function buildOrderTypedData(message, chainId) {
|
|
400
407
|
return {
|
|
401
408
|
domain: {
|
|
@@ -1174,6 +1181,79 @@ var ApiClient = class {
|
|
|
1174
1181
|
`/v1/portal/webhooks/${id}`
|
|
1175
1182
|
);
|
|
1176
1183
|
}
|
|
1184
|
+
// ─── Collection Claims ──────────────────────────────────────────────────────
|
|
1185
|
+
/**
|
|
1186
|
+
* Path 1: On-chain auto claim. Sends both x-api-key (tenant auth) and
|
|
1187
|
+
* Authorization: Bearer (Clerk JWT) simultaneously.
|
|
1188
|
+
*/
|
|
1189
|
+
async claimCollection(contractAddress, walletAddress, clerkToken) {
|
|
1190
|
+
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/claim`;
|
|
1191
|
+
const res = await fetch(url, {
|
|
1192
|
+
method: "POST",
|
|
1193
|
+
headers: {
|
|
1194
|
+
"x-api-key": this.baseHeaders["x-api-key"] ?? "",
|
|
1195
|
+
"Content-Type": "application/json",
|
|
1196
|
+
"Authorization": `Bearer ${clerkToken}`
|
|
1197
|
+
},
|
|
1198
|
+
body: JSON.stringify({ contractAddress, walletAddress })
|
|
1199
|
+
});
|
|
1200
|
+
return res.json();
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Path 3: Manual off-chain claim request (email-based).
|
|
1204
|
+
*/
|
|
1205
|
+
requestCollectionClaim(params) {
|
|
1206
|
+
return this.request("/v1/collections/claim/request", {
|
|
1207
|
+
method: "POST",
|
|
1208
|
+
body: JSON.stringify(params)
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
// ─── Collection Profiles ────────────────────────────────────────────────────
|
|
1212
|
+
async getCollectionProfile(contractAddress) {
|
|
1213
|
+
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/${normalizeAddress(contractAddress)}/profile`;
|
|
1214
|
+
const res = await fetch(url, { headers: this.baseHeaders });
|
|
1215
|
+
if (res.status === 404) return null;
|
|
1216
|
+
return res.json();
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Update collection profile. Requires Clerk JWT for ownership check.
|
|
1220
|
+
*/
|
|
1221
|
+
async updateCollectionProfile(contractAddress, data, clerkToken) {
|
|
1222
|
+
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/collections/${normalizeAddress(contractAddress)}/profile`;
|
|
1223
|
+
const res = await fetch(url, {
|
|
1224
|
+
method: "PATCH",
|
|
1225
|
+
headers: {
|
|
1226
|
+
"x-api-key": this.baseHeaders["x-api-key"] ?? "",
|
|
1227
|
+
"Content-Type": "application/json",
|
|
1228
|
+
"Authorization": `Bearer ${clerkToken}`
|
|
1229
|
+
},
|
|
1230
|
+
body: JSON.stringify(data)
|
|
1231
|
+
});
|
|
1232
|
+
return res.json();
|
|
1233
|
+
}
|
|
1234
|
+
// ─── Creator Profiles ───────────────────────────────────────────────────────
|
|
1235
|
+
async getCreatorProfile(walletAddress) {
|
|
1236
|
+
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/creators/${normalizeAddress(walletAddress)}/profile`;
|
|
1237
|
+
const res = await fetch(url, { headers: this.baseHeaders });
|
|
1238
|
+
if (res.status === 404) return null;
|
|
1239
|
+
return res.json();
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Update creator profile. Requires Clerk JWT; wallet must match authenticated user.
|
|
1243
|
+
*/
|
|
1244
|
+
async updateCreatorProfile(walletAddress, data, clerkToken) {
|
|
1245
|
+
const url = `${this.baseUrl.replace(/\/$/, "")}/v1/creators/${normalizeAddress(walletAddress)}/profile`;
|
|
1246
|
+
const res = await fetch(url, {
|
|
1247
|
+
method: "PATCH",
|
|
1248
|
+
headers: {
|
|
1249
|
+
"x-api-key": this.baseHeaders["x-api-key"] ?? "",
|
|
1250
|
+
"Content-Type": "application/json",
|
|
1251
|
+
"Authorization": `Bearer ${clerkToken}`
|
|
1252
|
+
},
|
|
1253
|
+
body: JSON.stringify(data)
|
|
1254
|
+
});
|
|
1255
|
+
return res.json();
|
|
1256
|
+
}
|
|
1177
1257
|
};
|
|
1178
1258
|
|
|
1179
1259
|
// src/client.ts
|
|
@@ -1206,6 +1286,6 @@ var MedialaneClient = class {
|
|
|
1206
1286
|
}
|
|
1207
1287
|
};
|
|
1208
1288
|
|
|
1209
|
-
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1289
|
+
export { ApiClient, COLLECTION_CONTRACT_MAINNET, DEFAULT_RPC_URLS, IPMarketplaceABI, MARKETPLACE_CONTRACT_MAINNET, MarketplaceModule, MedialaneApiError, MedialaneClient, MedialaneError, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, buildCancellationTypedData, buildFulfillmentTypedData, buildOrderTypedData, formatAmount, getListableTokens, getTokenByAddress, getTokenBySymbol, normalizeAddress, parseAmount, resolveConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1210
1290
|
//# sourceMappingURL=index.js.map
|
|
1211
1291
|
//# sourceMappingURL=index.js.map
|