@medialane/sdk 0.165.0 → 0.167.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk5UI75VQ2_cjs = require('../chunk-5UI75VQ2.cjs');
3
+ var chunkTPONHUAU_cjs = require('../chunk-TPONHUAU.cjs');
4
4
  var chunkH7I6TEOA_cjs = require('../chunk-H7I6TEOA.cjs');
5
5
  var starknet = require('starknet');
6
6
  var hkdf_js = require('@noble/hashes/hkdf.js');
@@ -33,7 +33,7 @@ function getChainId(config) {
33
33
  return starknet.constants.StarknetChainId.SN_MAIN;
34
34
  }
35
35
  function resolveToken(currency) {
36
- const token = chunk5UI75VQ2_cjs.SUPPORTED_TOKENS.find(
36
+ const token = chunkTPONHUAU_cjs.SUPPORTED_TOKENS.find(
37
37
  (t) => t.symbol === currency.toUpperCase() || t.address.toLowerCase() === currency.toLowerCase()
38
38
  );
39
39
  if (!token) throw new MedialaneError(`Unsupported currency: ${currency}`, "INVALID_PARAMS");
@@ -44,7 +44,7 @@ function getProvider(config) {
44
44
  let p = _providerCache.get(config);
45
45
  if (!p) {
46
46
  const urls = [config.rpcUrl];
47
- p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: chunk5UI75VQ2_cjs.createFailoverFetch(urls) });
47
+ p = new starknet.RpcProvider({ nodeUrl: urls[0], baseFetch: chunkTPONHUAU_cjs.createFailoverFetch(urls) });
48
48
  _providerCache.set(config, p);
49
49
  }
50
50
  return p;
@@ -9768,7 +9768,7 @@ function merkleTree(leafHashes) {
9768
9768
  };
9769
9769
  }
9770
9770
  function buildPopAllowlist(addresses) {
9771
- const unique = [...new Set(addresses.map((a) => chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", a)))];
9771
+ const unique = [...new Set(addresses.map((a) => chunkTPONHUAU_cjs.normalizeAddress("STARKNET", a)))];
9772
9772
  if (unique.length === 0) throw new Error("An allowlist needs at least one address");
9773
9773
  const leaves = unique.map((address) => ({ address, leaf: popLeafHash(address) }));
9774
9774
  const tree = merkleTree(leaves.map((l) => l.leaf));
@@ -9794,7 +9794,7 @@ function decodePopClaimFragment(fragment) {
9794
9794
 
9795
9795
  // src/starknet/pop-claim.ts
9796
9796
  function popClaimLinks(origin, collection, list) {
9797
- const base = `${origin}${chunk5UI75VQ2_cjs.collectionHref("STARKNET", collection)}`;
9797
+ const base = `${origin}${chunkTPONHUAU_cjs.collectionHref("STARKNET", collection)}`;
9798
9798
  return Object.entries(list.proofs).map(([address, proof]) => ({
9799
9799
  address,
9800
9800
  url: `${base}${encodePopClaimFragment(proof)}`
@@ -9804,7 +9804,7 @@ function popClaimLinksCsv(links) {
9804
9804
  return ["address,claim_link", ...links.map((l) => `${l.address},${l.url}`)].join("\n");
9805
9805
  }
9806
9806
  async function popClaimInfo(provider, collection) {
9807
- const contractAddress = chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", collection);
9807
+ const contractAddress = chunkTPONHUAU_cjs.normalizeAddress("STARKNET", collection);
9808
9808
  const [root, end] = await Promise.all([
9809
9809
  provider.callContract({ contractAddress, entrypoint: "allowlist_root", calldata: [] }),
9810
9810
  provider.callContract({ contractAddress, entrypoint: "claim_end_time", calldata: [] })
@@ -9821,7 +9821,7 @@ function popClaimState(input) {
9821
9821
  if (!wallet || !verifyPopProof(info.root, wallet, proof)) return "wrong-wallet";
9822
9822
  return "ready";
9823
9823
  }
9824
- var addr = (a) => chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", a);
9824
+ var addr = (a) => chunkTPONHUAU_cjs.normalizeAddress("STARKNET", a);
9825
9825
  var byteArrayFelts = (s) => starknet.CallData.compile([starknet.byteArray.byteArrayFromString(s)]);
9826
9826
  var popCalls = {
9827
9827
  claim(collection, proof) {
@@ -9876,9 +9876,9 @@ var PopService = class {
9876
9876
  };
9877
9877
  async function popHasClaimed(provider, collection, address) {
9878
9878
  const res = await provider.callContract({
9879
- contractAddress: chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", collection),
9879
+ contractAddress: chunkTPONHUAU_cjs.normalizeAddress("STARKNET", collection),
9880
9880
  entrypoint: "has_claimed",
9881
- calldata: [chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address)]
9881
+ calldata: [chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address)]
9882
9882
  });
9883
9883
  return BigInt(res[0] ?? "0x0") !== 0n;
9884
9884
  }
@@ -9912,7 +9912,7 @@ var DropService = class {
9912
9912
  this.config = config;
9913
9913
  }
9914
9914
  _collection(address, account) {
9915
- return newContract(DropCollectionABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), account);
9915
+ return newContract(DropCollectionABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), account);
9916
9916
  }
9917
9917
  async claim(account, collectionAddress, quantity = 1) {
9918
9918
  const collection = this._collection(collectionAddress, account);
@@ -9997,14 +9997,14 @@ var ERC1155CollectionService = class {
9997
9997
  _factory(account) {
9998
9998
  return newContract(
9999
9999
  IPCollection1155FactoryABI,
10000
- chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", this.factoryAddress),
10000
+ chunkTPONHUAU_cjs.normalizeAddress("STARKNET", this.factoryAddress),
10001
10001
  account
10002
10002
  );
10003
10003
  }
10004
10004
  _collection(address, account) {
10005
10005
  return newContract(
10006
10006
  IPCollection1155ABI,
10007
- chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address),
10007
+ chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address),
10008
10008
  account
10009
10009
  );
10010
10010
  }
@@ -10232,20 +10232,20 @@ function buildLaunchOnEkuboCalls(params) {
10232
10232
  }
10233
10233
  var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
10234
10234
  function parseCreatorCoinCreated(receipt) {
10235
- const factory = chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", chunkH7I6TEOA_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
10235
+ const factory = chunkTPONHUAU_cjs.normalizeAddress("STARKNET", chunkH7I6TEOA_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
10236
10236
  for (const ev of receipt?.events ?? []) {
10237
10237
  let from;
10238
10238
  try {
10239
- from = chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
10239
+ from = chunkTPONHUAU_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
10240
10240
  } catch {
10241
10241
  continue;
10242
10242
  }
10243
10243
  if (from !== factory) continue;
10244
10244
  const k0 = ev.keys?.[0];
10245
- if (!k0 || chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", k0) !== chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
10245
+ if (!k0 || chunkTPONHUAU_cjs.normalizeAddress("STARKNET", k0) !== chunkTPONHUAU_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
10246
10246
  const data = ev.data ?? [];
10247
10247
  if (data.length < 1) continue;
10248
- return chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
10248
+ return chunkTPONHUAU_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
10249
10249
  }
10250
10250
  throw new Error("Coin deployed but the coin address could not be read from the receipt");
10251
10251
  }
@@ -10281,14 +10281,14 @@ var TicketService = class {
10281
10281
  _factory(account, factoryAddress) {
10282
10282
  const address = factoryAddress ?? this.factoryAddress;
10283
10283
  if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
10284
- return newContract(IPTicketCollectionFactoryABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), account);
10284
+ return newContract(IPTicketCollectionFactoryABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), account);
10285
10285
  }
10286
10286
  _collection(address, account) {
10287
- return newContract(IPTicketCollectionABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), account);
10287
+ return newContract(IPTicketCollectionABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), account);
10288
10288
  }
10289
10289
  _collectionRead(address) {
10290
10290
  const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
10291
- return newContract(IPTicketCollectionABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), provider);
10291
+ return newContract(IPTicketCollectionABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), provider);
10292
10292
  }
10293
10293
  async deployCollection(account, params) {
10294
10294
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
@@ -10354,14 +10354,14 @@ var ClubService = class {
10354
10354
  _factory(account, factoryAddress) {
10355
10355
  const address = factoryAddress ?? this.factoryAddress;
10356
10356
  if (!address) throw new Error("IP-Club factory address not configured for this chain");
10357
- return newContract(IPClubFactoryABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), account);
10357
+ return newContract(IPClubFactoryABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), account);
10358
10358
  }
10359
10359
  _collection(address, account) {
10360
- return newContract(IPClubCollectionABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), account);
10360
+ return newContract(IPClubCollectionABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), account);
10361
10361
  }
10362
10362
  _collectionRead(address) {
10363
10363
  const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
10364
- return newContract(IPClubCollectionABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address), provider);
10364
+ return newContract(IPClubCollectionABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address), provider);
10365
10365
  }
10366
10366
  async deployCollection(account, params) {
10367
10367
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
@@ -10431,7 +10431,7 @@ var SponsorshipService = class {
10431
10431
  if (!resolved) {
10432
10432
  throw new Error("IP-Sponsorship address not configured for this chain");
10433
10433
  }
10434
- return newContract(IPSponsorshipABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", resolved), account);
10434
+ return newContract(IPSponsorshipABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", resolved), account);
10435
10435
  }
10436
10436
  _contractRead(address) {
10437
10437
  const resolved = address ?? this.sponsorshipAddress;
@@ -10439,7 +10439,7 @@ var SponsorshipService = class {
10439
10439
  throw new Error("IP-Sponsorship address not configured for this chain");
10440
10440
  }
10441
10441
  const provider = new starknet.RpcProvider({ nodeUrl: this.config.rpcUrl });
10442
- return newContract(IPSponsorshipABI, chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", resolved), provider);
10442
+ return newContract(IPSponsorshipABI, chunkTPONHUAU_cjs.normalizeAddress("STARKNET", resolved), provider);
10443
10443
  }
10444
10444
  async createOffer(account, params) {
10445
10445
  const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
@@ -10474,7 +10474,7 @@ var SponsorshipService = class {
10474
10474
  const approveCall = {
10475
10475
  contractAddress: params.paymentToken,
10476
10476
  entrypoint: "approve",
10477
- calldata: [chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
10477
+ calldata: [chunkTPONHUAU_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
10478
10478
  };
10479
10479
  const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
10480
10480
  starknet.cairo.uint256(params.offerId),
@@ -10601,7 +10601,7 @@ var SponsorshipService = class {
10601
10601
  // src/starknet/client.ts
10602
10602
  var MedialaneClient = class {
10603
10603
  constructor(rawConfig = {}) {
10604
- this.config = chunk5UI75VQ2_cjs.resolveConfig(rawConfig);
10604
+ this.config = chunkTPONHUAU_cjs.resolveConfig(rawConfig);
10605
10605
  this.services = {
10606
10606
  pop: new PopService(this.config),
10607
10607
  drop: new DropService(this.config),
@@ -10612,9 +10612,9 @@ var MedialaneClient = class {
10612
10612
  sponsorship: new SponsorshipService(this.config)
10613
10613
  };
10614
10614
  if (!this.config.backendUrl) {
10615
- const sentinel = new chunk5UI75VQ2_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
10615
+ const sentinel = new chunkTPONHUAU_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
10616
10616
  const apiMethodNames = new Set(
10617
- Object.getOwnPropertyNames(chunk5UI75VQ2_cjs.ApiClient.prototype).filter(
10617
+ Object.getOwnPropertyNames(chunkTPONHUAU_cjs.ApiClient.prototype).filter(
10618
10618
  (k) => k !== "constructor" && typeof sentinel[k] === "function"
10619
10619
  )
10620
10620
  );
@@ -10631,7 +10631,7 @@ var MedialaneClient = class {
10631
10631
  }
10632
10632
  });
10633
10633
  } else {
10634
- this.api = new chunk5UI75VQ2_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
10634
+ this.api = new chunkTPONHUAU_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
10635
10635
  }
10636
10636
  }
10637
10637
  get chain() {
@@ -10803,7 +10803,7 @@ function buildListingOrder(i, cfg) {
10803
10803
  salt: i.salt,
10804
10804
  counter: i.counter
10805
10805
  };
10806
- const typedData = chunk5UI75VQ2_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
10806
+ const typedData = chunkTPONHUAU_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
10807
10807
  return { orderParams, typedData };
10808
10808
  }
10809
10809
  function buildOfferOrder(i, cfg) {
@@ -10824,11 +10824,11 @@ function buildOfferOrder(i, cfg) {
10824
10824
  salt: i.salt,
10825
10825
  counter: i.counter
10826
10826
  };
10827
- const typedData = chunk5UI75VQ2_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
10827
+ const typedData = chunkTPONHUAU_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
10828
10828
  return { orderParams, typedData };
10829
10829
  }
10830
10830
  function registerPayload(orderParams, signature) {
10831
- return chunk5UI75VQ2_cjs.stringifyBigInts({
10831
+ return chunkTPONHUAU_cjs.stringifyBigInts({
10832
10832
  parameters: {
10833
10833
  ...orderParams,
10834
10834
  offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
@@ -10859,14 +10859,14 @@ function buildFulfillCalls(a, cfg) {
10859
10859
  return fee ? [approve, fulfill, fee] : [approve, fulfill];
10860
10860
  }
10861
10861
  function buildCancelCalls(a, cfg) {
10862
- const cancelRequest = chunk5UI75VQ2_cjs.stringifyBigInts({
10862
+ const cancelRequest = chunkTPONHUAU_cjs.stringifyBigInts({
10863
10863
  cancelation: { order_hash: a.orderHash, offerer: a.offerer },
10864
10864
  signature: a.signature
10865
10865
  });
10866
10866
  return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
10867
10867
  }
10868
10868
  function buildCancelTypedData(orderHash, offerer, cfg) {
10869
- return chunk5UI75VQ2_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
10869
+ return chunkTPONHUAU_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
10870
10870
  }
10871
10871
  function contractFor2(cfg) {
10872
10872
  return newContract(Medialane1155ABI, cfg.marketplace1155Contract, getProvider(cfg));
@@ -10889,7 +10889,7 @@ function buildListing1155Order(i, cfg) {
10889
10889
  salt: i.salt,
10890
10890
  counter: i.counter
10891
10891
  };
10892
- const typedData = chunk5UI75VQ2_cjs.stringifyBigInts(
10892
+ const typedData = chunkTPONHUAU_cjs.stringifyBigInts(
10893
10893
  build1155OrderTypedData(orderParams, getChainId(cfg))
10894
10894
  );
10895
10895
  return { orderParams, typedData };
@@ -10912,13 +10912,13 @@ function buildOffer1155Order(i, cfg) {
10912
10912
  salt: i.salt,
10913
10913
  counter: i.counter
10914
10914
  };
10915
- const typedData = chunk5UI75VQ2_cjs.stringifyBigInts(
10915
+ const typedData = chunkTPONHUAU_cjs.stringifyBigInts(
10916
10916
  build1155OrderTypedData(orderParams, getChainId(cfg))
10917
10917
  );
10918
10918
  return { orderParams, typedData };
10919
10919
  }
10920
10920
  function registerPayload2(orderParams, signature) {
10921
- return chunk5UI75VQ2_cjs.stringifyBigInts({
10921
+ return chunkTPONHUAU_cjs.stringifyBigInts({
10922
10922
  parameters: {
10923
10923
  ...orderParams,
10924
10924
  offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
@@ -10949,14 +10949,14 @@ function buildFulfill1155Calls(a, cfg) {
10949
10949
  return fee ? [approve, fulfill, fee] : [approve, fulfill];
10950
10950
  }
10951
10951
  function buildCancel1155Calls(a, cfg) {
10952
- const cancelPayload = chunk5UI75VQ2_cjs.stringifyBigInts({
10952
+ const cancelPayload = chunkTPONHUAU_cjs.stringifyBigInts({
10953
10953
  cancelation: { order_hash: a.orderHash, offerer: a.offerer },
10954
10954
  signature: a.signature
10955
10955
  });
10956
10956
  return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
10957
10957
  }
10958
10958
  function buildCancel1155TypedData(orderHash, offerer, cfg) {
10959
- return chunk5UI75VQ2_cjs.stringifyBigInts(
10959
+ return chunkTPONHUAU_cjs.stringifyBigInts(
10960
10960
  build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
10961
10961
  );
10962
10962
  }
@@ -11239,7 +11239,8 @@ async function fundWithChainTransfer(api, wallet, options) {
11239
11239
  const pollMs = options.pollMs ?? 3e3;
11240
11240
  const maxPolls = options.maxPolls ?? 20;
11241
11241
  step("creating");
11242
- const { data: intent } = await api.createFunding({ method: "chain-transfer", params: { amountUsdc: options.amountUsdc } });
11242
+ const params = options.amount !== void 0 ? { amount: options.amount } : { amountUsdc: options.amountUsdc };
11243
+ const { data: intent } = await api.createFunding({ method: "chain-transfer", params });
11243
11244
  let txHash;
11244
11245
  let transferStarted = false;
11245
11246
  try {
@@ -11299,14 +11300,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
11299
11300
  const receipt = await provider.getTransactionReceipt(txHash);
11300
11301
  const status = receipt.execution_status ?? receipt.status;
11301
11302
  if (status === "REVERTED" || status === "REJECTED") {
11302
- throw new chunk5UI75VQ2_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
11303
+ throw new chunkTPONHUAU_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
11303
11304
  }
11304
11305
  if (status) return receipt;
11305
11306
  } catch (err) {
11306
11307
  if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
11307
11308
  }
11308
11309
  }
11309
- throw new chunk5UI75VQ2_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
11310
+ throw new chunkTPONHUAU_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
11310
11311
  }
11311
11312
  async function executeIntent(provider, signer, client, intent, opts = {}) {
11312
11313
  let calls;
@@ -11359,14 +11360,14 @@ function u2562(low, high) {
11359
11360
  return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
11360
11361
  }
11361
11362
  function deployedCollectionFromReceipt(receipt, service) {
11362
- const factory = chunk5UI75VQ2_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
11363
+ const factory = chunkTPONHUAU_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
11363
11364
  const { event, address } = DEPLOY_EVENTS[service];
11364
11365
  const selector = BigInt(starknet.hash.getSelectorFromName(event));
11365
11366
  for (const e of receipt.events ?? []) {
11366
11367
  if (factory && !sameFelt(e.from_address, factory)) continue;
11367
11368
  if (!sameFelt(e.keys?.[0], selector)) continue;
11368
11369
  const value = address(e);
11369
- if (value) return chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", value);
11370
+ if (value) return chunkTPONHUAU_cjs.normalizeAddress("STARKNET", value);
11370
11371
  }
11371
11372
  return null;
11372
11373
  }
@@ -11487,13 +11488,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
11487
11488
  }
11488
11489
  function buildDeployAccountParams(ownerPubkey, salt = 0) {
11489
11490
  return {
11490
- classHash: chunk5UI75VQ2_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
11491
- constructorCalldata: chunk5UI75VQ2_cjs.ownerConstructorCalldata(ownerPubkey),
11491
+ classHash: chunkTPONHUAU_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
11492
+ constructorCalldata: chunkTPONHUAU_cjs.ownerConstructorCalldata(ownerPubkey),
11492
11493
  addressSalt: starknet.num.toHex(salt),
11493
- contractAddress: chunk5UI75VQ2_cjs.computeAccountAddress(ownerPubkey, salt)
11494
+ contractAddress: chunkTPONHUAU_cjs.computeAccountAddress(ownerPubkey, salt)
11494
11495
  };
11495
11496
  }
11496
- var norm = (address) => chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address);
11497
+ var norm = (address) => chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address);
11497
11498
  var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
11498
11499
  function encodeFeltArray(items) {
11499
11500
  return [starknet.num.toHex(items.length), ...items];
@@ -11690,7 +11691,7 @@ var InvalidRecoveryKeyError = class extends Error {
11690
11691
  var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
11691
11692
  function keyPair(privateKey) {
11692
11693
  try {
11693
- return chunk5UI75VQ2_cjs.starkKeyPairFromPrivateKey(privateKey);
11694
+ return chunkTPONHUAU_cjs.starkKeyPairFromPrivateKey(privateKey);
11694
11695
  } catch {
11695
11696
  throw new InvalidRecoveryKeyError();
11696
11697
  }
@@ -11703,7 +11704,7 @@ function parseRecoveryKey(input) {
11703
11704
  const trimmed = input.trim();
11704
11705
  if (!trimmed.startsWith(PREFIX)) {
11705
11706
  const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
11706
- return { walletAddress: chunk5UI75VQ2_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
11707
+ return { walletAddress: chunkTPONHUAU_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
11707
11708
  }
11708
11709
  const parts = trimmed.slice(PREFIX.length).split(":");
11709
11710
  const [walletAddress, privateKey] = parts;
@@ -11725,7 +11726,7 @@ function describeRecoveryAction(escape) {
11725
11726
  return "none";
11726
11727
  }
11727
11728
  function normalizeWalletAddress(address) {
11728
- return chunk5UI75VQ2_cjs.normalizeAddress("STARKNET", address);
11729
+ return chunkTPONHUAU_cjs.normalizeAddress("STARKNET", address);
11729
11730
  }
11730
11731
  function isValidStarknetAddress(address) {
11731
11732
  try {
@@ -11770,7 +11771,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
11770
11771
  return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
11771
11772
  }
11772
11773
  async function feeTokenBalance(provider, address, unit) {
11773
- const token = chunk5UI75VQ2_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
11774
+ const token = chunkTPONHUAU_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
11774
11775
  if (!token) throw new Error(`No fee token for unit ${unit}`);
11775
11776
  const [low = "0x0", high = "0x0"] = await provider.callContract({
11776
11777
  contractAddress: token.address,
@@ -11797,7 +11798,7 @@ function sponsoredExecutor(deps) {
11797
11798
  { proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
11798
11799
  {
11799
11800
  address: userAddress,
11800
- signTypedData: async (data) => chunk5UI75VQ2_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
11801
+ signTypedData: async (data) => chunkTPONHUAU_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
11801
11802
  },
11802
11803
  calls
11803
11804
  );
@@ -11857,7 +11858,7 @@ async function deploySelfFunded(input) {
11857
11858
  });
11858
11859
  const { transaction_hash } = await account.deployAccount({
11859
11860
  classHash,
11860
- constructorCalldata: chunk5UI75VQ2_cjs.ownerConstructorCalldata(input.ownerPubKey),
11861
+ constructorCalldata: chunkTPONHUAU_cjs.ownerConstructorCalldata(input.ownerPubKey),
11861
11862
  addressSalt: 0,
11862
11863
  contractAddress: input.ownerAddress
11863
11864
  });
@@ -11925,7 +11926,7 @@ async function completeDeployment(deps, onStep, options = {}) {
11925
11926
  backendUrl: deps.backendUrl,
11926
11927
  walletAddress: address,
11927
11928
  signer: {
11928
- signMessage: async (td) => chunk5UI75VQ2_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
11929
+ signMessage: async (td) => chunkTPONHUAU_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(td, address))
11929
11930
  }
11930
11931
  });
11931
11932
  deps.store.notifyChange();
@@ -12030,7 +12031,7 @@ function createMediaWallet(config) {
12030
12031
  address: sealed.address,
12031
12032
  signTypedData: async (data) => {
12032
12033
  const privateKeyHex = await unlockOnce(sealed);
12033
- return chunk5UI75VQ2_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
12034
+ return chunkTPONHUAU_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
12034
12035
  },
12035
12036
  execute: async (calls) => {
12036
12037
  const { transactionHash } = await run(sealed, calls);
@@ -12086,11 +12087,6 @@ function createMediaWallet(config) {
12086
12087
  }
12087
12088
 
12088
12089
  // src/session/session-wallet.ts
12089
- async function adoptSessionWallet(api, saveAddress) {
12090
- const wallet = await api.getSessionWallet();
12091
- if (wallet) saveAddress(wallet.walletAddress);
12092
- return wallet;
12093
- }
12094
12090
  async function claimSessionWallet(api, walletAddress, deps) {
12095
12091
  const saved = deps.loadOwner();
12096
12092
  const resuming = saved !== null && normalizeWalletAddress(saved.address) === normalizeWalletAddress(walletAddress);
@@ -12102,55 +12098,55 @@ async function claimSessionWallet(api, walletAddress, deps) {
12102
12098
 
12103
12099
  Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
12104
12100
  enumerable: true,
12105
- get: function () { return chunk5UI75VQ2_cjs.InvalidStarkPrivateKeyError; }
12101
+ get: function () { return chunkTPONHUAU_cjs.InvalidStarkPrivateKeyError; }
12106
12102
  });
12107
12103
  Object.defineProperty(exports, "PasskeyCancelledError", {
12108
12104
  enumerable: true,
12109
- get: function () { return chunk5UI75VQ2_cjs.PasskeyCancelledError; }
12105
+ get: function () { return chunkTPONHUAU_cjs.PasskeyCancelledError; }
12110
12106
  });
12111
12107
  Object.defineProperty(exports, "PasskeyUnsupportedError", {
12112
12108
  enumerable: true,
12113
- get: function () { return chunk5UI75VQ2_cjs.PasskeyUnsupportedError; }
12109
+ get: function () { return chunkTPONHUAU_cjs.PasskeyUnsupportedError; }
12114
12110
  });
12115
12111
  Object.defineProperty(exports, "UserFacingError", {
12116
12112
  enumerable: true,
12117
- get: function () { return chunk5UI75VQ2_cjs.UserFacingError; }
12113
+ get: function () { return chunkTPONHUAU_cjs.UserFacingError; }
12118
12114
  });
12119
12115
  Object.defineProperty(exports, "computeAccountAddress", {
12120
12116
  enumerable: true,
12121
- get: function () { return chunk5UI75VQ2_cjs.computeAccountAddress; }
12117
+ get: function () { return chunkTPONHUAU_cjs.computeAccountAddress; }
12122
12118
  });
12123
12119
  Object.defineProperty(exports, "createPasskeyOwner", {
12124
12120
  enumerable: true,
12125
- get: function () { return chunk5UI75VQ2_cjs.createPasskeyOwner; }
12121
+ get: function () { return chunkTPONHUAU_cjs.createPasskeyOwner; }
12126
12122
  });
12127
12123
  Object.defineProperty(exports, "deriveAesKey", {
12128
12124
  enumerable: true,
12129
- get: function () { return chunk5UI75VQ2_cjs.deriveAesKey; }
12125
+ get: function () { return chunkTPONHUAU_cjs.deriveAesKey; }
12130
12126
  });
12131
12127
  Object.defineProperty(exports, "generateStarkKeyPair", {
12132
12128
  enumerable: true,
12133
- get: function () { return chunk5UI75VQ2_cjs.generateStarkKeyPair; }
12129
+ get: function () { return chunkTPONHUAU_cjs.generateStarkKeyPair; }
12134
12130
  });
12135
12131
  Object.defineProperty(exports, "ownerConstructorCalldata", {
12136
12132
  enumerable: true,
12137
- get: function () { return chunk5UI75VQ2_cjs.ownerConstructorCalldata; }
12133
+ get: function () { return chunkTPONHUAU_cjs.ownerConstructorCalldata; }
12138
12134
  });
12139
12135
  Object.defineProperty(exports, "sealPrivateKey", {
12140
12136
  enumerable: true,
12141
- get: function () { return chunk5UI75VQ2_cjs.sealPrivateKey; }
12137
+ get: function () { return chunkTPONHUAU_cjs.sealPrivateKey; }
12142
12138
  });
12143
12139
  Object.defineProperty(exports, "signWithPrivateKey", {
12144
12140
  enumerable: true,
12145
- get: function () { return chunk5UI75VQ2_cjs.signWithPrivateKey; }
12141
+ get: function () { return chunkTPONHUAU_cjs.signWithPrivateKey; }
12146
12142
  });
12147
12143
  Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
12148
12144
  enumerable: true,
12149
- get: function () { return chunk5UI75VQ2_cjs.starkKeyPairFromPrivateKey; }
12145
+ get: function () { return chunkTPONHUAU_cjs.starkKeyPairFromPrivateKey; }
12150
12146
  });
12151
12147
  Object.defineProperty(exports, "unsealPrivateKey", {
12152
12148
  enumerable: true,
12153
- get: function () { return chunk5UI75VQ2_cjs.unsealPrivateKey; }
12149
+ get: function () { return chunkTPONHUAU_cjs.unsealPrivateKey; }
12154
12150
  });
12155
12151
  exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
12156
12152
  exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
@@ -12190,7 +12186,6 @@ exports.StarknetVenue = StarknetVenue;
12190
12186
  exports.TicketService = TicketService;
12191
12187
  exports.VALIDATED_EKUBO_PARAMS = VALIDATED_EKUBO_PARAMS;
12192
12188
  exports.accountFor = accountFor;
12193
- exports.adoptSessionWallet = adoptSessionWallet;
12194
12189
  exports.allowsFallbackFunding = allowsFallbackFunding;
12195
12190
  exports.assertTransactionSucceeded = assertTransactionSucceeded;
12196
12191
  exports.build1155CancellationTypedData = build1155CancellationTypedData;