@medialane/sdk 0.171.0 → 0.173.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 { 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';
1
+ import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, bJ as OrderDetails, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as PopAllowlist, c8 as PopClaimLink, c9 as SealedOwner, ca as ReceiptProviderLike, cb as WalletExecutor, cc as ExecutedTransaction, cd as PasskeyOwner, bi as CreateWalletManageIntentParams, ce as CreatedOwner } from '../errors-BFqApRV3.cjs';
2
+ export { cf as CreateCreatorCoinParams, cg as CreatorCoinGuarantees, ch as CreatorCoinReceiptLike, ci as EkuboLaunchParams, cj as EkuboPoolParams, ck as InvalidRecoveryKeyError, cl as MAX_HOLDERS_AT_LAUNCH, cm as MAX_TEAM_ALLOCATION_PERCENT, cn as OwnerSigner, bM as PasskeyCancelledError, co as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, cp as PopClaimInfo, cq as PopClaimState, cr as RecoveryKey, c1 as UserFacingError, cs as VALIDATED_EKUBO_PARAMS, ct as buildCreateCreatorCoinCall, cu as buildLaunchOnEkuboCalls, cv as buildPopAllowlist, cw as createPasskeyOwner, cx as decodePopClaimFragment, cy as encodePopClaimFragment, cz as encodeRecoveryKey, cA as getCreatorCoinGuarantees, cB as parseCreatorCoinCreated, cC as parseRecoveryKey, cD as popCalls, cE as popClaimInfo, cF as popClaimLinks, cG as popClaimLinksCsv, cH as popClaimState, cI as priceToEkuboParams, cJ as validatePrice, cK as verifyPopProof } from '../errors-BFqApRV3.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';
@@ -106,67 +106,6 @@ declare class ERC1155CollectionService {
106
106
  }): Promise<TxResult>;
107
107
  }
108
108
 
109
- interface CreateCreatorCoinParams {
110
- owner: string;
111
- name: string;
112
- symbol: string;
113
- initialSupply: bigint | string;
114
- salt?: bigint | string;
115
- }
116
- interface EkuboPoolParams {
117
- fee: bigint | string;
118
- tickSpacing: bigint | string;
119
- startingPrice: {
120
- mag: bigint | string;
121
- sign: boolean;
122
- };
123
- bound: bigint | string;
124
- }
125
- interface EkuboLaunchParams {
126
- creatorCoin: string;
127
- quoteToken: string;
128
- initialHolders: string[];
129
- initialHoldersAmounts: (bigint | string)[];
130
- transferRestrictionDelay?: number;
131
- maxPercentageBuyLaunch?: number;
132
- ekubo: EkuboPoolParams;
133
- quoteFundAmount?: bigint | string;
134
- }
135
- declare const VALIDATED_EKUBO_PARAMS: EkuboPoolParams;
136
- declare function priceToEkuboParams(quoteDecimals: number, price?: number): EkuboPoolParams;
137
- declare function validatePrice(quoteDecimals: number, price: number): string | null;
138
- declare const MAX_TEAM_ALLOCATION_PERCENT = 10;
139
- declare const MAX_HOLDERS_AT_LAUNCH = 10;
140
- interface CreatorCoinGuarantees {
141
- isLaunched: boolean;
142
- launchedAtBlock: number | null;
143
- totalSupplyRaw: string;
144
- teamAllocationRaw: string;
145
- teamAllocationPercent: number | null;
146
- liquidityPositionId: string | null;
147
- }
148
- declare function getCreatorCoinGuarantees(coinAddress: string, provider: ProviderInterface): Promise<CreatorCoinGuarantees | null>;
149
- declare function buildCreateCreatorCoinCall(params: CreateCreatorCoinParams): Call;
150
- declare function buildLaunchOnEkuboCalls(params: EkuboLaunchParams): Call[];
151
- interface CreatorCoinReceiptLike {
152
- events?: Array<{
153
- from_address?: string;
154
- keys?: string[];
155
- data?: string[];
156
- }>;
157
- }
158
- declare function parseCreatorCoinCreated(receipt: CreatorCoinReceiptLike): string;
159
- declare class CreatorCoinService {
160
- private readonly factoryAddress;
161
- private readonly config;
162
- constructor(config: ResolvedConfig);
163
- private _factory;
164
- createCreatorCoin(account: AccountInterface, params: CreateCreatorCoinParams): Promise<TxResult>;
165
- launchOnEkubo(account: AccountInterface, params: EkuboLaunchParams): Promise<TxResult>;
166
- isCreatorCoin(address: string, account: AccountInterface): Promise<boolean>;
167
- getGuarantees(coinAddress: string): Promise<CreatorCoinGuarantees | null>;
168
- }
169
-
170
109
  interface TicketRecord {
171
110
  maxSupply: bigint;
172
111
  minted: bigint;
@@ -434,6 +373,13 @@ declare function storeSiwsToken(address: string, token: string): void;
434
373
  declare function normalizeSiwsSignature(signature: unknown): string[];
435
374
  declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
436
375
 
376
+ declare function signInWithWallet(args: {
377
+ backendUrl: string;
378
+ walletAddress: string;
379
+ signer: SiwsSigner;
380
+ appSource: string;
381
+ }): Promise<void>;
382
+
437
383
  interface FundingTransferCall {
438
384
  contractAddress: string;
439
385
  entrypoint: "transfer";
@@ -8498,55 +8444,6 @@ declare function executeIntents(provider: ReceiptProvider, signer: StarknetVenue
8498
8444
  receipt: ReceiptLike;
8499
8445
  }>;
8500
8446
 
8501
- interface PopAllowlist {
8502
- /** Merkle root to publish with `set_allowlist_root`. */
8503
- root: string;
8504
- /** Proof per address, keyed by normalized Starknet address. */
8505
- proofs: Record<string, string[]>;
8506
- }
8507
- declare function buildPopAllowlist(addresses: string[]): PopAllowlist;
8508
- /** True when `proof` places `address` under `root` — checked before sending a claim. */
8509
- declare function verifyPopProof(root: string, address: string, proof: string[]): boolean;
8510
- declare function encodePopClaimFragment(proof: string[]): string;
8511
- /** The proof in a claim link's fragment; `null` when absent or malformed. */
8512
- declare function decodePopClaimFragment(fragment: string): string[] | null;
8513
-
8514
- interface PopClaimLink {
8515
- address: string;
8516
- url: string;
8517
- }
8518
- /** One claim link per allowlisted address: the collection page with the proof in its fragment. */
8519
- declare function popClaimLinks(origin: string, collection: string, list: PopAllowlist): PopClaimLink[];
8520
- declare function popClaimLinksCsv(links: PopClaimLink[]): string;
8521
- interface PopClaimInfo {
8522
- /** Allowlist Merkle root; 0 when claims are closed. */
8523
- root: string;
8524
- /** Unix seconds; 0 = no deadline. */
8525
- claimEndTime: number;
8526
- }
8527
- /** Reads a collection's allowlist root and claim deadline from chain. */
8528
- declare function popClaimInfo(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<PopClaimInfo>;
8529
- type PopClaimState = "loading" | "claimed" | "closed" | "ended" | "no-link" | "wrong-wallet" | "ready";
8530
- /** What a claim page should show, decided before any transaction is sent. */
8531
- declare function popClaimState(input: {
8532
- hasClaimed: boolean | null;
8533
- proof: string[] | null;
8534
- wallet: string | null;
8535
- /** The collection's claim settings, with `now` in Unix seconds. */
8536
- info: (PopClaimInfo & {
8537
- now: number;
8538
- }) | null;
8539
- }): PopClaimState;
8540
- /** Calls on a POP collection, ready for `account.execute` or a sponsored transaction. */
8541
- declare const popCalls: {
8542
- claim(collection: string, proof: string[]): Call;
8543
- /** An empty `tokenUri` uses the collection's URI. */
8544
- issue(collection: string, recipient: string, tokenUri?: string): Call;
8545
- /** Only the token's holder can burn it. */
8546
- burn(collection: string, tokenId: string | bigint): Call;
8547
- setAllowlistRoot(collection: string, root: string): Call;
8548
- };
8549
-
8550
8447
  /** Most tokens one claim transaction mints. */
8551
8448
  declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8552
8449
  /** Sale terms as the contract's `SaleTerms` struct. A free drop names no token. */
@@ -8645,6 +8542,11 @@ interface SponsoredExecuteConfig {
8645
8542
  fetchImpl?: typeof fetch;
8646
8543
  headers?: Record<string, string>;
8647
8544
  }
8545
+ type SponsoredRequest = {
8546
+ intentIds: string[];
8547
+ } | {
8548
+ userAddress: string;
8549
+ };
8648
8550
  type SponsoredExecuteResult = {
8649
8551
  status: "sponsored";
8650
8552
  transactionHash: string;
@@ -8656,7 +8558,7 @@ declare class SponsoredCallRejectedError extends Error {
8656
8558
  }
8657
8559
  type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
8658
8560
  declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
8659
- declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
8561
+ declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, request: SponsoredRequest): Promise<SponsoredExecuteResult>;
8660
8562
 
8661
8563
  declare function encodeByteArray(str: string): string[];
8662
8564
 
@@ -8912,4 +8814,4 @@ declare function claimSessionWallet(api: Pick<ApiClient, "setupWalletKey">, wall
8912
8814
 
8913
8815
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8914
8816
 
8915
- 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 };
8817
+ export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, 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 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, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, PopAllowlist, PopClaimLink, 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, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parsePairingPayload, popHasClaimed, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signInWithWallet, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, waitUntilDeployed };
@@ -1,5 +1,5 @@
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';
1
+ import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, bJ as OrderDetails, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as PopAllowlist, c8 as PopClaimLink, c9 as SealedOwner, ca as ReceiptProviderLike, cb as WalletExecutor, cc as ExecutedTransaction, cd as PasskeyOwner, bi as CreateWalletManageIntentParams, ce as CreatedOwner } from '../errors-J0nFhE6E.js';
2
+ export { cf as CreateCreatorCoinParams, cg as CreatorCoinGuarantees, ch as CreatorCoinReceiptLike, ci as EkuboLaunchParams, cj as EkuboPoolParams, ck as InvalidRecoveryKeyError, cl as MAX_HOLDERS_AT_LAUNCH, cm as MAX_TEAM_ALLOCATION_PERCENT, cn as OwnerSigner, bM as PasskeyCancelledError, co as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, cp as PopClaimInfo, cq as PopClaimState, cr as RecoveryKey, c1 as UserFacingError, cs as VALIDATED_EKUBO_PARAMS, ct as buildCreateCreatorCoinCall, cu as buildLaunchOnEkuboCalls, cv as buildPopAllowlist, cw as createPasskeyOwner, cx as decodePopClaimFragment, cy as encodePopClaimFragment, cz as encodeRecoveryKey, cA as getCreatorCoinGuarantees, cB as parseCreatorCoinCreated, cC as parseRecoveryKey, cD as popCalls, cE as popClaimInfo, cF as popClaimLinks, cG as popClaimLinksCsv, cH as popClaimState, cI as priceToEkuboParams, cJ as validatePrice, cK as verifyPopProof } from '../errors-J0nFhE6E.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';
@@ -106,67 +106,6 @@ declare class ERC1155CollectionService {
106
106
  }): Promise<TxResult>;
107
107
  }
108
108
 
109
- interface CreateCreatorCoinParams {
110
- owner: string;
111
- name: string;
112
- symbol: string;
113
- initialSupply: bigint | string;
114
- salt?: bigint | string;
115
- }
116
- interface EkuboPoolParams {
117
- fee: bigint | string;
118
- tickSpacing: bigint | string;
119
- startingPrice: {
120
- mag: bigint | string;
121
- sign: boolean;
122
- };
123
- bound: bigint | string;
124
- }
125
- interface EkuboLaunchParams {
126
- creatorCoin: string;
127
- quoteToken: string;
128
- initialHolders: string[];
129
- initialHoldersAmounts: (bigint | string)[];
130
- transferRestrictionDelay?: number;
131
- maxPercentageBuyLaunch?: number;
132
- ekubo: EkuboPoolParams;
133
- quoteFundAmount?: bigint | string;
134
- }
135
- declare const VALIDATED_EKUBO_PARAMS: EkuboPoolParams;
136
- declare function priceToEkuboParams(quoteDecimals: number, price?: number): EkuboPoolParams;
137
- declare function validatePrice(quoteDecimals: number, price: number): string | null;
138
- declare const MAX_TEAM_ALLOCATION_PERCENT = 10;
139
- declare const MAX_HOLDERS_AT_LAUNCH = 10;
140
- interface CreatorCoinGuarantees {
141
- isLaunched: boolean;
142
- launchedAtBlock: number | null;
143
- totalSupplyRaw: string;
144
- teamAllocationRaw: string;
145
- teamAllocationPercent: number | null;
146
- liquidityPositionId: string | null;
147
- }
148
- declare function getCreatorCoinGuarantees(coinAddress: string, provider: ProviderInterface): Promise<CreatorCoinGuarantees | null>;
149
- declare function buildCreateCreatorCoinCall(params: CreateCreatorCoinParams): Call;
150
- declare function buildLaunchOnEkuboCalls(params: EkuboLaunchParams): Call[];
151
- interface CreatorCoinReceiptLike {
152
- events?: Array<{
153
- from_address?: string;
154
- keys?: string[];
155
- data?: string[];
156
- }>;
157
- }
158
- declare function parseCreatorCoinCreated(receipt: CreatorCoinReceiptLike): string;
159
- declare class CreatorCoinService {
160
- private readonly factoryAddress;
161
- private readonly config;
162
- constructor(config: ResolvedConfig);
163
- private _factory;
164
- createCreatorCoin(account: AccountInterface, params: CreateCreatorCoinParams): Promise<TxResult>;
165
- launchOnEkubo(account: AccountInterface, params: EkuboLaunchParams): Promise<TxResult>;
166
- isCreatorCoin(address: string, account: AccountInterface): Promise<boolean>;
167
- getGuarantees(coinAddress: string): Promise<CreatorCoinGuarantees | null>;
168
- }
169
-
170
109
  interface TicketRecord {
171
110
  maxSupply: bigint;
172
111
  minted: bigint;
@@ -434,6 +373,13 @@ declare function storeSiwsToken(address: string, token: string): void;
434
373
  declare function normalizeSiwsSignature(signature: unknown): string[];
435
374
  declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
436
375
 
376
+ declare function signInWithWallet(args: {
377
+ backendUrl: string;
378
+ walletAddress: string;
379
+ signer: SiwsSigner;
380
+ appSource: string;
381
+ }): Promise<void>;
382
+
437
383
  interface FundingTransferCall {
438
384
  contractAddress: string;
439
385
  entrypoint: "transfer";
@@ -8498,55 +8444,6 @@ declare function executeIntents(provider: ReceiptProvider, signer: StarknetVenue
8498
8444
  receipt: ReceiptLike;
8499
8445
  }>;
8500
8446
 
8501
- interface PopAllowlist {
8502
- /** Merkle root to publish with `set_allowlist_root`. */
8503
- root: string;
8504
- /** Proof per address, keyed by normalized Starknet address. */
8505
- proofs: Record<string, string[]>;
8506
- }
8507
- declare function buildPopAllowlist(addresses: string[]): PopAllowlist;
8508
- /** True when `proof` places `address` under `root` — checked before sending a claim. */
8509
- declare function verifyPopProof(root: string, address: string, proof: string[]): boolean;
8510
- declare function encodePopClaimFragment(proof: string[]): string;
8511
- /** The proof in a claim link's fragment; `null` when absent or malformed. */
8512
- declare function decodePopClaimFragment(fragment: string): string[] | null;
8513
-
8514
- interface PopClaimLink {
8515
- address: string;
8516
- url: string;
8517
- }
8518
- /** One claim link per allowlisted address: the collection page with the proof in its fragment. */
8519
- declare function popClaimLinks(origin: string, collection: string, list: PopAllowlist): PopClaimLink[];
8520
- declare function popClaimLinksCsv(links: PopClaimLink[]): string;
8521
- interface PopClaimInfo {
8522
- /** Allowlist Merkle root; 0 when claims are closed. */
8523
- root: string;
8524
- /** Unix seconds; 0 = no deadline. */
8525
- claimEndTime: number;
8526
- }
8527
- /** Reads a collection's allowlist root and claim deadline from chain. */
8528
- declare function popClaimInfo(provider: Pick<ProviderInterface, "callContract">, collection: string): Promise<PopClaimInfo>;
8529
- type PopClaimState = "loading" | "claimed" | "closed" | "ended" | "no-link" | "wrong-wallet" | "ready";
8530
- /** What a claim page should show, decided before any transaction is sent. */
8531
- declare function popClaimState(input: {
8532
- hasClaimed: boolean | null;
8533
- proof: string[] | null;
8534
- wallet: string | null;
8535
- /** The collection's claim settings, with `now` in Unix seconds. */
8536
- info: (PopClaimInfo & {
8537
- now: number;
8538
- }) | null;
8539
- }): PopClaimState;
8540
- /** Calls on a POP collection, ready for `account.execute` or a sponsored transaction. */
8541
- declare const popCalls: {
8542
- claim(collection: string, proof: string[]): Call;
8543
- /** An empty `tokenUri` uses the collection's URI. */
8544
- issue(collection: string, recipient: string, tokenUri?: string): Call;
8545
- /** Only the token's holder can burn it. */
8546
- burn(collection: string, tokenId: string | bigint): Call;
8547
- setAllowlistRoot(collection: string, root: string): Call;
8548
- };
8549
-
8550
8447
  /** Most tokens one claim transaction mints. */
8551
8448
  declare const DROP_MAX_CLAIM_QUANTITY = 50n;
8552
8449
  /** Sale terms as the contract's `SaleTerms` struct. A free drop names no token. */
@@ -8645,6 +8542,11 @@ interface SponsoredExecuteConfig {
8645
8542
  fetchImpl?: typeof fetch;
8646
8543
  headers?: Record<string, string>;
8647
8544
  }
8545
+ type SponsoredRequest = {
8546
+ intentIds: string[];
8547
+ } | {
8548
+ userAddress: string;
8549
+ };
8648
8550
  type SponsoredExecuteResult = {
8649
8551
  status: "sponsored";
8650
8552
  transactionHash: string;
@@ -8656,7 +8558,7 @@ declare class SponsoredCallRejectedError extends Error {
8656
8558
  }
8657
8559
  type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
8658
8560
  declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
8659
- declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
8561
+ declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, request: SponsoredRequest): Promise<SponsoredExecuteResult>;
8660
8562
 
8661
8563
  declare function encodeByteArray(str: string): string[];
8662
8564
 
@@ -8912,4 +8814,4 @@ declare function claimSessionWallet(api: Pick<ApiClient, "setupWalletKey">, wall
8912
8814
 
8913
8815
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8914
8816
 
8915
- 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 };
8817
+ export { type AddSupplyParams, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreateDropParams, CreatePopCollectionParams, CreatedOwner, CreatorCoinFactoryABI, 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 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, type MediaWallet, type MediaWalletConfig, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, PasskeyOwner, PopAllowlist, PopClaimLink, 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, VenueSigner, WalletExecutor, accountFor, allowsFallbackFunding, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildCancelEscapeCall, buildCancellationTypedData, buildCompleteEscapeOwnerCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, claimSessionWallet, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerConstructorCalldata, parseAccountAddress, parsePairingPayload, popHasClaimed, readDrop, requestSiwsToken, sealPrivateKey, selfFundedExecutor, signInWithWallet, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, 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-DDZJFN65.js';
2
- export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-DDZJFN65.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-HB2OWSZB.js';
2
+ export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-HB2OWSZB.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';
@@ -11933,6 +11933,28 @@ async function requestSiwsToken({
11933
11933
  return token;
11934
11934
  }
11935
11935
 
11936
+ // src/starknet/siws/sign-in.ts
11937
+ async function signInWithWallet(args) {
11938
+ const base = args.backendUrl.replace(/\/$/, "");
11939
+ const nonceRes = await fetch(`${base}/v1/auth/siws/nonce`, {
11940
+ method: "POST",
11941
+ headers: { "Content-Type": "application/json" },
11942
+ body: JSON.stringify({ walletAddress: args.walletAddress })
11943
+ });
11944
+ if (!nonceRes.ok) throw new Error("Failed to prepare wallet sign-in");
11945
+ const { nonce, typedData } = await nonceRes.json();
11946
+ const signature = normalizeSiwsSignature(await args.signer.signMessage(typedData));
11947
+ const verifyRes = await fetch(`${base}/v1/auth/siws/verify`, {
11948
+ method: "POST",
11949
+ headers: { "Content-Type": "application/json" },
11950
+ body: JSON.stringify({ walletAddress: args.walletAddress, nonce, signature, appSource: args.appSource })
11951
+ });
11952
+ if (!verifyRes.ok) {
11953
+ const body = await verifyRes.json().catch(() => null);
11954
+ throw new Error(body?.message ?? body?.error ?? "Wallet sign-in failed");
11955
+ }
11956
+ }
11957
+
11936
11958
  // src/starknet/funding/chain-transfer.ts
11937
11959
  var FundingTransferNotSentError = class extends Error {
11938
11960
  constructor(message = "The transfer was not sent.") {
@@ -12119,14 +12141,14 @@ async function failureOf(res, fallback) {
12119
12141
  const body = await res.json().catch(() => null);
12120
12142
  return { reason: body?.error || fallback, code: typeof body?.code === "string" ? body.code : void 0 };
12121
12143
  }
12122
- async function executeSponsored(config, signer, calls, intentIds) {
12144
+ async function executeSponsored(config, signer, request) {
12123
12145
  const doFetch = config.fetchImpl ?? fetch;
12124
12146
  const base = config.proxyUrl.replace(/\/$/, "");
12125
12147
  const headers = { "Content-Type": "application/json", ...config.headers };
12126
12148
  const buildRes = await doFetch(`${base}/build`, {
12127
12149
  method: "POST",
12128
12150
  headers,
12129
- body: JSON.stringify(intentIds ? { intentIds } : { userAddress: signer.address, calls })
12151
+ body: JSON.stringify(request)
12130
12152
  });
12131
12153
  if (!buildRes.ok) {
12132
12154
  const { reason, code } = await failureOf(buildRes, "We couldn't prepare this transaction.");
@@ -12138,7 +12160,7 @@ async function executeSponsored(config, signer, calls, intentIds) {
12138
12160
  const executeRes = await doFetch(`${base}/execute`, {
12139
12161
  method: "POST",
12140
12162
  headers,
12141
- body: JSON.stringify(intentIds ? { intentIds, typedData, signature } : { userAddress: signer.address, typedData, signature, calls })
12163
+ body: JSON.stringify({ ...request, typedData, signature })
12142
12164
  });
12143
12165
  if (!executeRes.ok) {
12144
12166
  const { reason, code } = await failureOf(executeRes, "We couldn't submit this transaction.");
@@ -12520,14 +12542,18 @@ function sponsoredExecutor(deps) {
12520
12542
  return {
12521
12543
  async execute(input) {
12522
12544
  const { userAddress, privateKeyHex, calls, intentIds } = input;
12545
+ if (!intentIds?.length) {
12546
+ const consented2 = await deps.consent.request({ address: userAddress, calls });
12547
+ if (!consented2) throw new SponsoredCallRejectedError("This action can't be sponsored");
12548
+ return fallback.execute(input);
12549
+ }
12523
12550
  const result = await executeSponsored(
12524
12551
  { proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
12525
12552
  {
12526
12553
  address: userAddress,
12527
12554
  signTypedData: async (data) => signWithPrivateKey(privateKeyHex, typedData.getMessageHash(data, userAddress))
12528
12555
  },
12529
- calls,
12530
- intentIds
12556
+ { intentIds }
12531
12557
  );
12532
12558
  if (result.status === "sponsored") return { transactionHash: result.transactionHash };
12533
12559
  const consented = await deps.consent.request({ address: userAddress, calls });
@@ -12808,6 +12834,6 @@ async function claimSessionWallet(api, walletAddress, deps) {
12808
12834
  if (removeOwnerGuid) await deps.removeOwner(sealed, removeOwnerGuid);
12809
12835
  }
12810
12836
 
12811
- export { MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, FundingTransferNotSentError, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidRecoveryKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, 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, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, encodeRecoveryKey, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, parseRecoveryKey, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, selfFundedExecutor, sponsoredExecutor, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
12837
+ export { MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DROP_MAX_CLAIM_QUANTITY, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, FundingTransferNotSentError, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidRecoveryKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, 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, computeOwnerGuid, confirmIntentBestEffort, createDeploymentCoordinator, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, decodePopClaimFragment, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, dropCalls, dropClaimLinks, dropClaimedBy, dropMintCost, dropMintState, encodeByteArray, encodePairingPayload, encodePopClaimFragment, encodeRecoveryKey, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, feeAmount, feeBps, fundWithChainTransfer, fundingApiFor, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, parseAccountAddress, parseCreatorCoinCreated, parsePairingPayload, parseRecoveryKey, popCalls, popClaimInfo, popClaimLinks, popClaimLinksCsv, popClaimState, popHasClaimed, priceToEkuboParams, readDrop, requestSiwsToken, selfFundedExecutor, signInWithWallet, sponsoredExecutor, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractTerms as toDropContractTerms, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyPopProof, waitUntilDeployed };
12812
12838
  //# sourceMappingURL=index.js.map
12813
12839
  //# sourceMappingURL=index.js.map