@medialane/sdk 0.121.0 → 0.122.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.
- package/dist/starknet/index.cjs +120 -0
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +52 -1
- package/dist/starknet/index.d.ts +52 -1
- package/dist/starknet/index.js +119 -2
- package/dist/starknet/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -8080,6 +8080,51 @@ 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
|
+
interface DeploymentDeps {
|
|
8104
|
+
store: {
|
|
8105
|
+
load(): SealedOwner | null;
|
|
8106
|
+
save(sealed: SealedOwner): void;
|
|
8107
|
+
notifyChange(): void;
|
|
8108
|
+
};
|
|
8109
|
+
passkey: {
|
|
8110
|
+
createOwnerKey(): Promise<{
|
|
8111
|
+
sealed: SealedOwner;
|
|
8112
|
+
privateKeyHex: string;
|
|
8113
|
+
}>;
|
|
8114
|
+
unlockOwnerKey(sealed: SealedOwner): Promise<string>;
|
|
8115
|
+
};
|
|
8116
|
+
provider: () => ProviderInterface;
|
|
8117
|
+
backendUrl: string;
|
|
8118
|
+
deployProxyUrl?: string;
|
|
8119
|
+
fetchImpl?: typeof fetch;
|
|
8120
|
+
deploySponsoredImpl?: typeof deploySponsored;
|
|
8121
|
+
deploySelfFundedImpl?: typeof deploySelfFunded;
|
|
8122
|
+
requestSiwsTokenImpl?: typeof requestSiwsToken;
|
|
8123
|
+
}
|
|
8124
|
+
declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
|
|
8125
|
+
forceNew?: boolean;
|
|
8126
|
+
}): Promise<DeploymentResult>;
|
|
8127
|
+
|
|
8083
8128
|
interface DeviceEntry {
|
|
8084
8129
|
guid: string;
|
|
8085
8130
|
type: GuardianInfo["type"];
|
|
@@ -8093,6 +8138,9 @@ interface MediaWalletConfig {
|
|
|
8093
8138
|
executor: WalletExecutor;
|
|
8094
8139
|
provider: () => ProviderInterface;
|
|
8095
8140
|
unlockTtlMs?: number;
|
|
8141
|
+
backendUrl?: string;
|
|
8142
|
+
deployProxyUrl?: string;
|
|
8143
|
+
fetchImpl?: typeof fetch;
|
|
8096
8144
|
}
|
|
8097
8145
|
interface MediaWallet {
|
|
8098
8146
|
store: OwnerStore;
|
|
@@ -8117,9 +8165,12 @@ interface MediaWallet {
|
|
|
8117
8165
|
isOwnerOf(accountAddress: string, devicePubkey: string): Promise<boolean>;
|
|
8118
8166
|
addDevice(sealed: SealedOwner, devicePubkey: string): Promise<string>;
|
|
8119
8167
|
removeDevice(sealed: SealedOwner, ownerGuid: string): Promise<string>;
|
|
8168
|
+
completeDeployment(onStep: (step: DeploymentStep) => void, options?: {
|
|
8169
|
+
forceNew?: boolean;
|
|
8170
|
+
}): Promise<DeploymentResult>;
|
|
8120
8171
|
}
|
|
8121
8172
|
declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
|
|
8122
8173
|
|
|
8123
8174
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
8124
8175
|
|
|
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 };
|
|
8176
|
+
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 };
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -8080,6 +8080,51 @@ 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
|
+
interface DeploymentDeps {
|
|
8104
|
+
store: {
|
|
8105
|
+
load(): SealedOwner | null;
|
|
8106
|
+
save(sealed: SealedOwner): void;
|
|
8107
|
+
notifyChange(): void;
|
|
8108
|
+
};
|
|
8109
|
+
passkey: {
|
|
8110
|
+
createOwnerKey(): Promise<{
|
|
8111
|
+
sealed: SealedOwner;
|
|
8112
|
+
privateKeyHex: string;
|
|
8113
|
+
}>;
|
|
8114
|
+
unlockOwnerKey(sealed: SealedOwner): Promise<string>;
|
|
8115
|
+
};
|
|
8116
|
+
provider: () => ProviderInterface;
|
|
8117
|
+
backendUrl: string;
|
|
8118
|
+
deployProxyUrl?: string;
|
|
8119
|
+
fetchImpl?: typeof fetch;
|
|
8120
|
+
deploySponsoredImpl?: typeof deploySponsored;
|
|
8121
|
+
deploySelfFundedImpl?: typeof deploySelfFunded;
|
|
8122
|
+
requestSiwsTokenImpl?: typeof requestSiwsToken;
|
|
8123
|
+
}
|
|
8124
|
+
declare function completeDeployment(deps: DeploymentDeps, onStep: (step: DeploymentStep) => void, options?: {
|
|
8125
|
+
forceNew?: boolean;
|
|
8126
|
+
}): Promise<DeploymentResult>;
|
|
8127
|
+
|
|
8083
8128
|
interface DeviceEntry {
|
|
8084
8129
|
guid: string;
|
|
8085
8130
|
type: GuardianInfo["type"];
|
|
@@ -8093,6 +8138,9 @@ interface MediaWalletConfig {
|
|
|
8093
8138
|
executor: WalletExecutor;
|
|
8094
8139
|
provider: () => ProviderInterface;
|
|
8095
8140
|
unlockTtlMs?: number;
|
|
8141
|
+
backendUrl?: string;
|
|
8142
|
+
deployProxyUrl?: string;
|
|
8143
|
+
fetchImpl?: typeof fetch;
|
|
8096
8144
|
}
|
|
8097
8145
|
interface MediaWallet {
|
|
8098
8146
|
store: OwnerStore;
|
|
@@ -8117,9 +8165,12 @@ interface MediaWallet {
|
|
|
8117
8165
|
isOwnerOf(accountAddress: string, devicePubkey: string): Promise<boolean>;
|
|
8118
8166
|
addDevice(sealed: SealedOwner, devicePubkey: string): Promise<string>;
|
|
8119
8167
|
removeDevice(sealed: SealedOwner, ownerGuid: string): Promise<string>;
|
|
8168
|
+
completeDeployment(onStep: (step: DeploymentStep) => void, options?: {
|
|
8169
|
+
forceNew?: boolean;
|
|
8170
|
+
}): Promise<DeploymentResult>;
|
|
8120
8171
|
}
|
|
8121
8172
|
declare function createMediaWallet(config: MediaWalletConfig): MediaWallet;
|
|
8122
8173
|
|
|
8123
8174
|
type StarknetVenueSigner = VenueSigner<TypedData, Call>;
|
|
8124
8175
|
|
|
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 };
|
|
8176
|
+
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 };
|
package/dist/starknet/index.js
CHANGED
|
@@ -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,111 @@ 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 completeDeployment(deps, onStep, options = {}) {
|
|
12709
|
+
let sealed = options.forceNew ? null : deps.store.load();
|
|
12710
|
+
let privateKeyHex;
|
|
12711
|
+
if (!sealed) {
|
|
12712
|
+
onStep("creating-passkey");
|
|
12713
|
+
const created = await deps.passkey.createOwnerKey();
|
|
12714
|
+
sealed = created.sealed;
|
|
12715
|
+
privateKeyHex = created.privateKeyHex;
|
|
12716
|
+
deps.store.save(sealed);
|
|
12717
|
+
} else {
|
|
12718
|
+
privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
|
|
12719
|
+
}
|
|
12720
|
+
onStep("deploying");
|
|
12721
|
+
const wallet = { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex };
|
|
12722
|
+
const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
|
|
12723
|
+
const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
|
|
12724
|
+
if (deps.deployProxyUrl) {
|
|
12725
|
+
try {
|
|
12726
|
+
await sponsored({
|
|
12727
|
+
proxyUrl: deps.deployProxyUrl,
|
|
12728
|
+
provider: deps.provider(),
|
|
12729
|
+
fetchImpl: deps.fetchImpl,
|
|
12730
|
+
...wallet
|
|
12731
|
+
});
|
|
12732
|
+
} catch (sponsoredErr) {
|
|
12733
|
+
try {
|
|
12734
|
+
await selfFunded({ provider: deps.provider(), ...wallet });
|
|
12735
|
+
} catch (selfFundedErr) {
|
|
12736
|
+
const sponsored2 = sponsoredErr instanceof Error ? sponsoredErr.message : String(sponsoredErr);
|
|
12737
|
+
const selfFunded2 = selfFundedErr instanceof Error ? selfFundedErr.message : String(selfFundedErr);
|
|
12738
|
+
throw new Error(`Sponsored deploy failed: ${sponsored2}. Self-funded fallback failed: ${selfFunded2}`);
|
|
12739
|
+
}
|
|
12740
|
+
}
|
|
12741
|
+
} else {
|
|
12742
|
+
await selfFunded({ provider: deps.provider(), ...wallet });
|
|
12743
|
+
}
|
|
12744
|
+
onStep("signing-in");
|
|
12745
|
+
const address = sealed.address;
|
|
12746
|
+
const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
|
|
12747
|
+
backendUrl: deps.backendUrl,
|
|
12748
|
+
walletAddress: address,
|
|
12749
|
+
signer: {
|
|
12750
|
+
signMessage: async (td) => signWithPrivateKey(privateKeyHex, typedData.getMessageHash(td, address))
|
|
12751
|
+
}
|
|
12752
|
+
});
|
|
12753
|
+
deps.store.notifyChange();
|
|
12754
|
+
return { sealed, siwsToken };
|
|
12755
|
+
}
|
|
12756
|
+
|
|
12757
|
+
// src/wallet/client.ts
|
|
12653
12758
|
function describeDevices(owners, thisDevicePubkey) {
|
|
12654
12759
|
const mine = computeOwnerGuid(thisDevicePubkey);
|
|
12655
12760
|
return owners.map((owner) => ({
|
|
@@ -12748,10 +12853,22 @@ function createMediaWallet(config) {
|
|
|
12748
12853
|
async removeDevice(sealed, ownerGuid) {
|
|
12749
12854
|
const { transactionHash } = await run(sealed, [buildRemoveOwnerByGuidCall(sealed.address, ownerGuid)]);
|
|
12750
12855
|
return transactionHash;
|
|
12856
|
+
},
|
|
12857
|
+
completeDeployment(onStep, options = {}) {
|
|
12858
|
+
if (!config.backendUrl) throw new Error("This wallet has no backend url configured for sign-in");
|
|
12859
|
+
const deps = {
|
|
12860
|
+
store: config.store,
|
|
12861
|
+
passkey: config.passkey,
|
|
12862
|
+
provider: config.provider,
|
|
12863
|
+
backendUrl: config.backendUrl,
|
|
12864
|
+
deployProxyUrl: config.deployProxyUrl,
|
|
12865
|
+
fetchImpl: config.fetchImpl
|
|
12866
|
+
};
|
|
12867
|
+
return completeDeployment(deps, onStep, options);
|
|
12751
12868
|
}
|
|
12752
12869
|
};
|
|
12753
12870
|
}
|
|
12754
12871
|
|
|
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 };
|
|
12872
|
+
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 };
|
|
12756
12873
|
//# sourceMappingURL=index.js.map
|
|
12757
12874
|
//# sourceMappingURL=index.js.map
|