@medialane/sdk 0.129.1 → 0.130.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 { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated, by as SealedOwner, bz as ReceiptProviderLike, bA as WalletExecutor, bB as ExecutedTransaction, bC as PasskeyOwner } from '../errors-Fgqpww_8.cjs';
2
- export { bD as CreatedOwner, bE as OwnerSigner, ba as PasskeyCancelledError, bF as PasskeyConfig, bs as UserFacingError, bG as createPasskeyOwner } from '../errors-Fgqpww_8.cjs';
1
+ import { bn as ResolvedConfig, bv as TxResult, aI as CreatePopCollectionParams, at as ClaimConditions, aE as CreateDropParams, aN as CreateTicketParams, b7 as MintTicketsParams, aG as CreateMembershipParams, b6 as MintMembershipsParams, aL as CreateSponsorshipOfferParams, bk as ProposeSponsorshipParams, l as ApiClient, b4 as MedialaneConfig, b5 as MedialaneErrorCode, bc as OrderDetails, R as ResolvedFeeConfig, F as ApiFundingIntent, E as ApiFundingInstructions, I as ApiFundingSubmit, K as ApiIntentCreated, bD as SealedOwner, bE as ReceiptProviderLike, bF as WalletExecutor, bG as ExecutedTransaction, bH as PasskeyOwner } from '../errors-C_zqe9TI.cjs';
2
+ export { bI as CreatedOwner, bJ as OwnerSigner, bf as PasskeyCancelledError, bK as PasskeyConfig, bx as UserFacingError, bL as createPasskeyOwner } from '../errors-C_zqe9TI.cjs';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.cjs';
5
5
  import 'zod';
@@ -570,6 +570,66 @@ declare function storeSiwsToken(address: string, token: string): void;
570
570
  declare function normalizeSiwsSignature(signature: unknown): string[];
571
571
  declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
572
572
 
573
+ interface FundingTransferCall {
574
+ contractAddress: string;
575
+ entrypoint: "transfer";
576
+ calldata: string[];
577
+ }
578
+ interface FundingWallet {
579
+ address: string;
580
+ signTypedData(typedData: TypedData): Promise<string[]>;
581
+ sendTransfer(call: FundingTransferCall): Promise<{
582
+ txHash: string;
583
+ }>;
584
+ }
585
+ /** A wallet adapter throws this only when it is certain nothing was broadcast: a rejected prompt, or no sponsor available. */
586
+ declare class FundingTransferNotSentError extends Error {
587
+ constructor(message?: string);
588
+ }
589
+ type Res<T> = Promise<{
590
+ data: T;
591
+ }>;
592
+ /** The funding calls with the caller's sign-in already bound. */
593
+ interface FundingApi {
594
+ createFunding(input: {
595
+ method: string;
596
+ params: Record<string, unknown>;
597
+ }): Res<ApiFundingIntent>;
598
+ getFundingChallenge(id: string, payer: string): Res<{
599
+ typedData: unknown;
600
+ }>;
601
+ authorizeFunding(id: string, input: {
602
+ payer: string;
603
+ signature: string[];
604
+ }): Res<{
605
+ instructions: ApiFundingInstructions;
606
+ }>;
607
+ submitFunding(id: string, txHash: string): Res<ApiFundingSubmit>;
608
+ cancelFunding(id: string): Res<{
609
+ status: string;
610
+ }>;
611
+ }
612
+ declare function fundingApiFor(client: ApiClient, siwsToken?: string): FundingApi;
613
+ declare function buildFundingTransferCall(instructions: ApiFundingInstructions): FundingTransferCall;
614
+ type FundingStep = "creating" | "signing" | "authorizing" | "paying" | "confirming";
615
+ type FundingResult = {
616
+ status: "SETTLED";
617
+ intentId: string;
618
+ credited?: number;
619
+ } | {
620
+ status: "PENDING";
621
+ intentId: string;
622
+ reason: string;
623
+ };
624
+ interface FundWithTransferOptions {
625
+ amountUsdc: string;
626
+ onStep?: (step: FundingStep) => void;
627
+ pollMs?: number;
628
+ maxPolls?: number;
629
+ sleep?: (ms: number) => Promise<void>;
630
+ }
631
+ declare function fundWithChainTransfer(api: FundingApi, wallet: FundingWallet, options: FundWithTransferOptions): Promise<FundingResult>;
632
+
573
633
  declare const IPMarketplaceABI: readonly [{
574
634
  readonly type: "impl";
575
635
  readonly name: "Medialane721Impl";
@@ -8126,4 +8186,4 @@ declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
8126
8186
 
8127
8187
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8128
8188
 
8129
- export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, 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, type ParsedAdminHeaders, PasskeyOwner, 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 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, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
8189
+ export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, 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, type ParsedAdminHeaders, PasskeyOwner, 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 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, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
@@ -1,5 +1,5 @@
1
- import { bi as ResolvedConfig, bq as TxResult, aD as CreatePopCollectionParams, ao as ClaimConditions, az as CreateDropParams, aI as CreateTicketParams, b2 as MintTicketsParams, aB as CreateMembershipParams, b1 as MintMembershipsParams, aG as CreateSponsorshipOfferParams, bf as ProposeSponsorshipParams, l as ApiClient, a$ as MedialaneConfig, b0 as MedialaneErrorCode, b7 as OrderDetails, R as ResolvedFeeConfig, F as ApiIntentCreated, by as SealedOwner, bz as ReceiptProviderLike, bA as WalletExecutor, bB as ExecutedTransaction, bC as PasskeyOwner } from '../errors-DQJIxfVu.js';
2
- export { bD as CreatedOwner, bE as OwnerSigner, ba as PasskeyCancelledError, bF as PasskeyConfig, bs as UserFacingError, bG as createPasskeyOwner } from '../errors-DQJIxfVu.js';
1
+ import { bn as ResolvedConfig, bv as TxResult, aI as CreatePopCollectionParams, at as ClaimConditions, aE as CreateDropParams, aN as CreateTicketParams, b7 as MintTicketsParams, aG as CreateMembershipParams, b6 as MintMembershipsParams, aL as CreateSponsorshipOfferParams, bk as ProposeSponsorshipParams, l as ApiClient, b4 as MedialaneConfig, b5 as MedialaneErrorCode, bc as OrderDetails, R as ResolvedFeeConfig, F as ApiFundingIntent, E as ApiFundingInstructions, I as ApiFundingSubmit, K as ApiIntentCreated, bD as SealedOwner, bE as ReceiptProviderLike, bF as WalletExecutor, bG as ExecutedTransaction, bH as PasskeyOwner } from '../errors-Dc-g0mMr.js';
2
+ export { bI as CreatedOwner, bJ as OwnerSigner, bf as PasskeyCancelledError, bK as PasskeyConfig, bx as UserFacingError, bL as createPasskeyOwner } from '../errors-Dc-g0mMr.js';
3
3
  import { AccountInterface, Call, ProviderInterface, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
4
4
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-CuSlc_YE.js';
5
5
  import 'zod';
@@ -570,6 +570,66 @@ declare function storeSiwsToken(address: string, token: string): void;
570
570
  declare function normalizeSiwsSignature(signature: unknown): string[];
571
571
  declare function requestSiwsToken({ backendUrl, walletAddress, signer, appSource, }: RequestSiwsTokenArgs): Promise<string>;
572
572
 
573
+ interface FundingTransferCall {
574
+ contractAddress: string;
575
+ entrypoint: "transfer";
576
+ calldata: string[];
577
+ }
578
+ interface FundingWallet {
579
+ address: string;
580
+ signTypedData(typedData: TypedData): Promise<string[]>;
581
+ sendTransfer(call: FundingTransferCall): Promise<{
582
+ txHash: string;
583
+ }>;
584
+ }
585
+ /** A wallet adapter throws this only when it is certain nothing was broadcast: a rejected prompt, or no sponsor available. */
586
+ declare class FundingTransferNotSentError extends Error {
587
+ constructor(message?: string);
588
+ }
589
+ type Res<T> = Promise<{
590
+ data: T;
591
+ }>;
592
+ /** The funding calls with the caller's sign-in already bound. */
593
+ interface FundingApi {
594
+ createFunding(input: {
595
+ method: string;
596
+ params: Record<string, unknown>;
597
+ }): Res<ApiFundingIntent>;
598
+ getFundingChallenge(id: string, payer: string): Res<{
599
+ typedData: unknown;
600
+ }>;
601
+ authorizeFunding(id: string, input: {
602
+ payer: string;
603
+ signature: string[];
604
+ }): Res<{
605
+ instructions: ApiFundingInstructions;
606
+ }>;
607
+ submitFunding(id: string, txHash: string): Res<ApiFundingSubmit>;
608
+ cancelFunding(id: string): Res<{
609
+ status: string;
610
+ }>;
611
+ }
612
+ declare function fundingApiFor(client: ApiClient, siwsToken?: string): FundingApi;
613
+ declare function buildFundingTransferCall(instructions: ApiFundingInstructions): FundingTransferCall;
614
+ type FundingStep = "creating" | "signing" | "authorizing" | "paying" | "confirming";
615
+ type FundingResult = {
616
+ status: "SETTLED";
617
+ intentId: string;
618
+ credited?: number;
619
+ } | {
620
+ status: "PENDING";
621
+ intentId: string;
622
+ reason: string;
623
+ };
624
+ interface FundWithTransferOptions {
625
+ amountUsdc: string;
626
+ onStep?: (step: FundingStep) => void;
627
+ pollMs?: number;
628
+ maxPolls?: number;
629
+ sleep?: (ms: number) => Promise<void>;
630
+ }
631
+ declare function fundWithChainTransfer(api: FundingApi, wallet: FundingWallet, options: FundWithTransferOptions): Promise<FundingResult>;
632
+
573
633
  declare const IPMarketplaceABI: readonly [{
574
634
  readonly type: "impl";
575
635
  readonly name: "Medialane721Impl";
@@ -8126,4 +8186,4 @@ declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
8126
8186
 
8127
8187
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8128
8188
 
8129
- export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, ExecutedTransaction, type FeeSurface, 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, type ParsedAdminHeaders, PasskeyOwner, 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 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, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
8189
+ export { ADMIN_HEADERS, ADMIN_SCOPE, type AddSupplyParams, type AdminGrant, type AdminRequest, type AdminRequestSig, type AdminSession, type AdminSessionTypedDataInput, type BatchMintEditionParams, type BuildFeeCallParams, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClaimConditions, ClubService, type CreateCreatorCoinParams, CreateDropParams, type CreateGrantOpts, CreatePopCollectionParams, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeploymentDeps, type DeploymentResult, type DeploymentStep, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, 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, type ParsedAdminHeaders, PasskeyOwner, 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 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, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
@@ -564,6 +564,7 @@ var ApiClient = class {
564
564
  headers: this.asSubject(siwsToken)
565
565
  });
566
566
  }
567
+ /** @deprecated Use the funding methods (`createFunding`, or `fundWithChainTransfer` from `@medialane/sdk/starknet`). This call only nudges a legacy scanner and never credits anything itself. */
567
568
  checkDeposit(txHash, siwsToken) {
568
569
  return this.request("/v1/portal/credits/check", {
569
570
  method: "POST",
@@ -571,6 +572,52 @@ var ApiClient = class {
571
572
  headers: this.asSubject(siwsToken)
572
573
  });
573
574
  }
575
+ getFundingMethods(siwsToken) {
576
+ return this.request("/v1/portal/funding/methods", {
577
+ method: "GET",
578
+ headers: this.asSubject(siwsToken)
579
+ });
580
+ }
581
+ createFunding(input, siwsToken) {
582
+ return this.request("/v1/portal/funding", {
583
+ method: "POST",
584
+ body: JSON.stringify({ method: input.method, params: input.params }),
585
+ headers: this.asSubject(siwsToken)
586
+ });
587
+ }
588
+ getFunding(id, siwsToken) {
589
+ return this.request(`/v1/portal/funding/${encodeURIComponent(id)}`, {
590
+ method: "GET",
591
+ headers: this.asSubject(siwsToken)
592
+ });
593
+ }
594
+ getFundingChallenge(id, payer, siwsToken) {
595
+ return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/challenge`, {
596
+ method: "POST",
597
+ body: JSON.stringify({ payer }),
598
+ headers: this.asSubject(siwsToken)
599
+ });
600
+ }
601
+ authorizeFunding(id, input, siwsToken) {
602
+ return this.request(
603
+ `/v1/portal/funding/${encodeURIComponent(id)}/authorize`,
604
+ { method: "POST", body: JSON.stringify({ payer: input.payer, signature: input.signature }), headers: this.asSubject(siwsToken) }
605
+ );
606
+ }
607
+ submitFunding(id, txHash, siwsToken) {
608
+ return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/submit`, {
609
+ method: "POST",
610
+ body: JSON.stringify({ txHash }),
611
+ headers: this.asSubject(siwsToken)
612
+ });
613
+ }
614
+ cancelFunding(id, siwsToken) {
615
+ return this.request(`/v1/portal/funding/${encodeURIComponent(id)}/cancel`, {
616
+ method: "POST",
617
+ body: JSON.stringify({}),
618
+ headers: this.asSubject(siwsToken)
619
+ });
620
+ }
574
621
  getWebhooks() {
575
622
  return this.get("/v1/portal/webhooks");
576
623
  }
@@ -11616,6 +11663,69 @@ async function requestSiwsToken({
11616
11663
  return token;
11617
11664
  }
11618
11665
 
11666
+ // src/starknet/funding/chain-transfer.ts
11667
+ var FundingTransferNotSentError = class extends Error {
11668
+ constructor(message = "The transfer was not sent.") {
11669
+ super(message);
11670
+ this.name = "FundingTransferNotSentError";
11671
+ }
11672
+ };
11673
+ function fundingApiFor(client, siwsToken) {
11674
+ return {
11675
+ createFunding: (input) => client.createFunding(input, siwsToken),
11676
+ getFundingChallenge: (id, payer) => client.getFundingChallenge(id, payer, siwsToken),
11677
+ authorizeFunding: (id, input) => client.authorizeFunding(id, input, siwsToken),
11678
+ submitFunding: (id, txHash) => client.submitFunding(id, txHash, siwsToken),
11679
+ cancelFunding: (id) => client.cancelFunding(id, siwsToken)
11680
+ };
11681
+ }
11682
+ function buildFundingTransferCall(instructions) {
11683
+ const amount = BigInt(instructions.amountAtomic);
11684
+ const mask = (1n << 128n) - 1n;
11685
+ return {
11686
+ contractAddress: instructions.asset,
11687
+ entrypoint: "transfer",
11688
+ calldata: [instructions.payTo, (amount & mask).toString(), (amount >> 128n).toString()]
11689
+ };
11690
+ }
11691
+ async function fundWithChainTransfer(api, wallet, options) {
11692
+ const step = options.onStep ?? (() => {
11693
+ });
11694
+ const sleep2 = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
11695
+ const pollMs = options.pollMs ?? 3e3;
11696
+ const maxPolls = options.maxPolls ?? 20;
11697
+ step("creating");
11698
+ const { data: intent } = await api.createFunding({ method: "chain-transfer", params: { amountUsdc: options.amountUsdc } });
11699
+ let txHash;
11700
+ let transferStarted = false;
11701
+ try {
11702
+ step("signing");
11703
+ const challenge = await api.getFundingChallenge(intent.id, wallet.address);
11704
+ const signature = await wallet.signTypedData(challenge.data.typedData);
11705
+ step("authorizing");
11706
+ const authorized = await api.authorizeFunding(intent.id, { payer: wallet.address, signature });
11707
+ step("paying");
11708
+ transferStarted = true;
11709
+ ({ txHash } = await wallet.sendTransfer(buildFundingTransferCall(authorized.data.instructions)));
11710
+ } catch (err) {
11711
+ if (!transferStarted || err instanceof FundingTransferNotSentError) {
11712
+ await api.cancelFunding(intent.id).catch(() => void 0);
11713
+ }
11714
+ throw err;
11715
+ }
11716
+ step("confirming");
11717
+ let reason = "waiting for the transfer to confirm";
11718
+ for (let attempt = 0; attempt < maxPolls; attempt++) {
11719
+ const res = await api.submitFunding(intent.id, txHash);
11720
+ if (res.data.status === "SETTLED") {
11721
+ return { status: "SETTLED", intentId: intent.id, credited: res.data.credited };
11722
+ }
11723
+ reason = res.data.reason;
11724
+ await sleep2(pollMs);
11725
+ }
11726
+ return { status: "PENDING", intentId: intent.id, reason };
11727
+ }
11728
+
11619
11729
  // src/errors.ts
11620
11730
  var UserFacingError = class extends Error {
11621
11731
  constructor(message) {
@@ -12893,6 +13003,6 @@ function createMediaWallet(config) {
12893
13003
  };
12894
13004
  }
12895
13005
 
12896
- export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PasskeyCancelledError, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, UserFacingError, VALIDATED_EKUBO_PARAMS, accountFor, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
13006
+ export { ADMIN_HEADERS, ADMIN_SCOPE, MAX_SUPPLY as COIN_MAX_SUPPLY, MIN_SUPPLY as COIN_MIN_SUPPLY, ClubService, CreatorCoinFactoryABI, CreatorCoinService, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, FundingTransferNotSentError, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, InvalidPairingPayloadError, InvalidStarkPrivateKeyError, MAX_HOLDERS_AT_LAUNCH, MAX_TEAM_ALLOCATION_PERCENT, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PasskeyCancelledError, PopService, SUGGESTED_DEFAULT_PRICE, SponsoredCallRejectedError, SponsorshipService, StarknetVenue, TicketService, UserFacingError, VALIDATED_EKUBO_PARAMS, accountFor, adminRequestDigest, assertTransactionSucceeded, build1155CancellationTypedData, build1155OrderTypedData, buildAddOwnerCall, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildFundingTransferCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildRemoveOwnerByGuidCall, buildRemoveOwnerCall, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, canRemoveDevice, toRaw as coinToRaw, completeDeployment, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, deploySelfFunded, deploySponsored, deployedCollectionFromReceipt, deriveAesKey, deriveOwnerKeyPair, describeDevices, describeGuardianStatus, describeRecoveryAction, encodeAdminHeaders, encodeByteArray, encodePairingPayload, estimateSelfFundedFee, executeIntent, executeIntents, executeSponsored, fdvHuman, fundWithChainTransfer, fundingApiFor, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinGuarantees, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getOwners, getSiwsStorageKey, getStoredSiwsToken, isDeployed, isRecoveryKeyForWallet, isSiwsTokenValid, isValidStarknetAddress, mintedTokenIdFromReceipt, normalizeSiwsSignature, normalizeWalletAddress, ownerAliveTypedData, ownerConstructorCalldata, parseAccountAddress, parseAdminHeaders, parseCreatorCoinCreated, parsePairingPayload, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, selfFundedExecutor, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, sponsoredExecutor, starkKeyPairFromPrivateKey, storeSiwsToken, syncTransactionBestEffort, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, userMayPayInstead, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, validatePrice, verifyAdminRequestSig, waitUntilDeployed };
12897
13007
  //# sourceMappingURL=index.js.map
12898
13008
  //# sourceMappingURL=index.js.map