@medialane/sdk 0.170.0 → 0.172.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.
@@ -1,5 +1,5 @@
1
- import { bV as ResolvedConfig, b6 as CreatePopCollectionParams, c0 as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bF as MintTicketsParams, b2 as CreateMembershipParams, bE as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bS as ProposeSponsorshipParams, k as ApiClient, bC as MedialaneConfig, bD as MedialaneErrorCode, bK as OrderDetails, R as ResolvedFeeConfig, L as ApiFundingIntent, K as ApiFundingInstructions, O as ApiFundingSubmit, Q as ApiIntentCreated, bl as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-CZlv-DJJ.cjs';
2
- export { cd as InvalidRecoveryKeyError, ce as OwnerSigner, bN as PasskeyCancelledError, cf as PasskeyConfig, bO as PasskeyUnsupportedError, bP as PasskeyUnsupportedReason, cg as RecoveryKey, c2 as UserFacingError, ch as createPasskeyOwner, ci as encodeRecoveryKey, cj as parseRecoveryKey } from '../errors-CZlv-DJJ.cjs';
1
+ import { bS as ResolvedConfig, b4 as CreatePopCollectionParams, bZ as TxResult, aY as CreateDropParams, bb as CreateTicketParams, bC as MintTicketsParams, b0 as CreateMembershipParams, bB as MintMembershipsParams, b8 as CreateSponsorshipOfferParams, bP as ProposeSponsorshipParams, k as ApiClient, bz as MedialaneConfig, bA as MedialaneErrorCode, bH as OrderDetails, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bi as DropTerms, c4 as SealedOwner, c5 as ReceiptProviderLike, c6 as WalletExecutor, c7 as ExecutedTransaction, c8 as PasskeyOwner, bg as CreateWalletManageIntentParams, c9 as CreatedOwner } from '../errors-DvSfHOZu.cjs';
2
+ export { ca as InvalidRecoveryKeyError, cb as OwnerSigner, bK as PasskeyCancelledError, cc as PasskeyConfig, bL as PasskeyUnsupportedError, bM as PasskeyUnsupportedReason, cd as RecoveryKey, b$ as UserFacingError, ce as createPasskeyOwner, cf as encodeRecoveryKey, cg as parseRecoveryKey } from '../errors-DvSfHOZu.cjs';
3
3
  import * as starknet from 'starknet';
4
4
  import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
5
5
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-BTNjkUst.cjs';
@@ -8547,6 +8547,8 @@ declare const popCalls: {
8547
8547
  setAllowlistRoot(collection: string, root: string): Call;
8548
8548
  };
8549
8549
 
8550
+ /** Most tokens one claim transaction mints. */
8551
+ declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8550
8552
  /** Sale terms as the contract's `SaleTerms` struct. A free drop names no token. */
8551
8553
  declare function toContractTerms(t: DropTerms): {
8552
8554
  start_time: number;
@@ -8577,7 +8579,7 @@ interface DropMintCost {
8577
8579
  fee: bigint;
8578
8580
  total: bigint;
8579
8581
  }
8580
- declare function dropMintCost(price: bigint | string, quantity: bigint | string | number, cfg: ResolvedFeeConfig): DropMintCost;
8582
+ declare function dropMintCost(price: bigint | string, quantity: bigint | string | number, feeBps: number): DropMintCost;
8581
8583
 
8582
8584
  interface DropOnchain {
8583
8585
  organizer: string;
@@ -8599,8 +8601,6 @@ interface DropOnchain {
8599
8601
  declare function readDrop(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<DropOnchain>;
8600
8602
  /** How many tokens `wallet` has claimed from this drop (gifts not included). */
8601
8603
  declare function dropClaimedBy(provider: Pick<ProviderInterface, "callContract">, collection: string, wallet: string): Promise<bigint>;
8602
- /** Most tokens one claim transaction mints. */
8603
- declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8604
8604
  type DropMintStateKind = "loading" | "upcoming" | "ended" | "sold-out" | "no-wallet" | "no-link" | "not-on-list" | "limit-reached" | "insufficient-balance" | "ready";
8605
8605
  interface DropMintState {
8606
8606
  state: DropMintStateKind;
@@ -8617,7 +8617,8 @@ declare function dropMintState(input: {
8617
8617
  proof: string[] | null;
8618
8618
  /** Wallet balance of the payment token; null while loading (ignored for free drops). */
8619
8619
  balance: bigint | null;
8620
- feeConfig: ResolvedFeeConfig;
8620
+ /** Platform fee added to a mint, in basis points. */
8621
+ feeBps: number;
8621
8622
  /** Unix seconds. */
8622
8623
  now: number;
8623
8624
  }): DropMintState;
@@ -8644,6 +8645,11 @@ interface SponsoredExecuteConfig {
8644
8645
  fetchImpl?: typeof fetch;
8645
8646
  headers?: Record<string, string>;
8646
8647
  }
8648
+ type SponsoredRequest = {
8649
+ intentIds: string[];
8650
+ } | {
8651
+ userAddress: string;
8652
+ };
8647
8653
  type SponsoredExecuteResult = {
8648
8654
  status: "sponsored";
8649
8655
  transactionHash: string;
@@ -8655,7 +8661,7 @@ declare class SponsoredCallRejectedError extends Error {
8655
8661
  }
8656
8662
  type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
8657
8663
  declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
8658
- declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
8664
+ declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, request: SponsoredRequest): Promise<SponsoredExecuteResult>;
8659
8665
 
8660
8666
  declare function encodeByteArray(str: string): string[];
8661
8667
 
@@ -8911,4 +8917,4 @@ declare function claimSessionWallet(api: Pick<ApiClient, "setupWalletKey">, wall
8911
8917
 
8912
8918
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8913
8919
 
8914
- export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, type CreateCreatorCoinParams, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, type DeployCollectionParams, type DeployingServiceId, type DeploymentCoordinator, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, type DropMintCost, type DropMintState, type DropMintStateKind, type DropOnchain, DropService, DropTerms, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, type FundWithTransferOptions, type FundingApi, type FundingResult, type FundingStep, type FundingTransferCall, FundingTransferNotSentError, type FundingWallet, type GuardianInfo, type GuardianStatus, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, type PopAllowlist, type PopClaimInfo, type PopClaimLink, type PopClaimState, PopService, type ReceiptLike, type ReceiptProvider, ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, SealedOwner, type SelfFundConsent, type SelfFundConsentHandler, type SelfFundFeeEstimate, type SelfFundedDeps, type SessionWallet, type SessionWalletClaimDeps, type SiwsSigner, SponsoredCallRejectedError, type SponsoredDeps, type SponsoredExecuteConfig, type SponsoredExecuteResult, type SponsorshipFailureCode, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
8920
+ export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, type CreateCreatorCoinParams, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, type DeployCollectionParams, type DeployingServiceId, type DeploymentCoordinator, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, type DropMintCost, type DropMintState, type DropMintStateKind, type DropOnchain, DropService, DropTerms, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, type FundWithTransferOptions, type FundingApi, type FundingResult, type FundingStep, type FundingTransferCall, FundingTransferNotSentError, type FundingWallet, type GuardianInfo, type GuardianStatus, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, type PopAllowlist, type PopClaimInfo, type PopClaimLink, type PopClaimState, PopService, type ReceiptLike, type ReceiptProvider, ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, SealedOwner, type SelfFundConsent, type SelfFundConsentHandler, type SelfFundFeeEstimate, type SelfFundedDeps, type SessionWallet, type SessionWalletClaimDeps, type SiwsSigner, SponsoredCallRejectedError, type SponsoredDeps, type SponsoredExecuteConfig, type SponsoredExecuteResult, type SponsoredRequest, type SponsorshipFailureCode, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
@@ -1,5 +1,5 @@
1
- import { bV as ResolvedConfig, b6 as CreatePopCollectionParams, c0 as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bF as MintTicketsParams, b2 as CreateMembershipParams, bE as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bS as ProposeSponsorshipParams, k as ApiClient, bC as MedialaneConfig, bD as MedialaneErrorCode, bK as OrderDetails, R as ResolvedFeeConfig, L as ApiFundingIntent, K as ApiFundingInstructions, O as ApiFundingSubmit, Q as ApiIntentCreated, bl as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-PGCoVYdU.js';
2
- export { cd as InvalidRecoveryKeyError, ce as OwnerSigner, bN as PasskeyCancelledError, cf as PasskeyConfig, bO as PasskeyUnsupportedError, bP as PasskeyUnsupportedReason, cg as RecoveryKey, c2 as UserFacingError, ch as createPasskeyOwner, ci as encodeRecoveryKey, cj as parseRecoveryKey } from '../errors-PGCoVYdU.js';
1
+ import { bS as ResolvedConfig, b4 as CreatePopCollectionParams, bZ as TxResult, aY as CreateDropParams, bb as CreateTicketParams, bC as MintTicketsParams, b0 as CreateMembershipParams, bB as MintMembershipsParams, b8 as CreateSponsorshipOfferParams, bP as ProposeSponsorshipParams, k as ApiClient, bz as MedialaneConfig, bA as MedialaneErrorCode, bH as OrderDetails, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bi as DropTerms, c4 as SealedOwner, c5 as ReceiptProviderLike, c6 as WalletExecutor, c7 as ExecutedTransaction, c8 as PasskeyOwner, bg as CreateWalletManageIntentParams, c9 as CreatedOwner } from '../errors-5C3YHsDE.js';
2
+ export { ca as InvalidRecoveryKeyError, cb as OwnerSigner, bK as PasskeyCancelledError, cc as PasskeyConfig, bL as PasskeyUnsupportedError, bM as PasskeyUnsupportedReason, cd as RecoveryKey, b$ as UserFacingError, ce as createPasskeyOwner, cf as encodeRecoveryKey, cg as parseRecoveryKey } from '../errors-5C3YHsDE.js';
3
3
  import * as starknet from 'starknet';
4
4
  import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
5
5
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-BTNjkUst.js';
@@ -8547,6 +8547,8 @@ declare const popCalls: {
8547
8547
  setAllowlistRoot(collection: string, root: string): Call;
8548
8548
  };
8549
8549
 
8550
+ /** Most tokens one claim transaction mints. */
8551
+ declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8550
8552
  /** Sale terms as the contract's `SaleTerms` struct. A free drop names no token. */
8551
8553
  declare function toContractTerms(t: DropTerms): {
8552
8554
  start_time: number;
@@ -8577,7 +8579,7 @@ interface DropMintCost {
8577
8579
  fee: bigint;
8578
8580
  total: bigint;
8579
8581
  }
8580
- declare function dropMintCost(price: bigint | string, quantity: bigint | string | number, cfg: ResolvedFeeConfig): DropMintCost;
8582
+ declare function dropMintCost(price: bigint | string, quantity: bigint | string | number, feeBps: number): DropMintCost;
8581
8583
 
8582
8584
  interface DropOnchain {
8583
8585
  organizer: string;
@@ -8599,8 +8601,6 @@ interface DropOnchain {
8599
8601
  declare function readDrop(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<DropOnchain>;
8600
8602
  /** How many tokens `wallet` has claimed from this drop (gifts not included). */
8601
8603
  declare function dropClaimedBy(provider: Pick<ProviderInterface, "callContract">, collection: string, wallet: string): Promise<bigint>;
8602
- /** Most tokens one claim transaction mints. */
8603
- declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8604
8604
  type DropMintStateKind = "loading" | "upcoming" | "ended" | "sold-out" | "no-wallet" | "no-link" | "not-on-list" | "limit-reached" | "insufficient-balance" | "ready";
8605
8605
  interface DropMintState {
8606
8606
  state: DropMintStateKind;
@@ -8617,7 +8617,8 @@ declare function dropMintState(input: {
8617
8617
  proof: string[] | null;
8618
8618
  /** Wallet balance of the payment token; null while loading (ignored for free drops). */
8619
8619
  balance: bigint | null;
8620
- feeConfig: ResolvedFeeConfig;
8620
+ /** Platform fee added to a mint, in basis points. */
8621
+ feeBps: number;
8621
8622
  /** Unix seconds. */
8622
8623
  now: number;
8623
8624
  }): DropMintState;
@@ -8644,6 +8645,11 @@ interface SponsoredExecuteConfig {
8644
8645
  fetchImpl?: typeof fetch;
8645
8646
  headers?: Record<string, string>;
8646
8647
  }
8648
+ type SponsoredRequest = {
8649
+ intentIds: string[];
8650
+ } | {
8651
+ userAddress: string;
8652
+ };
8647
8653
  type SponsoredExecuteResult = {
8648
8654
  status: "sponsored";
8649
8655
  transactionHash: string;
@@ -8655,7 +8661,7 @@ declare class SponsoredCallRejectedError extends Error {
8655
8661
  }
8656
8662
  type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
8657
8663
  declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
8658
- declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
8664
+ declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, request: SponsoredRequest): Promise<SponsoredExecuteResult>;
8659
8665
 
8660
8666
  declare function encodeByteArray(str: string): string[];
8661
8667
 
@@ -8911,4 +8917,4 @@ declare function claimSessionWallet(api: Pick<ApiClient, "setupWalletKey">, wall
8911
8917
 
8912
8918
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8913
8919
 
8914
- export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, type CreateCreatorCoinParams, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, type DeployCollectionParams, type DeployingServiceId, type DeploymentCoordinator, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, type DropMintCost, type DropMintState, type DropMintStateKind, type DropOnchain, DropService, DropTerms, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, type FundWithTransferOptions, type FundingApi, type FundingResult, type FundingStep, type FundingTransferCall, FundingTransferNotSentError, type FundingWallet, type GuardianInfo, type GuardianStatus, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, type PopAllowlist, type PopClaimInfo, type PopClaimLink, type PopClaimState, PopService, type ReceiptLike, type ReceiptProvider, ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, SealedOwner, type SelfFundConsent, type SelfFundConsentHandler, type SelfFundFeeEstimate, type SelfFundedDeps, type SessionWallet, type SessionWalletClaimDeps, type SiwsSigner, SponsoredCallRejectedError, type SponsoredDeps, type SponsoredExecuteConfig, type SponsoredExecuteResult, type SponsorshipFailureCode, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
8920
+ export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, type CreateCreatorCoinParams, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, type DeployCollectionParams, type DeployingServiceId, type DeploymentCoordinator, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, type DropMintCost, type DropMintState, type DropMintStateKind, type DropOnchain, DropService, DropTerms, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, type FundWithTransferOptions, type FundingApi, type FundingResult, type FundingStep, type FundingTransferCall, FundingTransferNotSentError, type FundingWallet, type GuardianInfo, type GuardianStatus, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, type PopAllowlist, type PopClaimInfo, type PopClaimLink, type PopClaimState, PopService, type ReceiptLike, type ReceiptProvider, ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, SealedOwner, type SelfFundConsent, type SelfFundConsentHandler, type SelfFundFeeEstimate, type SelfFundedDeps, type SessionWallet, type SessionWalletClaimDeps, type SiwsSigner, SponsoredCallRejectedError, type SponsoredDeps, type SponsoredExecuteConfig, type SponsoredExecuteResult, type SponsoredRequest, type SponsorshipFailureCode, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, type TypedDataSigner, VALIDATED_EKUBO_PARAMS, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildPopAllowlist, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
@@ -1,5 +1,5 @@
1
- import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-HUTEU22Y.js';
2
- export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-HUTEU22Y.js';
1
+ import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-DDZJFN65.js';
2
+ export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-DDZJFN65.js';
3
3
  import { getStarknetCoordinates, getCoordinates } from '../chunk-WYKCGQPN.js';
4
4
  import { CallData, hash, cairo, RpcProvider, uint256, CairoOption, CairoOptionVariant, num, ec, validateAndParseAddress, Account, typedData, stark, byteArray, Contract, TypedDataRevision, constants, shortString } from 'starknet';
5
5
  import { extract, expand } from '@noble/hashes/hkdf.js';
@@ -10545,6 +10545,7 @@ function buildFeeCall(p, cfg) {
10545
10545
  calldata: [cfg.fundAddress, u.low.toString(), u.high.toString()]
10546
10546
  };
10547
10547
  }
10548
+ var DROP_MAX_CLAIM_QUANTITY = 50n;
10548
10549
  var addr2 = (a) => normalizeAddress("STARKNET", a);
10549
10550
  var factoryData = new CallData(DropFactoryABI);
10550
10551
  var collectionData = new CallData(DropCollectionABI);
@@ -10576,6 +10577,7 @@ var dropCalls = {
10576
10577
  /** Approve (paid drops) and claim. The platform fee call is added by the caller. */
10577
10578
  claim(collection, p) {
10578
10579
  const quantity = BigInt(p.quantity);
10580
+ if (quantity < 1n || quantity > DROP_MAX_CLAIM_QUANTITY) throw new RangeError(`quantity must be 1 to ${DROP_MAX_CLAIM_QUANTITY}`);
10579
10581
  const total = BigInt(p.price) * quantity;
10580
10582
  const calls = [];
10581
10583
  if (total > 0n) {
@@ -10594,10 +10596,12 @@ var dropCalls = {
10594
10596
  },
10595
10597
  /** Organizer only: free mint within the supply cap. */
10596
10598
  issue(collection, recipient, quantity) {
10599
+ const q = BigInt(quantity);
10600
+ if (q < 1n) throw new RangeError("quantity must be at least 1");
10597
10601
  return {
10598
10602
  contractAddress: addr2(collection),
10599
10603
  entrypoint: "issue",
10600
- calldata: collectionData.compile("issue", { recipient: addr2(recipient), quantity: cairo.uint256(BigInt(quantity)) })
10604
+ calldata: collectionData.compile("issue", { recipient: addr2(recipient), quantity: cairo.uint256(q) })
10601
10605
  };
10602
10606
  },
10603
10607
  /** Organizer only. 0 opens the drop to everyone. */
@@ -10605,9 +10609,9 @@ var dropCalls = {
10605
10609
  return { contractAddress: addr2(collection), entrypoint: "set_allowlist_root", calldata: collectionData.compile("set_allowlist_root", { root }) };
10606
10610
  }
10607
10611
  };
10608
- function dropMintCost(price, quantity, cfg) {
10612
+ function dropMintCost(price, quantity, feeBps2) {
10609
10613
  const subtotal = BigInt(price) * BigInt(quantity);
10610
- const fee = feeAmount(subtotal, feeBps("launchpad", cfg));
10614
+ const fee = feeAmount(subtotal, feeBps2);
10611
10615
  return { subtotal, fee, total: subtotal + fee };
10612
10616
  }
10613
10617
 
@@ -10640,7 +10644,6 @@ async function dropClaimedBy(provider, collection, wallet) {
10640
10644
  const res = await provider.callContract({ contractAddress: hex(collection), entrypoint: "claimed_by", calldata: [hex(wallet)] });
10641
10645
  return u256(res[0], res[1]);
10642
10646
  }
10643
- var DROP_MAX_CLAIM_QUANTITY = 50n;
10644
10647
  function dropMintState(input) {
10645
10648
  const none = (state) => ({ state, maxQuantity: 0n });
10646
10649
  const { drop, wallet, claimed, proof, balance, now } = input;
@@ -10662,7 +10665,7 @@ function dropMintState(input) {
10662
10665
  if (walletLeft !== null && walletLeft < max) max = walletLeft;
10663
10666
  if (drop.price > 0n) {
10664
10667
  if (balance === null) return none("loading");
10665
- while (max > 0n && dropMintCost(drop.price, max, input.feeConfig).total > balance) max--;
10668
+ while (max > 0n && dropMintCost(drop.price, max, input.feeBps).total > balance) max--;
10666
10669
  if (max === 0n) return none("insufficient-balance");
10667
10670
  }
10668
10671
  return { state: "ready", maxQuantity: max };
@@ -12116,14 +12119,14 @@ async function failureOf(res, fallback) {
12116
12119
  const body = await res.json().catch(() => null);
12117
12120
  return { reason: body?.error || fallback, code: typeof body?.code === "string" ? body.code : void 0 };
12118
12121
  }
12119
- async function executeSponsored(config, signer, calls, intentIds) {
12122
+ async function executeSponsored(config, signer, request) {
12120
12123
  const doFetch = config.fetchImpl ?? fetch;
12121
12124
  const base = config.proxyUrl.replace(/\/$/, "");
12122
12125
  const headers = { "Content-Type": "application/json", ...config.headers };
12123
12126
  const buildRes = await doFetch(`${base}/build`, {
12124
12127
  method: "POST",
12125
12128
  headers,
12126
- body: JSON.stringify(intentIds ? { intentIds } : { userAddress: signer.address, calls })
12129
+ body: JSON.stringify(request)
12127
12130
  });
12128
12131
  if (!buildRes.ok) {
12129
12132
  const { reason, code } = await failureOf(buildRes, "We couldn't prepare this transaction.");
@@ -12135,7 +12138,7 @@ async function executeSponsored(config, signer, calls, intentIds) {
12135
12138
  const executeRes = await doFetch(`${base}/execute`, {
12136
12139
  method: "POST",
12137
12140
  headers,
12138
- body: JSON.stringify(intentIds ? { intentIds, typedData, signature } : { userAddress: signer.address, typedData, signature, calls })
12141
+ body: JSON.stringify({ ...request, typedData, signature })
12139
12142
  });
12140
12143
  if (!executeRes.ok) {
12141
12144
  const { reason, code } = await failureOf(executeRes, "We couldn't submit this transaction.");
@@ -12517,14 +12520,18 @@ function sponsoredExecutor(deps) {
12517
12520
  return {
12518
12521
  async execute(input) {
12519
12522
  const { userAddress, privateKeyHex, calls, intentIds } = input;
12523
+ if (!intentIds?.length) {
12524
+ const consented2 = await deps.consent.request({ address: userAddress, calls });
12525
+ if (!consented2) throw new SponsoredCallRejectedError("This action can't be sponsored");
12526
+ return fallback.execute(input);
12527
+ }
12520
12528
  const result = await executeSponsored(
12521
12529
  { proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
12522
12530
  {
12523
12531
  address: userAddress,
12524
12532
  signTypedData: async (data) => signWithPrivateKey(privateKeyHex, typedData.getMessageHash(data, userAddress))
12525
12533
  },
12526
- calls,
12527
- intentIds
12534
+ { intentIds }
12528
12535
  );
12529
12536
  if (result.status === "sponsored") return { transactionHash: result.transactionHash };
12530
12537
  const consented = await deps.consent.request({ address: userAddress, calls });