@medialane/sdk 0.89.0 → 0.91.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 +65 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +61 -1
- package/dist/index.js.map +1 -1
- package/dist/{services-vwXIiRBm.d.cts → services-D3M9dJZg.d.cts} +7 -2
- package/dist/{services-CELm1bdL.d.ts → services-DTkc0lLx.d.ts} +7 -2
- package/dist/starknet/index.d.cts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as AcceptSponsorshipBidIntentParams, b as AcceptSponsorshipProposalIntentParams, c as ActivityType, d as ApiActivitiesQuery, e as ApiActivity, f as ApiActivityPrice, g as ApiAdminCollectionClaim, h as ApiAppSource, i as ApiBusinessProvisioning, j as ApiChain, k as ApiCheckoutIntentResult, l as ApiClient, m as ApiCoin, n as ApiCoinsQuery, o as ApiCollection, p as ApiCollectionClaim, q as ApiCollectionProfile, r as ApiCollectionSlugClaim, s as ApiCollectionsQuery, t as ApiComment, u as ApiCounterOffersQuery, v as ApiCreatorListResult, w as ApiCreatorProfile, x as ApiIntent, y as ApiIntentCreated, z as ApiKeyStatus, B as ApiMeta, C as ApiMetadataSignedUrl, D as ApiMetadataUpload, E as ApiOrder, F as ApiOrderConsideration, G as ApiOrderOffer, H as ApiOrderPrice, I as ApiOrderTokenMeta, J as ApiOrderTxHash, K as ApiOrdersQuery, L as ApiPointEvent, M as ApiPortalKey, N as ApiPortalKeyCreated, O as ApiPortalMe, P as ApiPublicRemix, Q as ApiRemixOffer, T as ApiRemixOfferPrice, U as ApiRemixOffersQuery, V as ApiResponse, W as ApiRewardsBadge, X as ApiRewardsBatchEntry, Y as ApiRewardsConfig, Z as ApiRewardsLeaderboardEntry, _ as ApiRewardsLevel, $ as ApiSearchCollectionResult, a0 as ApiSearchCreatorResult, a1 as ApiSearchResult, a2 as ApiSearchTokenResult, a3 as ApiToken, a4 as ApiTokenBalance, a5 as ApiTokenMetadata, a6 as ApiUsageDay, a7 as ApiUserRewards, a8 as ApiUserWallet, a9 as ApiWalletActivity, aa as ApiWebhookCreated, ab as ApiWebhookEndpoint, ac as AutoRemixOfferParams, ad as CancelOrderIntentParams, ae as ChainFilter, af as
|
|
1
|
+
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './services-D3M9dJZg.cjs';
|
|
2
|
+
export { A as AcceptSponsorshipBidIntentParams, b as AcceptSponsorshipProposalIntentParams, c as ActivityType, d as ApiActivitiesQuery, e as ApiActivity, f as ApiActivityPrice, g as ApiAdminCollectionClaim, h as ApiAppSource, i as ApiBusinessProvisioning, j as ApiChain, k as ApiCheckoutIntentResult, l as ApiClient, m as ApiCoin, n as ApiCoinsQuery, o as ApiCollection, p as ApiCollectionClaim, q as ApiCollectionProfile, r as ApiCollectionSlugClaim, s as ApiCollectionsQuery, t as ApiComment, u as ApiCounterOffersQuery, v as ApiCreatorListResult, w as ApiCreatorProfile, x as ApiIntent, y as ApiIntentCreated, z as ApiKeyStatus, B as ApiMeta, C as ApiMetadataSignedUrl, D as ApiMetadataUpload, E as ApiOrder, F as ApiOrderConsideration, G as ApiOrderOffer, H as ApiOrderPrice, I as ApiOrderTokenMeta, J as ApiOrderTxHash, K as ApiOrdersQuery, L as ApiPointEvent, M as ApiPortalKey, N as ApiPortalKeyCreated, O as ApiPortalMe, P as ApiPublicRemix, Q as ApiRemixOffer, T as ApiRemixOfferPrice, U as ApiRemixOffersQuery, V as ApiResponse, W as ApiRewardsBadge, X as ApiRewardsBatchEntry, Y as ApiRewardsConfig, Z as ApiRewardsLeaderboardEntry, _ as ApiRewardsLevel, $ as ApiSearchCollectionResult, a0 as ApiSearchCreatorResult, a1 as ApiSearchResult, a2 as ApiSearchTokenResult, a3 as ApiToken, a4 as ApiTokenBalance, a5 as ApiTokenMetadata, a6 as ApiUsageDay, a7 as ApiUserRewards, a8 as ApiUserWallet, a9 as ApiWalletActivity, aa as ApiWebhookCreated, ab as ApiWebhookEndpoint, ac as AutoRemixOfferParams, ad as CancelOrderIntentParams, ae as ChainFilter, af as CheckoutIntentItem, ag as ClaimConditions, ah as CollectionServiceId, ai as CollectionSort, aj as CollectionTokensSort, ak as ConfirmRemixOfferParams, al as ConfirmSelfRemixParams, am as ConsiderationItem, an as CreateCheckoutIntentParams, ao as CreateCoinIntentParams, ap as CreateCollectionIntentParams, aq as CreateCounterOfferIntentParams, ar as CreateDropParams, as as CreateListingIntentParams, at as CreateMembershipParams, au as CreateMintIntentParams, av as CreatePopCollectionParams, aw as CreateRemixOfferParams, ax as CreateSponsorshipOfferIntentParams, ay as CreateSponsorshipOfferParams, az as CreateSponsorshipProposalIntentParams, aA as CreateTicketParams, aB as CreateTierIntentParams, aC as CreateWebhookParams, aD as DropMintStatus, aE as EnforcementDeclaration, aF as FactoryFamilyServiceId, aG as FeeConfig, aH as FeeConfigSchema, aI as FulfillOrderIntentParams, aJ as IPType, aK as IntentCall, aL as IntentStatus, aM as IntentType, aN as IpAttribute, aO as IpNftMetadata, aP as LaunchCoinIntentParams, aQ as MakeOfferIntentParams, aR as MedialaneApiError, aS as MedialaneConfig, aT as MedialaneErrorCode, aU as MintMembershipsParams, aV as MintTicketsParams, aW as OPEN_LICENSES, aX as OfferItem, aY as OpenLicense, aZ as Order, a_ as OrderDetails, a$ as OrderParameters, b0 as OrderStatus, b1 as PlaceSponsorshipBidIntentParams, b2 as PopBatchEligibilityItem, b3 as PopClaimStatus, b4 as PopEventType, b5 as ProposeSponsorshipParams, b6 as RejectSponsorshipProposalIntentParams, b7 as RemixOfferStatus, b8 as ResolvedConfig, b9 as RetractSponsorshipBidIntentParams, ba as RetryOptions, bb as ServiceEventDeclaration, bc as SetSponsorshipOfferOpenIntentParams, bd as SortOrder, be as TenantPlan, bf as TierServiceId, bg as TxResult, bh as WebhookEventType, bi as WebhookStatus, bj as WithdrawSponsorshipProposalIntentParams, bk as resolveConfig, bl as resolveFeeConfig } from './services-D3M9dJZg.cjs';
|
|
3
3
|
import { C as Chain } from './types-nPIXtCF5.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-nPIXtCF5.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -426,6 +426,17 @@ interface BackendProxyConfig {
|
|
|
426
426
|
}
|
|
427
427
|
declare function createBackendProxyHandler(config: BackendProxyConfig): (req: Request) => Promise<Response>;
|
|
428
428
|
|
|
429
|
+
declare const ALLOWED_IMAGE_CONTENT_TYPES: Set<string>;
|
|
430
|
+
declare const MAX_IMAGE_REDIRECTS = 5;
|
|
431
|
+
declare const MAX_IMAGE_PROXY_BYTES: number;
|
|
432
|
+
declare function isPrivateHost(hostname: string): boolean;
|
|
433
|
+
declare function validateUrl(raw: string): {
|
|
434
|
+
url: URL;
|
|
435
|
+
} | {
|
|
436
|
+
error: string;
|
|
437
|
+
status: number;
|
|
438
|
+
};
|
|
439
|
+
|
|
429
440
|
interface BackendMetadataConfig {
|
|
430
441
|
backendUrl: string;
|
|
431
442
|
apiKey: string;
|
|
@@ -507,4 +518,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
507
518
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
508
519
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
509
520
|
|
|
510
|
-
export { type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, ResolvedFeeConfig, type RpcProxyConfig, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend };
|
|
521
|
+
export { ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, ResolvedFeeConfig, type RpcProxyConfig, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isPrivateHost, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as AcceptSponsorshipBidIntentParams, b as AcceptSponsorshipProposalIntentParams, c as ActivityType, d as ApiActivitiesQuery, e as ApiActivity, f as ApiActivityPrice, g as ApiAdminCollectionClaim, h as ApiAppSource, i as ApiBusinessProvisioning, j as ApiChain, k as ApiCheckoutIntentResult, l as ApiClient, m as ApiCoin, n as ApiCoinsQuery, o as ApiCollection, p as ApiCollectionClaim, q as ApiCollectionProfile, r as ApiCollectionSlugClaim, s as ApiCollectionsQuery, t as ApiComment, u as ApiCounterOffersQuery, v as ApiCreatorListResult, w as ApiCreatorProfile, x as ApiIntent, y as ApiIntentCreated, z as ApiKeyStatus, B as ApiMeta, C as ApiMetadataSignedUrl, D as ApiMetadataUpload, E as ApiOrder, F as ApiOrderConsideration, G as ApiOrderOffer, H as ApiOrderPrice, I as ApiOrderTokenMeta, J as ApiOrderTxHash, K as ApiOrdersQuery, L as ApiPointEvent, M as ApiPortalKey, N as ApiPortalKeyCreated, O as ApiPortalMe, P as ApiPublicRemix, Q as ApiRemixOffer, T as ApiRemixOfferPrice, U as ApiRemixOffersQuery, V as ApiResponse, W as ApiRewardsBadge, X as ApiRewardsBatchEntry, Y as ApiRewardsConfig, Z as ApiRewardsLeaderboardEntry, _ as ApiRewardsLevel, $ as ApiSearchCollectionResult, a0 as ApiSearchCreatorResult, a1 as ApiSearchResult, a2 as ApiSearchTokenResult, a3 as ApiToken, a4 as ApiTokenBalance, a5 as ApiTokenMetadata, a6 as ApiUsageDay, a7 as ApiUserRewards, a8 as ApiUserWallet, a9 as ApiWalletActivity, aa as ApiWebhookCreated, ab as ApiWebhookEndpoint, ac as AutoRemixOfferParams, ad as CancelOrderIntentParams, ae as ChainFilter, af as
|
|
1
|
+
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './services-DTkc0lLx.js';
|
|
2
|
+
export { A as AcceptSponsorshipBidIntentParams, b as AcceptSponsorshipProposalIntentParams, c as ActivityType, d as ApiActivitiesQuery, e as ApiActivity, f as ApiActivityPrice, g as ApiAdminCollectionClaim, h as ApiAppSource, i as ApiBusinessProvisioning, j as ApiChain, k as ApiCheckoutIntentResult, l as ApiClient, m as ApiCoin, n as ApiCoinsQuery, o as ApiCollection, p as ApiCollectionClaim, q as ApiCollectionProfile, r as ApiCollectionSlugClaim, s as ApiCollectionsQuery, t as ApiComment, u as ApiCounterOffersQuery, v as ApiCreatorListResult, w as ApiCreatorProfile, x as ApiIntent, y as ApiIntentCreated, z as ApiKeyStatus, B as ApiMeta, C as ApiMetadataSignedUrl, D as ApiMetadataUpload, E as ApiOrder, F as ApiOrderConsideration, G as ApiOrderOffer, H as ApiOrderPrice, I as ApiOrderTokenMeta, J as ApiOrderTxHash, K as ApiOrdersQuery, L as ApiPointEvent, M as ApiPortalKey, N as ApiPortalKeyCreated, O as ApiPortalMe, P as ApiPublicRemix, Q as ApiRemixOffer, T as ApiRemixOfferPrice, U as ApiRemixOffersQuery, V as ApiResponse, W as ApiRewardsBadge, X as ApiRewardsBatchEntry, Y as ApiRewardsConfig, Z as ApiRewardsLeaderboardEntry, _ as ApiRewardsLevel, $ as ApiSearchCollectionResult, a0 as ApiSearchCreatorResult, a1 as ApiSearchResult, a2 as ApiSearchTokenResult, a3 as ApiToken, a4 as ApiTokenBalance, a5 as ApiTokenMetadata, a6 as ApiUsageDay, a7 as ApiUserRewards, a8 as ApiUserWallet, a9 as ApiWalletActivity, aa as ApiWebhookCreated, ab as ApiWebhookEndpoint, ac as AutoRemixOfferParams, ad as CancelOrderIntentParams, ae as ChainFilter, af as CheckoutIntentItem, ag as ClaimConditions, ah as CollectionServiceId, ai as CollectionSort, aj as CollectionTokensSort, ak as ConfirmRemixOfferParams, al as ConfirmSelfRemixParams, am as ConsiderationItem, an as CreateCheckoutIntentParams, ao as CreateCoinIntentParams, ap as CreateCollectionIntentParams, aq as CreateCounterOfferIntentParams, ar as CreateDropParams, as as CreateListingIntentParams, at as CreateMembershipParams, au as CreateMintIntentParams, av as CreatePopCollectionParams, aw as CreateRemixOfferParams, ax as CreateSponsorshipOfferIntentParams, ay as CreateSponsorshipOfferParams, az as CreateSponsorshipProposalIntentParams, aA as CreateTicketParams, aB as CreateTierIntentParams, aC as CreateWebhookParams, aD as DropMintStatus, aE as EnforcementDeclaration, aF as FactoryFamilyServiceId, aG as FeeConfig, aH as FeeConfigSchema, aI as FulfillOrderIntentParams, aJ as IPType, aK as IntentCall, aL as IntentStatus, aM as IntentType, aN as IpAttribute, aO as IpNftMetadata, aP as LaunchCoinIntentParams, aQ as MakeOfferIntentParams, aR as MedialaneApiError, aS as MedialaneConfig, aT as MedialaneErrorCode, aU as MintMembershipsParams, aV as MintTicketsParams, aW as OPEN_LICENSES, aX as OfferItem, aY as OpenLicense, aZ as Order, a_ as OrderDetails, a$ as OrderParameters, b0 as OrderStatus, b1 as PlaceSponsorshipBidIntentParams, b2 as PopBatchEligibilityItem, b3 as PopClaimStatus, b4 as PopEventType, b5 as ProposeSponsorshipParams, b6 as RejectSponsorshipProposalIntentParams, b7 as RemixOfferStatus, b8 as ResolvedConfig, b9 as RetractSponsorshipBidIntentParams, ba as RetryOptions, bb as ServiceEventDeclaration, bc as SetSponsorshipOfferOpenIntentParams, bd as SortOrder, be as TenantPlan, bf as TierServiceId, bg as TxResult, bh as WebhookEventType, bi as WebhookStatus, bj as WithdrawSponsorshipProposalIntentParams, bk as resolveConfig, bl as resolveFeeConfig } from './services-DTkc0lLx.js';
|
|
3
3
|
import { C as Chain } from './types-nPIXtCF5.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-nPIXtCF5.js';
|
|
5
5
|
import 'zod';
|
|
@@ -426,6 +426,17 @@ interface BackendProxyConfig {
|
|
|
426
426
|
}
|
|
427
427
|
declare function createBackendProxyHandler(config: BackendProxyConfig): (req: Request) => Promise<Response>;
|
|
428
428
|
|
|
429
|
+
declare const ALLOWED_IMAGE_CONTENT_TYPES: Set<string>;
|
|
430
|
+
declare const MAX_IMAGE_REDIRECTS = 5;
|
|
431
|
+
declare const MAX_IMAGE_PROXY_BYTES: number;
|
|
432
|
+
declare function isPrivateHost(hostname: string): boolean;
|
|
433
|
+
declare function validateUrl(raw: string): {
|
|
434
|
+
url: URL;
|
|
435
|
+
} | {
|
|
436
|
+
error: string;
|
|
437
|
+
status: number;
|
|
438
|
+
};
|
|
439
|
+
|
|
429
440
|
interface BackendMetadataConfig {
|
|
430
441
|
backendUrl: string;
|
|
431
442
|
apiKey: string;
|
|
@@ -507,4 +518,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
507
518
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
508
519
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
509
520
|
|
|
510
|
-
export { type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, ResolvedFeeConfig, type RpcProxyConfig, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend };
|
|
521
|
+
export { ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, type RemixPolicy, type RemixPolicyInput, ResolvedFeeConfig, type RpcProxyConfig, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isPrivateHost, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl };
|
package/dist/index.js
CHANGED
|
@@ -1379,6 +1379,66 @@ function createRpcProxyHandler(config) {
|
|
|
1379
1379
|
return createBackendProxyHandler({ ...config, path: "/v1/rpc" });
|
|
1380
1380
|
}
|
|
1381
1381
|
|
|
1382
|
+
// src/server/ssrf-guard.ts
|
|
1383
|
+
var ALLOWED_IMAGE_CONTENT_TYPES = /* @__PURE__ */ new Set([
|
|
1384
|
+
"image/jpeg",
|
|
1385
|
+
"image/jpg",
|
|
1386
|
+
"image/png",
|
|
1387
|
+
"image/gif",
|
|
1388
|
+
"image/webp",
|
|
1389
|
+
"image/svg+xml",
|
|
1390
|
+
"image/avif",
|
|
1391
|
+
"image/bmp",
|
|
1392
|
+
"image/tiff"
|
|
1393
|
+
]);
|
|
1394
|
+
var MAX_IMAGE_REDIRECTS = 5;
|
|
1395
|
+
var MAX_IMAGE_PROXY_BYTES = 15 * 1024 * 1024;
|
|
1396
|
+
function isPrivateHost(hostname) {
|
|
1397
|
+
const h = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
1398
|
+
if (h === "localhost" || h === "127.0.0.1" || h === "0.0.0.0") return true;
|
|
1399
|
+
if (/^\d+$/.test(h)) {
|
|
1400
|
+
const n = parseInt(h, 10);
|
|
1401
|
+
if (n === 2130706433 || n === 0 || n >= 2886729728 && n <= 2887778303 || n >= 3232235520 && n <= 3232301055 || n >= 167772160 && n <= 184549375 || n >= 2851995648 && n <= 2852061183) return true;
|
|
1402
|
+
}
|
|
1403
|
+
if (/^0x[0-9a-f]+$/i.test(h)) {
|
|
1404
|
+
const n = parseInt(h, 16);
|
|
1405
|
+
if (n === 2130706433 || n === 0 || n >= 2886729728 && n <= 2887778303 || n >= 3232235520 && n <= 3232301055 || n >= 167772160 && n <= 184549375 || n >= 2851995648 && n <= 2852061183) return true;
|
|
1406
|
+
}
|
|
1407
|
+
if (/^0\d+\.\d+\.\d+\.\d+$/.test(h)) return true;
|
|
1408
|
+
if (h === "::1" || /^0*:0*:0*:0*:0*:0*:0*:0*1$/.test(h)) return true;
|
|
1409
|
+
const v4mapped = h.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
|
|
1410
|
+
if (v4mapped) return isPrivateHost(v4mapped[1]);
|
|
1411
|
+
if (/^10\./.test(h)) return true;
|
|
1412
|
+
if (/^172\.(1[6-9]|2\d|3[01])\./.test(h)) return true;
|
|
1413
|
+
if (/^192\.168\./.test(h)) return true;
|
|
1414
|
+
if (/^169\.254\./.test(h)) return true;
|
|
1415
|
+
if (/^100\.(6[4-9]|[7-9]\d|1[01]\d|12[0-7])\./.test(h)) return true;
|
|
1416
|
+
if (/^fe80:/i.test(h)) return true;
|
|
1417
|
+
if (/^f[cd][0-9a-f]{2}:/i.test(h)) return true;
|
|
1418
|
+
if (h.endsWith(".local")) return true;
|
|
1419
|
+
if (h === "metadata.google.internal") return true;
|
|
1420
|
+
if (h === "metadata.azure.internal") return true;
|
|
1421
|
+
return false;
|
|
1422
|
+
}
|
|
1423
|
+
function validateUrl(raw) {
|
|
1424
|
+
let parsed;
|
|
1425
|
+
try {
|
|
1426
|
+
parsed = new URL(raw);
|
|
1427
|
+
} catch {
|
|
1428
|
+
return { error: "Invalid url", status: 400 };
|
|
1429
|
+
}
|
|
1430
|
+
if (parsed.protocol !== "https:") {
|
|
1431
|
+
return { error: "Only https URLs allowed", status: 400 };
|
|
1432
|
+
}
|
|
1433
|
+
if (parsed.username || parsed.password) {
|
|
1434
|
+
return { error: "URL credentials not allowed", status: 400 };
|
|
1435
|
+
}
|
|
1436
|
+
if (isPrivateHost(parsed.hostname)) {
|
|
1437
|
+
return { error: "URL not allowed", status: 400 };
|
|
1438
|
+
}
|
|
1439
|
+
return { url: parsed };
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1382
1442
|
// src/server/backend-metadata.ts
|
|
1383
1443
|
function endpoint(config, path) {
|
|
1384
1444
|
return `${config.backendUrl.replace(/\/$/, "")}/v1/metadata/${path}`;
|
|
@@ -1521,6 +1581,6 @@ function resolveSafeImageContentType(contentType) {
|
|
|
1521
1581
|
}
|
|
1522
1582
|
var MAX_IPFS_GATEWAY_RESPONSE_BYTES = 25 * 1024 * 1024;
|
|
1523
1583
|
|
|
1524
|
-
export { ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY, FeeConfigSchema, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IPFS_GATEWAY_RESPONSE_BYTES, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getCoordinates, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getStarknetCoordinates, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveConfig, resolveFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend };
|
|
1584
|
+
export { ALLOWED_IMAGE_CONTENT_TYPES, ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY, FeeConfigSchema, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, 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, createBackendProxyHandler, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getCoordinates, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getStarknetCoordinates, getTokenByAddress, getTokenBySymbol, hasCapability, isPrivateHost, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveAppFeeConfig, resolveConfig, resolveFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl };
|
|
1525
1585
|
//# sourceMappingURL=index.js.map
|
|
1526
1586
|
//# sourceMappingURL=index.js.map
|