@flaunch/sdk 0.9.9 → 0.9.11

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.
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createDrift as createDrift$1 } from '@delvtech/drift';
2
- import { zeroAddress, parseEther, encodeAbiParameters as encodeAbiParameters$1, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, concat as concat$1, toHex as toHex$1, zeroHash, formatUnits as formatUnits$1, parseEventLogs, erc721Abi, erc20Abi, parseAbi, createWalletClient, http, decodeFunctionData } from 'viem';
2
+ import { zeroAddress, parseEther, encodeAbiParameters as encodeAbiParameters$1, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, concat as concat$1, toHex as toHex$1, zeroHash, formatUnits as formatUnits$1, parseEventLogs, decodeEventLog, erc721Abi, erc20Abi, parseAbi, createWalletClient, http, decodeFunctionData } from 'viem';
3
3
  import axios from 'axios';
4
4
  import { viemAdapter } from '@delvtech/drift-viem';
5
5
 
@@ -5770,6 +5770,10 @@ const DopplerVerifierAddress = {
5770
5770
  [base.id]: "0xedd66b080b8e9425c39d349a3fb69f480580f993",
5771
5771
  [baseSepolia.id]: "0x6428b5C4da36ecB070aBdcB5E1939244A3cC7fb5",
5772
5772
  };
5773
+ const SolanaVerifierAddress = {
5774
+ [base.id]: "0xba28ac1540893a34476c24b2c4fa32e0506c9055",
5775
+ [baseSepolia.id]: "0x47226918e518f205584bd75bf81e0b532b0b3ea7",
5776
+ };
5773
5777
  const VirtualsVerifierAddress = {
5774
5778
  [base.id]: "0x06a089fa231aca48d2aa77365123ad9aca43d3a4",
5775
5779
  [baseSepolia.id]: "0x6582d2bc6a7eba3b40bdf46b3868fc7ec2ff96ec",
@@ -11886,6 +11890,7 @@ var Verifier;
11886
11890
  (function (Verifier) {
11887
11891
  Verifier["CLANKER"] = "clanker";
11888
11892
  Verifier["DOPPLER"] = "doppler";
11893
+ Verifier["SOLANA"] = "solana";
11889
11894
  Verifier["VIRTUALS"] = "virtuals";
11890
11895
  Verifier["WHITELIST"] = "whitelist";
11891
11896
  Verifier["ZORA"] = "zora";
@@ -20703,6 +20708,8 @@ class ReadTokenImporter {
20703
20708
  return ClankerWorldVerifierAddress[this.chainId];
20704
20709
  case Verifier.DOPPLER:
20705
20710
  return DopplerVerifierAddress[this.chainId];
20711
+ case Verifier.SOLANA:
20712
+ return SolanaVerifierAddress[this.chainId];
20706
20713
  case Verifier.VIRTUALS:
20707
20714
  return VirtualsVerifierAddress[this.chainId];
20708
20715
  case Verifier.WHITELIST:
@@ -26408,6 +26415,50 @@ class ReadFlaunchSDK {
26408
26415
  }
26409
26416
  return poll();
26410
26417
  }
26418
+ /**
26419
+ * Parses a transaction to extract PoolCreated event data
26420
+ * @param txHash - The transaction hash to parse
26421
+ * @returns PoolCreated event parameters or null if not found
26422
+ */
26423
+ async getPoolCreatedFromTx(txHash) {
26424
+ if (!this.publicClient) {
26425
+ throw new Error("Public client is required to fetch transaction data");
26426
+ }
26427
+ // Get transaction receipt
26428
+ const receipt = await this.publicClient.getTransactionReceipt({
26429
+ hash: txHash,
26430
+ });
26431
+ if (!receipt) {
26432
+ throw new Error(`Transaction not found: ${txHash}`);
26433
+ }
26434
+ // Find PoolCreated event in logs by trying to decode each log
26435
+ // Using V1_2 ABI which is compatible with all versions (V1_2 has extra fields that are optional)
26436
+ for (const log of receipt.logs) {
26437
+ try {
26438
+ const decodedLog = decodeEventLog({
26439
+ abi: FlaunchPositionManagerV1_2Abi,
26440
+ data: log.data,
26441
+ topics: log.topics,
26442
+ });
26443
+ if (decodedLog.eventName === "PoolCreated") {
26444
+ return {
26445
+ poolId: decodedLog.args._poolId,
26446
+ memecoin: decodedLog.args._memecoin,
26447
+ memecoinTreasury: decodedLog.args._memecoinTreasury,
26448
+ tokenId: decodedLog.args._tokenId,
26449
+ currencyFlipped: decodedLog.args._currencyFlipped,
26450
+ flaunchFee: decodedLog.args._flaunchFee,
26451
+ params: decodedLog.args._params,
26452
+ };
26453
+ }
26454
+ }
26455
+ catch (error) {
26456
+ // Not a PoolCreated event or decoding failed, continue to next log
26457
+ continue;
26458
+ }
26459
+ }
26460
+ return null;
26461
+ }
26411
26462
  /**
26412
26463
  * Watches for pool swap events
26413
26464
  * @param params - Parameters for watching pool swaps including optional coin filter
@@ -32082,5 +32133,5 @@ const FlaunchSDK = {
32082
32133
  ReadWriteFlaunchSDK,
32083
32134
  };
32084
32135
 
32085
- export { AddressFeeSplitManagerAddress, AnyBidWallAddress, AnyFlaunchAddress, AnyPositionManagerAbi, AnyPositionManagerAddress, BidWallAddress, BidWallV1_1Abi, BidWallV1_1Address, BidwallAbi, BuyBackManagerAddress, ClankerWorldVerifierAddress, ClosedPermissionsAddress, DopplerVerifierAddress, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Abi, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FeeEscrowAbi, FeeEscrowAddress, FlaunchAbi, FlaunchAddress, FlaunchBackend, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Abi, FlaunchPositionManagerV1_1Address, FlaunchPositionManagerV1_2Address, FlaunchSDK, FlaunchV1_1Abi, FlaunchV1_1Address, FlaunchV1_2Address, FlaunchVersion, FlaunchZapAbi, FlaunchZapAddress, InitialPriceAbi, LiquidityMode, MemecoinAbi, MulticallAbi, PERMIT_DETAILS, PERMIT_TYPES, Permissions, Permit2Abi, Permit2Address, PoolManagerAbi, PoolManagerAddress, Q192, Q96, QuoterAbi, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, ReferralEscrowAbi, ReferralEscrowAddress, RevenueManagerAbi, RevenueManagerAddress, StakingManagerAddress, StateViewAbi, StateViewAddress, TICK_SPACING, TickFinder, TokenImporterAddress, TreasuryManagerFactoryAbi, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniV4PositionManagerAddress, UniversalRouterAbi, UniversalRouterAddress, Verifier, VirtualsVerifierAddress, WhitelistVerifierAddress, WhitelistedPermissionsAddress, ZoraVerifierAddress, buyMemecoin, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createCallDataWalletClient, createDrift, createFlaunch, createFlaunchCalldata, decodeCallData, encodedCallAbi, generateTokenUri, getAmountWithSlippage, getAmountsForLiquidity, getLiquidityFromAmounts, getNearestUsableTick, getPermissionsAddress, getPermit2TypedData, getPoolId, getSqrtPriceX96FromTick, getValidTick, maxLiquidityForAmount0Precise, maxLiquidityForAmount1, orderPoolKey, parseCall, parseSwapData, priceRatioToTick, resolveIPFS, sellMemecoinWithPermit2, uint256ToBytes32, uploadFileToIPFS, uploadImageToFlaunchAPI, uploadImageToIPFS, uploadJsonToIPFS, uploadMetadataToFlaunchAPI };
32136
+ export { AddressFeeSplitManagerAddress, AnyBidWallAddress, AnyFlaunchAddress, AnyPositionManagerAbi, AnyPositionManagerAddress, BidWallAddress, BidWallV1_1Abi, BidWallV1_1Address, BidwallAbi, BuyBackManagerAddress, ClankerWorldVerifierAddress, ClosedPermissionsAddress, DopplerVerifierAddress, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Abi, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FeeEscrowAbi, FeeEscrowAddress, FlaunchAbi, FlaunchAddress, FlaunchBackend, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Abi, FlaunchPositionManagerV1_1Address, FlaunchPositionManagerV1_2Address, FlaunchSDK, FlaunchV1_1Abi, FlaunchV1_1Address, FlaunchV1_2Address, FlaunchVersion, FlaunchZapAbi, FlaunchZapAddress, InitialPriceAbi, LiquidityMode, MemecoinAbi, MulticallAbi, PERMIT_DETAILS, PERMIT_TYPES, Permissions, Permit2Abi, Permit2Address, PoolManagerAbi, PoolManagerAddress, Q192, Q96, QuoterAbi, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, ReferralEscrowAbi, ReferralEscrowAddress, RevenueManagerAbi, RevenueManagerAddress, SolanaVerifierAddress, StakingManagerAddress, StateViewAbi, StateViewAddress, TICK_SPACING, TickFinder, TokenImporterAddress, TreasuryManagerFactoryAbi, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniV4PositionManagerAddress, UniversalRouterAbi, UniversalRouterAddress, Verifier, VirtualsVerifierAddress, WhitelistVerifierAddress, WhitelistedPermissionsAddress, ZoraVerifierAddress, buyMemecoin, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createCallDataWalletClient, createDrift, createFlaunch, createFlaunchCalldata, decodeCallData, encodedCallAbi, generateTokenUri, getAmountWithSlippage, getAmountsForLiquidity, getLiquidityFromAmounts, getNearestUsableTick, getPermissionsAddress, getPermit2TypedData, getPoolId, getSqrtPriceX96FromTick, getValidTick, maxLiquidityForAmount0Precise, maxLiquidityForAmount1, orderPoolKey, parseCall, parseSwapData, priceRatioToTick, resolveIPFS, sellMemecoinWithPermit2, uint256ToBytes32, uploadFileToIPFS, uploadImageToFlaunchAPI, uploadImageToIPFS, uploadJsonToIPFS, uploadMetadataToFlaunchAPI };
32086
32137
  //# sourceMappingURL=index.esm.js.map