@medialane/sdk 0.184.0 → 0.185.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 chunkRJH2Y53L_cjs = require('../chunk-RJH2Y53L.cjs');
3
+ var chunkCD52LTRP_cjs = require('../chunk-CD52LTRP.cjs');
4
4
  var chunk7EYJC5CB_cjs = require('../chunk-7EYJC5CB.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 = chunkRJH2Y53L_cjs.SUPPORTED_TOKENS.find(
36
+ const token = chunkCD52LTRP_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");
@@ -10405,7 +10405,7 @@ function merkleTree(leafHashes) {
10405
10405
  };
10406
10406
  }
10407
10407
  function buildPopAllowlist(addresses) {
10408
- const unique = [...new Set(addresses.map((a) => chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", a)))];
10408
+ const unique = [...new Set(addresses.map((a) => chunkCD52LTRP_cjs.normalizeAddress("STARKNET", a)))];
10409
10409
  if (unique.length === 0) throw new Error("An allowlist needs at least one address");
10410
10410
  const leaves = unique.map((address) => ({ address, leaf: popLeafHash(address) }));
10411
10411
  const tree = merkleTree(leaves.map((l) => l.leaf));
@@ -10431,7 +10431,7 @@ function decodePopClaimFragment(fragment) {
10431
10431
 
10432
10432
  // src/starknet/pop-claim.ts
10433
10433
  function popClaimLinks(origin, collection, list) {
10434
- const base = `${origin}${chunkRJH2Y53L_cjs.collectionHref("STARKNET", collection)}`;
10434
+ const base = `${origin}${chunkCD52LTRP_cjs.collectionHref("STARKNET", collection)}`;
10435
10435
  return Object.entries(list.proofs).map(([address, proof]) => ({
10436
10436
  address,
10437
10437
  url: `${base}${encodePopClaimFragment(proof)}`
@@ -10441,7 +10441,7 @@ function popClaimLinksCsv(links) {
10441
10441
  return ["address,claim_link", ...links.map((l) => `${l.address},${l.url}`)].join("\n");
10442
10442
  }
10443
10443
  async function popClaimInfo(provider, collection) {
10444
- const contractAddress = chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", collection);
10444
+ const contractAddress = chunkCD52LTRP_cjs.normalizeAddress("STARKNET", collection);
10445
10445
  const [root, end] = await Promise.all([
10446
10446
  provider.callContract({ contractAddress, entrypoint: "allowlist_root", calldata: [] }),
10447
10447
  provider.callContract({ contractAddress, entrypoint: "claim_end_time", calldata: [] })
@@ -10458,7 +10458,7 @@ function popClaimState(input) {
10458
10458
  if (!wallet || !verifyPopProof(info.root, wallet, proof)) return "wrong-wallet";
10459
10459
  return "ready";
10460
10460
  }
10461
- var addr = (a) => chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", a);
10461
+ var addr = (a) => chunkCD52LTRP_cjs.normalizeAddress("STARKNET", a);
10462
10462
  var byteArrayFelts = (s) => starknet.CallData.compile([starknet.byteArray.byteArrayFromString(s)]);
10463
10463
  var popCalls = {
10464
10464
  claim(collection, proof) {
@@ -10513,9 +10513,9 @@ var PopService = class {
10513
10513
  };
10514
10514
  async function popHasClaimed(provider, collection, address) {
10515
10515
  const res = await provider.callContract({
10516
- contractAddress: chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", collection),
10516
+ contractAddress: chunkCD52LTRP_cjs.normalizeAddress("STARKNET", collection),
10517
10517
  entrypoint: "has_claimed",
10518
- calldata: [chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address)]
10518
+ calldata: [chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address)]
10519
10519
  });
10520
10520
  return BigInt(res[0] ?? "0x0") !== 0n;
10521
10521
  }
@@ -10537,7 +10537,7 @@ function buildFeeCall(p, cfg) {
10537
10537
  };
10538
10538
  }
10539
10539
  var DROP_MAX_CLAIM_QUANTITY = 50n;
10540
- var addr2 = (a) => chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", a);
10540
+ var addr2 = (a) => chunkCD52LTRP_cjs.normalizeAddress("STARKNET", a);
10541
10541
  var factoryData = new starknet.CallData(DropFactoryABI);
10542
10542
  var collectionData = new starknet.CallData(DropCollectionABI);
10543
10543
  function toContractTerms(t) {
@@ -10607,7 +10607,7 @@ function dropMintCost(price, quantity, feeBps2) {
10607
10607
  }
10608
10608
 
10609
10609
  // src/starknet/drop-state.ts
10610
- var hex = (v) => chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", v ?? "0x0");
10610
+ var hex = (v) => chunkCD52LTRP_cjs.normalizeAddress("STARKNET", v ?? "0x0");
10611
10611
  var u256 = (low, high) => BigInt(low ?? "0x0") + (BigInt(high ?? "0x0") << 128n);
10612
10612
  async function readDrop(provider, collection) {
10613
10613
  const contractAddress = hex(collection);
@@ -10662,7 +10662,7 @@ function dropMintState(input) {
10662
10662
  return { state: "ready", maxQuantity: max };
10663
10663
  }
10664
10664
  function dropClaimLinks(origin, collection, list) {
10665
- const base = `${origin}${chunkRJH2Y53L_cjs.dropHref(collection)}`;
10665
+ const base = `${origin}${chunkCD52LTRP_cjs.dropHref(collection)}`;
10666
10666
  return Object.entries(list.proofs).map(([address, proof]) => ({
10667
10667
  address,
10668
10668
  url: `${base}${encodePopClaimFragment(proof)}`
@@ -10713,14 +10713,14 @@ var ERC1155CollectionService = class {
10713
10713
  _factory(account) {
10714
10714
  return newContract(
10715
10715
  IPCollection1155FactoryABI,
10716
- chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", this.factoryAddress),
10716
+ chunkCD52LTRP_cjs.normalizeAddress("STARKNET", this.factoryAddress),
10717
10717
  account
10718
10718
  );
10719
10719
  }
10720
10720
  _collection(address, account) {
10721
10721
  return newContract(
10722
10722
  IPCollection1155ABI,
10723
- chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address),
10723
+ chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address),
10724
10724
  account
10725
10725
  );
10726
10726
  }
@@ -10948,20 +10948,20 @@ function buildLaunchOnEkuboCalls(params) {
10948
10948
  }
10949
10949
  var CREATOR_COIN_CREATED_SELECTOR = starknet.hash.getSelectorFromName("CreatorCoinCreated");
10950
10950
  function parseCreatorCoinCreated(receipt) {
10951
- const factory = chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", chunk7EYJC5CB_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
10951
+ const factory = chunkCD52LTRP_cjs.normalizeAddress("STARKNET", chunk7EYJC5CB_cjs.getStarknetCoordinates("STARKNET").creatorCoinFactory);
10952
10952
  for (const ev of receipt?.events ?? []) {
10953
10953
  let from;
10954
10954
  try {
10955
- from = chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
10955
+ from = chunkCD52LTRP_cjs.normalizeAddress("STARKNET", ev.from_address ?? "");
10956
10956
  } catch {
10957
10957
  continue;
10958
10958
  }
10959
10959
  if (from !== factory) continue;
10960
10960
  const k0 = ev.keys?.[0];
10961
- if (!k0 || chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", k0) !== chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
10961
+ if (!k0 || chunkCD52LTRP_cjs.normalizeAddress("STARKNET", k0) !== chunkCD52LTRP_cjs.normalizeAddress("STARKNET", CREATOR_COIN_CREATED_SELECTOR)) continue;
10962
10962
  const data = ev.data ?? [];
10963
10963
  if (data.length < 1) continue;
10964
- return chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
10964
+ return chunkCD52LTRP_cjs.normalizeAddress("STARKNET", data[data.length - 1]);
10965
10965
  }
10966
10966
  throw new Error("Coin deployed but the coin address could not be read from the receipt");
10967
10967
  }
@@ -10992,10 +10992,10 @@ var TicketService = class {
10992
10992
  _factory(account, factoryAddress) {
10993
10993
  const address = factoryAddress ?? this.factoryAddress;
10994
10994
  if (!address) throw new Error("IP-Tickets factory address not configured for this chain");
10995
- return newContract(IPTicketCollectionFactoryABI, chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address), account);
10995
+ return newContract(IPTicketCollectionFactoryABI, chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address), account);
10996
10996
  }
10997
10997
  _collection(address, account) {
10998
- return newContract(IPTicketCollectionABI, chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address), account);
10998
+ return newContract(IPTicketCollectionABI, chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address), account);
10999
10999
  }
11000
11000
  async deployCollection(account, params) {
11001
11001
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
@@ -11036,10 +11036,10 @@ var ClubService = class {
11036
11036
  _factory(account, factoryAddress) {
11037
11037
  const address = factoryAddress ?? this.factoryAddress;
11038
11038
  if (!address) throw new Error("IP-Club factory address not configured for this chain");
11039
- return newContract(IPClubFactoryABI, chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address), account);
11039
+ return newContract(IPClubFactoryABI, chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address), account);
11040
11040
  }
11041
11041
  _collection(address, account) {
11042
- return newContract(IPClubCollectionABI, chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address), account);
11042
+ return newContract(IPClubCollectionABI, chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address), account);
11043
11043
  }
11044
11044
  async deployCollection(account, params) {
11045
11045
  const call = this._factory(account, params.factoryAddress).populate("deploy_collection", [
@@ -11082,7 +11082,7 @@ var SponsorshipService = class {
11082
11082
  if (!resolved) {
11083
11083
  throw new Error("IP-Sponsorship address not configured for this chain");
11084
11084
  }
11085
- return newContract(IPSponsorshipABI, chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", resolved), account);
11085
+ return newContract(IPSponsorshipABI, chunkCD52LTRP_cjs.normalizeAddress("STARKNET", resolved), account);
11086
11086
  }
11087
11087
  async createOffer(account, params) {
11088
11088
  const specificSponsor = params.specificSponsor ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, params.specificSponsor) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
@@ -11117,7 +11117,7 @@ var SponsorshipService = class {
11117
11117
  const approveCall = {
11118
11118
  contractAddress: params.paymentToken,
11119
11119
  entrypoint: "approve",
11120
- calldata: [chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
11120
+ calldata: [chunkCD52LTRP_cjs.normalizeAddress("STARKNET", sponsorshipAddress), amount.low.toString(), amount.high.toString()]
11121
11121
  };
11122
11122
  const bidCall = this._contract(account, sponsorshipAddress).populate("place_bid", [
11123
11123
  starknet.cairo.uint256(params.offerId),
@@ -11189,7 +11189,7 @@ function createChainProvider(backendUrl, apiKey) {
11189
11189
  // src/starknet/client.ts
11190
11190
  var MedialaneClient = class {
11191
11191
  constructor(rawConfig = {}) {
11192
- this.config = chunkRJH2Y53L_cjs.resolveConfig(rawConfig);
11192
+ this.config = chunkCD52LTRP_cjs.resolveConfig(rawConfig);
11193
11193
  this.services = {
11194
11194
  pop: new PopService(this.config),
11195
11195
  drop: new DropService(this.config),
@@ -11200,9 +11200,9 @@ var MedialaneClient = class {
11200
11200
  sponsorship: new SponsorshipService(this.config)
11201
11201
  };
11202
11202
  if (!this.config.backendUrl) {
11203
- const sentinel = new chunkRJH2Y53L_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
11203
+ const sentinel = new chunkCD52LTRP_cjs.ApiClient("https://medialane-sdk-no-backend.invalid", this.config.apiKey);
11204
11204
  const apiMethodNames = new Set(
11205
- Object.getOwnPropertyNames(chunkRJH2Y53L_cjs.ApiClient.prototype).filter(
11205
+ Object.getOwnPropertyNames(chunkCD52LTRP_cjs.ApiClient.prototype).filter(
11206
11206
  (k) => k !== "constructor" && typeof sentinel[k] === "function"
11207
11207
  )
11208
11208
  );
@@ -11219,7 +11219,7 @@ var MedialaneClient = class {
11219
11219
  }
11220
11220
  });
11221
11221
  } else {
11222
- this.api = new chunkRJH2Y53L_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
11222
+ this.api = new chunkCD52LTRP_cjs.ApiClient(this.config.backendUrl, this.config.apiKey, this.config.retryOptions, this.config.chain);
11223
11223
  }
11224
11224
  }
11225
11225
  get chain() {
@@ -11359,7 +11359,7 @@ function buildListingOrder(i, cfg) {
11359
11359
  salt: i.salt,
11360
11360
  counter: i.counter
11361
11361
  };
11362
- const typedData = chunkRJH2Y53L_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
11362
+ const typedData = chunkCD52LTRP_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
11363
11363
  return { orderParams, typedData };
11364
11364
  }
11365
11365
  function buildOfferOrder(i, cfg) {
@@ -11380,11 +11380,11 @@ function buildOfferOrder(i, cfg) {
11380
11380
  salt: i.salt,
11381
11381
  counter: i.counter
11382
11382
  };
11383
- const typedData = chunkRJH2Y53L_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
11383
+ const typedData = chunkCD52LTRP_cjs.stringifyBigInts(buildOrderTypedData(orderParams, getChainId(cfg)));
11384
11384
  return { orderParams, typedData };
11385
11385
  }
11386
11386
  function registerPayload(orderParams, signature) {
11387
- return chunkRJH2Y53L_cjs.stringifyBigInts({
11387
+ return chunkCD52LTRP_cjs.stringifyBigInts({
11388
11388
  parameters: {
11389
11389
  ...orderParams,
11390
11390
  offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
@@ -11415,14 +11415,14 @@ function buildFulfillCalls(a, cfg) {
11415
11415
  return fee ? [approve, fulfill, fee] : [approve, fulfill];
11416
11416
  }
11417
11417
  function buildCancelCalls(a, cfg) {
11418
- const cancelRequest = chunkRJH2Y53L_cjs.stringifyBigInts({
11418
+ const cancelRequest = chunkCD52LTRP_cjs.stringifyBigInts({
11419
11419
  cancelation: { order_hash: a.orderHash, offerer: a.offerer },
11420
11420
  signature: a.signature
11421
11421
  });
11422
11422
  return [contractFor(cfg).populate("cancel_order", [cancelRequest])];
11423
11423
  }
11424
11424
  function buildCancelTypedData(orderHash, offerer, cfg) {
11425
- return chunkRJH2Y53L_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
11425
+ return chunkCD52LTRP_cjs.stringifyBigInts(buildCancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg)));
11426
11426
  }
11427
11427
  function contractFor2(cfg) {
11428
11428
  return newContract(Medialane1155ABI, cfg.marketplace1155Contract);
@@ -11445,7 +11445,7 @@ function buildListing1155Order(i, cfg) {
11445
11445
  salt: i.salt,
11446
11446
  counter: i.counter
11447
11447
  };
11448
- const typedData = chunkRJH2Y53L_cjs.stringifyBigInts(
11448
+ const typedData = chunkCD52LTRP_cjs.stringifyBigInts(
11449
11449
  build1155OrderTypedData(orderParams, getChainId(cfg))
11450
11450
  );
11451
11451
  return { orderParams, typedData };
@@ -11468,13 +11468,13 @@ function buildOffer1155Order(i, cfg) {
11468
11468
  salt: i.salt,
11469
11469
  counter: i.counter
11470
11470
  };
11471
- const typedData = chunkRJH2Y53L_cjs.stringifyBigInts(
11471
+ const typedData = chunkCD52LTRP_cjs.stringifyBigInts(
11472
11472
  build1155OrderTypedData(orderParams, getChainId(cfg))
11473
11473
  );
11474
11474
  return { orderParams, typedData };
11475
11475
  }
11476
11476
  function registerPayload2(orderParams, signature) {
11477
- return chunkRJH2Y53L_cjs.stringifyBigInts({
11477
+ return chunkCD52LTRP_cjs.stringifyBigInts({
11478
11478
  parameters: {
11479
11479
  ...orderParams,
11480
11480
  offer: { ...orderParams.offer, item_type: starknet.shortString.encodeShortString(orderParams.offer.item_type) },
@@ -11505,14 +11505,14 @@ function buildFulfill1155Calls(a, cfg) {
11505
11505
  return fee ? [approve, fulfill, fee] : [approve, fulfill];
11506
11506
  }
11507
11507
  function buildCancel1155Calls(a, cfg) {
11508
- const cancelPayload = chunkRJH2Y53L_cjs.stringifyBigInts({
11508
+ const cancelPayload = chunkCD52LTRP_cjs.stringifyBigInts({
11509
11509
  cancelation: { order_hash: a.orderHash, offerer: a.offerer },
11510
11510
  signature: a.signature
11511
11511
  });
11512
11512
  return [contractFor2(cfg).populate("cancel_order", [cancelPayload])];
11513
11513
  }
11514
11514
  function buildCancel1155TypedData(orderHash, offerer, cfg) {
11515
- return chunkRJH2Y53L_cjs.stringifyBigInts(
11515
+ return chunkCD52LTRP_cjs.stringifyBigInts(
11516
11516
  build1155CancellationTypedData({ order_hash: orderHash, offerer }, getChainId(cfg))
11517
11517
  );
11518
11518
  }
@@ -11881,7 +11881,7 @@ async function confirmIntentBestEffort(client, intentId, txHash) {
11881
11881
  var SYNC_TIMEOUT_MS = 2e4;
11882
11882
  var SYNC_RETRY_MS = 2e3;
11883
11883
  function readableLater(err) {
11884
- return err instanceof chunkRJH2Y53L_cjs.MedialaneApiError && err.status === 404;
11884
+ return err instanceof chunkCD52LTRP_cjs.MedialaneApiError && err.status === 404;
11885
11885
  }
11886
11886
  async function syncTransactionBestEffort(client, txHash, timeoutMs = SYNC_TIMEOUT_MS, retryMs = SYNC_RETRY_MS) {
11887
11887
  const deadline = Date.now() + timeoutMs;
@@ -11916,14 +11916,14 @@ async function assertTransactionSucceeded(provider, txHash, retryDelaysMs = RECE
11916
11916
  const receipt = await provider.getTransactionReceipt(txHash);
11917
11917
  const status = receipt.execution_status ?? receipt.status;
11918
11918
  if (status === "REVERTED" || status === "REJECTED") {
11919
- throw new chunkRJH2Y53L_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
11919
+ throw new chunkCD52LTRP_cjs.UserFacingError("Transaction was submitted but reverted onchain. Please check your balance and try again.");
11920
11920
  }
11921
11921
  if (status) return receipt;
11922
11922
  } catch (err) {
11923
11923
  if (err instanceof Error && err.message.includes("reverted onchain")) throw err;
11924
11924
  }
11925
11925
  }
11926
- throw new chunkRJH2Y53L_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
11926
+ throw new chunkCD52LTRP_cjs.UserFacingError("Verification timed out. Check your account for the transaction status.");
11927
11927
  }
11928
11928
  async function executeIntent(signer, client, intent, opts = {}) {
11929
11929
  let calls;
@@ -11976,14 +11976,14 @@ function u2563(low, high) {
11976
11976
  return (BigInt(low ?? 0) + (BigInt(high ?? 0) << 128n)).toString();
11977
11977
  }
11978
11978
  function deployedCollectionFromReceipt(receipt, service) {
11979
- const factory = chunkRJH2Y53L_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
11979
+ const factory = chunkCD52LTRP_cjs.getService(service)?.onchain?.STARKNET?.factoryAddress;
11980
11980
  const { event, address } = DEPLOY_EVENTS[service];
11981
11981
  const selector = BigInt(starknet.hash.getSelectorFromName(event));
11982
11982
  for (const e of receipt.events ?? []) {
11983
11983
  if (factory && !sameFelt(e.from_address, factory)) continue;
11984
11984
  if (!sameFelt(e.keys?.[0], selector)) continue;
11985
11985
  const value = address(e);
11986
- if (value) return chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", value);
11986
+ if (value) return chunkCD52LTRP_cjs.normalizeAddress("STARKNET", value);
11987
11987
  }
11988
11988
  return null;
11989
11989
  }
@@ -12104,13 +12104,13 @@ function buildRemoveOwnerByGuidCall(accountAddress, ownerGuid) {
12104
12104
  }
12105
12105
  function buildDeployAccountParams(ownerPubkey, salt = 0) {
12106
12106
  return {
12107
- classHash: chunkRJH2Y53L_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
12108
- constructorCalldata: chunkRJH2Y53L_cjs.ownerConstructorCalldata(ownerPubkey),
12107
+ classHash: chunkCD52LTRP_cjs.STARKNET_MEDIAWALLET_CLASS_HASH,
12108
+ constructorCalldata: chunkCD52LTRP_cjs.ownerConstructorCalldata(ownerPubkey),
12109
12109
  addressSalt: starknet.num.toHex(salt),
12110
- contractAddress: chunkRJH2Y53L_cjs.computeAccountAddress(ownerPubkey, salt)
12110
+ contractAddress: chunkCD52LTRP_cjs.computeAccountAddress(ownerPubkey, salt)
12111
12111
  };
12112
12112
  }
12113
- var norm = (address) => chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address);
12113
+ var norm = (address) => chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address);
12114
12114
  var SIGNER_TYPE_NAMES = ["Starknet", "Secp256k1", "Secp256r1"];
12115
12115
  function encodeFeltArray(items) {
12116
12116
  return [starknet.num.toHex(items.length), ...items];
@@ -12307,7 +12307,7 @@ var InvalidRecoveryKeyError = class extends Error {
12307
12307
  var canonicalAddress = (address) => `0x${BigInt(address).toString(16).padStart(64, "0")}`;
12308
12308
  function keyPair(privateKey) {
12309
12309
  try {
12310
- return chunkRJH2Y53L_cjs.starkKeyPairFromPrivateKey(privateKey);
12310
+ return chunkCD52LTRP_cjs.starkKeyPairFromPrivateKey(privateKey);
12311
12311
  } catch {
12312
12312
  throw new InvalidRecoveryKeyError();
12313
12313
  }
@@ -12320,7 +12320,7 @@ function parseRecoveryKey(input) {
12320
12320
  const trimmed = input.trim();
12321
12321
  if (!trimmed.startsWith(PREFIX)) {
12322
12322
  const { privateKeyHex, publicKeyHex } = keyPair(trimmed);
12323
- return { walletAddress: chunkRJH2Y53L_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
12323
+ return { walletAddress: chunkCD52LTRP_cjs.computeAccountAddress(publicKeyHex, 0), privateKey: privateKeyHex };
12324
12324
  }
12325
12325
  const parts = trimmed.slice(PREFIX.length).split(":");
12326
12326
  const [walletAddress, privateKey] = parts;
@@ -12342,7 +12342,7 @@ function describeRecoveryAction(escape) {
12342
12342
  return "none";
12343
12343
  }
12344
12344
  function normalizeWalletAddress(address) {
12345
- return chunkRJH2Y53L_cjs.normalizeAddress("STARKNET", address);
12345
+ return chunkCD52LTRP_cjs.normalizeAddress("STARKNET", address);
12346
12346
  }
12347
12347
  function isValidStarknetAddress(address) {
12348
12348
  try {
@@ -12387,7 +12387,7 @@ async function estimateSelfFundedFee(provider, address, calls) {
12387
12387
  return { feeRaw: estimate.overall_fee, unit: estimate.unit, balanceRaw };
12388
12388
  }
12389
12389
  async function feeTokenBalance(provider, address, unit) {
12390
- const token = chunkRJH2Y53L_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
12390
+ const token = chunkCD52LTRP_cjs.getTokenBySymbol(unit === "FRI" ? "STRK" : "ETH");
12391
12391
  if (!token) throw new Error(`No fee token for unit ${unit}`);
12392
12392
  return erc20Balance(provider, token.address, address);
12393
12393
  }
@@ -12414,7 +12414,7 @@ function sponsoredExecutor(deps) {
12414
12414
  { proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
12415
12415
  {
12416
12416
  address: userAddress,
12417
- signTypedData: async (data) => chunkRJH2Y53L_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
12417
+ signTypedData: async (data) => chunkCD52LTRP_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, userAddress))
12418
12418
  },
12419
12419
  { intentIds }
12420
12420
  );
@@ -12474,7 +12474,7 @@ async function deploySelfFunded(input) {
12474
12474
  });
12475
12475
  const { transaction_hash } = await account.deployAccount({
12476
12476
  classHash,
12477
- constructorCalldata: chunkRJH2Y53L_cjs.ownerConstructorCalldata(input.ownerPubKey),
12477
+ constructorCalldata: chunkCD52LTRP_cjs.ownerConstructorCalldata(input.ownerPubKey),
12478
12478
  addressSalt: 0,
12479
12479
  contractAddress: input.ownerAddress
12480
12480
  });
@@ -12630,7 +12630,7 @@ function createMediaWallet(config) {
12630
12630
  };
12631
12631
  const walletIntents = config.walletIntents ?? (async (params) => {
12632
12632
  if (!config.backendUrl) throw new Error("This wallet has no backend url configured");
12633
- const created = await new chunkRJH2Y53L_cjs.ApiClient(config.backendUrl).createWalletManageIntent(params);
12633
+ const created = await new chunkCD52LTRP_cjs.ApiClient(config.backendUrl).createWalletManageIntent(params);
12634
12634
  return created.data;
12635
12635
  });
12636
12636
  const manage = async (sealed, params) => {
@@ -12647,7 +12647,7 @@ function createMediaWallet(config) {
12647
12647
  address: sealed.address,
12648
12648
  signTypedData: async (data) => {
12649
12649
  const privateKeyHex = await unlockOnce(sealed);
12650
- return chunkRJH2Y53L_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
12650
+ return chunkCD52LTRP_cjs.signWithPrivateKey(privateKeyHex, starknet.typedData.getMessageHash(data, sealed.address));
12651
12651
  },
12652
12652
  execute: async (calls, opts) => {
12653
12653
  const { transactionHash } = await run(sealed, calls, void 0, opts?.intentIds);
@@ -12688,55 +12688,55 @@ async function claimSessionWallet(api, walletAddress, deps) {
12688
12688
 
12689
12689
  Object.defineProperty(exports, "InvalidStarkPrivateKeyError", {
12690
12690
  enumerable: true,
12691
- get: function () { return chunkRJH2Y53L_cjs.InvalidStarkPrivateKeyError; }
12691
+ get: function () { return chunkCD52LTRP_cjs.InvalidStarkPrivateKeyError; }
12692
12692
  });
12693
12693
  Object.defineProperty(exports, "PasskeyCancelledError", {
12694
12694
  enumerable: true,
12695
- get: function () { return chunkRJH2Y53L_cjs.PasskeyCancelledError; }
12695
+ get: function () { return chunkCD52LTRP_cjs.PasskeyCancelledError; }
12696
12696
  });
12697
12697
  Object.defineProperty(exports, "PasskeyUnsupportedError", {
12698
12698
  enumerable: true,
12699
- get: function () { return chunkRJH2Y53L_cjs.PasskeyUnsupportedError; }
12699
+ get: function () { return chunkCD52LTRP_cjs.PasskeyUnsupportedError; }
12700
12700
  });
12701
12701
  Object.defineProperty(exports, "UserFacingError", {
12702
12702
  enumerable: true,
12703
- get: function () { return chunkRJH2Y53L_cjs.UserFacingError; }
12703
+ get: function () { return chunkCD52LTRP_cjs.UserFacingError; }
12704
12704
  });
12705
12705
  Object.defineProperty(exports, "computeAccountAddress", {
12706
12706
  enumerable: true,
12707
- get: function () { return chunkRJH2Y53L_cjs.computeAccountAddress; }
12707
+ get: function () { return chunkCD52LTRP_cjs.computeAccountAddress; }
12708
12708
  });
12709
12709
  Object.defineProperty(exports, "createPasskeyOwner", {
12710
12710
  enumerable: true,
12711
- get: function () { return chunkRJH2Y53L_cjs.createPasskeyOwner; }
12711
+ get: function () { return chunkCD52LTRP_cjs.createPasskeyOwner; }
12712
12712
  });
12713
12713
  Object.defineProperty(exports, "deriveAesKey", {
12714
12714
  enumerable: true,
12715
- get: function () { return chunkRJH2Y53L_cjs.deriveAesKey; }
12715
+ get: function () { return chunkCD52LTRP_cjs.deriveAesKey; }
12716
12716
  });
12717
12717
  Object.defineProperty(exports, "generateStarkKeyPair", {
12718
12718
  enumerable: true,
12719
- get: function () { return chunkRJH2Y53L_cjs.generateStarkKeyPair; }
12719
+ get: function () { return chunkCD52LTRP_cjs.generateStarkKeyPair; }
12720
12720
  });
12721
12721
  Object.defineProperty(exports, "ownerConstructorCalldata", {
12722
12722
  enumerable: true,
12723
- get: function () { return chunkRJH2Y53L_cjs.ownerConstructorCalldata; }
12723
+ get: function () { return chunkCD52LTRP_cjs.ownerConstructorCalldata; }
12724
12724
  });
12725
12725
  Object.defineProperty(exports, "sealPrivateKey", {
12726
12726
  enumerable: true,
12727
- get: function () { return chunkRJH2Y53L_cjs.sealPrivateKey; }
12727
+ get: function () { return chunkCD52LTRP_cjs.sealPrivateKey; }
12728
12728
  });
12729
12729
  Object.defineProperty(exports, "signWithPrivateKey", {
12730
12730
  enumerable: true,
12731
- get: function () { return chunkRJH2Y53L_cjs.signWithPrivateKey; }
12731
+ get: function () { return chunkCD52LTRP_cjs.signWithPrivateKey; }
12732
12732
  });
12733
12733
  Object.defineProperty(exports, "starkKeyPairFromPrivateKey", {
12734
12734
  enumerable: true,
12735
- get: function () { return chunkRJH2Y53L_cjs.starkKeyPairFromPrivateKey; }
12735
+ get: function () { return chunkCD52LTRP_cjs.starkKeyPairFromPrivateKey; }
12736
12736
  });
12737
12737
  Object.defineProperty(exports, "unsealPrivateKey", {
12738
12738
  enumerable: true,
12739
- get: function () { return chunkRJH2Y53L_cjs.unsealPrivateKey; }
12739
+ get: function () { return chunkCD52LTRP_cjs.unsealPrivateKey; }
12740
12740
  });
12741
12741
  exports.COIN_MAX_SUPPLY = MAX_SUPPLY;
12742
12742
  exports.COIN_MIN_SUPPLY = MIN_SUPPLY;
@@ -1,7 +1,7 @@
1
1
  import * as starknet from 'starknet';
2
2
  import { AccountInterface, ProviderInterface, RpcProvider, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
3
- import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-CrBviXC8.cjs';
4
- export { cd as ApiKeyAction, ce as ApiKeyConfirmation, cf as ApiKeyConfirmationInput, cg as CreateCreatorCoinParams, ch as CreatorCoinGuarantees, ci as CreatorCoinReceiptLike, cj as DropMintState, ck as DropMintStateKind, cl as DropOnchain, cm as EkuboLaunchParams, cn as EkuboPoolParams, co as InvalidRecoveryKeyError, cp as MAX_HOLDERS_AT_LAUNCH, cq as MAX_TEAM_ALLOCATION_PERCENT, cr as OwnerSigner, bM as PasskeyCancelledError, cs as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, ct as PopAllowlist, cu as PopClaimInfo, cv as PopClaimLink, cw as PopClaimState, cx as RecoveryKey, c1 as UserFacingError, cy as VALIDATED_EKUBO_PARAMS, cz as apiKeyConfirmationTypedData, cA as buildCreateCreatorCoinCall, cB as buildLaunchOnEkuboCalls, cC as buildPopAllowlist, cD as createPasskeyOwner, cE as decodePopClaimFragment, cF as dropClaimLinks, cG as dropClaimedBy, cH as dropMintState, cI as encodePopClaimFragment, cJ as encodeRecoveryKey, cK as getCreatorCoinGuarantees, cL as parseCreatorCoinCreated, cM as parseRecoveryKey, cN as popCalls, cO as popClaimInfo, cP as popClaimLinks, cQ as popClaimLinksCsv, cR as popClaimState, cS as priceToEkuboParams, cT as readDrop, cU as validatePrice, cV as verifyPopProof } from '../errors-CrBviXC8.cjs';
3
+ import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-BpLUsT6k.cjs';
4
+ export { cd as ApiKeyAction, ce as ApiKeyConfirmation, cf as ApiKeyConfirmationInput, cg as CreateCreatorCoinParams, ch as CreatorCoinGuarantees, ci as CreatorCoinReceiptLike, cj as DropMintState, ck as DropMintStateKind, cl as DropOnchain, cm as EkuboLaunchParams, cn as EkuboPoolParams, co as InvalidRecoveryKeyError, cp as MAX_HOLDERS_AT_LAUNCH, cq as MAX_TEAM_ALLOCATION_PERCENT, cr as OwnerSigner, bM as PasskeyCancelledError, cs as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, ct as PopAllowlist, cu as PopClaimInfo, cv as PopClaimLink, cw as PopClaimState, cx as RecoveryKey, c1 as UserFacingError, cy as VALIDATED_EKUBO_PARAMS, cz as apiKeyConfirmationTypedData, cA as buildCreateCreatorCoinCall, cB as buildLaunchOnEkuboCalls, cC as buildPopAllowlist, cD as createPasskeyOwner, cE as decodePopClaimFragment, cF as dropClaimLinks, cG as dropClaimedBy, cH as dropMintState, cI as encodePopClaimFragment, cJ as encodeRecoveryKey, cK as getCreatorCoinGuarantees, cL as parseCreatorCoinCreated, cM as parseRecoveryKey, cN as popCalls, cO as popClaimInfo, cP as popClaimLinks, cQ as popClaimLinksCsv, cR as popClaimState, cS as priceToEkuboParams, cT as readDrop, cU as validatePrice, cV as verifyPopProof } from '../errors-BpLUsT6k.cjs';
5
5
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-DC4jNPAF.cjs';
6
6
  import 'zod';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import * as starknet from 'starknet';
2
2
  import { AccountInterface, ProviderInterface, RpcProvider, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
3
- import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-kCrcWfrz.js';
4
- export { cd as ApiKeyAction, ce as ApiKeyConfirmation, cf as ApiKeyConfirmationInput, cg as CreateCreatorCoinParams, ch as CreatorCoinGuarantees, ci as CreatorCoinReceiptLike, cj as DropMintState, ck as DropMintStateKind, cl as DropOnchain, cm as EkuboLaunchParams, cn as EkuboPoolParams, co as InvalidRecoveryKeyError, cp as MAX_HOLDERS_AT_LAUNCH, cq as MAX_TEAM_ALLOCATION_PERCENT, cr as OwnerSigner, bM as PasskeyCancelledError, cs as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, ct as PopAllowlist, cu as PopClaimInfo, cv as PopClaimLink, cw as PopClaimState, cx as RecoveryKey, c1 as UserFacingError, cy as VALIDATED_EKUBO_PARAMS, cz as apiKeyConfirmationTypedData, cA as buildCreateCreatorCoinCall, cB as buildLaunchOnEkuboCalls, cC as buildPopAllowlist, cD as createPasskeyOwner, cE as decodePopClaimFragment, cF as dropClaimLinks, cG as dropClaimedBy, cH as dropMintState, cI as encodePopClaimFragment, cJ as encodeRecoveryKey, cK as getCreatorCoinGuarantees, cL as parseCreatorCoinCreated, cM as parseRecoveryKey, cN as popCalls, cO as popClaimInfo, cP as popClaimLinks, cQ as popClaimLinksCsv, cR as popClaimState, cS as priceToEkuboParams, cT as readDrop, cU as validatePrice, cV as verifyPopProof } from '../errors-kCrcWfrz.js';
3
+ import { bU as ResolvedConfig, b6 as CreatePopCollectionParams, b$ as TxResult, a_ as CreateDropParams, bd as CreateTicketParams, bE as MintTicketsParams, b2 as CreateMembershipParams, bD as MintMembershipsParams, ba as CreateSponsorshipOfferParams, bR as ProposeSponsorshipParams, k as ApiClient, c6 as CreatorCoinService, bB as MedialaneConfig, bC as MedialaneErrorCode, R as ResolvedFeeConfig, J as ApiFundingIntent, I as ApiFundingInstructions, M as ApiFundingSubmit, O as ApiIntentCreated, bk as DropTerms, c7 as SealedOwner, c8 as ReceiptProviderLike, c9 as WalletExecutor, ca as ExecutedTransaction, cb as PasskeyOwner, bi as CreateWalletManageIntentParams, cc as CreatedOwner } from '../errors-Bz6FfzMj.js';
4
+ export { cd as ApiKeyAction, ce as ApiKeyConfirmation, cf as ApiKeyConfirmationInput, cg as CreateCreatorCoinParams, ch as CreatorCoinGuarantees, ci as CreatorCoinReceiptLike, cj as DropMintState, ck as DropMintStateKind, cl as DropOnchain, cm as EkuboLaunchParams, cn as EkuboPoolParams, co as InvalidRecoveryKeyError, cp as MAX_HOLDERS_AT_LAUNCH, cq as MAX_TEAM_ALLOCATION_PERCENT, cr as OwnerSigner, bM as PasskeyCancelledError, cs as PasskeyConfig, bN as PasskeyUnsupportedError, bO as PasskeyUnsupportedReason, ct as PopAllowlist, cu as PopClaimInfo, cv as PopClaimLink, cw as PopClaimState, cx as RecoveryKey, c1 as UserFacingError, cy as VALIDATED_EKUBO_PARAMS, cz as apiKeyConfirmationTypedData, cA as buildCreateCreatorCoinCall, cB as buildLaunchOnEkuboCalls, cC as buildPopAllowlist, cD as createPasskeyOwner, cE as decodePopClaimFragment, cF as dropClaimLinks, cG as dropClaimedBy, cH as dropMintState, cI as encodePopClaimFragment, cJ as encodeRecoveryKey, cK as getCreatorCoinGuarantees, cL as parseCreatorCoinCreated, cM as parseRecoveryKey, cN as popCalls, cO as popClaimInfo, cP as popClaimLinks, cQ as popClaimLinksCsv, cR as popClaimState, cS as priceToEkuboParams, cT as readDrop, cU as validatePrice, cV as verifyPopProof } from '../errors-Bz6FfzMj.js';
5
5
  import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-DC4jNPAF.js';
6
6
  import 'zod';
7
7
 
@@ -1,5 +1,5 @@
1
- import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, MedialaneApiError, starkKeyPairFromPrivateKey } from '../chunk-6KFXIVA6.js';
2
- export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-6KFXIVA6.js';
1
+ import { normalizeAddress, collectionHref, dropHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, MedialaneApiError, starkKeyPairFromPrivateKey } from '../chunk-B56VSHNR.js';
2
+ export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-B56VSHNR.js';
3
3
  import { getStarknetCoordinates, getCoordinates } from '../chunk-3ME5YKTW.js';
4
4
  import { CallData, hash, cairo, uint256, CairoOption, CairoOptionVariant, RpcProvider, num, ec, validateAndParseAddress, Account, typedData, stark, byteArray, Contract, TypedDataRevision, constants, shortString } from 'starknet';
5
5
  import { extract, expand } from '@noble/hashes/hkdf.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medialane/sdk",
3
- "version": "0.184.0",
3
+ "version": "0.185.0",
4
4
  "description": "Framework-agnostic TypeScript SDK for Medialane.io — the IP marketplace on Starknet",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",