@medialane/sdk 0.130.0 → 0.132.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/{errors-Dc-g0mMr.d.ts → errors-HTG0DcWa.d.ts} +24 -12
- package/dist/{errors-C_zqe9TI.d.cts → errors-JkeKc3cu.d.cts} +24 -12
- package/dist/index.cjs +21 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -13
- package/dist/index.d.ts +3 -13
- package/dist/index.js +22 -73
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +21 -7
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +21 -7
- 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 { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './errors-
|
|
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 ApiCoinClaimResult, o as ApiCoinPrice, p as ApiCoinPrices, q as ApiCoinsQuery, r as ApiCollection, s as ApiCollectionClaim, t as ApiCollectionProfile, u as ApiCollectionSlugClaim, v as ApiCollectionsQuery, w as ApiComment, x as ApiCounterOffersQuery, y as ApiCreatorListResult, z as ApiCreatorProfile, B as ApiCreditPayment, C as ApiEmissionCall, D as ApiEmissionResult, E as ApiFundingInstructions, F as ApiFundingIntent, G as ApiFundingMethod, H as ApiFundingStatus, I as ApiFundingSubmit, J as ApiIntent, K as ApiIntentCreated, L as ApiKeyStatus, M as ApiMeta, N as ApiMetadataSignedUrl, O as ApiMetadataUpload, P as ApiOrder, Q as ApiOrderConsideration, T as ApiOrderOffer, U as ApiOrderPrice, V as ApiOrderTokenMeta, W as ApiOrderTxHash, X as ApiOrdersQuery, Y as ApiPointEvent, Z as ApiPortalKey, _ as ApiPortalKeyCreated, $ as ApiPortalMe, a0 as ApiPortalSpend, a1 as ApiPublicRemix, a2 as ApiRemixOffer, a3 as ApiRemixOfferPrice, a4 as ApiRemixOffersQuery, a5 as ApiResponse, a6 as ApiRewardsBadge, a7 as ApiRewardsBatchEntry, a8 as ApiRewardsConfig, a9 as ApiRewardsLeaderboardEntry, aa as ApiRewardsLevel, ab as ApiSearchCollectionResult, ac as ApiSearchCreatorResult, ad as ApiSearchResult, ae as ApiSearchTokenResult, af as ApiSpendByAction, ag as ApiToken, ah as ApiTokenBalance, ai as ApiTokenMetadata, aj as ApiTxSyncResult, ak as ApiUserRewards, al as ApiUserWallet, am as ApiWalletActivity, an as ApiWebhookCreated, ao as ApiWebhookEndpoint, ap as AutoRemixOfferParams, aq as CancelOrderIntentParams, ar as ChainFilter, as as CheckoutIntentItem, at as ClaimConditions, au as CollectionServiceId, av as CollectionSort, aw as CollectionTokensSort, ax as ConfirmRemixOfferParams, ay as ConfirmSelfRemixParams, az as ConsiderationItem, aA as CreateCheckoutIntentParams, aB as CreateCoinIntentParams, aC as CreateCollectionIntentParams, aD as CreateCounterOfferIntentParams, aE as CreateDropParams, aF as CreateListingIntentParams, aG as CreateMembershipParams, aH as CreateMintIntentParams, aI as CreatePopCollectionParams, aJ as CreateRemixOfferParams, aK as CreateSponsorshipOfferIntentParams, aL as CreateSponsorshipOfferParams, aM as CreateSponsorshipProposalIntentParams, aN as CreateTicketParams, aO as CreateTierIntentParams, aP as CreateWebhookParams, aQ as DropMintStatus, aR as EmissionParams, aS as EnforcementDeclaration, aT as FactoryFamilyServiceId, aU as FeeConfig, aV as FeeConfigSchema, aW as FulfillOrderIntentParams, aX as IPType, aY as IntentCall, aZ as IntentStatus, a_ as IntentType, a$ as IpAttribute, b0 as IpNftMetadata, b1 as LaunchCoinIntentParams, b2 as MakeOfferIntentParams, b3 as MedialaneApiError, b4 as MedialaneConfig, b5 as MedialaneErrorCode, b6 as MintMembershipsParams, b7 as MintTicketsParams, b8 as OPEN_LICENSES, b9 as OfferItem, ba as OpenLicense, bb as Order, bc as OrderDetails, bd as OrderParameters, be as OrderStatus, bf as PasskeyCancelledError, bg as PlaceSponsorshipBidIntentParams, bh as PopBatchEligibilityItem, bi as PopClaimStatus, bj as PopEventType, bk as ProposeSponsorshipParams, bl as RejectSponsorshipProposalIntentParams, bm as RemixOfferStatus, bn as ResolvedConfig, bo as RetractSponsorshipBidIntentParams, bp as RetryOptions, bq as ServiceEventDeclaration, br as SetSponsorshipOfferOpenIntentParams, bs as SortOrder, bt as TenantPlan, bu as TierServiceId, bv as TxResult, bw as UpdateCollectionProfileInput, bx as UserFacingError, by as WebhookEventType, bz as WebhookStatus, bA as WithdrawSponsorshipProposalIntentParams, bB as resolveConfig, bC as resolveFeeConfig } from './errors-
|
|
1
|
+
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './errors-JkeKc3cu.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 ApiCoinClaimResult, o as ApiCoinPrice, p as ApiCoinPrices, q as ApiCoinsQuery, r as ApiCollection, s as ApiCollectionClaim, t as ApiCollectionProfile, u as ApiCollectionSlugClaim, v as ApiCollectionsQuery, w as ApiComment, x as ApiCounterOffersQuery, y as ApiCreatorListResult, z as ApiCreatorProfile, B as ApiCreditPayment, C as ApiEmissionCall, D as ApiEmissionResult, E as ApiFundingInstructions, F as ApiFundingIntent, G as ApiFundingMethod, H as ApiFundingStatus, I as ApiFundingSubmit, J as ApiIntent, K as ApiIntentCreated, L as ApiKeyStatus, M as ApiMeta, N as ApiMetadataSignedUrl, O as ApiMetadataUpload, P as ApiOrder, Q as ApiOrderConsideration, T as ApiOrderOffer, U as ApiOrderPrice, V as ApiOrderTokenMeta, W as ApiOrderTxHash, X as ApiOrdersQuery, Y as ApiPointEvent, Z as ApiPortalKey, _ as ApiPortalKeyCreated, $ as ApiPortalMe, a0 as ApiPortalSpend, a1 as ApiPublicRemix, a2 as ApiRemixOffer, a3 as ApiRemixOfferPrice, a4 as ApiRemixOffersQuery, a5 as ApiResponse, a6 as ApiRewardsBadge, a7 as ApiRewardsBatchEntry, a8 as ApiRewardsConfig, a9 as ApiRewardsLeaderboardEntry, aa as ApiRewardsLevel, ab as ApiSearchCollectionResult, ac as ApiSearchCreatorResult, ad as ApiSearchResult, ae as ApiSearchTokenResult, af as ApiSpendByAction, ag as ApiToken, ah as ApiTokenBalance, ai as ApiTokenMetadata, aj as ApiTxSyncResult, ak as ApiUserRewards, al as ApiUserWallet, am as ApiWalletActivity, an as ApiWebhookCreated, ao as ApiWebhookEndpoint, ap as AutoRemixOfferParams, aq as CancelOrderIntentParams, ar as ChainFilter, as as CheckoutIntentItem, at as ClaimConditions, au as CollectionServiceId, av as CollectionSort, aw as CollectionTokensSort, ax as ConfirmRemixOfferParams, ay as ConfirmSelfRemixParams, az as ConsiderationItem, aA as CreateCheckoutIntentParams, aB as CreateCoinIntentParams, aC as CreateCollectionIntentParams, aD as CreateCounterOfferIntentParams, aE as CreateDropParams, aF as CreateListingIntentParams, aG as CreateMembershipParams, aH as CreateMintIntentParams, aI as CreatePopCollectionParams, aJ as CreateRemixOfferParams, aK as CreateSponsorshipOfferIntentParams, aL as CreateSponsorshipOfferParams, aM as CreateSponsorshipProposalIntentParams, aN as CreateTicketParams, aO as CreateTierIntentParams, aP as CreateWebhookParams, aQ as DropMintStatus, aR as EmissionParams, aS as EnforcementDeclaration, aT as FactoryFamilyServiceId, aU as FeeConfig, aV as FeeConfigSchema, aW as FulfillOrderIntentParams, aX as IPType, aY as IntentCall, aZ as IntentStatus, a_ as IntentType, a$ as IpAttribute, b0 as IpNftMetadata, b1 as LaunchCoinIntentParams, b2 as MakeOfferIntentParams, b3 as MedialaneApiError, b4 as MedialaneConfig, b5 as MedialaneErrorCode, b6 as MintMembershipsParams, b7 as MintTicketsParams, b8 as OPEN_LICENSES, b9 as OfferItem, ba as OpenLicense, bb as Order, bc as OrderDetails, bd as OrderParameters, be as OrderStatus, bf as PasskeyCancelledError, bg as PlaceSponsorshipBidIntentParams, bh as PopBatchEligibilityItem, bi as PopClaimStatus, bj as PopEventType, bk as ProposeSponsorshipParams, bl as RejectSponsorshipProposalIntentParams, bm as RemixOfferStatus, bn as ResolvedConfig, bo as RetractSponsorshipBidIntentParams, bp as RetryOptions, bq as ServiceEventDeclaration, br as SetSponsorshipOfferOpenIntentParams, bs as SortOrder, bt as TenantPlan, bu as TierServiceId, bv as TxResult, bw as UpdateCollectionProfileInput, bx as UserFacingError, by as WebhookEventType, bz as WebhookStatus, bA as WithdrawSponsorshipProposalIntentParams, bB as resolveConfig, bC as resolveFeeConfig } from './errors-JkeKc3cu.cjs';
|
|
3
3
|
import { C as Chain } from './types-CuSlc_YE.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-CuSlc_YE.cjs';
|
|
5
5
|
import 'zod';
|
|
@@ -480,7 +480,6 @@ declare function createFailoverFetch(urls: string[], options?: FailoverFetchOpti
|
|
|
480
480
|
interface RpcProxyConfig {
|
|
481
481
|
backendUrl: string;
|
|
482
482
|
apiKey: string | undefined;
|
|
483
|
-
checkRateLimit: (ip: string) => boolean;
|
|
484
483
|
fetchImpl?: typeof fetch;
|
|
485
484
|
}
|
|
486
485
|
declare function createRpcProxyHandler(config: RpcProxyConfig): (req: Request) => Promise<Response>;
|
|
@@ -489,7 +488,6 @@ interface BackendProxyConfig {
|
|
|
489
488
|
path: string;
|
|
490
489
|
backendUrl: string;
|
|
491
490
|
apiKey: string | undefined;
|
|
492
|
-
checkRateLimit: (ip: string) => boolean;
|
|
493
491
|
fetchImpl?: typeof fetch;
|
|
494
492
|
forwardCookie?: {
|
|
495
493
|
name: string;
|
|
@@ -513,7 +511,6 @@ declare function validateUrl(raw: string, options?: {
|
|
|
513
511
|
declare function isPrivateOrInsecureUrl(raw: string, requireHttps?: boolean): boolean;
|
|
514
512
|
|
|
515
513
|
interface ImageProxyConfig {
|
|
516
|
-
checkRateLimit: (ip: string) => boolean;
|
|
517
514
|
resolveHostname: (hostname: string) => Promise<string[]>;
|
|
518
515
|
fetchImpl?: typeof fetch;
|
|
519
516
|
userAgent?: string;
|
|
@@ -547,15 +544,8 @@ declare function uploadDirectoryToBackend(config: BackendMetadataConfig, files:
|
|
|
547
544
|
}>;
|
|
548
545
|
declare function getBackendSignedUrl(config: BackendMetadataConfig, kind?: "image" | "document" | "media"): Promise<string>;
|
|
549
546
|
|
|
550
|
-
declare function createRateLimiter(windowMs: number, max: number): (key: string) => boolean;
|
|
551
|
-
declare const TRUSTED_APP_IP_HEADER = "x-medialane-client-ip";
|
|
552
|
-
declare function requestIp(req: Request): string;
|
|
553
|
-
|
|
554
547
|
declare function isSameOrigin(req: Request): boolean;
|
|
555
548
|
|
|
556
|
-
declare function isSpoofableForwardingHeader(name: string): boolean;
|
|
557
|
-
declare function trustedClientIp(req: Request): string;
|
|
558
|
-
|
|
559
549
|
declare const IDENTITY_TTL_SECONDS = 86400;
|
|
560
550
|
declare const ACCOUNT_SESSION_TTL_SECONDS: number;
|
|
561
551
|
interface SiwsIdentity {
|
|
@@ -623,4 +613,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
623
613
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
624
614
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
625
615
|
|
|
626
|
-
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, type CanonicalHash, type CappedBody, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, type ImageProxyConfig, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, POLICY_REFUSAL_CODES, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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 SiwsIdentity, type SupportedToken, type SupportedTokenSymbol,
|
|
616
|
+
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, type CanonicalHash, type CappedBody, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, type ImageProxyConfig, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, POLICY_REFUSAL_CODES, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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 SiwsIdentity, type SupportedToken, type SupportedTokenSymbol, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createBackendProxyHandler, createFailoverFetch, createImageProxyHandler, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isPolicyRefusal, isPrivateHost, isPrivateOrInsecureUrl, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, issueAccountSessionToken, issueSiwsToken, listServices, normalizeAddress, normalizeHash, parseAmount, readBodyWithCap, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl, verifyAccountSessionToken, verifySiwsToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './errors-
|
|
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 ApiCoinClaimResult, o as ApiCoinPrice, p as ApiCoinPrices, q as ApiCoinsQuery, r as ApiCollection, s as ApiCollectionClaim, t as ApiCollectionProfile, u as ApiCollectionSlugClaim, v as ApiCollectionsQuery, w as ApiComment, x as ApiCounterOffersQuery, y as ApiCreatorListResult, z as ApiCreatorProfile, B as ApiCreditPayment, C as ApiEmissionCall, D as ApiEmissionResult, E as ApiFundingInstructions, F as ApiFundingIntent, G as ApiFundingMethod, H as ApiFundingStatus, I as ApiFundingSubmit, J as ApiIntent, K as ApiIntentCreated, L as ApiKeyStatus, M as ApiMeta, N as ApiMetadataSignedUrl, O as ApiMetadataUpload, P as ApiOrder, Q as ApiOrderConsideration, T as ApiOrderOffer, U as ApiOrderPrice, V as ApiOrderTokenMeta, W as ApiOrderTxHash, X as ApiOrdersQuery, Y as ApiPointEvent, Z as ApiPortalKey, _ as ApiPortalKeyCreated, $ as ApiPortalMe, a0 as ApiPortalSpend, a1 as ApiPublicRemix, a2 as ApiRemixOffer, a3 as ApiRemixOfferPrice, a4 as ApiRemixOffersQuery, a5 as ApiResponse, a6 as ApiRewardsBadge, a7 as ApiRewardsBatchEntry, a8 as ApiRewardsConfig, a9 as ApiRewardsLeaderboardEntry, aa as ApiRewardsLevel, ab as ApiSearchCollectionResult, ac as ApiSearchCreatorResult, ad as ApiSearchResult, ae as ApiSearchTokenResult, af as ApiSpendByAction, ag as ApiToken, ah as ApiTokenBalance, ai as ApiTokenMetadata, aj as ApiTxSyncResult, ak as ApiUserRewards, al as ApiUserWallet, am as ApiWalletActivity, an as ApiWebhookCreated, ao as ApiWebhookEndpoint, ap as AutoRemixOfferParams, aq as CancelOrderIntentParams, ar as ChainFilter, as as CheckoutIntentItem, at as ClaimConditions, au as CollectionServiceId, av as CollectionSort, aw as CollectionTokensSort, ax as ConfirmRemixOfferParams, ay as ConfirmSelfRemixParams, az as ConsiderationItem, aA as CreateCheckoutIntentParams, aB as CreateCoinIntentParams, aC as CreateCollectionIntentParams, aD as CreateCounterOfferIntentParams, aE as CreateDropParams, aF as CreateListingIntentParams, aG as CreateMembershipParams, aH as CreateMintIntentParams, aI as CreatePopCollectionParams, aJ as CreateRemixOfferParams, aK as CreateSponsorshipOfferIntentParams, aL as CreateSponsorshipOfferParams, aM as CreateSponsorshipProposalIntentParams, aN as CreateTicketParams, aO as CreateTierIntentParams, aP as CreateWebhookParams, aQ as DropMintStatus, aR as EmissionParams, aS as EnforcementDeclaration, aT as FactoryFamilyServiceId, aU as FeeConfig, aV as FeeConfigSchema, aW as FulfillOrderIntentParams, aX as IPType, aY as IntentCall, aZ as IntentStatus, a_ as IntentType, a$ as IpAttribute, b0 as IpNftMetadata, b1 as LaunchCoinIntentParams, b2 as MakeOfferIntentParams, b3 as MedialaneApiError, b4 as MedialaneConfig, b5 as MedialaneErrorCode, b6 as MintMembershipsParams, b7 as MintTicketsParams, b8 as OPEN_LICENSES, b9 as OfferItem, ba as OpenLicense, bb as Order, bc as OrderDetails, bd as OrderParameters, be as OrderStatus, bf as PasskeyCancelledError, bg as PlaceSponsorshipBidIntentParams, bh as PopBatchEligibilityItem, bi as PopClaimStatus, bj as PopEventType, bk as ProposeSponsorshipParams, bl as RejectSponsorshipProposalIntentParams, bm as RemixOfferStatus, bn as ResolvedConfig, bo as RetractSponsorshipBidIntentParams, bp as RetryOptions, bq as ServiceEventDeclaration, br as SetSponsorshipOfferOpenIntentParams, bs as SortOrder, bt as TenantPlan, bu as TierServiceId, bv as TxResult, bw as UpdateCollectionProfileInput, bx as UserFacingError, by as WebhookEventType, bz as WebhookStatus, bA as WithdrawSponsorshipProposalIntentParams, bB as resolveConfig, bC as resolveFeeConfig } from './errors-
|
|
1
|
+
import { R as ResolvedFeeConfig, S as ServiceDefinition, a as ServiceCapability } from './errors-HTG0DcWa.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 ApiCoinClaimResult, o as ApiCoinPrice, p as ApiCoinPrices, q as ApiCoinsQuery, r as ApiCollection, s as ApiCollectionClaim, t as ApiCollectionProfile, u as ApiCollectionSlugClaim, v as ApiCollectionsQuery, w as ApiComment, x as ApiCounterOffersQuery, y as ApiCreatorListResult, z as ApiCreatorProfile, B as ApiCreditPayment, C as ApiEmissionCall, D as ApiEmissionResult, E as ApiFundingInstructions, F as ApiFundingIntent, G as ApiFundingMethod, H as ApiFundingStatus, I as ApiFundingSubmit, J as ApiIntent, K as ApiIntentCreated, L as ApiKeyStatus, M as ApiMeta, N as ApiMetadataSignedUrl, O as ApiMetadataUpload, P as ApiOrder, Q as ApiOrderConsideration, T as ApiOrderOffer, U as ApiOrderPrice, V as ApiOrderTokenMeta, W as ApiOrderTxHash, X as ApiOrdersQuery, Y as ApiPointEvent, Z as ApiPortalKey, _ as ApiPortalKeyCreated, $ as ApiPortalMe, a0 as ApiPortalSpend, a1 as ApiPublicRemix, a2 as ApiRemixOffer, a3 as ApiRemixOfferPrice, a4 as ApiRemixOffersQuery, a5 as ApiResponse, a6 as ApiRewardsBadge, a7 as ApiRewardsBatchEntry, a8 as ApiRewardsConfig, a9 as ApiRewardsLeaderboardEntry, aa as ApiRewardsLevel, ab as ApiSearchCollectionResult, ac as ApiSearchCreatorResult, ad as ApiSearchResult, ae as ApiSearchTokenResult, af as ApiSpendByAction, ag as ApiToken, ah as ApiTokenBalance, ai as ApiTokenMetadata, aj as ApiTxSyncResult, ak as ApiUserRewards, al as ApiUserWallet, am as ApiWalletActivity, an as ApiWebhookCreated, ao as ApiWebhookEndpoint, ap as AutoRemixOfferParams, aq as CancelOrderIntentParams, ar as ChainFilter, as as CheckoutIntentItem, at as ClaimConditions, au as CollectionServiceId, av as CollectionSort, aw as CollectionTokensSort, ax as ConfirmRemixOfferParams, ay as ConfirmSelfRemixParams, az as ConsiderationItem, aA as CreateCheckoutIntentParams, aB as CreateCoinIntentParams, aC as CreateCollectionIntentParams, aD as CreateCounterOfferIntentParams, aE as CreateDropParams, aF as CreateListingIntentParams, aG as CreateMembershipParams, aH as CreateMintIntentParams, aI as CreatePopCollectionParams, aJ as CreateRemixOfferParams, aK as CreateSponsorshipOfferIntentParams, aL as CreateSponsorshipOfferParams, aM as CreateSponsorshipProposalIntentParams, aN as CreateTicketParams, aO as CreateTierIntentParams, aP as CreateWebhookParams, aQ as DropMintStatus, aR as EmissionParams, aS as EnforcementDeclaration, aT as FactoryFamilyServiceId, aU as FeeConfig, aV as FeeConfigSchema, aW as FulfillOrderIntentParams, aX as IPType, aY as IntentCall, aZ as IntentStatus, a_ as IntentType, a$ as IpAttribute, b0 as IpNftMetadata, b1 as LaunchCoinIntentParams, b2 as MakeOfferIntentParams, b3 as MedialaneApiError, b4 as MedialaneConfig, b5 as MedialaneErrorCode, b6 as MintMembershipsParams, b7 as MintTicketsParams, b8 as OPEN_LICENSES, b9 as OfferItem, ba as OpenLicense, bb as Order, bc as OrderDetails, bd as OrderParameters, be as OrderStatus, bf as PasskeyCancelledError, bg as PlaceSponsorshipBidIntentParams, bh as PopBatchEligibilityItem, bi as PopClaimStatus, bj as PopEventType, bk as ProposeSponsorshipParams, bl as RejectSponsorshipProposalIntentParams, bm as RemixOfferStatus, bn as ResolvedConfig, bo as RetractSponsorshipBidIntentParams, bp as RetryOptions, bq as ServiceEventDeclaration, br as SetSponsorshipOfferOpenIntentParams, bs as SortOrder, bt as TenantPlan, bu as TierServiceId, bv as TxResult, bw as UpdateCollectionProfileInput, bx as UserFacingError, by as WebhookEventType, bz as WebhookStatus, bA as WithdrawSponsorshipProposalIntentParams, bB as resolveConfig, bC as resolveFeeConfig } from './errors-HTG0DcWa.js';
|
|
3
3
|
import { C as Chain } from './types-CuSlc_YE.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-CuSlc_YE.js';
|
|
5
5
|
import 'zod';
|
|
@@ -480,7 +480,6 @@ declare function createFailoverFetch(urls: string[], options?: FailoverFetchOpti
|
|
|
480
480
|
interface RpcProxyConfig {
|
|
481
481
|
backendUrl: string;
|
|
482
482
|
apiKey: string | undefined;
|
|
483
|
-
checkRateLimit: (ip: string) => boolean;
|
|
484
483
|
fetchImpl?: typeof fetch;
|
|
485
484
|
}
|
|
486
485
|
declare function createRpcProxyHandler(config: RpcProxyConfig): (req: Request) => Promise<Response>;
|
|
@@ -489,7 +488,6 @@ interface BackendProxyConfig {
|
|
|
489
488
|
path: string;
|
|
490
489
|
backendUrl: string;
|
|
491
490
|
apiKey: string | undefined;
|
|
492
|
-
checkRateLimit: (ip: string) => boolean;
|
|
493
491
|
fetchImpl?: typeof fetch;
|
|
494
492
|
forwardCookie?: {
|
|
495
493
|
name: string;
|
|
@@ -513,7 +511,6 @@ declare function validateUrl(raw: string, options?: {
|
|
|
513
511
|
declare function isPrivateOrInsecureUrl(raw: string, requireHttps?: boolean): boolean;
|
|
514
512
|
|
|
515
513
|
interface ImageProxyConfig {
|
|
516
|
-
checkRateLimit: (ip: string) => boolean;
|
|
517
514
|
resolveHostname: (hostname: string) => Promise<string[]>;
|
|
518
515
|
fetchImpl?: typeof fetch;
|
|
519
516
|
userAgent?: string;
|
|
@@ -547,15 +544,8 @@ declare function uploadDirectoryToBackend(config: BackendMetadataConfig, files:
|
|
|
547
544
|
}>;
|
|
548
545
|
declare function getBackendSignedUrl(config: BackendMetadataConfig, kind?: "image" | "document" | "media"): Promise<string>;
|
|
549
546
|
|
|
550
|
-
declare function createRateLimiter(windowMs: number, max: number): (key: string) => boolean;
|
|
551
|
-
declare const TRUSTED_APP_IP_HEADER = "x-medialane-client-ip";
|
|
552
|
-
declare function requestIp(req: Request): string;
|
|
553
|
-
|
|
554
547
|
declare function isSameOrigin(req: Request): boolean;
|
|
555
548
|
|
|
556
|
-
declare function isSpoofableForwardingHeader(name: string): boolean;
|
|
557
|
-
declare function trustedClientIp(req: Request): string;
|
|
558
|
-
|
|
559
549
|
declare const IDENTITY_TTL_SECONDS = 86400;
|
|
560
550
|
declare const ACCOUNT_SESSION_TTL_SECONDS: number;
|
|
561
551
|
interface SiwsIdentity {
|
|
@@ -623,4 +613,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
623
613
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
624
614
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
625
615
|
|
|
626
|
-
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, type CanonicalHash, type CappedBody, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, type ImageProxyConfig, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, POLICY_REFUSAL_CODES, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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 SiwsIdentity, type SupportedToken, type SupportedTokenSymbol,
|
|
616
|
+
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, type AssetAttribute, type AssetMetadata, type BackendMetadataConfig, type BackendProxyConfig, type BackendUploadResult, type BuildAssetMetadataInput, type CanonicalHash, type CappedBody, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, type FeeEnv, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, type ImageProxyConfig, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, POLICY_REFUSAL_CODES, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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 SiwsIdentity, type SupportedToken, type SupportedTokenSymbol, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createBackendProxyHandler, createFailoverFetch, createImageProxyHandler, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isPolicyRefusal, isPrivateHost, isPrivateOrInsecureUrl, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, issueAccountSessionToken, issueSiwsToken, listServices, normalizeAddress, normalizeHash, parseAmount, readBodyWithCap, resolveAppFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl, verifyAccountSessionToken, verifySiwsToken };
|
package/dist/index.js
CHANGED
|
@@ -672,12 +672,9 @@ var ApiClient = class {
|
|
|
672
672
|
registerBusinessProvisioning(params) {
|
|
673
673
|
return this.post(
|
|
674
674
|
"/v1/business/provisioning",
|
|
675
|
-
params
|
|
675
|
+
{ chain: params.chain ?? "STARKNET", recipientScheme: params.recipientScheme, recipientValue: params.recipientValue }
|
|
676
676
|
);
|
|
677
677
|
}
|
|
678
|
-
completeBusinessProvisioning(id) {
|
|
679
|
-
return this.post(`/v1/business/provisioning/${id}/complete`, {});
|
|
680
|
-
}
|
|
681
678
|
getCollectionProfile(contractAddress) {
|
|
682
679
|
return this.request(
|
|
683
680
|
`/v1/collections/${this.addr(contractAddress)}/profile`,
|
|
@@ -774,11 +771,28 @@ var ApiClient = class {
|
|
|
774
771
|
headers: this.bearer(siwsToken)
|
|
775
772
|
});
|
|
776
773
|
}
|
|
777
|
-
async
|
|
778
|
-
const
|
|
774
|
+
async checkEmail(email) {
|
|
775
|
+
const body = await this.get(
|
|
779
776
|
`/v1/auth/email/exists?email=${encodeURIComponent(email)}`
|
|
780
777
|
);
|
|
781
|
-
return exists;
|
|
778
|
+
return { exists: body.exists, walletWaiting: body.walletWaiting === true };
|
|
779
|
+
}
|
|
780
|
+
async requestEmailCode(email) {
|
|
781
|
+
await this.post("/v1/auth/email/request-code", { email });
|
|
782
|
+
}
|
|
783
|
+
async registerEmailAccount(email) {
|
|
784
|
+
await this.post("/v1/auth/email/register-account", { email });
|
|
785
|
+
}
|
|
786
|
+
async verifyEmailCode(email, code) {
|
|
787
|
+
const body = await this.post("/v1/auth/email/verify-code", { email, code });
|
|
788
|
+
return { token: body.token, waitingWallets: body.waitingWallets ?? [] };
|
|
789
|
+
}
|
|
790
|
+
claimWallet(params) {
|
|
791
|
+
return this.post("/v1/users/me/claim-wallet", params);
|
|
792
|
+
}
|
|
793
|
+
async getSessionWallet() {
|
|
794
|
+
const body = await this.post("/v1/users/me/wallet", {});
|
|
795
|
+
return body.walletAddress ?? null;
|
|
782
796
|
}
|
|
783
797
|
getMyWallet(siwsToken) {
|
|
784
798
|
return this.request(
|
|
@@ -1490,41 +1504,6 @@ function createFailoverFetch(urls, options = {}) {
|
|
|
1490
1504
|
return failover;
|
|
1491
1505
|
}
|
|
1492
1506
|
|
|
1493
|
-
// src/server/rate-limit.ts
|
|
1494
|
-
function createRateLimiter(windowMs, max) {
|
|
1495
|
-
const counts = /* @__PURE__ */ new Map();
|
|
1496
|
-
let nextSweepAt = Date.now() + windowMs;
|
|
1497
|
-
return function checkRateLimit(key) {
|
|
1498
|
-
const now = Date.now();
|
|
1499
|
-
if (now >= nextSweepAt) {
|
|
1500
|
-
for (const [k, entry2] of counts) {
|
|
1501
|
-
if (now >= entry2.resetAt) counts.delete(k);
|
|
1502
|
-
}
|
|
1503
|
-
nextSweepAt = now + windowMs;
|
|
1504
|
-
}
|
|
1505
|
-
const entry = counts.get(key);
|
|
1506
|
-
if (!entry || now >= entry.resetAt) {
|
|
1507
|
-
counts.set(key, { count: 1, resetAt: now + windowMs });
|
|
1508
|
-
return true;
|
|
1509
|
-
}
|
|
1510
|
-
if (entry.count >= max) return false;
|
|
1511
|
-
entry.count += 1;
|
|
1512
|
-
return true;
|
|
1513
|
-
};
|
|
1514
|
-
}
|
|
1515
|
-
var TRUSTED_APP_IP_HEADER = "x-medialane-client-ip";
|
|
1516
|
-
function requestIp(req) {
|
|
1517
|
-
const fromEdge = req.headers.get("x-vercel-forwarded-for")?.split(",")[0]?.trim();
|
|
1518
|
-
if (fromEdge) return fromEdge;
|
|
1519
|
-
const forwarded = req.headers.get("x-forwarded-for");
|
|
1520
|
-
if (forwarded) {
|
|
1521
|
-
const hops = forwarded.split(",").map((hop) => hop.trim()).filter(Boolean);
|
|
1522
|
-
const nearest = hops[hops.length - 1];
|
|
1523
|
-
if (nearest) return nearest;
|
|
1524
|
-
}
|
|
1525
|
-
return "unknown";
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
1507
|
// src/server/origin.ts
|
|
1529
1508
|
function isSameOrigin(req) {
|
|
1530
1509
|
const origin = req.headers.get("origin");
|
|
@@ -1558,9 +1537,6 @@ function createBackendProxyHandler(config) {
|
|
|
1558
1537
|
if (!isSameOrigin(req)) {
|
|
1559
1538
|
return proxyError(-32600, "Cross-origin requests are not allowed", 403);
|
|
1560
1539
|
}
|
|
1561
|
-
if (!config.checkRateLimit(requestIp(req))) {
|
|
1562
|
-
return proxyError(-32005, "Too many requests", 429);
|
|
1563
|
-
}
|
|
1564
1540
|
if (!config.apiKey) {
|
|
1565
1541
|
return proxyError(-32003, "No API key configured \u2014 request not forwarded", 402);
|
|
1566
1542
|
}
|
|
@@ -1818,9 +1794,6 @@ function createImageProxyHandler(config) {
|
|
|
1818
1794
|
return res;
|
|
1819
1795
|
}
|
|
1820
1796
|
return async function handleImageProxy(req) {
|
|
1821
|
-
if (!config.checkRateLimit(requestIp(req))) {
|
|
1822
|
-
return jsonError("Too many requests", 429);
|
|
1823
|
-
}
|
|
1824
1797
|
const raw = new URL(req.url).searchParams.get("url");
|
|
1825
1798
|
if (!raw) return jsonError("Missing url", 400);
|
|
1826
1799
|
const validated = validateUrl(raw);
|
|
@@ -1902,30 +1875,6 @@ async function getBackendSignedUrl(config, kind = "image") {
|
|
|
1902
1875
|
if (!res.ok || !data.data) throw new Error(data.error ?? "Failed to create upload URL");
|
|
1903
1876
|
return data.data.url;
|
|
1904
1877
|
}
|
|
1905
|
-
|
|
1906
|
-
// src/server/trusted-client-ip.ts
|
|
1907
|
-
var SPOOFABLE_FORWARDING_HEADERS = [
|
|
1908
|
-
"x-forwarded-for",
|
|
1909
|
-
"x-real-ip",
|
|
1910
|
-
"x-client-ip",
|
|
1911
|
-
"true-client-ip",
|
|
1912
|
-
"cf-connecting-ip",
|
|
1913
|
-
TRUSTED_APP_IP_HEADER
|
|
1914
|
-
];
|
|
1915
|
-
function isSpoofableForwardingHeader(name) {
|
|
1916
|
-
return SPOOFABLE_FORWARDING_HEADERS.includes(name.toLowerCase());
|
|
1917
|
-
}
|
|
1918
|
-
function trustedClientIp(req) {
|
|
1919
|
-
const vercel = req.headers.get("x-vercel-forwarded-for")?.split(",")[0]?.trim();
|
|
1920
|
-
if (vercel) return vercel;
|
|
1921
|
-
const forwarded = req.headers.get("x-forwarded-for");
|
|
1922
|
-
if (forwarded) {
|
|
1923
|
-
const hops = forwarded.split(",").map((hop) => hop.trim()).filter(Boolean);
|
|
1924
|
-
const nearest = hops[hops.length - 1];
|
|
1925
|
-
if (nearest) return nearest;
|
|
1926
|
-
}
|
|
1927
|
-
return "unknown";
|
|
1928
|
-
}
|
|
1929
1878
|
var IDENTITY_PREFIX = "siws_";
|
|
1930
1879
|
var ACCOUNT_SESSION_PREFIX = "account_session_";
|
|
1931
1880
|
var IDENTITY_DOMAIN = "siws-identity-v1";
|
|
@@ -2102,6 +2051,6 @@ var UserFacingError = class extends Error {
|
|
|
2102
2051
|
}
|
|
2103
2052
|
};
|
|
2104
2053
|
|
|
2105
|
-
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY, FeeConfigSchema, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, MedialaneApiError, OPEN_LICENSES, POLICY_REFUSAL_CODES, PasskeyCancelledError, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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,
|
|
2054
|
+
export { ACCOUNT_SESSION_TTL_SECONDS, ALLOWED_IMAGE_CONTENT_TYPES, ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY, FeeConfigSchema, IDENTITY_TTL_SECONDS, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IMAGE_PROXY_BYTES, MAX_IMAGE_REDIRECTS, MAX_IPFS_GATEWAY_RESPONSE_BYTES, MedialaneApiError, OPEN_LICENSES, POLICY_REFUSAL_CODES, PasskeyCancelledError, 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_DATA_TOKENIZATION_721_CONTRACT, STARKNET_DROP_COLLECTION_CLASS_HASH, STARKNET_DROP_FACTORY_CONTRACT, STARKNET_EKUBO_CORE, STARKNET_GENESIS_MINT_BR_CONTRACT, STARKNET_GENESIS_MINT_GLOBAL_CONTRACT, STARKNET_GENESIS_MINT_LAUNCH_CONTRACT, 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, UserFacingError, assetHref, buildAssetMetadata, chainFromSlug, chainSlug, coinHref, collectionHref, createBackendProxyHandler, createFailoverFetch, createImageProxyHandler, createRpcProxyHandler, encodeU256, formatAmount, getBackendSignedUrl, getCoordinates, getDerivativesTerm, getListableTokens, getService, getServicesByCapability, getStarknetCoordinates, getTokenByAddress, getTokenBySymbol, hasCapability, isPolicyRefusal, isPrivateHost, isPrivateOrInsecureUrl, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, issueAccountSessionToken, issueSiwsToken, listServices, normalizeAddress, normalizeHash, parseAmount, readBodyWithCap, resolveAppFeeConfig, resolveConfig, resolveFeeConfig, resolveRemixPolicy, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt, uploadDirectoryToBackend, uploadFileToBackend, uploadJsonToBackend, validateUrl, verifyAccountSessionToken, verifySiwsToken };
|
|
2106
2055
|
//# sourceMappingURL=index.js.map
|
|
2107
2056
|
//# sourceMappingURL=index.js.map
|