@medialane/sdk 0.85.12 → 0.86.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 +25 -116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +25 -116
- package/dist/index.js.map +1 -1
- package/dist/{services-B_7IX3dM.d.ts → services-BMVi2U8T.d.ts} +1 -1
- package/dist/{services-BN4c7iT1.d.cts → services-yppVbYf6.d.cts} +1 -1
- package/dist/starknet/index.cjs +3 -2
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/dist/starknet/index.js +3 -2
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as 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, R as ApiRemixOfferPrice, T as ApiRemixOffersQuery, U as ApiResponse, V as ApiRewardsBadge, W as ApiRewardsBatchEntry, X as ApiRewardsConfig, Y as ApiRewardsLeaderboardEntry, Z as ApiRewardsLevel, _ as ApiSearchCollectionResult, $ as ApiSearchCreatorResult, a0 as ApiSearchResult, a1 as ApiSearchTokenResult, a2 as ApiToken, a3 as ApiTokenBalance, a4 as ApiTokenMetadata, a5 as ApiUsageDay, a6 as ApiUserRewards, a7 as ApiUserWallet, a8 as ApiWalletActivity, a9 as ApiWebhookCreated, aa as ApiWebhookEndpoint, ab as AutoRemixOfferParams, ac as CancelOrderIntentParams, ad as ChainFilter, ae as ClaimConditions, af as CollectionServiceId, ag as CollectionSort, ah as CollectionTokensSort, ai as ConfirmRemixOfferParams, aj as ConfirmSelfRemixParams, ak as ConsiderationItem, al as CreateCheckoutIntentParams, am as CreateCoinIntentParams, an as CreateCollectionIntentParams, ao as CreateCounterOfferIntentParams, ap as CreateDropParams, aq as CreateListingIntentParams, ar as CreateMembershipParams, as as CreateMintIntentParams, at as CreatePopCollectionParams, au as CreateRemixOfferParams, av as CreateSponsorshipOfferIntentParams, aw as CreateSponsorshipOfferParams, ax as CreateSponsorshipProposalIntentParams, ay as CreateTicketParams, az as CreateTierIntentParams, aA as CreateWebhookParams, aB as DropMintStatus, aC as EnforcementDeclaration, aD as FactoryFamilyServiceId, aE as FeeConfig, aF as FeeConfigSchema, aG as FulfillOrderIntentParams, aH as IPType, aI as IntentCall, aJ as IntentStatus, aK as IntentType, aL as IpAttribute, aM as IpNftMetadata, aN as LaunchCoinIntentParams, aO as MakeOfferIntentParams, aP as MedialaneApiError, aQ as MedialaneConfig, aR as MedialaneErrorCode, aS as MintMembershipsParams, aT as MintTicketsParams, aU as OPEN_LICENSES, aV as OfferItem, aW as OpenLicense, aX as Order, aY as OrderDetails, aZ as OrderParameters, a_ as OrderStatus, a$ as PlaceSponsorshipBidIntentParams, b0 as PopBatchEligibilityItem, b1 as PopClaimStatus, b2 as PopEventType, b3 as ProposeSponsorshipParams, b4 as RejectSponsorshipProposalIntentParams, b5 as RemixOfferStatus, b6 as ResolvedConfig, b7 as ResolvedFeeConfig, b8 as RetractSponsorshipBidIntentParams, b9 as RetryOptions, ba as ServiceEventDeclaration, bb as SetSponsorshipOfferOpenIntentParams, bc as SortOrder, bd as TenantPlan, be as TierServiceId, bf as TxResult, bg as WebhookEventType, bh as WebhookStatus, bi as WithdrawSponsorshipProposalIntentParams, bj as resolveConfig, bk as resolveFeeConfig } from './services-
|
|
1
|
+
import { S as ServiceDefinition, a as ServiceCapability } from './services-yppVbYf6.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, R as ApiRemixOfferPrice, T as ApiRemixOffersQuery, U as ApiResponse, V as ApiRewardsBadge, W as ApiRewardsBatchEntry, X as ApiRewardsConfig, Y as ApiRewardsLeaderboardEntry, Z as ApiRewardsLevel, _ as ApiSearchCollectionResult, $ as ApiSearchCreatorResult, a0 as ApiSearchResult, a1 as ApiSearchTokenResult, a2 as ApiToken, a3 as ApiTokenBalance, a4 as ApiTokenMetadata, a5 as ApiUsageDay, a6 as ApiUserRewards, a7 as ApiUserWallet, a8 as ApiWalletActivity, a9 as ApiWebhookCreated, aa as ApiWebhookEndpoint, ab as AutoRemixOfferParams, ac as CancelOrderIntentParams, ad as ChainFilter, ae as ClaimConditions, af as CollectionServiceId, ag as CollectionSort, ah as CollectionTokensSort, ai as ConfirmRemixOfferParams, aj as ConfirmSelfRemixParams, ak as ConsiderationItem, al as CreateCheckoutIntentParams, am as CreateCoinIntentParams, an as CreateCollectionIntentParams, ao as CreateCounterOfferIntentParams, ap as CreateDropParams, aq as CreateListingIntentParams, ar as CreateMembershipParams, as as CreateMintIntentParams, at as CreatePopCollectionParams, au as CreateRemixOfferParams, av as CreateSponsorshipOfferIntentParams, aw as CreateSponsorshipOfferParams, ax as CreateSponsorshipProposalIntentParams, ay as CreateTicketParams, az as CreateTierIntentParams, aA as CreateWebhookParams, aB as DropMintStatus, aC as EnforcementDeclaration, aD as FactoryFamilyServiceId, aE as FeeConfig, aF as FeeConfigSchema, aG as FulfillOrderIntentParams, aH as IPType, aI as IntentCall, aJ as IntentStatus, aK as IntentType, aL as IpAttribute, aM as IpNftMetadata, aN as LaunchCoinIntentParams, aO as MakeOfferIntentParams, aP as MedialaneApiError, aQ as MedialaneConfig, aR as MedialaneErrorCode, aS as MintMembershipsParams, aT as MintTicketsParams, aU as OPEN_LICENSES, aV as OfferItem, aW as OpenLicense, aX as Order, aY as OrderDetails, aZ as OrderParameters, a_ as OrderStatus, a$ as PlaceSponsorshipBidIntentParams, b0 as PopBatchEligibilityItem, b1 as PopClaimStatus, b2 as PopEventType, b3 as ProposeSponsorshipParams, b4 as RejectSponsorshipProposalIntentParams, b5 as RemixOfferStatus, b6 as ResolvedConfig, b7 as ResolvedFeeConfig, b8 as RetractSponsorshipBidIntentParams, b9 as RetryOptions, ba as ServiceEventDeclaration, bb as SetSponsorshipOfferOpenIntentParams, bc as SortOrder, bd as TenantPlan, be as TierServiceId, bf as TxResult, bg as WebhookEventType, bh as WebhookStatus, bi as WithdrawSponsorshipProposalIntentParams, bj as resolveConfig, bk as resolveFeeConfig } from './services-yppVbYf6.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';
|
|
@@ -401,19 +401,19 @@ interface FailoverFetchOptions {
|
|
|
401
401
|
}
|
|
402
402
|
declare function createFailoverFetch(urls: string[], options?: FailoverFetchOptions): typeof fetch;
|
|
403
403
|
|
|
404
|
-
declare const DEFAULT_STARKNET_RPC_METHODS: readonly string[];
|
|
405
404
|
interface RpcProxyConfig {
|
|
406
|
-
rpcUrls: string[];
|
|
407
|
-
allowedMethods?: readonly string[];
|
|
408
405
|
backendUrl: string;
|
|
409
406
|
apiKey: string | undefined;
|
|
410
407
|
checkRateLimit: (ip: string) => boolean;
|
|
408
|
+
fetchImpl?: typeof fetch;
|
|
411
409
|
}
|
|
412
410
|
declare function createRpcProxyHandler(config: RpcProxyConfig): (req: Request) => Promise<Response>;
|
|
413
411
|
|
|
414
412
|
declare function createRateLimiter(windowMs: number, max: number): (key: string) => boolean;
|
|
415
413
|
declare function requestIp(req: Request): string;
|
|
416
414
|
|
|
415
|
+
declare function isSameOrigin(req: Request): boolean;
|
|
416
|
+
|
|
417
417
|
type AssetAttribute = {
|
|
418
418
|
trait_type: string;
|
|
419
419
|
value: string;
|
|
@@ -454,4 +454,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
454
454
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
455
455
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
456
456
|
|
|
457
|
-
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY,
|
|
457
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, 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, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as ServiceDefinition, a as ServiceCapability } from './services-
|
|
2
|
-
export { A as 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, R as ApiRemixOfferPrice, T as ApiRemixOffersQuery, U as ApiResponse, V as ApiRewardsBadge, W as ApiRewardsBatchEntry, X as ApiRewardsConfig, Y as ApiRewardsLeaderboardEntry, Z as ApiRewardsLevel, _ as ApiSearchCollectionResult, $ as ApiSearchCreatorResult, a0 as ApiSearchResult, a1 as ApiSearchTokenResult, a2 as ApiToken, a3 as ApiTokenBalance, a4 as ApiTokenMetadata, a5 as ApiUsageDay, a6 as ApiUserRewards, a7 as ApiUserWallet, a8 as ApiWalletActivity, a9 as ApiWebhookCreated, aa as ApiWebhookEndpoint, ab as AutoRemixOfferParams, ac as CancelOrderIntentParams, ad as ChainFilter, ae as ClaimConditions, af as CollectionServiceId, ag as CollectionSort, ah as CollectionTokensSort, ai as ConfirmRemixOfferParams, aj as ConfirmSelfRemixParams, ak as ConsiderationItem, al as CreateCheckoutIntentParams, am as CreateCoinIntentParams, an as CreateCollectionIntentParams, ao as CreateCounterOfferIntentParams, ap as CreateDropParams, aq as CreateListingIntentParams, ar as CreateMembershipParams, as as CreateMintIntentParams, at as CreatePopCollectionParams, au as CreateRemixOfferParams, av as CreateSponsorshipOfferIntentParams, aw as CreateSponsorshipOfferParams, ax as CreateSponsorshipProposalIntentParams, ay as CreateTicketParams, az as CreateTierIntentParams, aA as CreateWebhookParams, aB as DropMintStatus, aC as EnforcementDeclaration, aD as FactoryFamilyServiceId, aE as FeeConfig, aF as FeeConfigSchema, aG as FulfillOrderIntentParams, aH as IPType, aI as IntentCall, aJ as IntentStatus, aK as IntentType, aL as IpAttribute, aM as IpNftMetadata, aN as LaunchCoinIntentParams, aO as MakeOfferIntentParams, aP as MedialaneApiError, aQ as MedialaneConfig, aR as MedialaneErrorCode, aS as MintMembershipsParams, aT as MintTicketsParams, aU as OPEN_LICENSES, aV as OfferItem, aW as OpenLicense, aX as Order, aY as OrderDetails, aZ as OrderParameters, a_ as OrderStatus, a$ as PlaceSponsorshipBidIntentParams, b0 as PopBatchEligibilityItem, b1 as PopClaimStatus, b2 as PopEventType, b3 as ProposeSponsorshipParams, b4 as RejectSponsorshipProposalIntentParams, b5 as RemixOfferStatus, b6 as ResolvedConfig, b7 as ResolvedFeeConfig, b8 as RetractSponsorshipBidIntentParams, b9 as RetryOptions, ba as ServiceEventDeclaration, bb as SetSponsorshipOfferOpenIntentParams, bc as SortOrder, bd as TenantPlan, be as TierServiceId, bf as TxResult, bg as WebhookEventType, bh as WebhookStatus, bi as WithdrawSponsorshipProposalIntentParams, bj as resolveConfig, bk as resolveFeeConfig } from './services-
|
|
1
|
+
import { S as ServiceDefinition, a as ServiceCapability } from './services-BMVi2U8T.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, R as ApiRemixOfferPrice, T as ApiRemixOffersQuery, U as ApiResponse, V as ApiRewardsBadge, W as ApiRewardsBatchEntry, X as ApiRewardsConfig, Y as ApiRewardsLeaderboardEntry, Z as ApiRewardsLevel, _ as ApiSearchCollectionResult, $ as ApiSearchCreatorResult, a0 as ApiSearchResult, a1 as ApiSearchTokenResult, a2 as ApiToken, a3 as ApiTokenBalance, a4 as ApiTokenMetadata, a5 as ApiUsageDay, a6 as ApiUserRewards, a7 as ApiUserWallet, a8 as ApiWalletActivity, a9 as ApiWebhookCreated, aa as ApiWebhookEndpoint, ab as AutoRemixOfferParams, ac as CancelOrderIntentParams, ad as ChainFilter, ae as ClaimConditions, af as CollectionServiceId, ag as CollectionSort, ah as CollectionTokensSort, ai as ConfirmRemixOfferParams, aj as ConfirmSelfRemixParams, ak as ConsiderationItem, al as CreateCheckoutIntentParams, am as CreateCoinIntentParams, an as CreateCollectionIntentParams, ao as CreateCounterOfferIntentParams, ap as CreateDropParams, aq as CreateListingIntentParams, ar as CreateMembershipParams, as as CreateMintIntentParams, at as CreatePopCollectionParams, au as CreateRemixOfferParams, av as CreateSponsorshipOfferIntentParams, aw as CreateSponsorshipOfferParams, ax as CreateSponsorshipProposalIntentParams, ay as CreateTicketParams, az as CreateTierIntentParams, aA as CreateWebhookParams, aB as DropMintStatus, aC as EnforcementDeclaration, aD as FactoryFamilyServiceId, aE as FeeConfig, aF as FeeConfigSchema, aG as FulfillOrderIntentParams, aH as IPType, aI as IntentCall, aJ as IntentStatus, aK as IntentType, aL as IpAttribute, aM as IpNftMetadata, aN as LaunchCoinIntentParams, aO as MakeOfferIntentParams, aP as MedialaneApiError, aQ as MedialaneConfig, aR as MedialaneErrorCode, aS as MintMembershipsParams, aT as MintTicketsParams, aU as OPEN_LICENSES, aV as OfferItem, aW as OpenLicense, aX as Order, aY as OrderDetails, aZ as OrderParameters, a_ as OrderStatus, a$ as PlaceSponsorshipBidIntentParams, b0 as PopBatchEligibilityItem, b1 as PopClaimStatus, b2 as PopEventType, b3 as ProposeSponsorshipParams, b4 as RejectSponsorshipProposalIntentParams, b5 as RemixOfferStatus, b6 as ResolvedConfig, b7 as ResolvedFeeConfig, b8 as RetractSponsorshipBidIntentParams, b9 as RetryOptions, ba as ServiceEventDeclaration, bb as SetSponsorshipOfferOpenIntentParams, bc as SortOrder, bd as TenantPlan, be as TierServiceId, bf as TxResult, bg as WebhookEventType, bh as WebhookStatus, bi as WithdrawSponsorshipProposalIntentParams, bj as resolveConfig, bk as resolveFeeConfig } from './services-BMVi2U8T.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';
|
|
@@ -401,19 +401,19 @@ interface FailoverFetchOptions {
|
|
|
401
401
|
}
|
|
402
402
|
declare function createFailoverFetch(urls: string[], options?: FailoverFetchOptions): typeof fetch;
|
|
403
403
|
|
|
404
|
-
declare const DEFAULT_STARKNET_RPC_METHODS: readonly string[];
|
|
405
404
|
interface RpcProxyConfig {
|
|
406
|
-
rpcUrls: string[];
|
|
407
|
-
allowedMethods?: readonly string[];
|
|
408
405
|
backendUrl: string;
|
|
409
406
|
apiKey: string | undefined;
|
|
410
407
|
checkRateLimit: (ip: string) => boolean;
|
|
408
|
+
fetchImpl?: typeof fetch;
|
|
411
409
|
}
|
|
412
410
|
declare function createRpcProxyHandler(config: RpcProxyConfig): (req: Request) => Promise<Response>;
|
|
413
411
|
|
|
414
412
|
declare function createRateLimiter(windowMs: number, max: number): (key: string) => boolean;
|
|
415
413
|
declare function requestIp(req: Request): string;
|
|
416
414
|
|
|
415
|
+
declare function isSameOrigin(req: Request): boolean;
|
|
416
|
+
|
|
417
417
|
type AssetAttribute = {
|
|
418
418
|
trait_type: string;
|
|
419
419
|
value: string;
|
|
@@ -454,4 +454,4 @@ declare const IPFS_SAFE_CONTENT_TYPE_PREFIXES: readonly ["image/jpeg", "image/pn
|
|
|
454
454
|
declare function resolveSafeImageContentType(contentType: string): string;
|
|
455
455
|
declare const MAX_IPFS_GATEWAY_RESPONSE_BYTES: number;
|
|
456
456
|
|
|
457
|
-
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY,
|
|
457
|
+
export { type AssetAttribute, type AssetMetadata, type BuildAssetMetadataInput, Chain, DEFAULT_CURRENCY, type FailoverFetchOptions, IPFS_SAFE_CONTENT_TYPE_PREFIXES, MAX_IPFS_GATEWAY_RESPONSE_BYTES, PUBLIC_RPC_FALLBACKS, RESERVED_TRAITS, 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, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt };
|
package/dist/index.js
CHANGED
|
@@ -493,8 +493,9 @@ var ApiClient = class {
|
|
|
493
493
|
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
494
494
|
return this.get(`/v1/orders/counter-offers?${params}`);
|
|
495
495
|
}
|
|
496
|
-
getMetadataSignedUrl() {
|
|
497
|
-
|
|
496
|
+
getMetadataSignedUrl(kind) {
|
|
497
|
+
const params = kind ? `?kind=${kind}` : "";
|
|
498
|
+
return this.get(`/v1/metadata/signed-url${params}`);
|
|
498
499
|
}
|
|
499
500
|
uploadMetadata(metadata) {
|
|
500
501
|
return this.post("/v1/metadata/upload", metadata);
|
|
@@ -1305,48 +1306,7 @@ function requestIp(req) {
|
|
|
1305
1306
|
return req.headers.get("x-forwarded-for")?.split(",")[0].trim() ?? "unknown";
|
|
1306
1307
|
}
|
|
1307
1308
|
|
|
1308
|
-
// src/server/
|
|
1309
|
-
var DEFAULT_STARKNET_RPC_METHODS = [
|
|
1310
|
-
"starknet_call",
|
|
1311
|
-
"starknet_addInvokeTransaction",
|
|
1312
|
-
"starknet_getTransactionReceipt",
|
|
1313
|
-
"starknet_getTransactionStatus",
|
|
1314
|
-
"starknet_getTransactionByHash",
|
|
1315
|
-
"starknet_getTransaction",
|
|
1316
|
-
"starknet_getBlockWithReceipts",
|
|
1317
|
-
"starknet_estimateFee",
|
|
1318
|
-
"starknet_getNonce",
|
|
1319
|
-
"starknet_simulateTransactions",
|
|
1320
|
-
"starknet_specVersion",
|
|
1321
|
-
"starknet_chainId",
|
|
1322
|
-
"starknet_blockNumber",
|
|
1323
|
-
"starknet_blockHashAndNumber",
|
|
1324
|
-
"starknet_getClassAt",
|
|
1325
|
-
"starknet_getClass",
|
|
1326
|
-
"starknet_getClassHashAt",
|
|
1327
|
-
"starknet_getStorageAt",
|
|
1328
|
-
"starknet_getBlockWithTxHashes",
|
|
1329
|
-
"starknet_getBlockWithTxs",
|
|
1330
|
-
"starknet_getEvents"
|
|
1331
|
-
];
|
|
1332
|
-
function isAllowedMethod(body, allowed) {
|
|
1333
|
-
if (Array.isArray(body)) {
|
|
1334
|
-
return body.every((item) => isAllowedMethod(item, allowed));
|
|
1335
|
-
}
|
|
1336
|
-
if (body && typeof body === "object") {
|
|
1337
|
-
const method = body.method;
|
|
1338
|
-
return typeof method === "string" && allowed.has(method);
|
|
1339
|
-
}
|
|
1340
|
-
return false;
|
|
1341
|
-
}
|
|
1342
|
-
function extractMethod(body) {
|
|
1343
|
-
if (Array.isArray(body)) return "batch";
|
|
1344
|
-
if (body && typeof body === "object") {
|
|
1345
|
-
const method = body.method;
|
|
1346
|
-
if (typeof method === "string") return method;
|
|
1347
|
-
}
|
|
1348
|
-
return "unknown";
|
|
1349
|
-
}
|
|
1309
|
+
// src/server/origin.ts
|
|
1350
1310
|
function isSameOrigin(req) {
|
|
1351
1311
|
const origin = req.headers.get("origin");
|
|
1352
1312
|
if (!origin) return true;
|
|
@@ -1357,28 +1317,14 @@ function isSameOrigin(req) {
|
|
|
1357
1317
|
return false;
|
|
1358
1318
|
}
|
|
1359
1319
|
}
|
|
1320
|
+
|
|
1321
|
+
// src/server/rpc-proxy.ts
|
|
1360
1322
|
function rpcError(code, message, status = 200, id = null) {
|
|
1361
1323
|
return Response.json({ jsonrpc: "2.0", error: { code, message }, id }, { status });
|
|
1362
1324
|
}
|
|
1363
|
-
async function billRpcCall(backendUrl, apiKey, method) {
|
|
1364
|
-
if (!apiKey) {
|
|
1365
|
-
console.error("[rpc-proxy] no API key configured \u2014 refusing to bill/forward");
|
|
1366
|
-
return false;
|
|
1367
|
-
}
|
|
1368
|
-
try {
|
|
1369
|
-
const res = await fetch(`${backendUrl.replace(/\/$/, "")}/v1/rpc/meter`, {
|
|
1370
|
-
method: "POST",
|
|
1371
|
-
headers: { "Content-Type": "application/json", "x-api-key": apiKey },
|
|
1372
|
-
body: JSON.stringify({ method })
|
|
1373
|
-
});
|
|
1374
|
-
return res.ok;
|
|
1375
|
-
} catch (err) {
|
|
1376
|
-
console.error("[rpc-proxy] billing call failed", { err: err instanceof Error ? err.message : String(err) });
|
|
1377
|
-
return false;
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
1325
|
function createRpcProxyHandler(config) {
|
|
1381
|
-
const
|
|
1326
|
+
const doFetch = config.fetchImpl ?? fetch;
|
|
1327
|
+
const endpoint = `${config.backendUrl.replace(/\/$/, "")}/v1/rpc`;
|
|
1382
1328
|
return async function handleRpcProxy(req) {
|
|
1383
1329
|
if (!isSameOrigin(req)) {
|
|
1384
1330
|
return rpcError(-32600, "Cross-origin requests are not allowed", 403);
|
|
@@ -1386,66 +1332,29 @@ function createRpcProxyHandler(config) {
|
|
|
1386
1332
|
if (!config.checkRateLimit(requestIp(req))) {
|
|
1387
1333
|
return rpcError(-32005, "Too many requests", 429);
|
|
1388
1334
|
}
|
|
1335
|
+
if (!config.apiKey) {
|
|
1336
|
+
return rpcError(-32003, "No API key configured \u2014 RPC call not forwarded", 402);
|
|
1337
|
+
}
|
|
1389
1338
|
let body;
|
|
1390
1339
|
try {
|
|
1391
1340
|
body = await req.json();
|
|
1392
1341
|
} catch {
|
|
1393
1342
|
return rpcError(-32700, "Parse error");
|
|
1394
1343
|
}
|
|
1395
|
-
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
headers: { "Content-Type": "application/json" },
|
|
1409
|
-
body: JSON.stringify(body)
|
|
1410
|
-
});
|
|
1411
|
-
const text = await response.text();
|
|
1412
|
-
const upstream = rpcUrl.split("/")[2];
|
|
1413
|
-
if (!text) {
|
|
1414
|
-
lastError = `Upstream RPC returned empty body (HTTP ${response.status})`;
|
|
1415
|
-
console.warn("[rpc-proxy] upstream returned empty body", { status: response.status, upstream });
|
|
1416
|
-
continue;
|
|
1417
|
-
}
|
|
1418
|
-
try {
|
|
1419
|
-
const data = JSON.parse(text);
|
|
1420
|
-
if (isTransientRpcError({ status: response.status, body: data })) {
|
|
1421
|
-
const errObj = data.error;
|
|
1422
|
-
lastError = `Upstream RPC returned transient JSON-RPC error: ${String(errObj?.message ?? "(no message)")}`;
|
|
1423
|
-
console.warn("[rpc-proxy] upstream returned transient JSON-RPC error", {
|
|
1424
|
-
upstream,
|
|
1425
|
-
code: errObj?.code,
|
|
1426
|
-
message: errObj?.message
|
|
1427
|
-
});
|
|
1428
|
-
continue;
|
|
1429
|
-
}
|
|
1430
|
-
return Response.json(data, { status: 200 });
|
|
1431
|
-
} catch {
|
|
1432
|
-
lastError = `Upstream RPC returned non-JSON (HTTP ${response.status})`;
|
|
1433
|
-
console.warn("[rpc-proxy] upstream returned non-JSON", {
|
|
1434
|
-
status: response.status,
|
|
1435
|
-
upstream,
|
|
1436
|
-
bodyPreview: text.slice(0, 200)
|
|
1437
|
-
});
|
|
1438
|
-
continue;
|
|
1439
|
-
}
|
|
1440
|
-
} catch (err) {
|
|
1441
|
-
lastError = `Upstream RPC unreachable: ${err instanceof Error ? err.message : "unknown error"}`;
|
|
1442
|
-
console.warn("[rpc-proxy] upstream fetch failed", {
|
|
1443
|
-
upstream: rpcUrl.split("/")[2],
|
|
1444
|
-
err: err instanceof Error ? err.message : String(err)
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1344
|
+
try {
|
|
1345
|
+
const upstream = await doFetch(endpoint, {
|
|
1346
|
+
method: "POST",
|
|
1347
|
+
headers: { "Content-Type": "application/json", "x-api-key": config.apiKey },
|
|
1348
|
+
body: JSON.stringify(body)
|
|
1349
|
+
});
|
|
1350
|
+
const text = await upstream.text();
|
|
1351
|
+
return new Response(text, {
|
|
1352
|
+
status: upstream.status,
|
|
1353
|
+
headers: { "Content-Type": "application/json" }
|
|
1354
|
+
});
|
|
1355
|
+
} catch {
|
|
1356
|
+
return rpcError(-32603, "RPC backend unreachable");
|
|
1447
1357
|
}
|
|
1448
|
-
return rpcError(-32603, lastError);
|
|
1449
1358
|
};
|
|
1450
1359
|
}
|
|
1451
1360
|
|
|
@@ -1529,6 +1438,6 @@ function resolveSafeImageContentType(contentType) {
|
|
|
1529
1438
|
}
|
|
1530
1439
|
var MAX_IPFS_GATEWAY_RESPONSE_BYTES = 25 * 1024 * 1024;
|
|
1531
1440
|
|
|
1532
|
-
export { ApiClient, CHAINS, DEFAULT_CHAIN, DEFAULT_CURRENCY,
|
|
1441
|
+
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, createFailoverFetch, createRateLimiter, createRpcProxyHandler, encodeU256, formatAmount, getCoordinates, getListableTokens, getService, getServicesByCapability, getStarknetCoordinates, getTokenByAddress, getTokenBySymbol, hasCapability, isSameOrigin, isServiceId, isTransientRpcError, isValidIpfsCidPath, listServices, normalizeAddress, normalizeHash, parseAmount, requestIp, resolveConfig, resolveFeeConfig, resolveSafeImageContentType, shortenAddress, stringifyBigInts, u256ToBigInt };
|
|
1533
1442
|
//# sourceMappingURL=index.js.map
|
|
1534
1443
|
//# sourceMappingURL=index.js.map
|