@medialane/sdk 0.120.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.
@@ -12329,6 +12329,548 @@ function signWithPrivateKey(privateKeyHex, msgHash) {
12329
12329
  return [starknet.num.toHex(sig.r), starknet.num.toHex(sig.s)];
12330
12330
  }
12331
12331
 
12332
+ // src/wallet/store.ts
12333
+ function createOwnerStore(config) {
12334
+ const { storeKey, changeEvent } = config;
12335
+ const announce = () => {
12336
+ if (typeof window === "undefined") return;
12337
+ window.dispatchEvent(new Event(changeEvent));
12338
+ };
12339
+ return {
12340
+ load() {
12341
+ if (typeof window === "undefined") return null;
12342
+ try {
12343
+ const raw = localStorage.getItem(storeKey);
12344
+ return raw ? JSON.parse(raw) : null;
12345
+ } catch {
12346
+ return null;
12347
+ }
12348
+ },
12349
+ loadAddress() {
12350
+ return this.load()?.address ?? null;
12351
+ },
12352
+ save(sealed) {
12353
+ localStorage.setItem(storeKey, JSON.stringify(sealed));
12354
+ announce();
12355
+ },
12356
+ clear() {
12357
+ localStorage.removeItem(storeKey);
12358
+ announce();
12359
+ },
12360
+ notifyChange: announce,
12361
+ onChange(listener) {
12362
+ window.addEventListener(changeEvent, listener);
12363
+ return () => window.removeEventListener(changeEvent, listener);
12364
+ }
12365
+ };
12366
+ }
12367
+
12368
+ // src/wallet/pairing.ts
12369
+ var SCHEME = "medialane-device";
12370
+ var VERSION = 1;
12371
+ var LABEL_MAX = 32;
12372
+ var STARK_PRIME = (1n << 251n) + 17n * (1n << 192n) + 1n;
12373
+ var InvalidPairingPayloadError = class extends Error {
12374
+ constructor(message = "This code is not a Medialane device request.") {
12375
+ super(message);
12376
+ this.name = "InvalidPairingPayloadError";
12377
+ }
12378
+ };
12379
+ function normalisePublicKey(input) {
12380
+ if (typeof input !== "string" || !/^0x[0-9a-fA-F]+$/.test(input)) {
12381
+ throw new InvalidPairingPayloadError("That device key is not valid.");
12382
+ }
12383
+ const value = BigInt(input);
12384
+ if (value === 0n || value >= STARK_PRIME) {
12385
+ throw new InvalidPairingPayloadError("That device key is not valid.");
12386
+ }
12387
+ return `0x${value.toString(16)}`;
12388
+ }
12389
+ function sanitiseLabel(input) {
12390
+ const raw = typeof input === "string" ? input : "";
12391
+ return raw.replace(/\s+/g, " ").trim().slice(0, LABEL_MAX);
12392
+ }
12393
+ function encodePairingPayload(payload) {
12394
+ return JSON.stringify({
12395
+ scheme: SCHEME,
12396
+ version: VERSION,
12397
+ publicKey: normalisePublicKey(payload.publicKey),
12398
+ label: sanitiseLabel(payload.label)
12399
+ });
12400
+ }
12401
+ function parsePairingPayload(encoded) {
12402
+ let data;
12403
+ try {
12404
+ data = JSON.parse(encoded);
12405
+ } catch {
12406
+ throw new InvalidPairingPayloadError();
12407
+ }
12408
+ if (data === null || typeof data !== "object") throw new InvalidPairingPayloadError();
12409
+ if (data.scheme !== SCHEME || data.version !== VERSION) throw new InvalidPairingPayloadError();
12410
+ return {
12411
+ publicKey: normalisePublicKey(data.publicKey),
12412
+ label: sanitiseLabel(data.label)
12413
+ };
12414
+ }
12415
+ function parseAccountAddress(input) {
12416
+ const trimmed = typeof input === "string" ? input.trim() : "";
12417
+ if (!/^0x[0-9a-fA-F]{50,64}$/.test(trimmed)) {
12418
+ throw new InvalidPairingPayloadError("That does not look like an account address.");
12419
+ }
12420
+ if (BigInt(trimmed) === 0n) {
12421
+ throw new InvalidPairingPayloadError("That does not look like an account address.");
12422
+ }
12423
+ return trimmed;
12424
+ }
12425
+
12426
+ // src/wallet/recovery-key.ts
12427
+ function isRecoveryKeyForWallet(sealed) {
12428
+ try {
12429
+ return BigInt(computeAccountAddress(sealed.ownerPubKey, 0)) === BigInt(sealed.address);
12430
+ } catch {
12431
+ return false;
12432
+ }
12433
+ }
12434
+
12435
+ // src/wallet/guardian-status.ts
12436
+ function describeGuardianStatus(guardians) {
12437
+ if (guardians.length === 0) return { kind: "none" };
12438
+ return { kind: "active", guardian: guardians[0] };
12439
+ }
12440
+ function describeRecoveryAction(escape) {
12441
+ if (escape.escapeType !== "Owner") return "none";
12442
+ if (escape.status === "Ready") return "complete";
12443
+ if (escape.status === "Expired") return "start";
12444
+ return "none";
12445
+ }
12446
+ function normalizeWalletAddress(address) {
12447
+ return normalizeAddress("STARKNET", address);
12448
+ }
12449
+ function isValidStarknetAddress(address) {
12450
+ try {
12451
+ starknet.validateAndParseAddress(address.trim());
12452
+ return true;
12453
+ } catch {
12454
+ return false;
12455
+ }
12456
+ }
12457
+ async function isDeployed(provider, address) {
12458
+ try {
12459
+ await provider.getClassHashAt(normalizeWalletAddress(address));
12460
+ return true;
12461
+ } catch {
12462
+ return false;
12463
+ }
12464
+ }
12465
+
12466
+ // src/wallet/self-fund-consent.ts
12467
+ function createSelfFundConsent(estimateFee) {
12468
+ let handler = null;
12469
+ return {
12470
+ registerHandler(next) {
12471
+ handler = next;
12472
+ },
12473
+ async request({ address, calls }) {
12474
+ if (!handler) return false;
12475
+ const feeEstimate = address && calls ? estimateFee(address, calls).catch(() => null) : Promise.resolve(null);
12476
+ return handler(feeEstimate);
12477
+ }
12478
+ };
12479
+ }
12480
+
12481
+ // src/wallet/passkey.ts
12482
+ var PasskeyCancelledError = class extends Error {
12483
+ constructor(message = "Passkey prompt was cancelled.") {
12484
+ super(message);
12485
+ this.name = "PasskeyCancelledError";
12486
+ }
12487
+ };
12488
+ var encodeBase64 = (buf) => {
12489
+ const bytes = buf instanceof Uint8Array ? buf : new Uint8Array(buf);
12490
+ let binary = "";
12491
+ for (const byte of bytes) binary += String.fromCharCode(byte);
12492
+ return btoa(binary);
12493
+ };
12494
+ var decodeBase64 = (value) => {
12495
+ const binary = atob(value);
12496
+ const bytes = new Uint8Array(binary.length);
12497
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
12498
+ return bytes;
12499
+ };
12500
+ function isPasskeyCancellation(err) {
12501
+ const name = err?.name;
12502
+ return name === "NotAllowedError" || name === "AbortError";
12503
+ }
12504
+ function createPasskeyOwner(config) {
12505
+ const randomBytes = config.randomBytes ?? ((length) => crypto.getRandomValues(new Uint8Array(length)));
12506
+ const credentialsApi = () => {
12507
+ const api = config.credentials ?? (typeof navigator === "undefined" ? void 0 : navigator.credentials);
12508
+ if (!api) throw new Error("Passkeys are only available in a browser.");
12509
+ return api;
12510
+ };
12511
+ const prfUnsupportedMessage = () => {
12512
+ const isBrave = typeof navigator !== "undefined" && "brave" in navigator;
12513
+ const cause = isBrave ? "Brave doesn't currently support the WebAuthn PRF extension." : "This browser didn't return a passkey PRF secret.";
12514
+ return `${cause} ${config.appName} needs it to seal your key. Your device passkey (Touch ID) is fine, the limitation is the browser. Please open this in Safari or Chrome on an up-to-date OS.`;
12515
+ };
12516
+ async function registerPasskey() {
12517
+ let credential;
12518
+ try {
12519
+ credential = await credentialsApi().create({
12520
+ publicKey: {
12521
+ challenge: randomBytes(32),
12522
+ rp: { name: config.relyingPartyName, id: config.relyingPartyId() },
12523
+ user: await config.passkeyUser(),
12524
+ excludeCredentials: config.knownCredentials(),
12525
+ pubKeyCredParams: [
12526
+ { type: "public-key", alg: -7 },
12527
+ { type: "public-key", alg: -257 }
12528
+ ],
12529
+ authenticatorSelection: {
12530
+ residentKey: "required",
12531
+ userVerification: "required",
12532
+ authenticatorAttachment: "platform"
12533
+ },
12534
+ extensions: { prf: { eval: { first: config.prfSalt } } }
12535
+ }
12536
+ });
12537
+ } catch (err) {
12538
+ if (isPasskeyCancellation(err)) throw new PasskeyCancelledError();
12539
+ throw err;
12540
+ }
12541
+ const prf = credential.getClientExtensionResults().prf;
12542
+ return { credentialId: encodeBase64(credential.rawId), prfFirst: prf?.results?.first ?? null };
12543
+ }
12544
+ async function prfSecret(credentialId) {
12545
+ let assertion;
12546
+ try {
12547
+ assertion = await credentialsApi().get({
12548
+ publicKey: {
12549
+ challenge: randomBytes(32),
12550
+ rpId: config.relyingPartyId(),
12551
+ allowCredentials: [{ type: "public-key", id: decodeBase64(credentialId) }],
12552
+ userVerification: "required",
12553
+ extensions: { prf: { eval: { first: config.prfSalt } } }
12554
+ }
12555
+ });
12556
+ } catch (err) {
12557
+ if (isPasskeyCancellation(err)) throw new PasskeyCancelledError();
12558
+ throw err;
12559
+ }
12560
+ const result = assertion.getClientExtensionResults().prf?.results?.first;
12561
+ if (!result) throw new Error("Passkey PRF unavailable on this device/browser.");
12562
+ return new Uint8Array(result);
12563
+ }
12564
+ async function secretFromRegistration(registration) {
12565
+ if (registration.prfFirst) return new Uint8Array(registration.prfFirst);
12566
+ try {
12567
+ return await prfSecret(registration.credentialId);
12568
+ } catch {
12569
+ throw new Error(prfUnsupportedMessage());
12570
+ }
12571
+ }
12572
+ async function seal(secret, privateKeyHex) {
12573
+ const aes = await deriveAesKey(secret, config.hkdfInfo);
12574
+ const iv = randomBytes(12);
12575
+ const ciphertext = await sealPrivateKey(aes, iv, privateKeyHex);
12576
+ return { iv: encodeBase64(iv), ciphertext: encodeBase64(ciphertext) };
12577
+ }
12578
+ return {
12579
+ async createOwnerKey() {
12580
+ const registration = await registerPasskey();
12581
+ const secret = await secretFromRegistration(registration);
12582
+ const { privateKeyHex, publicKeyHex } = generateStarkKeyPair();
12583
+ const { iv, ciphertext } = await seal(secret, privateKeyHex);
12584
+ return {
12585
+ sealed: {
12586
+ credentialId: registration.credentialId,
12587
+ ownerPubKey: publicKeyHex,
12588
+ address: computeAccountAddress(publicKeyHex, 0),
12589
+ iv,
12590
+ ciphertext
12591
+ },
12592
+ privateKeyHex
12593
+ };
12594
+ },
12595
+ async unlockOwnerKey(sealed) {
12596
+ const secret = await prfSecret(sealed.credentialId);
12597
+ const aes = await deriveAesKey(secret, config.hkdfInfo);
12598
+ return unsealPrivateKey(aes, decodeBase64(sealed.iv), decodeBase64(sealed.ciphertext));
12599
+ },
12600
+ async sealImportedOwnerKey(privateKeyInput) {
12601
+ const { privateKeyHex, publicKeyHex } = starkKeyPairFromPrivateKey(privateKeyInput);
12602
+ const registration = await registerPasskey();
12603
+ const secret = await secretFromRegistration(registration);
12604
+ const { iv, ciphertext } = await seal(secret, privateKeyHex);
12605
+ return {
12606
+ credentialId: registration.credentialId,
12607
+ ownerPubKey: publicKeyHex,
12608
+ address: computeAccountAddress(publicKeyHex, 0),
12609
+ iv,
12610
+ ciphertext
12611
+ };
12612
+ },
12613
+ walletAddressForPrivateKey(privateKeyInput) {
12614
+ return computeAccountAddress(starkKeyPairFromPrivateKey(privateKeyInput).publicKeyHex, 0);
12615
+ }
12616
+ };
12617
+ }
12618
+ function accountFor(provider, address, privateKeyHex) {
12619
+ return new starknet.Account({ provider, address, signer: privateKeyHex, cairoVersion: "1" });
12620
+ }
12621
+ async function estimateSelfFundedFee(provider, address, calls) {
12622
+ const account = new starknet.Account({ provider, address, signer: "0x1", cairoVersion: "1" });
12623
+ const estimate = await account.estimateInvokeFee(calls);
12624
+ return { feeRaw: estimate.overall_fee, unit: estimate.unit };
12625
+ }
12626
+ function selfFundedExecutor(deps) {
12627
+ return {
12628
+ async execute({ userAddress, privateKeyHex, calls }) {
12629
+ const account = accountFor(deps.provider(), userAddress, privateKeyHex);
12630
+ const { transaction_hash } = await account.execute(calls);
12631
+ return { transactionHash: transaction_hash };
12632
+ }
12633
+ };
12634
+ }
12635
+ function sponsoredExecutor(deps) {
12636
+ const fallback = deps.fallback ?? selfFundedExecutor(deps);
12637
+ return {
12638
+ async execute(input) {
12639
+ const { userAddress, privateKeyHex, calls } = input;
12640
+ const result = await executeSponsored(
12641
+ { proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
12642
+ {
12643
+ address: userAddress,
12644
+ signTypedData: async (data) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
12645
+ },
12646
+ calls
12647
+ );
12648
+ if (result.status === "sponsored") return { transactionHash: result.transactionHash };
12649
+ const consented = await deps.consent.request({ address: userAddress, calls });
12650
+ if (!consented) throw new SponsoredCallRejectedError(result.reason);
12651
+ return fallback.execute(input);
12652
+ }
12653
+ };
12654
+ }
12655
+ async function describeFailure(res, fallback) {
12656
+ const body = await res.json().catch(() => null);
12657
+ throw new Error(body?.error || fallback);
12658
+ }
12659
+ async function deploySponsored(input) {
12660
+ const doFetch = input.fetchImpl ?? fetch;
12661
+ const base = input.proxyUrl.replace(/\/$/, "");
12662
+ const buildRes = await doFetch(`${base}/build`, {
12663
+ method: "POST",
12664
+ headers: { "Content-Type": "application/json" },
12665
+ body: JSON.stringify({
12666
+ ownerPubkey: input.ownerPubKey,
12667
+ ownerAddress: input.ownerAddress,
12668
+ salt: input.salt ?? "0x0"
12669
+ })
12670
+ });
12671
+ if (!buildRes.ok) {
12672
+ await describeFailure(buildRes, "We couldn't prepare your wallet deployment. Please try again.");
12673
+ }
12674
+ const { typedData, deployment, calls } = await buildRes.json();
12675
+ const account = new starknet.Account({
12676
+ provider: input.provider,
12677
+ address: input.ownerAddress,
12678
+ signer: input.privateKeyHex,
12679
+ cairoVersion: "1"
12680
+ });
12681
+ const signature = starknet.stark.signatureToHexArray(await account.signMessage(typedData));
12682
+ const executeRes = await doFetch(`${base}/execute`, {
12683
+ method: "POST",
12684
+ headers: { "Content-Type": "application/json" },
12685
+ body: JSON.stringify({ ownerAddress: input.ownerAddress, typedData, signature, deployment, calls })
12686
+ });
12687
+ if (!executeRes.ok) {
12688
+ await describeFailure(executeRes, "We couldn't complete your wallet deployment. Please try again.");
12689
+ }
12690
+ const { transactionHash } = await executeRes.json();
12691
+ return { transactionHash };
12692
+ }
12693
+ async function deploySelfFunded(input) {
12694
+ const classHash = getCoordinates("STARKNET").mediaWalletClassHash;
12695
+ if (!classHash) throw new Error("Media Wallet class hash is not configured");
12696
+ const account = new starknet.Account({
12697
+ provider: input.provider,
12698
+ address: input.ownerAddress,
12699
+ signer: input.privateKeyHex,
12700
+ cairoVersion: "1"
12701
+ });
12702
+ const { transaction_hash } = await account.deployAccount({
12703
+ classHash,
12704
+ constructorCalldata: ownerConstructorCalldata(input.ownerPubKey),
12705
+ addressSalt: 0,
12706
+ contractAddress: input.ownerAddress
12707
+ });
12708
+ return { transactionHash: transaction_hash };
12709
+ }
12710
+ async function completeDeployment(deps, onStep, options = {}) {
12711
+ let sealed = options.forceNew ? null : deps.store.load();
12712
+ let privateKeyHex;
12713
+ if (!sealed) {
12714
+ onStep("creating-passkey");
12715
+ const created = await deps.passkey.createOwnerKey();
12716
+ sealed = created.sealed;
12717
+ privateKeyHex = created.privateKeyHex;
12718
+ deps.store.save(sealed);
12719
+ } else {
12720
+ privateKeyHex = await deps.passkey.unlockOwnerKey(sealed);
12721
+ }
12722
+ onStep("deploying");
12723
+ const wallet = { ownerAddress: sealed.address, ownerPubKey: sealed.ownerPubKey, privateKeyHex };
12724
+ const sponsored = deps.deploySponsoredImpl ?? deploySponsored;
12725
+ const selfFunded = deps.deploySelfFundedImpl ?? deploySelfFunded;
12726
+ if (deps.deployProxyUrl) {
12727
+ try {
12728
+ await sponsored({
12729
+ proxyUrl: deps.deployProxyUrl,
12730
+ provider: deps.provider(),
12731
+ fetchImpl: deps.fetchImpl,
12732
+ ...wallet
12733
+ });
12734
+ } catch (sponsoredErr) {
12735
+ try {
12736
+ await selfFunded({ provider: deps.provider(), ...wallet });
12737
+ } catch (selfFundedErr) {
12738
+ const sponsored2 = sponsoredErr instanceof Error ? sponsoredErr.message : String(sponsoredErr);
12739
+ const selfFunded2 = selfFundedErr instanceof Error ? selfFundedErr.message : String(selfFundedErr);
12740
+ throw new Error(`Sponsored deploy failed: ${sponsored2}. Self-funded fallback failed: ${selfFunded2}`);
12741
+ }
12742
+ }
12743
+ } else {
12744
+ await selfFunded({ provider: deps.provider(), ...wallet });
12745
+ }
12746
+ onStep("signing-in");
12747
+ const address = sealed.address;
12748
+ const siwsToken = await (deps.requestSiwsTokenImpl ?? requestSiwsToken)({
12749
+ backendUrl: deps.backendUrl,
12750
+ walletAddress: address,
12751
+ signer: {
12752
+ signMessage: async (td) => signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
12753
+ }
12754
+ });
12755
+ deps.store.notifyChange();
12756
+ return { sealed, siwsToken };
12757
+ }
12758
+
12759
+ // src/wallet/client.ts
12760
+ function describeDevices(owners, thisDevicePubkey) {
12761
+ const mine = computeOwnerGuid(thisDevicePubkey);
12762
+ return owners.map((owner) => ({
12763
+ guid: owner.guid,
12764
+ type: owner.type,
12765
+ isThisDevice: BigInt(owner.guid) === BigInt(mine)
12766
+ }));
12767
+ }
12768
+ function canRemoveDevice(devices, guid) {
12769
+ if (devices.length <= 1) return false;
12770
+ return devices.some((device) => BigInt(device.guid) === BigInt(guid));
12771
+ }
12772
+ function createMediaWallet(config) {
12773
+ const ttl = config.unlockTtlMs ?? 2e4;
12774
+ const unlockCache = /* @__PURE__ */ new Map();
12775
+ const lock = (address) => {
12776
+ const entry = unlockCache.get(address);
12777
+ if (!entry) return;
12778
+ clearTimeout(entry.timer);
12779
+ unlockCache.delete(address);
12780
+ };
12781
+ const unlockOnce = (sealed) => {
12782
+ const existing = unlockCache.get(sealed.address);
12783
+ if (existing) return existing.promise;
12784
+ const promise = config.passkey.unlockOwnerKey(sealed).catch((err) => {
12785
+ lock(sealed.address);
12786
+ throw err;
12787
+ });
12788
+ const timer = setTimeout(() => lock(sealed.address), ttl);
12789
+ unlockCache.set(sealed.address, { promise, timer });
12790
+ return promise;
12791
+ };
12792
+ const run = async (sealed, calls, userAddress) => {
12793
+ const privateKeyHex = await unlockOnce(sealed);
12794
+ return config.executor.execute({
12795
+ userAddress: userAddress ?? sealed.address,
12796
+ privateKeyHex,
12797
+ calls
12798
+ });
12799
+ };
12800
+ return {
12801
+ store: config.store,
12802
+ passkey: config.passkey,
12803
+ lock,
12804
+ signerFor(sealed) {
12805
+ return {
12806
+ address: sealed.address,
12807
+ signTypedData: async (data) => {
12808
+ const privateKeyHex = await unlockOnce(sealed);
12809
+ return signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
12810
+ },
12811
+ execute: async (calls) => {
12812
+ const { transactionHash } = await run(sealed, calls);
12813
+ return { txHash: transactionHash };
12814
+ }
12815
+ };
12816
+ },
12817
+ run,
12818
+ getGuardians: (address) => getGuardians(config.provider(), address),
12819
+ getEscape: (address) => getEscape(config.provider(), address),
12820
+ getEscapeSecurityPeriod: (address) => getEscapeSecurityPeriod(config.provider(), address),
12821
+ getOwners: (address) => getOwners(config.provider(), address),
12822
+ async isOwnerOf(accountAddress, devicePubkey) {
12823
+ const owners = await getOwners(config.provider(), accountAddress);
12824
+ const guid = BigInt(computeOwnerGuid(devicePubkey));
12825
+ return owners.some((owner) => BigInt(owner.guid) === guid);
12826
+ },
12827
+ async setFirstGuardian(sealed, guardianPubkey) {
12828
+ const { transactionHash } = await run(sealed, [buildSetFirstGuardianCall(sealed.address, guardianPubkey)]);
12829
+ return transactionHash;
12830
+ },
12831
+ async triggerEscapeOwner(guardianSealed, targetAddress, newOwnerPubkey) {
12832
+ const { transactionHash } = await run(
12833
+ guardianSealed,
12834
+ [buildTriggerEscapeOwnerCall(targetAddress, newOwnerPubkey)],
12835
+ normalizeWalletAddress(targetAddress)
12836
+ );
12837
+ return transactionHash;
12838
+ },
12839
+ async completeEscapeOwner(guardianSealed, targetAddress) {
12840
+ const { transactionHash } = await run(
12841
+ guardianSealed,
12842
+ [buildCompleteEscapeOwnerCall(targetAddress)],
12843
+ normalizeWalletAddress(targetAddress)
12844
+ );
12845
+ return transactionHash;
12846
+ },
12847
+ async cancelEscape(sealed) {
12848
+ const { transactionHash } = await run(sealed, [buildCancelEscapeCall(sealed.address)]);
12849
+ return transactionHash;
12850
+ },
12851
+ async addDevice(sealed, devicePubkey) {
12852
+ const { transactionHash } = await run(sealed, [buildAddOwnerCall(sealed.address, devicePubkey)]);
12853
+ return transactionHash;
12854
+ },
12855
+ async removeDevice(sealed, ownerGuid) {
12856
+ const { transactionHash } = await run(sealed, [buildRemoveOwnerByGuidCall(sealed.address, ownerGuid)]);
12857
+ return transactionHash;
12858
+ },
12859
+ completeDeployment(onStep, options = {}) {
12860
+ if (!config.backendUrl) throw new Error("This wallet has no backend url configured for sign-in");
12861
+ const deps = {
12862
+ store: config.store,
12863
+ passkey: config.passkey,
12864
+ provider: config.provider,
12865
+ backendUrl: config.backendUrl,
12866
+ deployProxyUrl: config.deployProxyUrl,
12867
+ fetchImpl: config.fetchImpl
12868
+ };
12869
+ return completeDeployment(deps, onStep, options);
12870
+ }
12871
+ };
12872
+ }
12873
+
12332
12874
  exports.ADMIN_HEADERS = ADMIN_HEADERS;
12333
12875
  exports.ADMIN_SCOPE = ADMIN_SCOPE;
12334
12876
  exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
@@ -12351,6 +12893,7 @@ exports.IPNftABI = IPNftABI;
12351
12893
  exports.IPSponsorshipABI = IPSponsorshipABI;
12352
12894
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
12353
12895
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
12896
+ exports.InvalidPairingPayloadError = InvalidPairingPayloadError;
12354
12897
  exports.InvalidStarkPrivateKeyError = InvalidStarkPrivateKeyError;
12355
12898
  exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
12356
12899
  exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
@@ -12359,6 +12902,7 @@ exports.MedialaneClient = MedialaneClient;
12359
12902
  exports.MedialaneError = MedialaneError;
12360
12903
  exports.POPCollectionABI = POPCollectionABI;
12361
12904
  exports.POPFactoryABI = POPFactoryABI;
12905
+ exports.PasskeyCancelledError = PasskeyCancelledError;
12362
12906
  exports.PopService = PopService;
12363
12907
  exports.SUGGESTED_DEFAULT_PRICE = SUGGESTED_DEFAULT_PRICE;
12364
12908
  exports.SponsoredCallRejectedError = SponsoredCallRejectedError;
@@ -12366,6 +12910,7 @@ exports.SponsorshipService = SponsorshipService;
12366
12910
  exports.StarknetVenue = StarknetVenue;
12367
12911
  exports.TicketService = TicketService;
12368
12912
  exports.VALIDATED_EKUBO_PARAMS = VALIDATED_EKUBO_PARAMS;
12913
+ exports.accountFor = accountFor;
12369
12914
  exports.adminRequestDigest = adminRequestDigest;
12370
12915
  exports.assertTransactionSucceeded = assertTransactionSucceeded;
12371
12916
  exports.build1155CancellationTypedData = build1155CancellationTypedData;
@@ -12386,18 +12931,31 @@ exports.buildRemoveOwnerCall = buildRemoveOwnerCall;
12386
12931
  exports.buildSetFirstGuardianCall = buildSetFirstGuardianCall;
12387
12932
  exports.buildTriggerEscapeOwnerCall = buildTriggerEscapeOwnerCall;
12388
12933
  exports.buybackQuoteRaw = buybackQuoteRaw;
12934
+ exports.canRemoveDevice = canRemoveDevice;
12389
12935
  exports.coinToRaw = toRaw;
12936
+ exports.completeDeployment = completeDeployment;
12390
12937
  exports.computeAccountAddress = computeAccountAddress;
12391
12938
  exports.computeOwnerGuid = computeOwnerGuid;
12392
12939
  exports.confirmIntentBestEffort = confirmIntentBestEffort;
12393
12940
  exports.createAdminSessionGrant = createAdminSessionGrant;
12941
+ exports.createMediaWallet = createMediaWallet;
12942
+ exports.createOwnerStore = createOwnerStore;
12943
+ exports.createPasskeyOwner = createPasskeyOwner;
12944
+ exports.createSelfFundConsent = createSelfFundConsent;
12394
12945
  exports.decodeEscapeAndStatus = decodeEscapeAndStatus;
12395
12946
  exports.decodeGuardiansInfo = decodeGuardiansInfo;
12947
+ exports.deploySelfFunded = deploySelfFunded;
12948
+ exports.deploySponsored = deploySponsored;
12396
12949
  exports.deployedCollectionFromReceipt = deployedCollectionFromReceipt;
12397
12950
  exports.deriveAesKey = deriveAesKey;
12398
12951
  exports.deriveOwnerKeyPair = deriveOwnerKeyPair;
12952
+ exports.describeDevices = describeDevices;
12953
+ exports.describeGuardianStatus = describeGuardianStatus;
12954
+ exports.describeRecoveryAction = describeRecoveryAction;
12399
12955
  exports.encodeAdminHeaders = encodeAdminHeaders;
12400
12956
  exports.encodeByteArray = encodeByteArray;
12957
+ exports.encodePairingPayload = encodePairingPayload;
12958
+ exports.estimateSelfFundedFee = estimateSelfFundedFee;
12401
12959
  exports.executeIntent = executeIntent;
12402
12960
  exports.executeIntents = executeIntents;
12403
12961
  exports.executeSponsored = executeSponsored;
@@ -12414,20 +12972,28 @@ exports.getOrderDetails1155 = getOrderDetails1155;
12414
12972
  exports.getOwners = getOwners;
12415
12973
  exports.getSiwsStorageKey = getSiwsStorageKey;
12416
12974
  exports.getStoredSiwsToken = getStoredSiwsToken;
12975
+ exports.isDeployed = isDeployed;
12976
+ exports.isRecoveryKeyForWallet = isRecoveryKeyForWallet;
12417
12977
  exports.isSiwsTokenValid = isSiwsTokenValid;
12978
+ exports.isValidStarknetAddress = isValidStarknetAddress;
12418
12979
  exports.mintedTokenIdFromReceipt = mintedTokenIdFromReceipt;
12419
12980
  exports.normalizeSiwsSignature = normalizeSiwsSignature;
12981
+ exports.normalizeWalletAddress = normalizeWalletAddress;
12420
12982
  exports.ownerAliveTypedData = ownerAliveTypedData;
12421
12983
  exports.ownerConstructorCalldata = ownerConstructorCalldata;
12984
+ exports.parseAccountAddress = parseAccountAddress;
12422
12985
  exports.parseAdminHeaders = parseAdminHeaders;
12423
12986
  exports.parseCreatorCoinCreated = parseCreatorCoinCreated;
12987
+ exports.parsePairingPayload = parsePairingPayload;
12424
12988
  exports.priceToEkuboParams = priceToEkuboParams;
12425
12989
  exports.randomNonce = randomNonce;
12426
12990
  exports.requestSiwsToken = requestSiwsToken;
12427
12991
  exports.sealPrivateKey = sealPrivateKey;
12992
+ exports.selfFundedExecutor = selfFundedExecutor;
12428
12993
  exports.sessionKeyHashOf = sessionKeyHashOf;
12429
12994
  exports.signAdminRequest = signAdminRequest;
12430
12995
  exports.signWithPrivateKey = signWithPrivateKey;
12996
+ exports.sponsoredExecutor = sponsoredExecutor;
12431
12997
  exports.starkKeyPairFromPrivateKey = starkKeyPairFromPrivateKey;
12432
12998
  exports.storeSiwsToken = storeSiwsToken;
12433
12999
  exports.syncTransactionBestEffort = syncTransactionBestEffort;