@medialane/sdk 0.85.8 → 0.85.9

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.
@@ -7880,6 +7880,25 @@ declare function getGuardians(provider: ProviderInterface, address: string): Pro
7880
7880
  declare function getEscape(provider: ProviderInterface, address: string): Promise<EscapeInfo>;
7881
7881
  declare function getEscapeSecurityPeriod(provider: ProviderInterface, address: string): Promise<number>;
7882
7882
 
7883
+ /**
7884
+ * Pure crypto primitives behind a passkey-sealed Starknet wallet — HKDF key
7885
+ * derivation, AES-GCM seal/unseal, Stark keypair generation, Stark-curve
7886
+ * signing. Deliberately excludes the WebAuthn calls (`navigator.credentials`)
7887
+ * that produce the PRF secret these functions consume — that stays app-local
7888
+ * because it's untestable in this SDK's Node-based test environment and
7889
+ * because RP_NAME/PRF_SALT are legitimately per-app identity, not protocol
7890
+ * facts. `hkdfInfo` is always an explicit caller-supplied parameter, never
7891
+ * defaulted — see the design doc's "load-bearing constraint" for why.
7892
+ */
7893
+ declare function deriveAesKey(prfSecret: Uint8Array, hkdfInfo: Uint8Array): Promise<CryptoKey>;
7894
+ declare function generateStarkKeyPair(): {
7895
+ privateKeyHex: string;
7896
+ publicKeyHex: string;
7897
+ };
7898
+ declare function sealPrivateKey(aesKey: CryptoKey, iv: Uint8Array, privateKeyHex: string): Promise<ArrayBuffer>;
7899
+ declare function unsealPrivateKey(aesKey: CryptoKey, iv: Uint8Array, ciphertext: BufferSource): Promise<string>;
7900
+ declare function signWithPrivateKey(privateKeyHex: string, msgHash: string): [string, string];
7901
+
7883
7902
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
7884
7903
 
7885
- 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 CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
7904
+ 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 CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
@@ -7880,6 +7880,25 @@ declare function getGuardians(provider: ProviderInterface, address: string): Pro
7880
7880
  declare function getEscape(provider: ProviderInterface, address: string): Promise<EscapeInfo>;
7881
7881
  declare function getEscapeSecurityPeriod(provider: ProviderInterface, address: string): Promise<number>;
7882
7882
 
7883
+ /**
7884
+ * Pure crypto primitives behind a passkey-sealed Starknet wallet — HKDF key
7885
+ * derivation, AES-GCM seal/unseal, Stark keypair generation, Stark-curve
7886
+ * signing. Deliberately excludes the WebAuthn calls (`navigator.credentials`)
7887
+ * that produce the PRF secret these functions consume — that stays app-local
7888
+ * because it's untestable in this SDK's Node-based test environment and
7889
+ * because RP_NAME/PRF_SALT are legitimately per-app identity, not protocol
7890
+ * facts. `hkdfInfo` is always an explicit caller-supplied parameter, never
7891
+ * defaulted — see the design doc's "load-bearing constraint" for why.
7892
+ */
7893
+ declare function deriveAesKey(prfSecret: Uint8Array, hkdfInfo: Uint8Array): Promise<CryptoKey>;
7894
+ declare function generateStarkKeyPair(): {
7895
+ privateKeyHex: string;
7896
+ publicKeyHex: string;
7897
+ };
7898
+ declare function sealPrivateKey(aesKey: CryptoKey, iv: Uint8Array, privateKeyHex: string): Promise<ArrayBuffer>;
7899
+ declare function unsealPrivateKey(aesKey: CryptoKey, iv: Uint8Array, ciphertext: BufferSource): Promise<string>;
7900
+ declare function signWithPrivateKey(privateKeyHex: string, msgHash: string): [string, string];
7901
+
7883
7902
  type StarknetVenueSigner = VenueSigner<TypedData, Call>;
7884
7903
 
7885
- 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 CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
7904
+ 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 CreatorCoinPrice, type CreatorCoinReceiptLike, CreatorCoinService, type DeployCollectionParams, DropCollectionABI, DropFactoryABI, DropService, ERC1155CollectionService, type EkuboLaunchParams, type EkuboPoolParams, type EscapeInfo, type EscapeStatusName, type EscapeTypeName, type FeeSurface, type GuardianInfo, IPClubCollectionABI, IPClubFactoryABI, IPCollection1155ABI, IPCollection1155FactoryABI, IPCollectionABI, IPGenesisABI, IPMarketplaceABI, IPNftABI, IPSponsorshipABI, IPTicketCollectionABI, IPTicketCollectionFactoryABI, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, type MintEditionParams, POPCollectionABI, POPFactoryABI, type ParsedAdminHeaders, PopService, type RequestSiwsTokenArgs, type ResolvedOrder, type SiwsSigner, SponsorshipService, StarknetVenue, type StarknetVenueDeps, type StarknetVenueSigner, TicketService, VALIDATED_EKUBO_PARAMS, VenueSigner, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
@@ -11671,7 +11671,36 @@ async function getEscapeSecurityPeriod(provider, address) {
11671
11671
  });
11672
11672
  return Number(res[0]);
11673
11673
  }
11674
+ async function deriveAesKey(prfSecret, hkdfInfo) {
11675
+ const hkdf = await crypto.subtle.importKey("raw", prfSecret, "HKDF", false, ["deriveKey"]);
11676
+ return crypto.subtle.deriveKey(
11677
+ { name: "HKDF", hash: "SHA-256", salt: new Uint8Array(0), info: hkdfInfo },
11678
+ hkdf,
11679
+ { name: "AES-GCM", length: 256 },
11680
+ false,
11681
+ ["encrypt", "decrypt"]
11682
+ );
11683
+ }
11684
+ function generateStarkKeyPair() {
11685
+ const privateKeyHex = "0x" + Array.from(ec.starkCurve.utils.randomPrivateKey()).map((b) => b.toString(16).padStart(2, "0")).join("");
11686
+ return { privateKeyHex, publicKeyHex: ec.starkCurve.getStarkKey(privateKeyHex) };
11687
+ }
11688
+ async function sealPrivateKey(aesKey, iv, privateKeyHex) {
11689
+ return crypto.subtle.encrypt(
11690
+ { name: "AES-GCM", iv },
11691
+ aesKey,
11692
+ new TextEncoder().encode(privateKeyHex)
11693
+ );
11694
+ }
11695
+ async function unsealPrivateKey(aesKey, iv, ciphertext) {
11696
+ const buf = await crypto.subtle.decrypt({ name: "AES-GCM", iv }, aesKey, ciphertext);
11697
+ return new TextDecoder().decode(buf);
11698
+ }
11699
+ function signWithPrivateKey(privateKeyHex, msgHash) {
11700
+ const sig = ec.starkCurve.sign(msgHash, privateKeyHex);
11701
+ return [num.toHex(sig.r), num.toHex(sig.s)];
11702
+ }
11674
11703
 
11675
- 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, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sessionKeyHashOf, signAdminRequest, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
11704
+ 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, LAUNCH_PRICE_QUOTE_PER_COIN, Medialane1155ABI, MedialaneClient, MedialaneError, POPCollectionABI, POPFactoryABI, PopService, SponsorshipService, StarknetVenue, TicketService, VALIDATED_EKUBO_PARAMS, adminRequestDigest, build1155CancellationTypedData, build1155OrderTypedData, buildAdminSessionTypedData, buildCancelEscapeCall, buildCancellationTypedData, buildChangeOwnersCall, buildCompleteEscapeOwnerCall, buildCreateCreatorCoinCall, buildDeployAccountParams, buildFeeCall, buildLaunchOnEkuboCalls, buildOrderTypedData, buildSetFirstGuardianCall, buildTriggerEscapeOwnerCall, buybackQuoteRaw, toRaw as coinToRaw, computeAccountAddress, computeOwnerGuid, createAdminSessionGrant, decodeEscapeAndStatus, decodeGuardiansInfo, deriveAesKey, deriveOwnerKeyPair, encodeAdminHeaders, encodeByteArray, fdvHuman, generateStarkKeyPair, getCounter, getCounter1155, getCreatorCoinPrice, getEscape, getEscapeSecurityPeriod, getGuardians, getOrderDetails, getOrderDetails1155, getSiwsStorageKey, getStoredSiwsToken, isSiwsTokenValid, normalizeSiwsSignature, ownerConstructorCalldata, parseAdminHeaders, parseCreatorCoinCreated, priceToEkuboParams, randomNonce, requestSiwsToken, sealPrivateKey, sessionKeyHashOf, signAdminRequest, signWithPrivateKey, storeSiwsToken, teamCoinsRaw, toContractConditions as toDropContractConditions, unsealPrivateKey, validateName as validateCoinName, validateSupply as validateCoinSupply, validateSymbol as validateCoinSymbol, verifyAdminRequestSig };
11676
11705
  //# sourceMappingURL=index.js.map
11677
11706
  //# sourceMappingURL=index.js.map