@medialane/sdk 0.121.0 → 0.122.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8080,6 +8080,53 @@ interface SponsoredDeps extends SelfFundedDeps {
8080
8080
  }
8081
8081
  declare function sponsoredExecutor(deps: SponsoredDeps): WalletExecutor;
8082
8082
 
8083
+ type DeploymentStep = "creating-passkey" | "deploying" | "signing-in";
8084
+ interface DeploymentResult {
8085
+ sealed: SealedOwner;
8086
+ siwsToken: string;
8087
+ }
8088
+ declare function deploySponsored(input: {
8089
+ proxyUrl: string;
8090
+ provider: ProviderInterface;
8091
+ ownerAddress: string;
8092
+ ownerPubKey: string;
8093
+ privateKeyHex: string;
8094
+ salt?: string;
8095
+ fetchImpl?: typeof fetch;
8096
+ }): Promise<ExecutedTransaction>;
8097
+ declare function deploySelfFunded(input: {
8098
+ provider: ProviderInterface;
8099
+ ownerAddress: string;
8100
+ ownerPubKey: string;
8101
+ privateKeyHex: string;
8102
+ }): Promise<ExecutedTransaction>;
8103
+ declare function waitUntilDeployed(provider: ProviderInterface, address: string, timeoutMs?: number, sleep?: (ms: number) => Promise<void>): Promise<void>;
8104
+ interface DeploymentDeps {
8105
+ store: {
8106
+ load(): SealedOwner | null;
8107
+ save(sealed: SealedOwner): void;
8108
+ notifyChange(): void;
8109
+ };
8110
+ passkey: {
8111
+ createOwnerKey(): Promise<{
8112
+ sealed: SealedOwner;
8113
+ privateKeyHex: string;
8114
+ }>;
8115
+ unlockOwnerKey(sealed: SealedOwner): Promise<string>;
8116
+ };
8117
+ provider: () => ProviderInterface;
8118
+ backendUrl: string;
8119
+ deployProxyUrl?: string;
8120
+ fetchImpl?: typeof fetch;
8121
+ deploySponsoredImpl?: typeof deploySponsored;
8122
+ deploySelfFundedImpl?: typeof deploySelfFunded;
8123
+ requestSiwsTokenImpl?: typeof requestSiwsToken;
8124
+ waitUntilDeployedImpl?: typeof waitUntilDeployed;
8125
+ }
8126
+ declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
8127
+ forceNew?: boolean;
8128
+ }): Promise<DeploymentResult>;
8129
+
8083
8130
  interface DeviceEntry {
8084
8131
  guid: string;
8085
8132
  type: GuardianInfo["type"];
@@ -8093,6 +8140,9 @@ interface MediaWalletConfig {
8093
8140
  executor: WalletExecutor;
8094
8141
  provider: () => ProviderInterface;
8095
8142
  unlockTtlMs?: number;
8143
+ backendUrl?: string;
8144
+ deployProxyUrl?: string;
8145
+ fetchImpl?: typeof fetch;
8096
8146
  }
8097
8147
  interface MediaWallet {
8098
8148
  store: OwnerStore;
@@ -8117,9 +8167,12 @@ interface MediaWallet {
8117
8167
  isOwnerOf(accountAddress: string, devicePubkey: string): Promise<boolean>;
8118
8168
  addDevice(sealed: SealedOwner, devicePubkey: string): Promise<string>;
8119
8169
  removeDevice(sealed: SealedOwner, ownerGuid: string): Promise<string>;
8170
+ completeDeployment(onStep: (step: DeploymentStep) => void, options?: {
8171
+ forceNew?: boolean;
8172
+ }): Promise<DeploymentResult>;
8120
8173
  }
8121
8174
  declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
8122
8175
 
8123
8176
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8124
8177
 
8125
- 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, type CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, type 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 OwnerSigner, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, type ParsedAdminHeaders, PasskeyCancelledError, type PasskeyConfig, type PasskeyOwner, PopService, type ReceiptLike, type ReceiptProvider, type ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type 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, type 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, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, 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 };
8178
+ 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, type CreatedOwner, 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, type 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 OwnerSigner, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, type ParsedAdminHeaders, PasskeyCancelledError, type PasskeyConfig, type PasskeyOwner, PopService, type ReceiptLike, type ReceiptProvider, type ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type 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, type 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, 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 };
@@ -8080,6 +8080,53 @@ interface SponsoredDeps extends SelfFundedDeps {
8080
8080
  }
8081
8081
  declare function sponsoredExecutor(deps: SponsoredDeps): WalletExecutor;
8082
8082
 
8083
+ type DeploymentStep = "creating-passkey" | "deploying" | "signing-in";
8084
+ interface DeploymentResult {
8085
+ sealed: SealedOwner;
8086
+ siwsToken: string;
8087
+ }
8088
+ declare function deploySponsored(input: {
8089
+ proxyUrl: string;
8090
+ provider: ProviderInterface;
8091
+ ownerAddress: string;
8092
+ ownerPubKey: string;
8093
+ privateKeyHex: string;
8094
+ salt?: string;
8095
+ fetchImpl?: typeof fetch;
8096
+ }): Promise<ExecutedTransaction>;
8097
+ declare function deploySelfFunded(input: {
8098
+ provider: ProviderInterface;
8099
+ ownerAddress: string;
8100
+ ownerPubKey: string;
8101
+ privateKeyHex: string;
8102
+ }): Promise<ExecutedTransaction>;
8103
+ declare function waitUntilDeployed(provider: ProviderInterface, address: string, timeoutMs?: number, sleep?: (ms: number) => Promise<void>): Promise<void>;
8104
+ interface DeploymentDeps {
8105
+ store: {
8106
+ load(): SealedOwner | null;
8107
+ save(sealed: SealedOwner): void;
8108
+ notifyChange(): void;
8109
+ };
8110
+ passkey: {
8111
+ createOwnerKey(): Promise<{
8112
+ sealed: SealedOwner;
8113
+ privateKeyHex: string;
8114
+ }>;
8115
+ unlockOwnerKey(sealed: SealedOwner): Promise<string>;
8116
+ };
8117
+ provider: () => ProviderInterface;
8118
+ backendUrl: string;
8119
+ deployProxyUrl?: string;
8120
+ fetchImpl?: typeof fetch;
8121
+ deploySponsoredImpl?: typeof deploySponsored;
8122
+ deploySelfFundedImpl?: typeof deploySelfFunded;
8123
+ requestSiwsTokenImpl?: typeof requestSiwsToken;
8124
+ waitUntilDeployedImpl?: typeof waitUntilDeployed;
8125
+ }
8126
+ declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
8127
+ forceNew?: boolean;
8128
+ }): Promise<DeploymentResult>;
8129
+
8083
8130
  interface DeviceEntry {
8084
8131
  guid: string;
8085
8132
  type: GuardianInfo["type"];
@@ -8093,6 +8140,9 @@ interface MediaWalletConfig {
8093
8140
  executor: WalletExecutor;
8094
8141
  provider: () => ProviderInterface;
8095
8142
  unlockTtlMs?: number;
8143
+ backendUrl?: string;
8144
+ deployProxyUrl?: string;
8145
+ fetchImpl?: typeof fetch;
8096
8146
  }
8097
8147
  interface MediaWallet {
8098
8148
  store: OwnerStore;
@@ -8117,9 +8167,12 @@ interface MediaWallet {
8117
8167
  isOwnerOf(accountAddress: string, devicePubkey: string): Promise<boolean>;
8118
8168
  addDevice(sealed: SealedOwner, devicePubkey: string): Promise<string>;
8119
8169
  removeDevice(sealed: SealedOwner, ownerGuid: string): Promise<string>;
8170
+ completeDeployment(onStep: (step: DeploymentStep) => void, options?: {
8171
+ forceNew?: boolean;
8172
+ }): Promise<DeploymentResult>;
8120
8173
  }
8121
8174
  declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
8122
8175
 
8123
8176
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
8124
8177
 
8125
- 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, type CreatedOwner, CreatorCoinFactoryABI, type CreatorCoinGuarantees, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, type DeployingServiceId, type DeviceEntry, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type ExecuteIntentOpts, type 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 OwnerSigner, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, type ParsedAdminHeaders, PasskeyCancelledError, type PasskeyConfig, type PasskeyOwner, PopService, type ReceiptLike, type ReceiptProvider, type ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type 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, type 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, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, 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 };
8178
+ 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, type CreatedOwner, 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, type 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 OwnerSigner, type OwnerStore, POPCollectionABI, POPFactoryABI, type PairingPayload, type ParsedAdminHeaders, PasskeyCancelledError, type PasskeyConfig, type PasskeyOwner, PopService, type ReceiptLike, type ReceiptProvider, type ReceiptProviderLike, type RecoveryAction, type RequestSiwsTokenArgs, type ResolvedOrder, SUGGESTED_DEFAULT_PRICE, type 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, type 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, 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 };
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { keccak_256 } from '@noble/hashes/sha3.js';
3
3
  import { base32, base58 } from '@scure/base';
4
- import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, encode, validateAndParseAddress, Account, typedData, Contract, TypedDataRevision, constants, shortString } from 'starknet';
4
+ import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, encode, validateAndParseAddress, Account, typedData, stark, Contract, TypedDataRevision, constants, shortString } from 'starknet';
5
5
  import { extract, expand } from '@noble/hashes/hkdf.js';
6
6
  import { sha256 } from '@noble/hashes/sha2.js';
7
7
 
@@ -12650,6 +12650,126 @@ function sponsoredExecutor(deps) {
12650
12650
  }
12651
12651
  };
12652
12652
  }
12653
+ async function describeFailure(res, fallback) {
12654
+ const body = await res.json().catch(() => null);
12655
+ throw new Error(body?.error || fallback);
12656
+ }
12657
+ async function deploySponsored(input) {
12658
+ const doFetch = input.fetchImpl ?? fetch;
12659
+ const base = input.proxyUrl.replace(/\/$/, "");
12660
+ const buildRes = await doFetch(`${base}/build`, {
12661
+ method: "POST",
12662
+ headers: { "Content-Type": "application/json" },
12663
+ body: JSON.stringify({
12664
+ ownerPubkey: input.ownerPubKey,
12665
+ ownerAddress: input.ownerAddress,
12666
+ salt: input.salt ?? "0x0"
12667
+ })
12668
+ });
12669
+ if (!buildRes.ok) {
12670
+ await describeFailure(buildRes, "We couldn't prepare your wallet deployment. Please try again.");
12671
+ }
12672
+ const { typedData, deployment, calls } = await buildRes.json();
12673
+ const account = new Account({
12674
+ provider: input.provider,
12675
+ address: input.ownerAddress,
12676
+ signer: input.privateKeyHex,
12677
+ cairoVersion: "1"
12678
+ });
12679
+ const signature = stark.signatureToHexArray(await account.signMessage(typedData));
12680
+ const executeRes = await doFetch(`${base}/execute`, {
12681
+ method: "POST",
12682
+ headers: { "Content-Type": "application/json" },
12683
+ body: JSON.stringify({ ownerAddress: input.ownerAddress, typedData, signature, deployment, calls })
12684
+ });
12685
+ if (!executeRes.ok) {
12686
+ await describeFailure(executeRes, "We couldn't complete your wallet deployment. Please try again.");
12687
+ }
12688
+ const { transactionHash } = await executeRes.json();
12689
+ return { transactionHash };
12690
+ }
12691
+ async function deploySelfFunded(input) {
12692
+ const classHash = getCoordinates("STARKNET").mediaWalletClassHash;
12693
+ if (!classHash) throw new Error("Media Wallet class hash is not configured");
12694
+ const account = new Account({
12695
+ provider: input.provider,
12696
+ address: input.ownerAddress,
12697
+ signer: input.privateKeyHex,
12698
+ cairoVersion: "1"
12699
+ });
12700
+ const { transaction_hash } = await account.deployAccount({
12701
+ classHash,
12702
+ constructorCalldata: ownerConstructorCalldata(input.ownerPubKey),
12703
+ addressSalt: 0,
12704
+ contractAddress: input.ownerAddress
12705
+ });
12706
+ return { transactionHash: transaction_hash };
12707
+ }
12708
+ async function waitUntilDeployed(provider, address, timeoutMs = 9e4, sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
12709
+ const deadline = Date.now() + timeoutMs;
12710
+ let wait = 1e3;
12711
+ for (; ; ) {
12712
+ if (await isDeployed(provider, address)) return;
12713
+ if (Date.now() >= deadline) {
12714
+ throw new Error(
12715
+ "Your wallet was submitted but has not appeared on Starknet yet. Please try again in a moment."
12716
+ );
12717
+ }
12718
+ await sleep2(wait);
12719
+ wait = Math.min(Math.round(wait * 1.5), 5e3);
12720
+ }
12721
+ }
12722
+ async function completeDeployment(deps, onStep, options = {}) {
12723
+ let sealed = options.forceNew ? null : deps.store.load();
12724
+ let privateKeyHex;
12725
+ if (!sealed) {
12726
+ onStep("creating-passkey");
12727
+ const created = await deps.passkey.createOwnerKey();
12728
+ sealed = created.sealed;
12729
+ privateKeyHex = created.privateKeyHex;
12730
+ deps.store.save(sealed);
12731
+ } else {
12732
+ privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
12733
+ }
12734
+ onStep("deploying");
12735
+ const wallet = { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex };
12736
+ const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
12737
+ const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
12738
+ if (deps.deployProxyUrl) {
12739
+ try {
12740
+ await sponsored({
12741
+ proxyUrl: deps.deployProxyUrl,
12742
+ provider: deps.provider(),
12743
+ fetchImpl: deps.fetchImpl,
12744
+ ...wallet
12745
+ });
12746
+ } catch (sponsoredErr) {
12747
+ try {
12748
+ await selfFunded({ provider: deps.provider(), ...wallet });
12749
+ } catch (selfFundedErr) {
12750
+ const sponsored2 = sponsoredErr instanceof Error ? sponsoredErr.message : String(sponsoredErr);
12751
+ const selfFunded2 = selfFundedErr instanceof Error ? selfFundedErr.message : String(selfFundedErr);
12752
+ throw new Error(`Sponsored deploy failed: ${sponsored2}. Self-funded fallback failed: ${selfFunded2}`);
12753
+ }
12754
+ }
12755
+ } else {
12756
+ await selfFunded({ provider: deps.provider(), ...wallet });
12757
+ }
12758
+ await (deps.waitUntilDeployedImpl ?? waitUntilDeployed)(deps.provider(), sealed.address);
12759
+ onStep("signing-in");
12760
+ const address = sealed.address;
12761
+ const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
12762
+ backendUrl: deps.backendUrl,
12763
+ walletAddress: address,
12764
+ signer: {
12765
+ signMessage: async (td) => signWithPrivateKey(privateKeyHex, typedData.getMessageHash(td, address))
12766
+ }
12767
+ });
12768
+ deps.store.notifyChange();
12769
+ return { sealed, siwsToken };
12770
+ }
12771
+
12772
+ // src/wallet/client.ts
12653
12773
  function describeDevices(owners, thisDevicePubkey) {
12654
12774
  const mine = computeOwnerGuid(thisDevicePubkey);
12655
12775
  return owners.map((owner) => ({
@@ -12748,10 +12868,22 @@ function createMediaWallet(config) {
12748
12868
  async removeDevice(sealed, ownerGuid) {
12749
12869
  const { transactionHash } = await run(sealed, [buildRemoveOwnerByGuidCall(sealed.address, ownerGuid)]);
12750
12870
  return transactionHash;
12871
+ },
12872
+ completeDeployment(onStep, options = {}) {
12873
+ if (!config.backendUrl) throw new Error("This wallet has no backend url configured for sign-in");
12874
+ const deps = {
12875
+ store: config.store,
12876
+ passkey: config.passkey,
12877
+ provider: config.provider,
12878
+ backendUrl: config.backendUrl,
12879
+ deployProxyUrl: config.deployProxyUrl,
12880
+ fetchImpl: config.fetchImpl
12881
+ };
12882
+ return completeDeployment(deps, onStep, options);
12751
12883
  }
12752
12884
  };
12753
12885
  }
12754
12886
 
12755
- 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, 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, computeAccountAddress, computeOwnerGuid, confirmIntentBestEffort, createAdminSessionGrant, createMediaWallet, createOwnerStore, createPasskeyOwner, createSelfFundConsent, decodeEscapeAndStatus, decodeGuardiansInfo, 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 };
12887
+ 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, 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 };
12756
12888
  //# sourceMappingURL=index.js.map
12757
12889
  //# sourceMappingURL=index.js.map