@medialane/sdk 0.92.0 → 0.94.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,38 @@ 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, allocRes] = await Promise.all([
10343
+ call("is_launched").catch(() => null),
10344
+ call("get_team_allocation").catch(() => null)
10345
+ ]);
10346
+ if (!launchedRes || !allocRes) return null;
10347
+ const [supplyRes, blockRes, liquidityRes] = await Promise.all([
10348
+ call("total_supply"),
10349
+ call("launched_at_block_number").catch(() => null),
10350
+ call("liquidity_type").catch(() => null)
10351
+ ]);
10352
+ const isLaunched = BigInt(launchedRes[0] ?? "0x0") !== 0n;
10353
+ const totalSupply = u256(supplyRes);
10354
+ const teamAllocation = u256(allocRes);
10355
+ const teamAllocationPercent = totalSupply > 0n ? Number(teamAllocation * 10000n / totalSupply) / 100 : null;
10356
+ const launchedAtBlock = isLaunched && blockRes?.[0] != null ? Number(BigInt(blockRes[0])) : null;
10357
+ const liquidityPositionId = liquidityRes && BigInt(liquidityRes[0] ?? "0x1") === 0n && liquidityRes[2] != null ? BigInt(liquidityRes[2]).toString() : null;
10358
+ return {
10359
+ isLaunched,
10360
+ launchedAtBlock,
10361
+ totalSupplyRaw: totalSupply.toString(),
10362
+ teamAllocationRaw: teamAllocation.toString(),
10363
+ teamAllocationPercent,
10364
+ liquidityPositionId
10365
+ };
10366
+ }
10335
10367
  var COIN_DECIMALS2 = 18;
10336
10368
  async function getCreatorCoinMarket(coinAddress, provider) {
10337
10369
  const r = await provider.callContract({
@@ -11730,6 +11762,8 @@ exports.IPSponsorshipABI = IPSponsorshipABI;
11730
11762
  exports.IPTicketCollectionABI = IPTicketCollectionABI;
11731
11763
  exports.IPTicketCollectionFactoryABI = IPTicketCollectionFactoryABI;
11732
11764
  exports.LAUNCH_PRICE_QUOTE_PER_COIN = LAUNCH_PRICE_QUOTE_PER_COIN;
11765
+ exports.MAX_HOLDERS_AT_LAUNCH = MAX_HOLDERS_AT_LAUNCH;
11766
+ exports.MAX_TEAM_ALLOCATION_PERCENT = MAX_TEAM_ALLOCATION_PERCENT;
11733
11767
  exports.Medialane1155ABI = Medialane1155ABI;
11734
11768
  exports.MedialaneClient = MedialaneClient;
11735
11769
  exports.MedialaneError = MedialaneError;
@@ -11770,6 +11804,7 @@ exports.fdvHuman = fdvHuman;
11770
11804
  exports.generateStarkKeyPair = generateStarkKeyPair;
11771
11805
  exports.getCounter = getCounter;
11772
11806
  exports.getCounter1155 = getCounter1155;
11807
+ exports.getCreatorCoinGuarantees = getCreatorCoinGuarantees;
11773
11808
  exports.getCreatorCoinMarket = getCreatorCoinMarket;
11774
11809
  exports.getEscape = getEscape;
11775
11810
  exports.getEscapeSecurityPeriod = getEscapeSecurityPeriod;