@flaunch/sdk 0.9.0-beta.2 → 0.9.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 +1 @@
1
- {"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AAEzE,qBAAa,0BAA0B;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;gBAEtD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAWrE,+BAA+B,CAAC,IAAI,EAAE,SAAS;CA2BtD;AAED,qBAAa,+BAAgC,SAAQ,0BAA0B;IACrE,QAAQ,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;gBAEnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;CAG5E"}
1
+ {"version":3,"file":"TreasuryManagerFactoryClient.d.ts","sourceRoot":"","sources":["../../src/clients/TreasuryManagerFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAC;AAEzE,qBAAa,0BAA0B;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAgB,QAAQ,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;gBAEtD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAWrE,+BAA+B,CAAC,IAAI,EAAE,SAAS;CA2BtD;AAED,qBAAa,+BAAgC,SAAQ,0BAA0B;IACrE,QAAQ,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;gBAEnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;CAG5E"}
package/dist/index.cjs.js CHANGED
@@ -23908,16 +23908,14 @@ class ReadTreasuryManagerFactory {
23908
23908
  });
23909
23909
  // Wait for transaction receipt
23910
23910
  const receipt = await publicClient.waitForTransactionReceipt({ hash });
23911
- // Get the logs from the receipt and find the ManagerDeployed event
23912
- const events = await publicClient.getContractEvents({
23913
- address: this.contract.address,
23911
+ // Parse the ManagerDeployed event from receipt logs
23912
+ const parsedLogs = viem.parseEventLogs({
23914
23913
  abi: TreasuryManagerFactoryAbi,
23915
23914
  eventName: "ManagerDeployed",
23916
- fromBlock: receipt.blockNumber,
23917
- toBlock: receipt.blockNumber,
23915
+ logs: receipt.logs,
23918
23916
  });
23919
23917
  // Find the event from our transaction
23920
- const event = events.find((e) => e.transactionHash === hash);
23918
+ const event = parsedLogs.find((log) => log.address.toLowerCase() === this.contract.address.toLowerCase());
23921
23919
  if (!event) {
23922
23920
  throw new Error("ManagerDeployed event not found in transaction logs");
23923
23921
  }
@@ -26422,13 +26420,13 @@ class ReadFlaunchSDK {
26422
26420
  * Calculates the coin price in USD based on the current ETH/USDC price
26423
26421
  * @param coinAddress - The address of the coin
26424
26422
  * @param version - Optional specific version to use. If not provided, will be determined automatically
26425
- * @returns Promise<string> - The price of the coin in USD with 2 decimal precision
26423
+ * @returns Promise<string> - The price of the coin in USD with 18 decimal precision
26426
26424
  */
26427
26425
  async coinPriceInUSD({ coinAddress, version, drift, }) {
26428
26426
  const coinVersion = version || (await this.getCoinVersion(coinAddress));
26429
26427
  const ethPerCoin = await this.coinPriceInETH(coinAddress, coinVersion);
26430
26428
  const ethPrice = await this.getETHUSDCPrice(drift);
26431
- return (parseFloat(ethPerCoin) * ethPrice).toFixed(2);
26429
+ return (parseFloat(ethPerCoin) * ethPrice).toFixed(18);
26432
26430
  }
26433
26431
  async coinMarketCapInUSD({ coinAddress, version, drift, }) {
26434
26432
  const totalSupply = 100000000000; // 100 Billion tokens