@medialane/sdk 0.92.0 → 0.93.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.
@@ -10332,6 +10332,35 @@ function priceToEkuboParams(quoteDecimals, price = LAUNCH_PRICE_QUOTE_PER_COIN)
10332
10332
  bound: VALIDATED_EKUBO_PARAMS.bound
10333
10333
  };
10334
10334
  }
10335
+ var MAX_TEAM_ALLOCATION_PERCENT = 10;
10336
+ var MAX_HOLDERS_AT_LAUNCH = 10;
10337
+ function u256(parts, offset = 0) {
10338
+ return BigInt(parts[offset] ?? "0x0") + (BigInt(parts[offset + 1] ?? "0x0") << 128n);
10339
+ }
10340
+ async function getCreatorCoinGuarantees(coinAddress, provider) {
10341
+ const call = (entrypoint) => provider.callContract({ contractAddress: coinAddress, entrypoint, calldata: [] });
10342
+ const [launchedRes, supplyRes, allocRes, blockRes, liquidityRes] = await Promise.all([
10343
+ call("is_launched"),
10344
+ call("total_supply"),
10345
+ call("get_team_allocation"),
10346
+ call("launched_at_block_number").catch(() => null),
10347
+ call("liquidity_type").catch(() => null)
10348
+ ]);
10349
+ const isLaunched = BigInt(launchedRes[0] ?? "0x0") !== 0n;
10350
+ const totalSupply = u256(supplyRes);
10351
+ const teamAllocation = u256(allocRes);
10352
+ const teamAllocationPercent = totalSupply > 0n ? Number(teamAllocation * 10000n / totalSupply) / 100 : null;
10353
+ const launchedAtBlock = isLaunched && blockRes?.[0] != null ? Number(BigInt(blockRes[0])) : null;
10354
+ const liquidityPositionId = liquidityRes && BigInt(liquidityRes[0] ?? "0x1") === 0n && liquidityRes[2] != null ? BigInt(liquidityRes[2]).toString() : null;
10355
+ return {
10356
+ isLaunched,
10357
+ launchedAtBlock,
10358
+ totalSupplyRaw: totalSupply.toString(),
10359
+ teamAllocationRaw: teamAllocation.toString(),
10360
+ teamAllocationPercent,
10361
+ liquidityPositionId
10362
+ };
10363
+ }
10335
10364
  var COIN_DECIMALS2 = 18;
10336
10365
  async function getCreatorCoinMarket(coinAddress, provider) {
10337
10366
  const r = await provider.callContract({
@@ -11730,6 +11759,8 @@ exports.IPSponsorshipABI = IPSponsorshipABI;
11730
11759
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
11731
11760
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
11732
11761
  exports.LAUNCH_PRICE_QUOTE_PER_COIN = LAUNCH_PRICE_QUOTE_PER_COIN;
11762
+ exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
11763
+ exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
11733
11764
  exports.Medialane1155ABI = Medialane1155ABI;
11734
11765
  exports.MedialaneClient = MedialaneClient;
11735
11766
  exports.MedialaneError = MedialaneError;
@@ -11770,6 +11801,7 @@ exports.fdvHuman = fdvHuman;
11770
11801
  exports.generateStarkKeyPair = generateStarkKeyPair;
11771
11802
  exports.getCounter = getCounter;
11772
11803
  exports.getCounter1155 = getCounter1155;
11804
+ exports.getCreatorCoinGuarantees = getCreatorCoinGuarantees;
11773
11805
  exports.getCreatorCoinMarket = getCreatorCoinMarket;
11774
11806
  exports.getEscape = getEscape;
11775
11807
  exports.getEscapeSecurityPeriod = getEscapeSecurityPeriod;