@medialane/sdk 0.98.0 → 0.99.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.
@@ -599,7 +599,6 @@ interface LaunchCoinIntentParams {
599
599
  owner: string;
600
600
  creatorCoin: string;
601
601
  quoteToken: string;
602
- price: number;
603
602
  initialHolders: string[];
604
603
  initialHoldersAmounts: string[];
605
604
  transferRestrictionDelay?: number;
@@ -599,7 +599,6 @@ interface LaunchCoinIntentParams {
599
599
  owner: string;
600
600
  creatorCoin: string;
601
601
  quoteToken: string;
602
- price: number;
603
602
  initialHolders: string[];
604
603
  initialHoldersAmounts: string[];
605
604
  transferRestrictionDelay?: number;
@@ -10269,7 +10269,7 @@ var ERC1155CollectionService = class {
10269
10269
 
10270
10270
  // src/starknet/services/coinLaunchMath.ts
10271
10271
  var COIN_DECIMALS = 18;
10272
- var SUGGESTED_DEFAULT_PRICE = 0.01;
10272
+ var LAUNCH_PRICE_QUOTE_PER_COIN = 0.01;
10273
10273
  var MIN_SUPPLY = 1000n;
10274
10274
  var MAX_SUPPLY = 1000000000000n;
10275
10275
  var MAX_FELT_BYTES = 31;
@@ -10300,13 +10300,11 @@ function teamCoinsRaw(supplyRaw, pct) {
10300
10300
  const bps = BigInt(Math.round(pct * 100));
10301
10301
  return supplyRaw * bps / 10000n;
10302
10302
  }
10303
- var PRICE_SCALE = 1000000000000n;
10304
- function buybackQuoteRaw(teamCoinsRawValue, price, quoteDecimals) {
10305
- const priceScaled = BigInt(Math.round(price * Number(PRICE_SCALE)));
10306
- return teamCoinsRawValue * priceScaled * 10n ** BigInt(quoteDecimals) / (PRICE_SCALE * 10n ** BigInt(COIN_DECIMALS));
10303
+ function buybackQuoteRaw(teamCoinsRawValue, quoteDecimals) {
10304
+ return teamCoinsRawValue * 10n ** BigInt(quoteDecimals) / (100n * 10n ** BigInt(COIN_DECIMALS));
10307
10305
  }
10308
- function fdvHuman(supplyHuman, price) {
10309
- return supplyHuman * price;
10306
+ function fdvHuman(supplyHuman) {
10307
+ return supplyHuman * LAUNCH_PRICE_QUOTE_PER_COIN;
10310
10308
  }
10311
10309
 
10312
10310
  // src/starknet/services/creatorCoin.ts
@@ -10317,8 +10315,8 @@ var VALIDATED_EKUBO_PARAMS = {
10317
10315
  bound: 88719042n
10318
10316
  };
10319
10317
  var TICK_BASE = 1.000001;
10320
- function priceToEkuboParams(quoteDecimals, price = SUGGESTED_DEFAULT_PRICE) {
10321
- const decAdj = 10 ** (COIN_DECIMALS - quoteDecimals);
10318
+ function priceToEkuboParams(quoteDecimals, price = LAUNCH_PRICE_QUOTE_PER_COIN) {
10319
+ const decAdj = 10 ** (COIN_DECIMALS2 - quoteDecimals);
10322
10320
  const rawRatio = price / decAdj;
10323
10321
  const tickSpacing = Number(VALIDATED_EKUBO_PARAMS.tickSpacing);
10324
10322
  const rawTick = Math.log(rawRatio) / Math.log(TICK_BASE);
@@ -10330,17 +10328,6 @@ function priceToEkuboParams(quoteDecimals, price = SUGGESTED_DEFAULT_PRICE) {
10330
10328
  bound: VALIDATED_EKUBO_PARAMS.bound
10331
10329
  };
10332
10330
  }
10333
- function validatePrice(quoteDecimals, price) {
10334
- if (!isFinite(price) || price <= 0) return "Price must be a positive number";
10335
- const decAdj = 10 ** (COIN_DECIMALS - quoteDecimals);
10336
- const rawRatio = price / decAdj;
10337
- if (!isFinite(rawRatio) || rawRatio <= 0) return "Price must be a positive number";
10338
- const rawTick = Math.log(rawRatio) / Math.log(TICK_BASE);
10339
- if (!isFinite(rawTick)) return "Price is outside the supported range";
10340
- const bound = Number(VALIDATED_EKUBO_PARAMS.bound);
10341
- if (Math.abs(rawTick) >= bound) return "Price is outside the supported range";
10342
- return null;
10343
- }
10344
10331
  var MAX_TEAM_ALLOCATION_PERCENT = 10;
10345
10332
  var MAX_HOLDERS_AT_LAUNCH = 10;
10346
10333
  function u256(parts, offset = 0) {
@@ -10373,6 +10360,7 @@ async function getCreatorCoinGuarantees(coinAddress, provider) {
10373
10360
  liquidityPositionId
10374
10361
  };
10375
10362
  }
10363
+ var COIN_DECIMALS2 = 18;
10376
10364
  var _factoryContract = null;
10377
10365
  function factoryContract() {
10378
10366
  if (!_factoryContract) {
@@ -10394,7 +10382,7 @@ function buildCreateCreatorCoinCall(params) {
10394
10382
  ]);
10395
10383
  }
10396
10384
  function buildLaunchOnEkuboCalls(params) {
10397
- const ek = params.ekubo;
10385
+ const ek = params.ekubo ?? VALIDATED_EKUBO_PARAMS;
10398
10386
  const launchParameters = {
10399
10387
  creator_coin_address: params.creatorCoin,
10400
10388
  transfer_restriction_delay: params.transferRestrictionDelay ?? 0,
@@ -11739,6 +11727,7 @@ exports.IPNftABI = IPNftABI;
11739
11727
  exports.IPSponsorshipABI = IPSponsorshipABI;
11740
11728
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
11741
11729
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
11730
+ exports.LAUNCH_PRICE_QUOTE_PER_COIN = LAUNCH_PRICE_QUOTE_PER_COIN;
11742
11731
  exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
11743
11732
  exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
11744
11733
  exports.Medialane1155ABI = Medialane1155ABI;
@@ -11747,7 +11736,6 @@ exports.MedialaneError = MedialaneError;
11747
11736
  exports.POPCollectionABI = POPCollectionABI;
11748
11737
  exports.POPFactoryABI = POPFactoryABI;
11749
11738
  exports.PopService = PopService;
11750
- exports.SUGGESTED_DEFAULT_PRICE = SUGGESTED_DEFAULT_PRICE;
11751
11739
  exports.SponsorshipService = SponsorshipService;
11752
11740
  exports.StarknetVenue = StarknetVenue;
11753
11741
  exports.TicketService = TicketService;
@@ -11809,7 +11797,6 @@ exports.unsealPrivateKey = unsealPrivateKey;
11809
11797
  exports.validateCoinName = validateName;
11810
11798
  exports.validateCoinSupply = validateSupply;
11811
11799
  exports.validateCoinSymbol = validateSymbol;
11812
- exports.validatePrice = validatePrice;
11813
11800
  exports.verifyAdminRequestSig = verifyAdminRequestSig;
11814
11801
  //# sourceMappingURL=index.cjs.map
11815
11802
  //# sourceMappingURL=index.cjs.map