@medialane/sdk 0.34.0 → 0.35.1

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.d.cts CHANGED
@@ -59,17 +59,12 @@ declare const DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf
59
59
  /** IPCollectionFactory v0.3.0 (deployed mainnet 2026-06-10): sequential on-chain
60
60
  * edition ids, ownerless/immutable. New collections deploy from here. */
61
61
  declare const COLLECTION_1155_CONTRACT_MAINNET = "0x0083543c3ee15040a419fc539fa6889f5b956e7d071bcfa97842cb0ae42ad6cc";
62
- /** Prior ERC-1155 factory (v0.2.0, caller-supplied timestamp ids, mint_item).
63
- * Kept so the indexer can still recognise collections deployed before cutover. */
64
- declare const COLLECTION_1155_CONTRACT_LEGACY_MAINNET = "0x067064adcaaed61e17bf50ea802ea6482336126aec5b4d032b4ff8fbb5009131";
65
62
  /** Class hash of the IPCollectionFactory v0.3.0 implementation. */
66
63
  declare const COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET = "0x331a69da8655a882ba1fbcb55188b8fa09116521db901bbbaafc9fead0689f8";
67
64
  /** Class hash of the IPCollection ERC-1155 v0.3.0 implementation. */
68
65
  declare const COLLECTION_1155_CLASS_HASH_MAINNET = "0x4e110b59af240ae6c7742999964c4eae13fb2ed935c47fe97653ec017ebea34";
69
66
  /** First mainnet block of the v0.3.0 ERC-1155 factory deployment. */
70
67
  declare const COLLECTION_1155_START_BLOCK_MAINNET = 10665319;
71
- /** First mainnet block of the prior (v0.2.0) ERC-1155 factory. */
72
- declare const COLLECTION_1155_START_BLOCK_LEGACY_MAINNET = 10045611;
73
68
  /** Creator Coin Factory — entrypoint: create_creator_coin + launch_on_ekubo. */
74
69
  declare const CREATOR_COIN_FACTORY_CONTRACT_MAINNET = "0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c";
75
70
  /** EkuboLauncher — permanently holds (locks) each Creator Coin's LP position. */
@@ -1661,6 +1656,27 @@ interface CreatorCoinPrice {
1661
1656
  * dependency — works for day-one coins that AVNU doesn't index yet.
1662
1657
  */
1663
1658
  declare function getCreatorCoinPrice(coinAddress: string, provider: ProviderInterface): Promise<CreatorCoinPrice | null>;
1659
+ /** Build the `create_creator_coin` call (full supply minted to the Factory). */
1660
+ declare function buildCreateCreatorCoinCall(params: CreateCreatorCoinParams): Call;
1661
+ /**
1662
+ * Build the Ekubo launch multicall: optional quote `transfer` (pre-funds the
1663
+ * Factory for the team-allocation buyback) + `launch_on_ekubo`.
1664
+ */
1665
+ declare function buildLaunchOnEkuboCalls(params: EkuboLaunchParams): Call[];
1666
+ /** Minimal receipt shape — works with any starknet.js receipt version. */
1667
+ interface CreatorCoinReceiptLike {
1668
+ events?: Array<{
1669
+ from_address?: string;
1670
+ keys?: string[];
1671
+ data?: string[];
1672
+ }>;
1673
+ }
1674
+ /**
1675
+ * Pull the deployed coin address from a `create_creator_coin` tx receipt.
1676
+ * Event data = [owner, name, symbol, supply_low, supply_high, coin_address].
1677
+ * Throws when the receipt carries no matching Factory event.
1678
+ */
1679
+ declare function parseCreatorCoinCreated(receipt: CreatorCoinReceiptLike): string;
1664
1680
  /**
1665
1681
  * On-chain Creator Coin interactions (Ekubo-only launchpad).
1666
1682
  * Faithful fork of unruggable.meme — permanent LP lock + team-allocation buyback.
@@ -5867,4 +5883,4 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
5867
5883
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
5868
5884
  declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
5869
5885
 
5870
- export { type ActivityType, type AddSupplyParams, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_LEGACY_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_LEGACY_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
5886
+ export { type ActivityType, type AddSupplyParams, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, parseCreatorCoinCreated, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.d.ts CHANGED
@@ -59,17 +59,12 @@ declare const DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf
59
59
  /** IPCollectionFactory v0.3.0 (deployed mainnet 2026-06-10): sequential on-chain
60
60
  * edition ids, ownerless/immutable. New collections deploy from here. */
61
61
  declare const COLLECTION_1155_CONTRACT_MAINNET = "0x0083543c3ee15040a419fc539fa6889f5b956e7d071bcfa97842cb0ae42ad6cc";
62
- /** Prior ERC-1155 factory (v0.2.0, caller-supplied timestamp ids, mint_item).
63
- * Kept so the indexer can still recognise collections deployed before cutover. */
64
- declare const COLLECTION_1155_CONTRACT_LEGACY_MAINNET = "0x067064adcaaed61e17bf50ea802ea6482336126aec5b4d032b4ff8fbb5009131";
65
62
  /** Class hash of the IPCollectionFactory v0.3.0 implementation. */
66
63
  declare const COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET = "0x331a69da8655a882ba1fbcb55188b8fa09116521db901bbbaafc9fead0689f8";
67
64
  /** Class hash of the IPCollection ERC-1155 v0.3.0 implementation. */
68
65
  declare const COLLECTION_1155_CLASS_HASH_MAINNET = "0x4e110b59af240ae6c7742999964c4eae13fb2ed935c47fe97653ec017ebea34";
69
66
  /** First mainnet block of the v0.3.0 ERC-1155 factory deployment. */
70
67
  declare const COLLECTION_1155_START_BLOCK_MAINNET = 10665319;
71
- /** First mainnet block of the prior (v0.2.0) ERC-1155 factory. */
72
- declare const COLLECTION_1155_START_BLOCK_LEGACY_MAINNET = 10045611;
73
68
  /** Creator Coin Factory — entrypoint: create_creator_coin + launch_on_ekubo. */
74
69
  declare const CREATOR_COIN_FACTORY_CONTRACT_MAINNET = "0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c";
75
70
  /** EkuboLauncher — permanently holds (locks) each Creator Coin's LP position. */
@@ -1661,6 +1656,27 @@ interface CreatorCoinPrice {
1661
1656
  * dependency — works for day-one coins that AVNU doesn't index yet.
1662
1657
  */
1663
1658
  declare function getCreatorCoinPrice(coinAddress: string, provider: ProviderInterface): Promise<CreatorCoinPrice | null>;
1659
+ /** Build the `create_creator_coin` call (full supply minted to the Factory). */
1660
+ declare function buildCreateCreatorCoinCall(params: CreateCreatorCoinParams): Call;
1661
+ /**
1662
+ * Build the Ekubo launch multicall: optional quote `transfer` (pre-funds the
1663
+ * Factory for the team-allocation buyback) + `launch_on_ekubo`.
1664
+ */
1665
+ declare function buildLaunchOnEkuboCalls(params: EkuboLaunchParams): Call[];
1666
+ /** Minimal receipt shape — works with any starknet.js receipt version. */
1667
+ interface CreatorCoinReceiptLike {
1668
+ events?: Array<{
1669
+ from_address?: string;
1670
+ keys?: string[];
1671
+ data?: string[];
1672
+ }>;
1673
+ }
1674
+ /**
1675
+ * Pull the deployed coin address from a `create_creator_coin` tx receipt.
1676
+ * Event data = [owner, name, symbol, supply_low, supply_high, coin_address].
1677
+ * Throws when the receipt carries no matching Factory event.
1678
+ */
1679
+ declare function parseCreatorCoinCreated(receipt: CreatorCoinReceiptLike): string;
1664
1680
  /**
1665
1681
  * On-chain Creator Coin interactions (Ekubo-only launchpad).
1666
1682
  * Faithful fork of unruggable.meme — permanent LP lock + team-allocation buyback.
@@ -5867,4 +5883,4 @@ declare function build1155OrderTypedData(message: Record<string, unknown>, chain
5867
5883
  declare function buildCancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
5868
5884
  declare function build1155CancellationTypedData(message: Record<string, unknown>, chainId: constants.StarknetChainId | string): TypedData;
5869
5885
 
5870
- export { type ActivityType, type AddSupplyParams, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_LEGACY_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_LEGACY_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
5886
+ export { type ActivityType, type AddSupplyParams, type ApiActivitiesQuery, type ApiActivity, type ApiActivityPrice, type ApiAdminCollectionClaim, type ApiAppSource, type ApiChain, ApiClient, type ApiCollection, type ApiCollectionClaim, type ApiCollectionProfile, type ApiCollectionSlugClaim, type ApiCollectionsQuery, type ApiComment, type ApiCounterOffersQuery, type ApiCreatorListResult, type ApiCreatorProfile, type ApiIntent, type ApiIntentCreated, type ApiKeyStatus, type ApiMeta, type ApiMetadataSignedUrl, type ApiMetadataUpload, type ApiOrder, type ApiOrderConsideration, type ApiOrderOffer, type ApiOrderPrice, type ApiOrderTokenMeta, type ApiOrderTxHash, type ApiOrdersQuery, type ApiPortalKey, type ApiPortalKeyCreated, type ApiPortalMe, type ApiPublicRemix, type ApiRemixOffer, type ApiRemixOfferPrice, type ApiRemixOffersQuery, type ApiResponse, type ApiSearchCollectionResult, type ApiSearchCreatorResult, type ApiSearchResult, type ApiSearchTokenResult, type ApiToken, type ApiTokenBalance, type ApiTokenMetadata, type ApiUsageDay, type ApiUserWallet, type ApiWalletType, type ApiWebhookCreated, type ApiWebhookEndpoint, type AutoRemixOfferParams, type BatchMintEditionParams, type BuildFeeCallParams, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, type CancelOrder1155Params, type CancelOrderIntentParams, type CancelOrderParams, type Cancelation, type CartItem, type ClaimConditions, CollectionRegistryABI, type CollectionSort, type ConfirmRemixOfferParams, type ConfirmSelfRemixParams, type ConsiderationItem, type CreateCollectionIntentParams, type CreateCollectionParams, type CreateCounterOfferIntentParams, type CreateCreatorCoinParams, type CreateDropParams, type CreateListing1155Params, type CreateListingIntentParams, type CreateListingParams, type CreateMintIntentParams, type CreatePopCollectionParams, type CreateRemixOfferParams, type CreateWebhookParams, CreatorCoinFactoryABI, type CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, type DropMintStatus, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EnforcementDeclaration, type FailoverFetchOptions, type FeeConfig, FeeConfigSchema, type FeeSurface, type FulfillOrder1155Params, type FulfillOrderIntentParams, type FulfillOrderParams, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, type IPType, type IntentCall, type IntentStatus, type IntentType, type IpAttribute, type IpNftMetadata, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, type MakeOffer1155Params, type MakeOfferIntentParams, type MakeOfferParams, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, type MedialaneConfig, MedialaneError, type MedialaneErrorCode, type MintEditionParams, type MintParams, NFTCOMMENTS_CONTRACT_MAINNET, type Network, OPEN_LICENSES, type OfferItem, type OpenLicense, type Order, type OrderDetails, type OrderParameters, type OrderStatus, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, type PopBatchEligibilityItem, type PopClaimStatus, type PopEventType, PopService, type RemixOfferStatus, type ResolvedConfig, type ResolvedFeeConfig, type RetryOptions, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, type ServiceCapability, type ServiceDefinition, type ServiceEventDeclaration, type ServiceId, type SortOrder, type SupportedToken, type SupportedTokenSymbol, type TenantPlan, type TxResult, VALIDATED_EKUBO_PARAMS, type WebhookEventType, type WebhookStatus, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, parseCreatorCoinCreated, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { cairo, num, Contract, uint256, RpcProvider, TypedDataRevision, shortString, constants } from 'starknet';
2
+ import { hash, cairo, num, Contract, uint256, RpcProvider, TypedDataRevision, shortString, constants } from 'starknet';
3
3
 
4
4
  // src/config.ts
5
5
 
@@ -56,11 +56,9 @@ var DEFAULT_RPC_URL = "https://rpc.starknet.lava.build";
56
56
  var POP_COLLECTION_CLASS_HASH_MAINNET = "0x077c421686f10851872561953ea16898d933364b7f8937a5d7e2b1ba0a36263f";
57
57
  var DROP_COLLECTION_CLASS_HASH_MAINNET = "0x00092e72cdb63067521e803aaf7d4101c3e3ce026ae6bc045ec4228027e58282";
58
58
  var COLLECTION_1155_CONTRACT_MAINNET = "0x0083543c3ee15040a419fc539fa6889f5b956e7d071bcfa97842cb0ae42ad6cc";
59
- var COLLECTION_1155_CONTRACT_LEGACY_MAINNET = "0x067064adcaaed61e17bf50ea802ea6482336126aec5b4d032b4ff8fbb5009131";
60
59
  var COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET = "0x331a69da8655a882ba1fbcb55188b8fa09116521db901bbbaafc9fead0689f8";
61
60
  var COLLECTION_1155_CLASS_HASH_MAINNET = "0x4e110b59af240ae6c7742999964c4eae13fb2ed935c47fe97653ec017ebea34";
62
61
  var COLLECTION_1155_START_BLOCK_MAINNET = 10665319;
63
- var COLLECTION_1155_START_BLOCK_LEGACY_MAINNET = 10045611;
64
62
  var CREATOR_COIN_FACTORY_CONTRACT_MAINNET = "0x50fa807b5274079fb19374673d7bab6d2dc3af7e1032ea43eb6e44bcbde4c3c";
65
63
  var CREATOR_COIN_EKUBO_LAUNCHER_MAINNET = "0x4f7fceb5ac10f12f9544a09580592e5bdf1b7f04f48765eecf12286d8ccb7b4";
66
64
  var CREATOR_COIN_CLASS_HASH_MAINNET = "0x743e4c8a5b96bb83bbf4af04edbbb482d5ece89eed9b729a79fb7df0cd0b6b6";
@@ -5397,12 +5395,12 @@ function normalizeAddress(address) {
5397
5395
  throw new Error(`Invalid Starknet address: "${address}"`);
5398
5396
  }
5399
5397
  }
5400
- function normalizeHash(hash) {
5398
+ function normalizeHash(hash2) {
5401
5399
  try {
5402
- const hex = num.toHex(BigInt(hash));
5400
+ const hex = num.toHex(BigInt(hash2));
5403
5401
  return "0x" + hex.slice(2).padStart(64, "0").toLowerCase();
5404
5402
  } catch {
5405
- throw new Error(`Invalid Starknet hash: "${hash}"`);
5403
+ throw new Error(`Invalid Starknet hash: "${hash2}"`);
5406
5404
  }
5407
5405
  }
5408
5406
  function shortenAddress(address, chars = 4) {
@@ -6319,6 +6317,73 @@ async function getCreatorCoinPrice(coinAddress, provider) {
6319
6317
  const quotePerCoin = (quoteIsToken0 ? 1 / priceT1perT0 : priceT1perT0) * decAdj;
6320
6318
  return { quotePerCoin, quoteToken, quoteSymbol: token?.symbol ?? null, quoteDecimals };
6321
6319
  }
6320
+ var _factoryContract = null;
6321
+ function factoryContract() {
6322
+ if (!_factoryContract) {
6323
+ _factoryContract = new Contract(
6324
+ CreatorCoinFactoryABI,
6325
+ CREATOR_COIN_FACTORY_CONTRACT_MAINNET
6326
+ );
6327
+ }
6328
+ return _factoryContract;
6329
+ }
6330
+ function buildCreateCreatorCoinCall(params) {
6331
+ const salt = params.salt ?? BigInt("0x" + Date.now().toString(16));
6332
+ return factoryContract().populate("create_creator_coin", [
6333
+ params.owner,
6334
+ params.name,
6335
+ params.symbol,
6336
+ BigInt(params.initialSupply),
6337
+ BigInt(salt)
6338
+ ]);
6339
+ }
6340
+ function buildLaunchOnEkuboCalls(params) {
6341
+ const ek = params.ekubo ?? VALIDATED_EKUBO_PARAMS;
6342
+ const launchParameters = {
6343
+ creator_coin_address: params.creatorCoin,
6344
+ transfer_restriction_delay: params.transferRestrictionDelay ?? 0,
6345
+ max_percentage_buy_launch: params.maxPercentageBuyLaunch ?? 200,
6346
+ quote_address: params.quoteToken,
6347
+ initial_holders: params.initialHolders,
6348
+ initial_holders_amounts: params.initialHoldersAmounts.map((a) => BigInt(a))
6349
+ };
6350
+ const ekuboParameters = {
6351
+ fee: BigInt(ek.fee),
6352
+ tick_spacing: BigInt(ek.tickSpacing),
6353
+ starting_price: { mag: BigInt(ek.startingPrice.mag), sign: ek.startingPrice.sign },
6354
+ bound: BigInt(ek.bound)
6355
+ };
6356
+ const calls = [];
6357
+ if (params.quoteFundAmount !== void 0) {
6358
+ const amt = uint256.bnToUint256(BigInt(params.quoteFundAmount));
6359
+ calls.push({
6360
+ contractAddress: params.quoteToken,
6361
+ entrypoint: "transfer",
6362
+ calldata: [CREATOR_COIN_FACTORY_CONTRACT_MAINNET, amt.low, amt.high]
6363
+ });
6364
+ }
6365
+ calls.push(factoryContract().populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
6366
+ return calls;
6367
+ }
6368
+ var CREATOR_COIN_CREATED_SELECTOR = hash.getSelectorFromName("CreatorCoinCreated");
6369
+ function parseCreatorCoinCreated(receipt) {
6370
+ const factory = normalizeAddress(CREATOR_COIN_FACTORY_CONTRACT_MAINNET);
6371
+ for (const ev of receipt?.events ?? []) {
6372
+ let from;
6373
+ try {
6374
+ from = normalizeAddress(ev.from_address ?? "");
6375
+ } catch {
6376
+ continue;
6377
+ }
6378
+ if (from !== factory) continue;
6379
+ const k0 = ev.keys?.[0];
6380
+ if (!k0 || normalizeAddress(k0) !== normalizeAddress(CREATOR_COIN_CREATED_SELECTOR)) continue;
6381
+ const data = ev.data ?? [];
6382
+ if (data.length < 1) continue;
6383
+ return normalizeAddress(data[data.length - 1]);
6384
+ }
6385
+ throw new Error("Coin deployed but the coin address could not be read from the receipt");
6386
+ }
6322
6387
  var CreatorCoinService = class {
6323
6388
  constructor(config) {
6324
6389
  this.factoryAddress = CREATOR_COIN_FACTORY_CONTRACT_MAINNET;
@@ -6329,15 +6394,7 @@ var CreatorCoinService = class {
6329
6394
  }
6330
6395
  /** Deploy a fixed-supply CreatorCoin (full supply minted to the Factory). */
6331
6396
  async createCreatorCoin(account, params) {
6332
- const salt = params.salt ?? BigInt("0x" + Date.now().toString(16));
6333
- const call = this._factory(account).populate("create_creator_coin", [
6334
- params.owner,
6335
- params.name,
6336
- params.symbol,
6337
- BigInt(params.initialSupply),
6338
- BigInt(salt)
6339
- ]);
6340
- const res = await account.execute([call]);
6397
+ const res = await account.execute([buildCreateCreatorCoinCall(params)]);
6341
6398
  return { txHash: res.transaction_hash };
6342
6399
  }
6343
6400
  /**
@@ -6346,33 +6403,7 @@ var CreatorCoinService = class {
6346
6403
  * locked in the EkuboLauncher.
6347
6404
  */
6348
6405
  async launchOnEkubo(account, params) {
6349
- const ek = params.ekubo ?? VALIDATED_EKUBO_PARAMS;
6350
- const factory = this._factory(account);
6351
- const launchParameters = {
6352
- creator_coin_address: params.creatorCoin,
6353
- transfer_restriction_delay: params.transferRestrictionDelay ?? 0,
6354
- max_percentage_buy_launch: params.maxPercentageBuyLaunch ?? 200,
6355
- quote_address: params.quoteToken,
6356
- initial_holders: params.initialHolders,
6357
- initial_holders_amounts: params.initialHoldersAmounts.map((a) => BigInt(a))
6358
- };
6359
- const ekuboParameters = {
6360
- fee: BigInt(ek.fee),
6361
- tick_spacing: BigInt(ek.tickSpacing),
6362
- starting_price: { mag: BigInt(ek.startingPrice.mag), sign: ek.startingPrice.sign },
6363
- bound: BigInt(ek.bound)
6364
- };
6365
- const calls = [];
6366
- if (params.quoteFundAmount !== void 0) {
6367
- const amt = uint256.bnToUint256(BigInt(params.quoteFundAmount));
6368
- calls.push({
6369
- contractAddress: params.quoteToken,
6370
- entrypoint: "transfer",
6371
- calldata: [this.factoryAddress, amt.low, amt.high]
6372
- });
6373
- }
6374
- calls.push(factory.populate("launch_on_ekubo", [launchParameters, ekuboParameters]));
6375
- const res = await account.execute(calls);
6406
+ const res = await account.execute(buildLaunchOnEkuboCalls(params));
6376
6407
  return { txHash: res.transaction_hash };
6377
6408
  }
6378
6409
  /** View: is this address a Factory-deployed Creator Coin? */
@@ -6628,6 +6659,6 @@ function getServicesByCapability(cap) {
6628
6659
  );
6629
6660
  }
6630
6661
 
6631
- export { ApiClient, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_LEGACY_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_LEGACY_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, CollectionRegistryABI, CreatorCoinFactoryABI, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, DropCollectionABI, DropFactoryABI, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, FeeConfigSchema, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, MedialaneError, NFTCOMMENTS_CONTRACT_MAINNET, OPEN_LICENSES, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, PopService, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, VALIDATED_EKUBO_PARAMS, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildFeeCall, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
6662
+ export { ApiClient, COLLECTION_1155_CLASS_HASH_MAINNET, COLLECTION_1155_CONTRACT_MAINNET, COLLECTION_1155_FACTORY_CLASS_HASH_MAINNET, COLLECTION_1155_START_BLOCK_MAINNET, COLLECTION_721_CONTRACT_MAINNET, COLLECTION_721_START_BLOCK_MAINNET, CREATOR_COIN_CLASS_HASH_MAINNET, CREATOR_COIN_EKUBO_LAUNCHER_MAINNET, CREATOR_COIN_FACTORY_CLASS_HASH_MAINNET, CREATOR_COIN_FACTORY_CONTRACT_MAINNET, CREATOR_COIN_START_BLOCK_MAINNET, CollectionRegistryABI, CreatorCoinFactoryABI, CreatorCoinService, DEFAULT_RPC_URL, DROP_COLLECTION_CLASS_HASH_MAINNET, DROP_FACTORY_CONTRACT_MAINNET, DropCollectionABI, DropFactoryABI, DropService, EKUBO_CORE_MAINNET, ERC1155CollectionService, FeeConfigSchema, IPCOLLECTION_CLASS_HASH_MAINNET, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPMarketplaceABI, IPNFT_CLASS_HASH_MAINNET, IPNftABI, MARKETPLACE_1155_CLASS_HASH_MAINNET, MARKETPLACE_1155_CONTRACT_MAINNET, MARKETPLACE_1155_START_BLOCK_MAINNET, MARKETPLACE_721_CLASS_HASH_MAINNET, MARKETPLACE_721_CONTRACT_MAINNET, MARKETPLACE_721_START_BLOCK_MAINNET, MarketplaceModule, Medialane1155ABI, Medialane1155Module, MedialaneApiError, MedialaneClient, MedialaneError, NFTCOMMENTS_CONTRACT_MAINNET, OPEN_LICENSES, POPCollectionABI, POPFactoryABI, POP_COLLECTION_CLASS_HASH_MAINNET, POP_FACTORY_CONTRACT_MAINNET, PUBLIC_RPC_FALLBACKS, PopService, SUPPORTED_NETWORKS, SUPPORTED_TOKENS, VALIDATED_EKUBO_PARAMS, build1155CancellationTypedData, build1155OrderTypedData, buildCancellationTypedData, buildCreateCreatorCoinCall, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, createFailoverFetch, encodeByteArray, formatAmount, getCreatorCoinPrice, getListableTokens, getService, getServicesByCapability, getTokenByAddress, getTokenBySymbol, isServiceId, isTransientRpcError, listServices, normalizeAddress, normalizeHash, parseAmount, parseCreatorCoinCreated, resolveConfig, resolveFeeConfig, shortenAddress, stringifyBigInts, u256ToBigInt };
6632
6663
  //# sourceMappingURL=index.js.map
6633
6664
  //# sourceMappingURL=index.js.map