# Flaunch SDK [![npm version](https://img.shields.io/npm/v/@flaunch/sdk.svg)](https://npmjs.com/package/@flaunch/sdk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) A TypeScript SDK for seamless interaction with the Flaunch protocol and Uniswap V4. ![Flaunch Header](https://raw.githubusercontent.com/flayerlabs/flaunch-sdk/refs/heads/master/.github/flaunch-header.png) _Note: Add this `llms-full.txt` file into Cursor IDE / LLMs to provide context about using the Flaunch SDK: [llms-full.txt](https://raw.githubusercontent.com/flayerlabs/flaunch-sdk/refs/heads/master/llms-full.txt)_ ## Features - 🚀 Flaunch new memecoins - 💱 Buy and sell memecoins via Uniswap V4 hooks - 🏗️ Build your own token launchpads on top of the flaunch protocol - 📊 Read functions for token and pool data - 🔒 Built-in Permit2 support for gasless approvals - 🔵 Works on Base and Base Sepolia networks ## Table of Contents - [Installation](#installation) - [Quick Start](#quick-start) - [Usage](#usage) - [Read Operations (with Viem)](#read-operations-with-viem) - [Write Operations (with Viem + Wagmi)](#write-operations-with-viem--wagmi) - [Flaunching a Memecoin](#flaunching-a-memecoin) - [How to generate `base64Image` from User uploaded file](#how-to-generate-base64image-from-user-uploaded-file) - [Flaunch with Address Fee Splits](#flaunch-with-address-fee-splits) - [Buying a Flaunch coin](#buying-a-flaunch-coin) - [Selling with Permit2](#selling-with-permit2) - [Swap using USDC or other tokens by passing `intermediatePoolKey`](#swap-using-usdc-or-other-tokens-by-passing-intermediatepoolkey) - [Advanced Integration: Revenue Sharing with RevenueManager](#advanced-integration-revenue-sharing-with-revenuemanager) - [Bot Protection during Fair Launch via TrustedSigner](#bot-protection-during-fair-launch-via-trustedsigner) - [Groups](#groups) - [Importing External Coins into Flaunch](#importing-external-coins-into-flaunch) - [Adding Liquidity to Imported (or flaunch) coins](#adding-liquidity-to-imported-or-flaunch-coins) - [Import AND Add Liquidity calls in a single batch](#import-and-add-liquidity-calls-in-a-single-batch) - [Import AND Add Single-Sided Coin Liquidity calls in a single batch](#import-and-add-single-sided-coin-liquidity-calls-in-a-single-batch) - [`createFlaunchCalldata`: alternative to `createFlaunch`](#createflaunchcalldata-alternative-to-createflaunch-that-returns-the-tx-call-object-with-to-data-and-value-instead-of-directly-broadcasting-the-tx-from-walletclient) - [All SDK functions](#all-sdk-functions) - [React Hooks](#react-hooks) - [Flaunch Docs](#flaunch-reference) ## Installation Using pnpm (recommended): ```bash pnpm add @flaunch/sdk ``` Using npm: ```bash npm install @flaunch/sdk ``` Using yarn: ```bash yarn add @flaunch/sdk ``` ## Quick Start Here's a simple example to get started with reading token metadata: ```ts import { createFlaunch } from "@flaunch/sdk"; import { createPublicClient, http } from "viem"; import { base } from "viem/chains"; const publicClient = createPublicClient({ chain: base, transport: http(), }); const flaunchRead = createFlaunch({ publicClient }); const { symbol, name, image } = await flaunchRead.getCoinMetadata(coinAddress); // returns: {symbol: "TEST", name: "Test", image: "https://"} ``` ## Usage The SDK provides two types of operations: 1. Read operations: Only require a `publicClient` 2. Write operations: Require both `publicClient` and `walletClient` ### Read Operations (with Viem) ```ts import { createFlaunch } from "@flaunch/sdk"; import { createPublicClient, http } from "viem"; import { base } from "viem/chains"; const publicClient = createPublicClient({ chain: base, transport: http(""), // "" is optional, defaults to public RPC }); const flaunchRead = createFlaunch({ publicClient }); // Read token metadata const { symbol, name, image } = await flaunchRead.getCoinMetadata(coinAddress); // returns: {symbol: "TEST", name: "Test", image: "https://"} ``` ### Write Operations (with Viem + Wagmi) For write operations, you'll need both Viem and Wagmi. Here's how to set it up in a React component: ```ts import { createFlaunch, ReadWriteFlaunchSDK } from "@flaunch/sdk"; import { base } from "viem/chains"; import { useWalletClient } from "wagmi"; import { useMemo } from "react"; // ... your React component ... const publicClient = createPublicClient({ chain: base, transport: http(""), // "" is optional, defaults to public RPC }); const { data: walletClient } = useWalletClient(); const flaunchWrite = useMemo(() => { if (!publicClient && !walletClient) return null; return createFlaunch({ publicClient, walletClient, }) as ReadWriteFlaunchSDK; }, [publicClient, walletClient]); ``` ### Flaunching a Memecoin Flaunch your own memecoin with default parameters: _**Flaunches below $10k market caps don't incur any protocol fees!**_ ```ts const hash = await flaunchWrite.flaunchIPFS({ name: "Test", symbol: "TEST", fairLaunchPercent: 0, // 0% fairLaunchDuration: 30 * 60, // 30 mins initialMarketCapUSD: 10_000, // $10k creator: address, creatorFeeAllocationPercent: 80, // 80% to creator, 20% to community metadata: { base64Image: imageData, // refer to the code below, on how to generate this base64Image description: "Your memecoin description", // optional: websiteUrl: "https://example.com/", discordUrl: "https://discord.gg/example", twitterUrl: "https://x.com/example", telegramUrl: "https://t.me/example", }, }); // parse the logs from the tx hash to get memecoin address and Flaunch NFT tokenId import { PoolCreatedEventData } from "@flaunch/sdk"; // Parse the flaunch transaction hash const poolCreatedData: PoolCreatedEventData | null = await flaunchRead.getPoolCreatedFromTx(hash); if (poolCreatedData) { console.log("Memecoin Address:", poolCreatedData.memecoin); console.log("Token ID:", poolCreatedData.tokenId); // ... other params } ``` #### How to generate `base64Image` from User uploaded file ```tsx // handle image file input and convert into base64 const handleImageChange = useCallback( (e: ChangeEvent) => { if (e.target.files && e.target.files[0]) { const file = e.target.files[0]; // read the file as base64 const reader = new FileReader(); reader.onloadend = () => { const base64String = reader.result as string; // this can be passed to the flaunch function call handleFlaunch({ imageData: base64String }); // use `storedImagePreview` to display the uploaded image with setStoredImagePreview(base64String); }; reader.readAsDataURL(file); } }, [setStoredImagePreview] ); // File upload input ; ``` ### Flaunch with Address Fee Splits You can flaunch a coin and share the revenue with the creator and an array of recipients, each with a different percentage share.\ Example below of a creator splitting 50% of their revenue with 2 addresses, with 30% and 70% share respectively: ```ts await flaunchWrite.flaunchIPFSWithSplitManager({ name: "...", symbol: "...", metadata: { base64Image: "...", }, fairLaunchPercent: 0, fairLaunchDuration: 30 * 60, // 30 mins initialMarketCapUSD: 1_000, creator: "0x...", creatorFeeAllocationPercent: 100, // **Note:** Split related params creatorSplitPercent: 50, splitReceivers: [ { address: "0x123...", percent: 30, }, { address: "0xabc...", percent: 70, }, ], }); ``` ### Buying a Flaunch coin ```ts // Execute the buy transaction const buyTokens = async () => { const hash = await flaunchWrite.buyCoin({ coinAddress, slippagePercent: 5, swapType: "EXACT_IN", amountIn: parseEther("0.1"), }); // Wait for confirmation const receipt = await flaunchWrite.drift.waitForTransaction({ hash }); console.log(receipt.status === "success" ? "Success" : "Failed"); }; ``` ### Selling with Permit2 Permit2 enables gasless token approvals. Here's how to implement token selling with Permit2: ```ts import { useSignTypedData } from "wagmi"; import { parseEther, Hex } from "viem"; const { signTypedData, status: sigStatus, error: sigError, data: signature, } = useSignTypedData(); // Check allowance and permit if needed const { allowance } = await flaunchWrite.getPermit2AllowanceAndNonce( coinAddress ); if (allowance < parseEther(coinAmount)) { const { typedData, permitSingle } = await flaunchWrite.getPermit2TypedData( coinAddress ); signTypedData(typedData); // then call this when signature is not undefined const hash = await flaunchWrite.sellCoin({ coinAddress, amountIn: parseEther(coinAmount), slippagePercent: 5, permitSingle, signature, }); } else { // if already approved const hash = await flaunchWrite.sellCoin({ coinAddress, amountIn: parseEther(coinAmount), slippagePercent: 5, }); } ``` ### Swap using USDC or other tokens by passing `intermediatePoolKey` An `intermediatePoolKey` can be specified for the swap, where one currency of the poolKey is required to be `ETH` and the other currency can be `USDC` or some other token for which you want to swap from or into. With the addition of this intermediate pool key, the swap gets routed as: `USDC -> ETH -> flETH -> Coin` 1. Buy Coin with USDC ```ts import { useSignTypedData } from "wagmi"; const { signTypedData, status: sigStatus, error: sigError, data: signature, } = useSignTypedData(); // flaunch coins by default have infinite approval for Permit2 // this is required for external tokens like USDC const usdcAllowanceToPermit2 = await flaunchWrite.getERC20AllowanceToPermit2( usdcAddress ); if (usdcAllowanceToPermit2 < amount) { // 1. max approve tx for Permit2 address to spend USDC await flaunchWrite.setERC20AllowanceToPermit2(usdcAddress, maxUint256); } const { allowance: usdcPermit2Allowance } = await flaunchWrite.getPermit2AllowanceAndNonce(usdcAddress); if (usdcPermit2Allowance < amount) { // 2. sign permit2 signature to spend USDC for swap const { typedData, permitSingle } = await flaunchWrite.getPermit2TypedData( usdcAddress ); signTypedData(typedData); } // 3. Buy flaunch coin with USDC await flaunchWrite.buyCoin({ coinAddress: coin, slippagePercent: 5, swapType: "EXACT_IN", amountIn: amount, // USDC amount // poolKey to route USDC to ETH swap intermediatePoolKey: { currency0: zeroAddress, currency1: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC fee: 500, tickSpacing: 10, hooks: zeroAddress, hookData: "0x", }, permitSingle, signature, referrer: referrer, }); ``` 2. Sell coin for USDC ```ts import { useSignTypedData } from "wagmi"; import { parseEther, Hex } from "viem"; const { signTypedData, status: sigStatus, error: sigError, data: signature, } = useSignTypedData(); // Check allowance and permit if needed const { allowance } = await flaunchWrite.getPermit2AllowanceAndNonce( coinAddress ); if (allowance < parseEther(coinAmount)) { const { typedData, permitSingle } = await flaunchWrite.getPermit2TypedData( coinAddress ); signTypedData(typedData); // then call this when signature is not undefined const hash = await flaunchWrite.sellCoin({ coinAddress, amountIn: parseEther(coinAmount), slippagePercent: 5, permitSingle, signature, // poolKey to route ETH to USDC swap intermediatePoolKey: { currency0: zeroAddress, currency1: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC fee: 500, tickSpacing: 10, hooks: zeroAddress, hookData: "0x", }, }); } else { // if already approved const hash = await flaunchWrite.sellCoin({ coinAddress, amountIn: parseEther(coinAmount), slippagePercent: 5, // poolKey to route ETH to USDC swap intermediatePoolKey: { currency0: zeroAddress, currency1: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC fee: 500, tickSpacing: 10, hooks: zeroAddress, hookData: "0x", }, }); } ``` 3. The quote functions `getSellQuoteExactInput`, `getBuyQuoteExactInput` and `getBuyQuoteExactOutput` also support passing optional `intermediatePoolKey`. ### Advanced Integration: Revenue Sharing with RevenueManager For platforms building on top of Flaunch, the `RevenueManager` contract enables sophisticated revenue-sharing models. It allows platforms to automatically take a protocol fee from the trading fees generated by memecoins launched through their integration. **Key Concepts:** 1. **Deployment & Initialization**: Before flaunching tokens via your platform, deploy an instance of your `RevenueManager` with your protocol fee and recipient address. ```ts const revenueManagerInstanceAddress = await flaunchWrite.deployRevenueManager({ protocolRecipient: "0xabc...", protocolFeePercent: 20, // 20% revenue share between protocol and 80% to coin creators (of the 1% swap fees) }); ``` 2. **Flaunching Directly to Manager**: Instead of the creator receiving the Flaunch NFT, you'd flaunch the token directly into the `RevenueManager`. This automatically sets up the fee split. ```ts await flaunchWrite.flaunchIPFSWithRevenueManager({ name: "...", symbol: "...", metadata: { base64Image: "...", }, fairLaunchPercent: 0, fairLaunchDuration: 30 * 60, // 30 mins initialMarketCapUSD: 1_000, creator: "0x...", creatorFeeAllocationPercent: 100, // **Note:** Specify your instance of the RevenueManager here revenueManagerInstanceAddress: "...", }); ``` 3. **Claiming Fees**: Creators can claim their share of earned fees, and the protocol can claim its share via the `RevenueManager` contract. ```ts // check address' balance const balance = await flaunchRead.revenueManagerBalance({ revenueManagerAddress: revenueManagerInstanceAddress, recipient: "0xabc...", }); // protocol claim: the connected wallet must be the protocol recipient for the revenue manager await flaunchWrite.revenueManagerProtocolClaim({ revenueManagerAddress: revenueManagerInstanceAddress, }); // creator claim: the connected wallet must be the coin's creator for them to claim their share await flaunchWrite.revenueManagerCreatorClaim({ revenueManagerAddress: revenueManagerInstanceAddress, }); // creator claim: for specific flaunch token ids: await flaunchWrite.revenueManagerCreatorClaimForTokens({ revenueManagerAddress: revenueManagerInstanceAddress, flaunchTokens: [ { flaunch: FlaunchAddress[base.id], tokenId: 5, }, { flaunch: FlaunchV1_1Address[base.id], tokenId: 10, }, ], }); ``` Refer to the [RevenueManager Docs](https://docs.flaunch.gg/manager-types/revenuemanager) for detailed implementation guides and function references. ### Bot Protection during Fair Launch via TrustedSigner 1. The `flaunch` call can be modified to enable TrustedSigner. For coins where it's enabled in their fair launch period, the buy transactions revert if they don't include the hookData with the signature (unique to the coin & sender address). It's upto your UI integration to use some captcha service or other sort of gating to allow the signature to be generated only for the selected users that are trying to buy the coin during it's fair launch. You can also limit the amount of coins that can be bought in a single swap tx, or even set per wallet caps. **Note:** If your have provided your custom `trustedFeeSigner`, then the signatures are expected to be signed by your address. The Flaunch UI won't be able to execute the swaps during fair launch in that case, as our UI won't have access to your keys. But you may leave the `trustedFeeSigner` param `undefined`, then the swaps can go through our UI. But you won't be able to generate valid signatures on end, as you won't access to our signer address. 1.1. Without Premine ```ts const hash = await flaunchWrite.flaunchIPFS({ name: "Test", ... trustedSignerSettings: { enabled: true, trustedFeeSigner: "0x..", walletCap: parseEther("1000000"), // optional txCap: parseEther("10000"), // optional } }); ``` 1.2. With Premine Refer to '2.' below to understand how to generate the deadline and signature, that needs to be passed here. ```ts const hash = await flaunchWrite.flaunchIPFS({ name: "Test", ... premineAmount: 123.., trustedSignerSettings: { enabled: true, trustedFeeSigner: "0x...", walletCap: parseEther("1000000"), // optional txCap: parseEther("10000"), // optional premineSignedMessage: { deadline: 1234.., signature: "0xabc...", } } }); ``` 2. Backend SDK to sign & generate hookData As the signing happens via your secure privateKey, we have a separate `FlaunchBackend` exported from our SDK package that's intended to be run on your nodejs backend or API. The API can verify if the request is legit (post captcha verification), and then return the signed hookData to be used for the `buyCoin` transaction. ```ts import { FlaunchBackend } from "@flaunch/sdk"; const flaunchBackend = new FlaunchBackend(privateKeyHex, chain.id); const { hookData, deadline, signature } = await flaunchBackend.generateHookDataWithSignature({ userWallet, coinAddress, referrer: referrer || undefined, // Optional parameter deadlineFromNowInSeconds: 10 * 60, // 10 minutes in seconds }); // hookData would be passed to buyQuote and buyCoin functions // signature and deadline useful for passing to the flaunch call with premine, via `trustedSignerSettings.premineSignedMessage` parameter ``` 3. Check TrustedSigner status for a coin ```ts const { isCurrentlyEnabled, trustedSignerEnabled, signer, fairLaunchStartsAt, fairLaunchEndsAt, isFairLaunchActive, } = await flaunchRead.trustedPoolKeySignerStatus(coinAddress); // if `isCurrentlyEnabled` is true, then we need to sign & pass in the hookData for the swaps with the given `signer` address ``` 4. Buy quotes with TrustedSigner ```ts const quote = await flaunchRead.getBuyQuoteExactInput({ coinAddress: coin, amountIn: amount, // when trusted signer is currently enabled: hookData, // from the backend SDK userWallet: address, }); ``` 5. Buy coin transaction with TrustedSigner ```ts await flaunchWrite.buyCoin({ coinAddress: coin, slippagePercent: 5, swapType: "EXACT_IN", referrer: referrer, // when trusted signer is currently enabled: hookData, // from the backend SDK }); ``` ### Groups The technical side of Groups is handled by the StakingManager. It allows the creator to deposit their flaunch memestream into the manager, and then a defined ERC20 token can be staked by the user to earn their share of the ETH rewards from the memestream. 1. Deploy your instance of the staking manager ```ts import { Permissions } from "@flaunch/sdk"; const stakingManagerInstance = await flaunchWrite.deployStakingManager({ managerOwner: ..., stakingToken: ..., // The ERC20 token to stake minEscrowDuration: ..., // The minimum duration (in seconds) that the creator's memestream NFT would be locked for minStakeDuration: ..., // The minimum duration (in seconds) that the user's tokens would be locked for creatorSharePercent: ..., // The % share that a creator will earn from their token ownerSharePercent: ..., // The % share that the manager owner will earn from their token // The Permissions can be OPEN, CLOSED, or WHITELISTED // OPEN = anyone can stake // CLOSED = no one except the managerOwner can stake // WHITELISTED = only whitelisted addresses can stake permissions: Permissions.OPEN, }); ``` 2. Setting permissions after a Group is deployed (can only be called by the manager owner) ```ts await flaunchWrite.treasuryManagerSetPermissions( treasuryManagerAddress: stakingManagerInstance, permissions: Permissions.CLOSED ); ``` 3. Flaunch a new coin into your Group 3.1. Flaunching into your staking manager instance ```ts const hash = await flaunchWrite.flaunchIPFS({ name: "Test", ... treasuryManagerParams: { manager: stakingManagerInstance } }); ``` 3.2. Deploying a new staking manager instance, and flaunching a new coin into it in a single transaction ```ts import { StakingManagerAddress } from "@flaunch/sdk"; const hash = await flaunchWrite.flaunchIPFS({ name: "Test", ... treasuryManagerParams: { manager: StakingManagerAddress[chain.id], permissions: Permissions.CLOSED } }); ``` Note: the `treasuryManagerParams.permissions` value is ignored if the `treasuryManagerParams.manager` is your manager instance instead. 4. Add an already flaunched coin to a group ```ts import { FlaunchVersion } from "@flaunch/sdk"; // first approve then deposit const tokenId = 123; const isApproved = await flaunchRead.isFlaunchTokenApprovedForAll( FlaunchVersion.V1_1_1, owner, treasuryManagerAddress ); if (!isApproved) { await flaunchWrite.setFlaunchTokenApprovalForAll( FlaunchVersion.V1_1_1, treasuryManagerAddress, true ); } await flaunchWrite.addToTreasuryManager( treasuryManagerAddress, FlaunchVersion.V1_1_1, tokenId ); ``` ### Importing External Coins into Flaunch You can import external ERC20 coins launched on other platforms like Zora, Virtuals, etc. into Flaunch to utilize the power of our Uniswap V4 hooks! 1.1. Import with coin's current price ```ts await flaunchWrite.importMemecoin({ coinAddress: "0x...", // ERC20 token contract address creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) initialPriceUSD: 1, // Starting price in USD }); ``` 1.2. Import with coin's current market cap. For memecoins, market caps are more human readable so you can pass it as follows ```ts await flaunchWrite.importMemecoin({ coinAddress: "0x...", // ERC20 token contract address creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) initialMarketCapUSD: 10_000, // Starting market cap in USD }); ``` **Note:** The Flaunch Version for imported coins is: `FlaunchVersion.ANY` where `import {FlaunchVersion} from "@flaunch/sdk"` **⚠️ Note:** The term "MarketCap" used throughout simply means `current coin price * ERC20.totalSupply()`. Some coins might show it as FDV, make sure to verify so that the Pool is initialized at the right price, and the liquidity gets provided at the expected range. 1.3. Verify if a memecoin is imported into Flaunch ```ts const isImported = await flaunchRead.isMemecoinImported(coinAddress); ``` ### Adding Liquidity to Imported (or flaunch) coins When an external coin is imported into Flaunch's Uniswap V4 hooks, it has no liquidity in the pool. We can add liquidity by using the functions below. Note: for existing flaunch coins you can pass `version` param as `FlaunchVersion.V1_2`, if left blank then the SDK can determine it automatically, defaulting to `FlaunchVersion.ANY` for external coins 1. Read call to calculate the Coin & ETH amounts required for providing liquidity, based on the liquidity range specified. The return values are useful for displaying on the UI, before sending the liquidity transaction. 1.1. Full Range liquidity ```ts const result = await flaunchRead.calculateAddLiquidityAmounts({ coinAddress: "0x...", // Token contract address // version = FlaunchVersion.ANY for imported coins as they use our {AnyPositionManager} version: FlaunchVersion.ANY, // optional (auto determines Flaunch version if not provided, else defaults to ANY if not found) liquidityMode: LiquidityMode.FULL_RANGE, coinOrEthInputAmount: parseEther("1"), // Input amount in wei inputToken: "coin", // "coin" or "eth" - which token amount is specified minMarketCap: "0", // not needed for FULL_RANGE maxMarketCap: "0", // not needed for FULL_RANGE }); // Returns: { coinAmount, ethAmount, tickLower, tickUpper, currentTick } ``` 1.2. Concentrated Range liquidity 1.2.1. With Market Cap inputs ```ts const result = await flaunchRead.calculateAddLiquidityAmounts({ coinAddress: "0x...", // Token contract address version: FlaunchVersion.ANY, liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), // Input amount in wei inputToken: "coin", // "coin" or "eth" - which token amount is specified minMarketCap: "1000000", // $1M maxMarketCap: "5000000", // $5M }); // Returns: { coinAmount, ethAmount, tickLower, tickUpper, currentTick } ``` 1.2.2. With Coin Price inputs ```ts const result = await flaunchRead.calculateAddLiquidityAmounts({ coinAddress: "0x...", // Token contract address version: FlaunchVersion.ANY, liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), // Input amount in wei inputToken: "coin", // "coin" or "eth" - which token amount is specified minPriceUSD: "1", maxPriceUSD: "5", }); // Returns: { coinAmount, ethAmount, tickLower, tickUpper, currentTick } ``` 1.2.3. `checkSingleSidedAddLiquidity`: helper check function to detect which token input to hide during single-sided concentrated liquidity addition. Based on the specified concentrated range, we can determine which token (memecoin or ETH) to hide on the UI, as the liquidity would be single-sided ```ts const { isSingleSided, shouldHideCoinInput, shouldHideETHInput } = await flaunchRead.checkSingleSidedAddLiquidity({ coinAddress, liquidityMode: LiquidityMode.CONCENTRATED, // Option 1: can pass market caps minMarketCap: "1000000", // $1M maxMarketCap: "5000000", // $5M currentMarketCap: "1000000" // (optional) can be queried from the pool if not specified // OR Option 2: or can pass price minPriceUSD: "1", maxPriceUSD: "5", currentPriceUSD: 0.001, // (optional) can be queried from the pool if not specified }); ``` 2. Add Liquidity Transactions Adding liquidity is a multi-step process, but we have abstracted away all the complexities. With wallets supporting ERCs 5792 & 7702, users would only get one wallet popup to confirm the transactions. See code snippet below at 2.3. for the same 2.1. With Market Cap inputs ```ts const addLiqCalls = await flaunchWrite.getAddLiquidityCalls({ coinAddress: "0x...", // Same parameters as calculateAddLiquidityAmounts version: FlaunchVersion.ANY, // optional liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), inputToken: "coin", minMarketCap: "1000000", // $1M maxMarketCap: "5000000", // $5M }); // Returns: CallWithDescription[] - Array of transaction calls with descriptions ``` 2.2. With Coin Price inputs ```ts const addLiqCalls = await flaunchWrite.getAddLiquidityCalls({ coinAddress: "0x...", // Same parameters as calculateAddLiquidityAmounts version: FlaunchVersion.ANY, // optional liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), inputToken: "coin", minPriceUSD: "1", maxPriceUSD: "5", }); ``` 2.3. Sending the transactions as a single batch to the Wallet via ERC-5792 and wagmi **Note:** if the user's connected wallet doesn't support ERC-5792 (can be checked via `useCapabilities`), then you can simply loop through the `addLiqCalls` array and use `useSendTransaction` to send the transactions individually. The calls have a description to show on the UI if they'd be sent sequentially. ```ts import { useSendCalls } from "wagmi"; const { sendCalls } = useSendCalls(); const calls = addLiqCalls.map((call) => ({ to: call.to as `0x${string}`, value: call.value, data: call.data as `0x${string}`, })); await sendCalls({ calls }); ``` 3. **Single-Sided Coin Liquidity (Current Price to Infinity)** You can easily provide single-sided coin liquidity from the current price to infinity. ```ts const singleSidedCalls = await flaunchWrite.getSingleSidedCoinAddLiquidityCalls( { coinAddress: "0x...", // Token contract address coinAmount: parseEther("1000000"), // Amount of coins to provide as liquidity version: FlaunchVersion.V1_2, // optional (auto-determines if not provided) } ); ``` ### Import AND Add Liquidity calls in a single batch 1. This allows an external coin to be live on flaunch, and be tradeable instantly with the liquidity being provided in the same transaction batch. 💡 Tip: To mimic the traditional flaunch liquidity curve, the coin creator can provide liquidity from current market cap to a higher market cap. This makes the liquidity addition to be single-sided, entirely being in their coin with no ETH required. As people buy into the pool and the price goes up, the liquidity position accumulates ETH while selling the coins from the position. Note: As a flaunch liquidity provider, you won't accumulate the trading fees. The fees are only accumulated to the Creator or split based on the TreasuryManager used. 1.1. With Market Cap inputs ```ts const importAndAddLiqCalls = await flaunchWrite.getImportAndAddLiquidityCalls({ coinAddress: "0x...", // ERC20 token contract address creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) initialMarketCapUSD: 10_000, // Starting market cap in USD liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), // Input amount in wei inputToken: "coin", // "coin" or "eth" - which token amount is specified minMarketCap: "1000000", // $1M maxMarketCap: "5000000", // $5M }); // Returns: CallWithDescription[] - Array of transaction calls with descriptions // === send these calls to user's wallet as a batch === import { useSendCalls } from "wagmi"; const { sendCalls } = useSendCalls(); const calls = importAndAddLiqCalls.map((call) => ({ to: call.to as `0x${string}`, value: call.value, data: call.data as `0x${string}`, })); await sendCalls({ calls }); ``` 1.2. With Coin Price inputs ```ts const importAndAddLiqCalls = await flaunchWrite.getImportAndAddLiquidityCalls({ coinAddress: "0x...", // ERC20 token contract address creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) initialPriceUSD: 1, // Starting price in USD liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), // Input amount in wei inputToken: "coin", // "coin" or "eth" - which token amount is specified minPriceUSD: "1", maxPriceUSD: "5", }); ``` ### Import AND Add Single-Sided Coin Liquidity calls in a single batch This allows importing an external coin and providing single-sided coin liquidity (from current price to infinity) in one transaction batch. This is perfect for coin creators who want their imported tokens to be instantly tradeable with single-sided liquidity that doesn't require ETH. 💡 **Key Benefits:** - No ETH required for liquidity provision - Liquidity is provided from current price to infinity - As price increases, the position automatically sells coins and accumulates ETH - Instant tradeability after import 2.1. With Market Cap inputs ```ts const importAndSingleSidedCalls = await flaunchWrite.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", // ERC20 token contract address verifier: Verifier.CLANKER, // Optional verifier creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) coinAmount: parseEther("1000000"), // Amount of coins to provide as liquidity initialMarketCapUSD: 10_000, // Starting market cap in USD }); // Returns: CallWithDescription[] - Array of transaction calls with descriptions // === send these calls to user's wallet as a batch === import { useSendCalls } from "wagmi"; const { sendCalls } = useSendCalls(); const calls = importAndSingleSidedCalls.map((call) => ({ to: call.to as `0x${string}`, value: call.value, data: call.data as `0x${string}`, })); await sendCalls({ calls }); ``` 2.2. With Coin Price inputs ```ts const importAndSingleSidedCalls = await flaunchWrite.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", // ERC20 token contract address verifier: Verifier.CLANKER, // Optional verifier creatorFeeAllocationPercent: 100, // Fee allocation to creator (0-100%) coinAmount: parseEther("1000000"), // Amount of coins to provide as liquidity initialPriceUSD: 0.001, // Starting price in USD }); ``` ### `createFlaunchCalldata`: alternative to `createFlaunch` that returns the tx call object with to, data, and value instead of directly broadcasting the tx from walletClient To support custom signers that might not be compatible with our `walletClient` approach, or to enable account abstraction and batching on your wallet signer's end we have `createFlaunchCalldata` that returns the tx object, leaving the tx broadcasting to be flexible & handled on your end. All the write calls must go via `parseCall` as shown below, read calls are made normally as before ```ts import { createFlaunchCalldata, parseCall } from "@flaunch/sdk"; // 1. Can create read-only SDK (similar to createFlaunch without walletClient) const flaunchRead = createFlaunchCalldata({ publicClient, }); // 2. Create read-write SDK for call generation const flaunchCalldata = createFlaunchCalldata({ publicClient, walletAddress, }); const call = await parseCall(() => flaunchCalldata.setERC20AllowanceToPermit2(usdcAddress, maxUint256) ); console.log("Call:", { to: call.to, value: call.value.toString(), data: call.data, }); ``` ### All SDK functions For a list of all the functions in the SDK, refer to: [FlaunchSDK.ts](./src/sdk/FlaunchSDK.ts) ### React Hooks The package also has hooks to listen for new Flaunches and new Coin Swaps. Refer to: [hooks](./src/hooks/FlaunchPositionManagerHooks.ts) ```tsx import { usePoolCreatedEvents, usePoolSwapEvents } from "@flaunch/sdk/hooks"; const { logs: poolCreatedLogs } = usePoolCreatedEvents(flaunchRead); const { logs: poolSwapLogs } = usePoolSwapEvents(flaunchRead, coinAddress); /** * The `poolSwapLogs` calculates & returns the net swapped amount: * * type BuySwapLog = { * ...eventLog, * timestamp: number; * type: "BUY"; * delta: { * coinsBought: bigint; * flETHSold: bigint; * fees: { * isInFLETH: boolean; * amount: bigint; * }; * }; * }; * * type SellSwapLog = { * ...eventLog, * timestamp: number; * type: "SELL"; * delta: { * coinsSold: bigint; * flETHBought: bigint; * fees: { * isInFLETH: boolean; * amount: bigint; * }; * }; * }; */ ``` ## Flaunch Reference For detailed protocol documentation, visit our [Docs](https://docs.flaunch.gg/). # API Documentation @flaunch/sdk - v0.9.15 / Exports / FlaunchBackend # Class: FlaunchBackend Backend class for interacting with Flaunch protocol for generating hookData with signature for swaps. Doesn't require any publicClient or walletClient to be initialized. ## Table of contents ### Constructors - constructor ### Properties - chainId - signerPrivateKey ### Methods - generateHookDataWithSignature - getPositionManagerAddress ## Constructors ### constructor • **new FlaunchBackend**(`signerPrivateKey`, `chainId`): `FlaunchBackend` Parameters | Name | Type | | :------ | :------ | | `signerPrivateKey` | \`0x$\{string}\` | | `chainId` | `number` | Returns `FlaunchBackend` ## Properties ### chainId • `Readonly` **chainId**: `number` ___ ### signerPrivateKey • **signerPrivateKey**: \`0x$\{string}\` ## Methods ### generateHookDataWithSignature ▸ **generateHookDataWithSignature**(`«destructured»`): `Promise`\<\{ `deadline`: `number` ; `hookData`: \`0x$\{string}\` ; `signature`: \`0x$\{string}\` }\> Generates the hookData for swaps when TrustedSigner is enabled for a coin during fair launch Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `deadlineFromNowInSeconds` | `number` | | › `referrer?` | \`0x$\{string}\` | | › `userWallet` | \`0x$\{string}\` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<\{ `deadline`: `number` ; `hookData`: \`0x$\{string}\` ; `signature`: \`0x$\{string}\` }\> The hookData, deadline and signature ___ ### getPositionManagerAddress ▸ **getPositionManagerAddress**(`version?`): \`0x$\{string}\` Gets the position manager address for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version?` | `FlaunchVersion` | The version to get the position manager address for, defaults to the latest version if undefined | Returns \`0x$\{string}\` --- @flaunch/sdk - v0.9.15 / Exports / ReadFlaunchSDK # Class: ReadFlaunchSDK Base class for interacting with Flaunch protocol in read-only mode ## Hierarchy - **`ReadFlaunchSDK`** ↳ `ReadWriteFlaunchSDK` ## Table of contents ### Constructors - constructor ### Properties - TICK\_SPACING - chainId - drift - publicClient - readAnyBidWall - readAnyFlaunch - readAnyPositionManager - readBidWall - readBidWallV1\_1 - readFairLaunch - readFairLaunchV1\_1 - readFeeEscrow - readFlaunch - readFlaunchV1\_1 - readFlaunchV1\_2 - readFlaunchZap - readPermit2 - readPoolManager - readPositionManager - readPositionManagerV1\_1 - readPositionManagerV1\_2 - readQuoter - readReferralEscrow - readStateView - readTokenImporter - resolveIPFS ### Methods - bidWallPosition - calculateAddLiquidityAmounts - calculateAddLiquidityTicks - calculateCurrentTickFromMarketCap - checkSingleSidedAddLiquidity - coinMarketCapInUSD - coinPriceInETH - coinPriceInUSD - convertPriceToTick - createPoolKey - creatorRevenue - currentTick - determineCoinVersion - ethRequiredToFlaunch - fairLaunchCoinOnlyPosition - fairLaunchDuration - fairLaunchETHOnlyPosition - fairLaunchInfo - flETHIsCurrencyZero - getBidWall - getBidWallAddress - getBuyQuoteExactInput - getBuyQuoteExactOutput - getCoinInfo - getCoinMetadata - getCoinMetadataFromTokenId - getCoinMetadataFromTokenIds - getCoinVersion - getETHUSDCPrice - getFairLaunch - getFairLaunchAddress - getFlaunch - getFlaunchAddress - getFlaunchTokenIdForMemecoin - getFlaunchingFee - getMarketContext - getPoolCreatedFromTx - getPositionManager - getPositionManagerAddress - getSellQuoteExactInput - initialSqrtPriceX96 - initialTick - isFairLaunchActive - isFlaunchTokenApprovedForAll - isMemecoinImported - isValidCoin - marketCapToTokenPriceEth - parseSwapTx - pollPoolCreatedNow - pollPoolSwapNow - poolId - positionInfo - referralBalance - revenueManagerAllTokensByCreator - revenueManagerAllTokensInManager - revenueManagerBalance - revenueManagerProtocolBalance - revenueManagerTokensCount - setIPFSResolver - tokenImporterVerifyMemecoin - treasuryManagerInfo - trustedPoolKeySignerStatus - watchPoolCreated - watchPoolSwap ## Constructors ### constructor • **new ReadFlaunchSDK**(`chainId`, `drift?`, `publicClient?`): `ReadFlaunchSDK` Parameters | Name | Type | | :------ | :------ | | `chainId` | `number` | | `drift` | `Drift` | | `publicClient?` | `Object` | Returns `ReadFlaunchSDK` ## Properties ### TICK\_SPACING • `Readonly` **TICK\_SPACING**: ``60`` ___ ### chainId • `Readonly` **chainId**: `number` ___ ### drift • `Readonly` **drift**: `Drift` ___ ### publicClient • `Readonly` **publicClient**: `undefined` \| {} ___ ### readAnyBidWall • `Readonly` **readAnyBidWall**: `AnyBidWall` ___ ### readAnyFlaunch • `Readonly` **readAnyFlaunch**: `ReadAnyFlaunch` ___ ### readAnyPositionManager • `Readonly` **readAnyPositionManager**: `ReadAnyPositionManager` ___ ### readBidWall • `Readonly` **readBidWall**: `ReadBidWall` ___ ### readBidWallV1\_1 • `Readonly` **readBidWallV1\_1**: `ReadBidWallV1_1` ___ ### readFairLaunch • `Readonly` **readFairLaunch**: `ReadFairLaunch` ___ ### readFairLaunchV1\_1 • `Readonly` **readFairLaunchV1\_1**: `ReadFairLaunchV1_1` ___ ### readFeeEscrow • `Readonly` **readFeeEscrow**: `ReadFeeEscrow` ___ ### readFlaunch • `Readonly` **readFlaunch**: `ReadFlaunch` ___ ### readFlaunchV1\_1 • `Readonly` **readFlaunchV1\_1**: `ReadFlaunchV1_1` ___ ### readFlaunchV1\_2 • `Readonly` **readFlaunchV1\_2**: `ReadFlaunchV1_2` ___ ### readFlaunchZap • `Readonly` **readFlaunchZap**: `ReadFlaunchZap` ___ ### readPermit2 • `Readonly` **readPermit2**: `ReadPermit2` ___ ### readPoolManager • `Readonly` **readPoolManager**: `ReadPoolManager` ___ ### readPositionManager • `Readonly` **readPositionManager**: `ReadFlaunchPositionManager` ___ ### readPositionManagerV1\_1 • `Readonly` **readPositionManagerV1\_1**: `ReadFlaunchPositionManagerV1_1` ___ ### readPositionManagerV1\_2 • `Readonly` **readPositionManagerV1\_2**: `ReadFlaunchPositionManagerV1_2` ___ ### readQuoter • `Readonly` **readQuoter**: `ReadQuoter` ___ ### readReferralEscrow • `Readonly` **readReferralEscrow**: `ReadReferralEscrow` ___ ### readStateView • `Readonly` **readStateView**: `ReadStateView` ___ ### readTokenImporter • `Readonly` **readTokenImporter**: `ReadTokenImporter` ___ ### resolveIPFS • **resolveIPFS**: (`value`: `string`) => `string` Type declaration ▸ (`value`): `string` #Parameters | Name | Type | | :------ | :------ | | `value` | `string` | #Returns `string` ## Methods ### bidWallPosition ▸ **bidWallPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `pendingEth`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the bid wall position for a coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `pendingEth`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, pendingEth: bigint, tickLower: number, tickUpper: number}> - Bid wall position details ___ ### calculateAddLiquidityAmounts ▸ **calculateAddLiquidityAmounts**(`params`): `Promise`\<\{ `coinAmount`: `bigint` ; `currentTick`: `number` ; `ethAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Parameters | Name | Type | | :------ | :------ | | `params` | `CalculateAddLiquidityAmountsParams` | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `currentTick`: `number` ; `ethAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> ___ ### calculateAddLiquidityTicks ▸ **calculateAddLiquidityTicks**(`«destructured»`): `Promise`\<\{ `coinDecimals`: `number` ; `coinTotalSupply`: `bigint` ; `currentTick?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `currentMarketCap?` | `string` | | › `liquidityMode` | `LiquidityMode` | | › `maxMarketCap` | `string` | | › `minMarketCap` | `string` | Returns `Promise`\<\{ `coinDecimals`: `number` ; `coinTotalSupply`: `bigint` ; `currentTick?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` }\> ___ ### calculateCurrentTickFromMarketCap ▸ **calculateCurrentTickFromMarketCap**(`currentMarketCap`, `formattedTotalSupplyInDecimals`, `marketContext`): `undefined` \| `number` Calculates current tick from market cap if provided Parameters | Name | Type | | :------ | :------ | | `currentMarketCap` | `undefined` \| `string` | | `formattedTotalSupplyInDecimals` | `number` | | `marketContext` | `Object` | | `marketContext.decimals0` | `number` | | `marketContext.decimals1` | `number` | | `marketContext.ethUsdPrice` | `number` | | `marketContext.isFlethZero` | `boolean` | Returns `undefined` \| `number` ___ ### checkSingleSidedAddLiquidity ▸ **checkSingleSidedAddLiquidity**(`params`): `Promise`\<`SingleSidedLiquidityInfo`\> Parameters | Name | Type | | :------ | :------ | | `params` | `CheckSingleSidedAddLiquidityParams` | Returns `Promise`\<`SingleSidedLiquidityInfo`\> ___ ### coinMarketCapInUSD ▸ **coinMarketCapInUSD**(`«destructured»`): `Promise`\<`string`\> Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `drift?` | `Drift` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`string`\> ___ ### coinPriceInETH ▸ **coinPriceInETH**(`coinAddress`, `version?`): `Promise`\<`string`\> Calculates the coin price in ETH based on the current tick Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`string`\> Promise - The price of the coin in ETH with 18 decimals precision ___ ### coinPriceInUSD ▸ **coinPriceInUSD**(`«destructured»`): `Promise`\<`string`\> Calculates the coin price in USD based on the current ETH/USDC price Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `drift?` | `Drift` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`string`\> Promise - The price of the coin in USD with 18 decimal precision ___ ### convertPriceToTick ▸ **convertPriceToTick**(`priceEth`, `isFlethZero`, `decimals0`, `decimals1`): `number` Converts token price in ETH to tick Parameters | Name | Type | | :------ | :------ | | `priceEth` | `number` | | `isFlethZero` | `boolean` | | `decimals0` | `number` | | `decimals1` | `number` | Returns `number` ___ ### createPoolKey ▸ **createPoolKey**(`coinAddress`, `version`): `Object` Creates a pool key for the given coin and version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The coin address | | `version` | `FlaunchVersion` | The version to use for position manager | Returns `Object` The ordered pool key | Name | Type | | :------ | :------ | | `currency0` | \`0x$\{string}\` | | `currency1` | \`0x$\{string}\` | | `fee` | `number` | | `hooks` | \`0x$\{string}\` | | `tickSpacing` | `number` | ___ ### creatorRevenue ▸ **creatorRevenue**(`creator`, `isV1?`): `Promise`\<`bigint`\> Gets the ETH balance for the creator to claim Parameters | Name | Type | Description | | :------ | :------ | :------ | | `creator` | \`0x$\{string}\` | The address of the creator to check | | `isV1?` | `boolean` | Optional boolean to check the balance for V1. V1.1 & AnyPositionManager use the same FeeEscrow contract | Returns `Promise`\<`bigint`\> The balance of the creator ___ ### currentTick ▸ **currentTick**(`coinAddress`, `version?`): `Promise`\<`number`\> Gets the current tick for a given coin's pool Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number`\> Promise - The current tick of the pool ___ ### determineCoinVersion ▸ **determineCoinVersion**(`coinAddress`, `version?`): `Promise`\<`FlaunchVersion`\> Determines the version for a coin, using provided version or fetching it Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The coin address | | `version?` | `FlaunchVersion` | Optional version, if not provided will be fetched | Returns `Promise`\<`FlaunchVersion`\> The determined version ___ ### ethRequiredToFlaunch ▸ **ethRequiredToFlaunch**(`params`): `Promise`\<`bigint`\> Calculates the ETH required to flaunch a token, takes into account the ETH for premine and the flaunching fee Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | - | | `params.initialMarketCapUSD` | `number` | The initial market cap in USD | | `params.premineAmount` | `bigint` | The amount of coins to be premined | | `params.slippagePercent?` | `number` | The slippage percent | Returns `Promise`\<`bigint`\> Promise - The ETH required to flaunch ___ ### fairLaunchCoinOnlyPosition ▸ **fairLaunchCoinOnlyPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the coin-only position in a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details ___ ### fairLaunchDuration ▸ **fairLaunchDuration**(`coinAddress`, `version?`): `Promise`\<`number` \| `bigint`\> Gets the duration of a fair launch for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number` \| `bigint`\> Promise - The duration in seconds (30 minutes for V1, variable for V1.1) ___ ### fairLaunchETHOnlyPosition ▸ **fairLaunchETHOnlyPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the ETH-only position in a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details ___ ### fairLaunchInfo ▸ **fairLaunchInfo**(`coinAddress`, `version?`): `Promise`\<\{ `closed`: `boolean` ; `endsAt`: `bigint` ; `initialTick`: `number` ; `revenue`: `bigint` ; `startsAt`: `bigint` ; `supply`: `bigint` }\> Gets information about a fair launch for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `closed`: `boolean` ; `endsAt`: `bigint` ; `initialTick`: `number` ; `revenue`: `bigint` ; `startsAt`: `bigint` ; `supply`: `bigint` }\> Fair launch information from the appropriate contract version ___ ### flETHIsCurrencyZero ▸ **flETHIsCurrencyZero**(`coinAddress`): `boolean` Determines if flETH is currency0 in the pool Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `boolean` boolean - True if flETH is currency0, false otherwise ___ ### getBidWall ▸ **getBidWall**(`version`): `ReadBidWall` \| `AnyBidWall` \| `ReadBidWallV1_1` Gets the bid wall instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the bid wall instance for | Returns `ReadBidWall` \| `AnyBidWall` \| `ReadBidWallV1_1` ___ ### getBidWallAddress ▸ **getBidWallAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` ___ ### getBuyQuoteExactInput ▸ **getBuyQuoteExactInput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for buying tokens with an exact amount of ETH or inputToken Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountIn` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `hookData?` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `userWallet?` | \`0x$\{string}\` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The expected amount of coins to receive ___ ### getBuyQuoteExactOutput ▸ **getBuyQuoteExactOutput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for buying an exact amount of tokens with ETH or inputToken Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountOut` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `hookData?` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `userWallet?` | \`0x$\{string}\` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The required amount of ETH or inputToken to spend ___ ### getCoinInfo ▸ **getCoinInfo**(`coinAddress`): `Promise`\<\{ `decimals`: `number` ; `formattedTotalSupplyInDecimals`: `number` ; `totalSupply`: `bigint` }\> Gets basic coin information (total supply and decimals) Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | Returns `Promise`\<\{ `decimals`: `number` ; `formattedTotalSupplyInDecimals`: `number` ; `totalSupply`: `bigint` }\> ___ ### getCoinMetadata ▸ **getCoinMetadata**(`coinAddress`): `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Retrieves metadata for a given Flaunch coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Promise - The coin's metadata including name, symbol, description, and social links ___ ### getCoinMetadataFromTokenId ▸ **getCoinMetadataFromTokenId**(`flaunch`, `tokenId`): `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Retrieves metadata for a given Flaunch coin using its token ID & Flaunch contract address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `flaunch` | \`0x$\{string}\` | The address of the Flaunch contract | | `tokenId` | `bigint` | The token ID of the coin | Returns `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> The coin's metadata including name, symbol, description, and social links ___ ### getCoinMetadataFromTokenIds ▸ **getCoinMetadataFromTokenIds**(`params`, `batchSize?`, `batchDelay?`): `Promise`\<\{ `coinAddress`: \`0x$\{string}\` ; `collaborators`: `any` ; `description`: `any` ; `discordUrl`: `any` ; `external_link`: `any` ; `image`: `string` ; `name`: `string` ; `symbol`: `string` ; `telegramUrl`: `any` ; `twitterUrl`: `any` }[]\> Retrieves metadata for multiple Flaunch coins using their token IDs & Flaunch contract addresses Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | \{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[] | `undefined` | An array of objects containing flaunch contract address and token ID | | `batchSize` | `number` | `9` | Optional, the number of ipfs requests to process in each batch | | `batchDelay` | `number` | `500` | Optional, the delay in milliseconds between batches | Returns `Promise`\<\{ `coinAddress`: \`0x$\{string}\` ; `collaborators`: `any` ; `description`: `any` ; `discordUrl`: `any` ; `external_link`: `any` ; `image`: `string` ; `name`: `string` ; `symbol`: `string` ; `telegramUrl`: `any` ; `twitterUrl`: `any` }[]\> An array of objects containing coin address, name, symbol, description, and social links ___ ### getCoinVersion ▸ **getCoinVersion**(`coinAddress`): `Promise`\<`FlaunchVersion`\> Determines the version of a Flaunch coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`FlaunchVersion`\> Promise - The version of the coin ___ ### getETHUSDCPrice ▸ **getETHUSDCPrice**(`drift?`): `Promise`\<`number`\> Gets the current ETH/USDC price Parameters | Name | Type | Description | | :------ | :------ | :------ | | `drift?` | `Drift` | Optional drift instance to get price from Base Mainnet | Returns `Promise`\<`number`\> Promise - The current ETH/USDC price ___ ### getFairLaunch ▸ **getFairLaunch**(`version`): `ReadFairLaunch` \| `ReadFairLaunchV1_1` Gets the fair launch instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the fair launch instance for | Returns `ReadFairLaunch` \| `ReadFairLaunchV1_1` ___ ### getFairLaunchAddress ▸ **getFairLaunchAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` ___ ### getFlaunch ▸ **getFlaunch**(`version`): `ReadFlaunch` \| `ReadAnyFlaunch` \| `ReadFlaunchV1_1` \| `ReadFlaunchV1_2` Gets the flaunch contract instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the flaunch contract instance for | Returns `ReadFlaunch` \| `ReadAnyFlaunch` \| `ReadFlaunchV1_1` \| `ReadFlaunchV1_2` ___ ### getFlaunchAddress ▸ **getFlaunchAddress**(`version`): \`0x$\{string}\` Gets the flaunch contract address for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the flaunch contract address for | Returns \`0x$\{string}\` ___ ### getFlaunchTokenIdForMemecoin ▸ **getFlaunchTokenIdForMemecoin**(`coinAddress`): `Promise`\<\{ `flaunchAddress`: \`0x$\{string}\` ; `tokenId`: `bigint` }\> Gets the flaunch contract address and token ID for a memecoin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the memecoin | Returns `Promise`\<\{ `flaunchAddress`: \`0x$\{string}\` ; `tokenId`: `bigint` }\> Promise<{ flaunchAddress: Address; tokenId: bigint }> - The flaunch contract address and token ID ___ ### getFlaunchingFee ▸ **getFlaunchingFee**(`params`): `Promise`\<`bigint`\> Gets the flaunching fee for a given initial price and slippage percent Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | - | | `params.initialMarketCapUSD` | `number` | The initial market cap in USD | | `params.sender` | \`0x$\{string}\` | The address of the sender | | `params.slippagePercent?` | `number` | The slippage percent | Returns `Promise`\<`bigint`\> Promise - The flaunching fee ___ ### getMarketContext ▸ **getMarketContext**(`coinAddress`, `coinDecimals`): `Promise`\<\{ `decimals0`: `number` ; `decimals1`: `number` ; `ethUsdPrice`: `number` ; `isFlethZero`: `boolean` }\> Gets market context information needed for tick calculations Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | | `coinDecimals` | `number` | Returns `Promise`\<\{ `decimals0`: `number` ; `decimals1`: `number` ; `ethUsdPrice`: `number` ; `isFlethZero`: `boolean` }\> ___ ### getPoolCreatedFromTx ▸ **getPoolCreatedFromTx**(`txHash`): `Promise`\<``null`` \| `PoolCreatedEventData`\> Parses a transaction to extract PoolCreated event data Parameters | Name | Type | Description | | :------ | :------ | :------ | | `txHash` | \`0x$\{string}\` | The transaction hash to parse | Returns `Promise`\<``null`` \| `PoolCreatedEventData`\> PoolCreated event parameters or null if not found ___ ### getPositionManager ▸ **getPositionManager**(`version`): `ReadFlaunchPositionManager` \| `ReadFlaunchPositionManagerV1_1` \| `ReadFlaunchPositionManagerV1_2` \| `ReadAnyPositionManager` Gets the position manager instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the position manager instance for | Returns `ReadFlaunchPositionManager` \| `ReadFlaunchPositionManagerV1_1` \| `ReadFlaunchPositionManagerV1_2` \| `ReadAnyPositionManager` ___ ### getPositionManagerAddress ▸ **getPositionManagerAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` ___ ### getSellQuoteExactInput ▸ **getSellQuoteExactInput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for selling an exact amount of tokens for ETH Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountIn` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The expected amount of ETH to receive ___ ### initialSqrtPriceX96 ▸ **initialSqrtPriceX96**(`params`): `Promise`\<`bigint`\> Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.coinAddress` | \`0x$\{string}\` | | `params.initialMarketCapUSD` | `number` | Returns `Promise`\<`bigint`\> ___ ### initialTick ▸ **initialTick**(`coinAddress`, `version?`): `Promise`\<`number`\> Gets the initial tick for a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number`\> Promise - The initial tick value ___ ### isFairLaunchActive ▸ **isFairLaunchActive**(`coinAddress`, `version?`): `Promise`\<`boolean`\> Checks if a fair launch is currently active for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`boolean`\> Promise - True if fair launch is active, false otherwise ___ ### isFlaunchTokenApprovedForAll ▸ **isFlaunchTokenApprovedForAll**(`version`, `owner`, `operator`): `Promise`\<`boolean`\> Checks if an operator is approved for all flaunch tokens of an owner Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The flaunch version to determine the correct contract address | | `owner` | \`0x$\{string}\` | The owner address to check | | `operator` | \`0x$\{string}\` | The operator address to check | Returns `Promise`\<`boolean`\> Promise - True if operator is approved for all tokens ___ ### isMemecoinImported ▸ **isMemecoinImported**(`memecoin`): `Promise`\<`boolean`\> Checks if an external memecoin has been imported to Flaunch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `memecoin` | \`0x$\{string}\` | The address of the memecoin to check | Returns `Promise`\<`boolean`\> Promise - True if the memecoin has been imported ___ ### isValidCoin ▸ **isValidCoin**(`coinAddress`): `Promise`\<`boolean`\> Checks if a given coin address is a valid Flaunch coin (supports all versions) Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`boolean`\> Promise - True if the coin is valid, false otherwise ___ ### marketCapToTokenPriceEth ▸ **marketCapToTokenPriceEth**(`marketCapUsd`, `formattedTotalSupplyInDecimals`, `ethUsdPrice`): `number` Converts market cap in USD to token price in ETH Parameters | Name | Type | | :------ | :------ | | `marketCapUsd` | `number` | | `formattedTotalSupplyInDecimals` | `number` | | `ethUsdPrice` | `number` | Returns `number` ___ ### parseSwapTx ▸ **parseSwapTx**\<`T`\>(`params`): `Promise`\<`T` extends `boolean` ? `undefined` \| `GenericBuySwapLog` \| `GenericSellSwapLog` : `undefined` \| `GenericBaseSwapLog`\> Parses a transaction hash to extract PoolSwap events and return parsed swap data Type parameters | Name | Type | | :------ | :------ | | `T` | extends `undefined` \| `boolean` = `undefined` | Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Object containing parsing parameters | | `params.flETHIsCurrencyZero?` | `T` | Whether flETH is currency 0 in the pool (optional) | | `params.txHash` | \`0x$\{string}\` | The transaction hash to parse | | `params.version` | `FlaunchVersion` | The Flaunch version to use for parsing | Returns `Promise`\<`T` extends `boolean` ? `undefined` \| `GenericBuySwapLog` \| `GenericSellSwapLog` : `undefined` \| `GenericBaseSwapLog`\> Parsed swap log or undefined if no PoolSwap event found. If flETHIsCurrencyZero is provided, returns typed swap data with BUY/SELL information. If flETHIsCurrencyZero is undefined, returns basic swap log without parsed delta. ___ ### pollPoolCreatedNow ▸ **pollPoolCreatedNow**(`version?`): `undefined` \| `Promise`\<`void`\> Polls for current pool creation events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `undefined` \| `Promise`\<`void`\> Current pool creation events or undefined if polling is not available ___ ### pollPoolSwapNow ▸ **pollPoolSwapNow**(`version?`): `undefined` \| `Promise`\<`void`\> Polls for current pool swap events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `undefined` \| `Promise`\<`void`\> Current pool swap events or undefined if polling is not available ___ ### poolId ▸ **poolId**(`coinAddress`, `version?`): `Promise`\<\`0x$\{string}\`\> Gets the pool ID for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use | Returns `Promise`\<\`0x$\{string}\`\> Promise - The pool ID ___ ### positionInfo ▸ **positionInfo**(`params`): `Promise`\<\{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` } \| \{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` }\> Gets information about a liquidity position Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `PositionInfoParams` | Parameters for querying position info | Returns `Promise`\<\{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` } \| \{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` }\> Position information from the state view contract ___ ### referralBalance ▸ **referralBalance**(`recipient`, `coinAddress`): `Promise`\<`bigint`\> Gets the balance of a recipient for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `recipient` | \`0x$\{string}\` | The address of the recipient to check | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `Promise`\<`bigint`\> Promise - The balance of the recipient ___ ### revenueManagerAllTokensByCreator ▸ **revenueManagerAllTokensByCreator**(`params`): `Promise`\ Gets all tokens created by a specific creator address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for querying tokens by creator | | `params.creator` | \`0x$\{string}\` | The address of the creator to query tokens for | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | | `params.sortByDesc?` | `boolean` | Whether to sort the tokens by descending order | Returns `Promise`\ Promise> - Array of token objects containing flaunch address and token ID ___ ### revenueManagerAllTokensInManager ▸ **revenueManagerAllTokensInManager**(`params`): `Promise`\<\{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[]\> Gets all tokens currently managed by a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for querying tokens in manager | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | | `params.sortByDesc?` | `boolean` | Optional boolean to sort tokens in descending order (default: false) | Returns `Promise`\<\{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[]\> Promise> - Array of token objects containing flaunch address and token ID ___ ### revenueManagerBalance ▸ **revenueManagerBalance**(`params`): `Promise`\<`bigint`\> Gets the claimable balance of ETH for the recipient from a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for checking the balance | | `params.recipient` | \`0x$\{string}\` | The address of the recipient to check | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The claimable balance of ETH ___ ### revenueManagerProtocolBalance ▸ **revenueManagerProtocolBalance**(`revenueManagerAddress`): `Promise`\<`bigint`\> Gets the claimable balance of ETH for the protocol from a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The claimable balance of ETH ___ ### revenueManagerTokensCount ▸ **revenueManagerTokensCount**(`revenueManagerAddress`): `Promise`\<`bigint`\> Gets the total number of tokens managed by a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The total count of tokens ___ ### setIPFSResolver ▸ **setIPFSResolver**(`resolverFn`): `void` Sets a custom IPFS resolver function Parameters | Name | Type | Description | | :------ | :------ | :------ | | `resolverFn` | (`ipfsHash`: `string`) => `string` | Custom function to resolve IPFS URIs | Returns `void` **`Dev`** this is used to resolve IPFS hash to a gateway URL eg: input: Qabc, output: https://ipfs.io/ipfs/Qabc ___ ### tokenImporterVerifyMemecoin ▸ **tokenImporterVerifyMemecoin**(`memecoin`): `Promise`\<\{ `isValid`: `boolean` ; `verifier`: \`0x$\{string}\` }\> Verifies if a memecoin is valid for importing Parameters | Name | Type | Description | | :------ | :------ | :------ | | `memecoin` | \`0x$\{string}\` | The address of the memecoin to import | Returns `Promise`\<\{ `isValid`: `boolean` ; `verifier`: \`0x$\{string}\` }\> Promise<{ isValid: boolean; verifier: Address }> - The result of the verification ___ ### treasuryManagerInfo ▸ **treasuryManagerInfo**(`treasuryManagerAddress`): `Promise`\<\{ `managerOwner`: \`0x$\{string}\` ; `permissions`: \`0x$\{string}\` }\> Gets treasury manager information including owner and permissions Parameters | Name | Type | Description | | :------ | :------ | :------ | | `treasuryManagerAddress` | \`0x$\{string}\` | The address of the treasury manager | Returns `Promise`\<\{ `managerOwner`: \`0x$\{string}\` ; `permissions`: \`0x$\{string}\` }\> Promise<{managerOwner: Address, permissions: Address}> - Treasury manager owner and permissions contract addresses ___ ### trustedPoolKeySignerStatus ▸ **trustedPoolKeySignerStatus**(`coinAddress`, `version?`): `Promise`\<\{ `fairLaunchEndsAt`: `number` ; `fairLaunchStartsAt`: `number` ; `isCurrentlyEnabled`: `boolean` ; `isFairLaunchActive`: `boolean` ; `signer`: \`0x$\{string}\` ; `trustedSignerEnabled`: `boolean` }\> Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | | `version?` | `FlaunchVersion` | Returns `Promise`\<\{ `fairLaunchEndsAt`: `number` ; `fairLaunchStartsAt`: `number` ; `isCurrentlyEnabled`: `boolean` ; `isFairLaunchActive`: `boolean` ; `signer`: \`0x$\{string}\` ; `trustedSignerEnabled`: `boolean` }\> ___ ### watchPoolCreated ▸ **watchPoolCreated**(`params`, `version?`): `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolCreatedNow`: () => `Promise`\<`void`\> = pollEvents }\> Watches for pool creation events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | `WatchPoolCreatedParams` | `undefined` | Parameters for watching pool creation | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolCreatedNow`: () => `Promise`\<`void`\> = pollEvents }\> Subscription to pool creation events ___ ### watchPoolSwap ▸ **watchPoolSwap**(`params`, `version?`): `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolSwapNow`: () => `Promise`\<`void`\> = pollEvents }\> Watches for pool swap events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | `WatchPoolSwapParams` | `undefined` | Parameters for watching pool swaps including optional coin filter | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolSwapNow`: () => `Promise`\<`void`\> = pollEvents }\> Subscription to pool swap events --- @flaunch/sdk - v0.9.15 / Exports / ReadWriteFlaunchSDK # Class: ReadWriteFlaunchSDK Base class for interacting with Flaunch protocol in read-only mode ## Hierarchy - `ReadFlaunchSDK` ↳ **`ReadWriteFlaunchSDK`** ## Table of contents ### Constructors - constructor ### Properties - TICK\_SPACING - chainId - drift - publicClient - readAnyBidWall - readAnyFlaunch - readAnyPositionManager - readBidWall - readBidWallV1\_1 - readFairLaunch - readFairLaunchV1\_1 - readFeeEscrow - readFlaunch - readFlaunchV1\_1 - readFlaunchV1\_2 - readFlaunchZap - readPermit2 - readPoolManager - readPositionManager - readPositionManagerV1\_1 - readPositionManagerV1\_2 - readQuoter - readReferralEscrow - readStateView - readTokenImporter - readWriteAnyPositionManager - readWriteFeeEscrow - readWriteFlaunchZap - readWritePermit2 - readWritePositionManager - readWritePositionManagerV1\_1 - readWriteReferralEscrow - readWriteTokenImporter - readWriteTreasuryManagerFactory - resolveIPFS ### Methods - addToTreasuryManager - anyFlaunch - bidWallPosition - buyCoin - calculateAddLiquidityAmounts - calculateAddLiquidityTicks - calculateConstrainedLiquidity - calculateCurrentTickFromMarketCap - checkSingleSidedAddLiquidity - claimReferralBalance - coinBalance - coinMarketCapInUSD - coinPriceInETH - coinPriceInUSD - convertPriceToTick - createLiquidityCall - createPoolKey - creatorRevenue - currentTick - deployBuyBackManager - deployRevenueManager - deployStakingManager - determineCoinVersion - ethRequiredToFlaunch - fairLaunchCoinOnlyPosition - fairLaunchDuration - fairLaunchETHOnlyPosition - fairLaunchInfo - flETHIsCurrencyZero - flaunch - flaunchIPFS - flaunchIPFSWithRevenueManager - flaunchIPFSWithSplitManager - flaunchWithRevenueManager - flaunchWithSplitManager - getAddLiquidityCalls - getBidWall - getBidWallAddress - getBuyQuoteExactInput - getBuyQuoteExactOutput - getCoinInfo - getCoinMetadata - getCoinMetadataFromTokenId - getCoinMetadataFromTokenIds - getCoinVersion - getERC20AllowanceToPermit2 - getETHUSDCPrice - getFairLaunch - getFairLaunchAddress - getFlaunch - getFlaunchAddress - getFlaunchTokenIdForMemecoin - getFlaunchingFee - getImportAndAddLiquidityCalls - getImportAndSingleSidedCoinAddLiquidityCalls - getMarketContext - getPermit2AllowanceAndNonce - getPermit2TypedData - getPoolCreatedFromTx - getPositionManager - getPositionManagerAddress - getSellQuoteExactInput - getSingleSidedCoinAddLiquidityCalls - importMemecoin - initialSqrtPriceX96 - initialTick - isFairLaunchActive - isFlaunchTokenApprovedForAll - isMemecoinImported - isValidCoin - marketCapToTokenPriceEth - parseSwapTx - pollPoolCreatedNow - pollPoolSwapNow - poolId - positionInfo - referralBalance - revenueManagerAllTokensByCreator - revenueManagerAllTokensInManager - revenueManagerBalance - revenueManagerCreatorClaim - revenueManagerCreatorClaimForTokens - revenueManagerProtocolBalance - revenueManagerProtocolClaim - revenueManagerTokensCount - sellCoin - setERC20AllowanceToPermit2 - setFlaunchTokenApprovalForAll - setIPFSResolver - tokenImporterVerifyMemecoin - treasuryManagerInfo - treasuryManagerSetPermissions - treasuryManagerTransferOwnership - trustedPoolKeySignerStatus - watchPoolCreated - watchPoolSwap - withdrawCreatorRevenue ## Constructors ### constructor • **new ReadWriteFlaunchSDK**(`chainId`, `drift?`, `publicClient?`): `ReadWriteFlaunchSDK` Parameters | Name | Type | | :------ | :------ | | `chainId` | `number` | | `drift` | `Drift`\<`ReadWriteAdapter`\> | | `publicClient?` | `Object` | Returns `ReadWriteFlaunchSDK` Overrides ReadFlaunchSDK.constructor ## Properties ### TICK\_SPACING • `Readonly` **TICK\_SPACING**: ``60`` Inherited from ReadFlaunchSDK.TICK_SPACING ___ ### chainId • `Readonly` **chainId**: `number` Inherited from ReadFlaunchSDK.chainId ___ ### drift • **drift**: `Drift`\<`ReadWriteAdapter`\> Overrides ReadFlaunchSDK.drift ___ ### publicClient • `Readonly` **publicClient**: `undefined` \| {} Inherited from ReadFlaunchSDK.publicClient ___ ### readAnyBidWall • `Readonly` **readAnyBidWall**: `AnyBidWall` Inherited from ReadFlaunchSDK.readAnyBidWall ___ ### readAnyFlaunch • `Readonly` **readAnyFlaunch**: `ReadAnyFlaunch` Inherited from ReadFlaunchSDK.readAnyFlaunch ___ ### readAnyPositionManager • `Readonly` **readAnyPositionManager**: `ReadAnyPositionManager` Inherited from ReadFlaunchSDK.readAnyPositionManager ___ ### readBidWall • `Readonly` **readBidWall**: `ReadBidWall` Inherited from ReadFlaunchSDK.readBidWall ___ ### readBidWallV1\_1 • `Readonly` **readBidWallV1\_1**: `ReadBidWallV1_1` Inherited from ReadFlaunchSDK.readBidWallV1_1 ___ ### readFairLaunch • `Readonly` **readFairLaunch**: `ReadFairLaunch` Inherited from ReadFlaunchSDK.readFairLaunch ___ ### readFairLaunchV1\_1 • `Readonly` **readFairLaunchV1\_1**: `ReadFairLaunchV1_1` Inherited from ReadFlaunchSDK.readFairLaunchV1_1 ___ ### readFeeEscrow • `Readonly` **readFeeEscrow**: `ReadFeeEscrow` Inherited from ReadFlaunchSDK.readFeeEscrow ___ ### readFlaunch • `Readonly` **readFlaunch**: `ReadFlaunch` Inherited from ReadFlaunchSDK.readFlaunch ___ ### readFlaunchV1\_1 • `Readonly` **readFlaunchV1\_1**: `ReadFlaunchV1_1` Inherited from ReadFlaunchSDK.readFlaunchV1_1 ___ ### readFlaunchV1\_2 • `Readonly` **readFlaunchV1\_2**: `ReadFlaunchV1_2` Inherited from ReadFlaunchSDK.readFlaunchV1_2 ___ ### readFlaunchZap • `Readonly` **readFlaunchZap**: `ReadFlaunchZap` Inherited from ReadFlaunchSDK.readFlaunchZap ___ ### readPermit2 • `Readonly` **readPermit2**: `ReadPermit2` Inherited from ReadFlaunchSDK.readPermit2 ___ ### readPoolManager • `Readonly` **readPoolManager**: `ReadPoolManager` Inherited from ReadFlaunchSDK.readPoolManager ___ ### readPositionManager • `Readonly` **readPositionManager**: `ReadFlaunchPositionManager` Inherited from ReadFlaunchSDK.readPositionManager ___ ### readPositionManagerV1\_1 • `Readonly` **readPositionManagerV1\_1**: `ReadFlaunchPositionManagerV1_1` Inherited from ReadFlaunchSDK.readPositionManagerV1_1 ___ ### readPositionManagerV1\_2 • `Readonly` **readPositionManagerV1\_2**: `ReadFlaunchPositionManagerV1_2` Inherited from ReadFlaunchSDK.readPositionManagerV1_2 ___ ### readQuoter • `Readonly` **readQuoter**: `ReadQuoter` Inherited from ReadFlaunchSDK.readQuoter ___ ### readReferralEscrow • `Readonly` **readReferralEscrow**: `ReadReferralEscrow` Inherited from ReadFlaunchSDK.readReferralEscrow ___ ### readStateView • `Readonly` **readStateView**: `ReadStateView` Inherited from ReadFlaunchSDK.readStateView ___ ### readTokenImporter • `Readonly` **readTokenImporter**: `ReadTokenImporter` Inherited from ReadFlaunchSDK.readTokenImporter ___ ### readWriteAnyPositionManager • `Readonly` **readWriteAnyPositionManager**: `ReadWriteAnyPositionManager` ___ ### readWriteFeeEscrow • `Readonly` **readWriteFeeEscrow**: `ReadWriteFeeEscrow` ___ ### readWriteFlaunchZap • `Readonly` **readWriteFlaunchZap**: `ReadWriteFlaunchZap` ___ ### readWritePermit2 • `Readonly` **readWritePermit2**: `ReadWritePermit2` ___ ### readWritePositionManager • `Readonly` **readWritePositionManager**: `ReadWriteFlaunchPositionManager` ___ ### readWritePositionManagerV1\_1 • `Readonly` **readWritePositionManagerV1\_1**: `ReadWriteFlaunchPositionManagerV1_1` ___ ### readWriteReferralEscrow • `Readonly` **readWriteReferralEscrow**: `ReadWriteReferralEscrow` ___ ### readWriteTokenImporter • `Readonly` **readWriteTokenImporter**: `ReadWriteTokenImporter` ___ ### readWriteTreasuryManagerFactory • `Readonly` **readWriteTreasuryManagerFactory**: `ReadWriteTreasuryManagerFactory` ___ ### resolveIPFS • **resolveIPFS**: (`value`: `string`) => `string` Type declaration ▸ (`value`): `string` #Parameters | Name | Type | | :------ | :------ | | `value` | `string` | #Returns `string` Inherited from ReadFlaunchSDK.resolveIPFS ## Methods ### addToTreasuryManager ▸ **addToTreasuryManager**(`treasuryManagerAddress`, `version`, `tokenId`, `creator?`, `data?`): `Promise`\<\`0x$\{string}\`\> Adds an existing flaunch token to a treasury manager. NFT approval must be given prior to calling this function. Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `treasuryManagerAddress` | \`0x$\{string}\` | `undefined` | The address of the treasury manager | | `version` | `FlaunchVersion` | `undefined` | The flaunch version to determine the correct contract address | | `tokenId` | `bigint` | `undefined` | The token ID to deposit | | `creator?` | \`0x$\{string}\` | `undefined` | Optional creator address. If not provided, uses the connected wallet address | | `data` | \`0x$\{string}\` | `"0x"` | Optional additional data for the deposit (defaults to empty bytes) | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### anyFlaunch ▸ **anyFlaunch**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch with AnyPositionManager for external coins Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `AnyFlaunchParams` | Parameters for creating the Flaunch with AnyPositionManager | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### bidWallPosition ▸ **bidWallPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `pendingEth`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the bid wall position for a coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `pendingEth`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, pendingEth: bigint, tickLower: number, tickUpper: number}> - Bid wall position details Inherited from ReadFlaunchSDK.bidWallPosition ___ ### buyCoin ▸ **buyCoin**(`params`, `version?`): `Promise`\<\`0x$\{string}\`\> Buys a coin with ETH or custom inputToken via intermediatePoolKey Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `BuyCoinParams` | Parameters for buying the coin including amount, slippage, and referrer | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will determine automatically | Returns `Promise`\<\`0x$\{string}\`\> Transaction response for the buy operation ___ ### calculateAddLiquidityAmounts ▸ **calculateAddLiquidityAmounts**(`params`): `Promise`\<\{ `coinAmount`: `bigint` ; `currentTick`: `number` ; `ethAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Parameters | Name | Type | | :------ | :------ | | `params` | `CalculateAddLiquidityAmountsParams` | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `currentTick`: `number` ; `ethAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Inherited from ReadFlaunchSDK.calculateAddLiquidityAmounts ___ ### calculateAddLiquidityTicks ▸ **calculateAddLiquidityTicks**(`«destructured»`): `Promise`\<\{ `coinDecimals`: `number` ; `coinTotalSupply`: `bigint` ; `currentTick?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `currentMarketCap?` | `string` | | › `liquidityMode` | `LiquidityMode` | | › `maxMarketCap` | `string` | | › `minMarketCap` | `string` | Returns `Promise`\<\{ `coinDecimals`: `number` ; `coinTotalSupply`: `bigint` ; `currentTick?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Inherited from ReadFlaunchSDK.calculateAddLiquidityTicks ___ ### calculateConstrainedLiquidity ▸ **calculateConstrainedLiquidity**(`currentTick`, `tickLower`, `tickUpper`, `amount0`, `amount1`, `slippagePercent?`): `Object` Calculates and constrains liquidity amounts for a position Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `currentTick` | `number` | `undefined` | Current pool tick | | `tickLower` | `number` | `undefined` | Lower tick of the position | | `tickUpper` | `number` | `undefined` | Upper tick of the position | | `amount0` | `bigint` | `undefined` | Amount of currency0 | | `amount1` | `bigint` | `undefined` | Amount of currency1 | | `slippagePercent` | `number` | `0.05` | - | Returns `Object` Final liquidity and amounts | Name | Type | | :------ | :------ | | `finalAmount0` | `bigint` | | `finalAmount1` | `bigint` | | `finalLiquidity` | `bigint` | ___ ### calculateCurrentTickFromMarketCap ▸ **calculateCurrentTickFromMarketCap**(`currentMarketCap`, `formattedTotalSupplyInDecimals`, `marketContext`): `undefined` \| `number` Calculates current tick from market cap if provided Parameters | Name | Type | | :------ | :------ | | `currentMarketCap` | `undefined` \| `string` | | `formattedTotalSupplyInDecimals` | `number` | | `marketContext` | `Object` | | `marketContext.decimals0` | `number` | | `marketContext.decimals1` | `number` | | `marketContext.ethUsdPrice` | `number` | | `marketContext.isFlethZero` | `boolean` | Returns `undefined` \| `number` Inherited from ReadFlaunchSDK.calculateCurrentTickFromMarketCap ___ ### checkSingleSidedAddLiquidity ▸ **checkSingleSidedAddLiquidity**(`params`): `Promise`\<`SingleSidedLiquidityInfo`\> Parameters | Name | Type | | :------ | :------ | | `params` | `CheckSingleSidedAddLiquidityParams` | Returns `Promise`\<`SingleSidedLiquidityInfo`\> Inherited from ReadFlaunchSDK.checkSingleSidedAddLiquidity ___ ### claimReferralBalance ▸ **claimReferralBalance**(`coins`, `recipient`): `Promise`\<\`0x$\{string}\`\> Claims the referral balance for a given recipient Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coins` | \`0x$\{string}\`[] | The addresses of the coins to claim | | `recipient` | \`0x$\{string}\` | The address of the recipient to claim the balance for | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### coinBalance ▸ **coinBalance**(`coinAddress`): `Promise`\<`bigint`\> Gets the balance of a specific coin for the connected wallet Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`bigint`\> Promise - The balance of the coin ___ ### coinMarketCapInUSD ▸ **coinMarketCapInUSD**(`«destructured»`): `Promise`\<`string`\> Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `drift?` | `Drift` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`string`\> Inherited from ReadFlaunchSDK.coinMarketCapInUSD ___ ### coinPriceInETH ▸ **coinPriceInETH**(`coinAddress`, `version?`): `Promise`\<`string`\> Calculates the coin price in ETH based on the current tick Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`string`\> Promise - The price of the coin in ETH with 18 decimals precision Inherited from ReadFlaunchSDK.coinPriceInETH ___ ### coinPriceInUSD ▸ **coinPriceInUSD**(`«destructured»`): `Promise`\<`string`\> Calculates the coin price in USD based on the current ETH/USDC price Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `coinAddress` | \`0x$\{string}\` | | › `drift?` | `Drift` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`string`\> Promise - The price of the coin in USD with 18 decimal precision Inherited from ReadFlaunchSDK.coinPriceInUSD ___ ### convertPriceToTick ▸ **convertPriceToTick**(`priceEth`, `isFlethZero`, `decimals0`, `decimals1`): `number` Converts token price in ETH to tick Parameters | Name | Type | | :------ | :------ | | `priceEth` | `number` | | `isFlethZero` | `boolean` | | `decimals0` | `number` | | `decimals1` | `number` | Returns `number` Inherited from ReadFlaunchSDK.convertPriceToTick ___ ### createLiquidityCall ▸ **createLiquidityCall**(`poolKey`, `tickLower`, `tickUpper`, `finalLiquidity`, `finalAmount0`, `finalAmount1`, `userAddress`): `CallWithDescription` Creates the UniV4 Position Manager liquidity call Parameters | Name | Type | Description | | :------ | :------ | :------ | | `poolKey` | `any` | The pool key | | `tickLower` | `number` | Lower tick of the position | | `tickUpper` | `number` | Upper tick of the position | | `finalLiquidity` | `bigint` | Final liquidity amount | | `finalAmount0` | `bigint` | Final amount of currency0 | | `finalAmount1` | `bigint` | Final amount of currency1 | | `userAddress` | `string` | User's address | Returns `CallWithDescription` CallWithDescription for adding liquidity ___ ### createPoolKey ▸ **createPoolKey**(`coinAddress`, `version`): `Object` Creates a pool key for the given coin and version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The coin address | | `version` | `FlaunchVersion` | The version to use for position manager | Returns `Object` The ordered pool key | Name | Type | | :------ | :------ | | `currency0` | \`0x$\{string}\` | | `currency1` | \`0x$\{string}\` | | `fee` | `number` | | `hooks` | \`0x$\{string}\` | | `tickSpacing` | `number` | Inherited from ReadFlaunchSDK.createPoolKey ___ ### creatorRevenue ▸ **creatorRevenue**(`creator`, `isV1?`): `Promise`\<`bigint`\> Gets the ETH balance for the creator to claim Parameters | Name | Type | Description | | :------ | :------ | :------ | | `creator` | \`0x$\{string}\` | The address of the creator to check | | `isV1?` | `boolean` | Optional boolean to check the balance for V1. V1.1 & AnyPositionManager use the same FeeEscrow contract | Returns `Promise`\<`bigint`\> The balance of the creator Inherited from ReadFlaunchSDK.creatorRevenue ___ ### currentTick ▸ **currentTick**(`coinAddress`, `version?`): `Promise`\<`number`\> Gets the current tick for a given coin's pool Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number`\> Promise - The current tick of the pool Inherited from ReadFlaunchSDK.currentTick ___ ### deployBuyBackManager ▸ **deployBuyBackManager**(`params`): `Promise`\<\`0x$\{string}\`\> Deploys a new BuyBack manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `DeployBuyBackManagerParams` | Parameters for deploying the BuyBack manager | Returns `Promise`\<\`0x$\{string}\`\> Address of the deployed BuyBack manager ___ ### deployRevenueManager ▸ **deployRevenueManager**(`params`): `Promise`\<\`0x$\{string}\`\> Deploys a new revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `DeployRevenueManagerParams` | Parameters for deploying the revenue manager | Returns `Promise`\<\`0x$\{string}\`\> Address of the deployed revenue manager ___ ### deployStakingManager ▸ **deployStakingManager**(`params`): `Promise`\<\`0x$\{string}\`\> Deploys a new staking manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `DeployStakingManagerParams` | Parameters for deploying the staking manager | Returns `Promise`\<\`0x$\{string}\`\> Address of the deployed staking manager ___ ### determineCoinVersion ▸ **determineCoinVersion**(`coinAddress`, `version?`): `Promise`\<`FlaunchVersion`\> Determines the version for a coin, using provided version or fetching it Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The coin address | | `version?` | `FlaunchVersion` | Optional version, if not provided will be fetched | Returns `Promise`\<`FlaunchVersion`\> The determined version Inherited from ReadFlaunchSDK.determineCoinVersion ___ ### ethRequiredToFlaunch ▸ **ethRequiredToFlaunch**(`params`): `Promise`\<`bigint`\> Calculates the ETH required to flaunch a token, takes into account the ETH for premine and the flaunching fee Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | - | | `params.initialMarketCapUSD` | `number` | The initial market cap in USD | | `params.premineAmount` | `bigint` | The amount of coins to be premined | | `params.slippagePercent?` | `number` | The slippage percent | Returns `Promise`\<`bigint`\> Promise - The ETH required to flaunch Inherited from ReadFlaunchSDK.ethRequiredToFlaunch ___ ### fairLaunchCoinOnlyPosition ▸ **fairLaunchCoinOnlyPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the coin-only position in a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details Inherited from ReadFlaunchSDK.fairLaunchCoinOnlyPosition ___ ### fairLaunchDuration ▸ **fairLaunchDuration**(`coinAddress`, `version?`): `Promise`\<`number` \| `bigint`\> Gets the duration of a fair launch for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number` \| `bigint`\> Promise - The duration in seconds (30 minutes for V1, variable for V1.1) Inherited from ReadFlaunchSDK.fairLaunchDuration ___ ### fairLaunchETHOnlyPosition ▸ **fairLaunchETHOnlyPosition**(`coinAddress`, `version?`): `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Gets information about the ETH-only position in a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `coinAmount`: `bigint` ; `flETHAmount`: `bigint` ; `tickLower`: `number` ; `tickUpper`: `number` }\> Promise<{flETHAmount: bigint, coinAmount: bigint, tickLower: number, tickUpper: number}> - Position details Inherited from ReadFlaunchSDK.fairLaunchETHOnlyPosition ___ ### fairLaunchInfo ▸ **fairLaunchInfo**(`coinAddress`, `version?`): `Promise`\<\{ `closed`: `boolean` ; `endsAt`: `bigint` ; `initialTick`: `number` ; `revenue`: `bigint` ; `startsAt`: `bigint` ; `supply`: `bigint` }\> Gets information about a fair launch for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<\{ `closed`: `boolean` ; `endsAt`: `bigint` ; `initialTick`: `number` ; `revenue`: `bigint` ; `startsAt`: `bigint` ; `supply`: `bigint` }\> Fair launch information from the appropriate contract version Inherited from ReadFlaunchSDK.fairLaunchInfo ___ ### flETHIsCurrencyZero ▸ **flETHIsCurrencyZero**(`coinAddress`): `boolean` Determines if flETH is currency0 in the pool Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `boolean` boolean - True if flETH is currency0, false otherwise Inherited from ReadFlaunchSDK.flETHIsCurrencyZero ___ ### flaunch ▸ **flaunch**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch on the specified version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchParams` | Parameters for creating the Flaunch | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### flaunchIPFS ▸ **flaunchIPFS**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch with IPFS metadata and optional version specification Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchIPFSParams` | Parameters for creating the Flaunch with IPFS data | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### flaunchIPFSWithRevenueManager ▸ **flaunchIPFSWithRevenueManager**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch with revenue manager configuration and IPFS metadata Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchWithRevenueManagerIPFSParams` | Parameters for creating the Flaunch with revenue manager and IPFS data | Returns `Promise`\<\`0x$\{string}\`\> Transaction response **`Throws`** Error if FlaunchZap is not deployed on the current chain ___ ### flaunchIPFSWithSplitManager ▸ **flaunchIPFSWithSplitManager**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch that splits the creator fees to the creator and a list of recipients, storing the token metadata on IPFS Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchWithSplitManagerIPFSParams` | Parameters for creating the Flaunch with split manager including all IPFS metadata | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### flaunchWithRevenueManager ▸ **flaunchWithRevenueManager**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch with revenue manager configuration Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchWithRevenueManagerParams` | Parameters for creating the Flaunch with revenue manager | Returns `Promise`\<\`0x$\{string}\`\> Transaction response **`Throws`** Error if FlaunchZap is not deployed on the current chain ___ ### flaunchWithSplitManager ▸ **flaunchWithSplitManager**(`params`): `Promise`\<\`0x$\{string}\`\> Creates a new Flaunch that splits the creator fees to the creator and a list of recipients Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `FlaunchWithSplitManagerParams` | Parameters for creating the Flaunch with split manager | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### getAddLiquidityCalls ▸ **getAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to add liquidity to flaunch or imported coins Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `GetAddLiquidityCallsParams` | Parameters for adding liquidity | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions ___ ### getBidWall ▸ **getBidWall**(`version`): `ReadBidWall` \| `AnyBidWall` \| `ReadBidWallV1_1` Gets the bid wall instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the bid wall instance for | Returns `ReadBidWall` \| `AnyBidWall` \| `ReadBidWallV1_1` Inherited from ReadFlaunchSDK.getBidWall ___ ### getBidWallAddress ▸ **getBidWallAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` Inherited from ReadFlaunchSDK.getBidWallAddress ___ ### getBuyQuoteExactInput ▸ **getBuyQuoteExactInput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for buying tokens with an exact amount of ETH or inputToken Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountIn` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `hookData?` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `userWallet?` | \`0x$\{string}\` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The expected amount of coins to receive Inherited from ReadFlaunchSDK.getBuyQuoteExactInput ___ ### getBuyQuoteExactOutput ▸ **getBuyQuoteExactOutput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for buying an exact amount of tokens with ETH or inputToken Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountOut` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `hookData?` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `userWallet?` | \`0x$\{string}\` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The required amount of ETH or inputToken to spend Inherited from ReadFlaunchSDK.getBuyQuoteExactOutput ___ ### getCoinInfo ▸ **getCoinInfo**(`coinAddress`): `Promise`\<\{ `decimals`: `number` ; `formattedTotalSupplyInDecimals`: `number` ; `totalSupply`: `bigint` }\> Gets basic coin information (total supply and decimals) Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | Returns `Promise`\<\{ `decimals`: `number` ; `formattedTotalSupplyInDecimals`: `number` ; `totalSupply`: `bigint` }\> Inherited from ReadFlaunchSDK.getCoinInfo ___ ### getCoinMetadata ▸ **getCoinMetadata**(`coinAddress`): `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Retrieves metadata for a given Flaunch coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Promise - The coin's metadata including name, symbol, description, and social links Inherited from ReadFlaunchSDK.getCoinMetadata ___ ### getCoinMetadataFromTokenId ▸ **getCoinMetadataFromTokenId**(`flaunch`, `tokenId`): `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> Retrieves metadata for a given Flaunch coin using its token ID & Flaunch contract address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `flaunch` | \`0x$\{string}\` | The address of the Flaunch contract | | `tokenId` | `bigint` | The token ID of the coin | Returns `Promise`\<`CoinMetadata` & \{ `symbol`: `string` }\> The coin's metadata including name, symbol, description, and social links Inherited from ReadFlaunchSDK.getCoinMetadataFromTokenId ___ ### getCoinMetadataFromTokenIds ▸ **getCoinMetadataFromTokenIds**(`params`, `batchSize?`, `batchDelay?`): `Promise`\<\{ `coinAddress`: \`0x$\{string}\` ; `collaborators`: `any` ; `description`: `any` ; `discordUrl`: `any` ; `external_link`: `any` ; `image`: `string` ; `name`: `string` ; `symbol`: `string` ; `telegramUrl`: `any` ; `twitterUrl`: `any` }[]\> Retrieves metadata for multiple Flaunch coins using their token IDs & Flaunch contract addresses Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | \{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[] | `undefined` | An array of objects containing flaunch contract address and token ID | | `batchSize` | `number` | `9` | Optional, the number of ipfs requests to process in each batch | | `batchDelay` | `number` | `500` | Optional, the delay in milliseconds between batches | Returns `Promise`\<\{ `coinAddress`: \`0x$\{string}\` ; `collaborators`: `any` ; `description`: `any` ; `discordUrl`: `any` ; `external_link`: `any` ; `image`: `string` ; `name`: `string` ; `symbol`: `string` ; `telegramUrl`: `any` ; `twitterUrl`: `any` }[]\> An array of objects containing coin address, name, symbol, description, and social links Inherited from ReadFlaunchSDK.getCoinMetadataFromTokenIds ___ ### getCoinVersion ▸ **getCoinVersion**(`coinAddress`): `Promise`\<`FlaunchVersion`\> Determines the version of a Flaunch coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`FlaunchVersion`\> Promise - The version of the coin Inherited from ReadFlaunchSDK.getCoinVersion ___ ### getERC20AllowanceToPermit2 ▸ **getERC20AllowanceToPermit2**(`coinAddress`): `Promise`\<`bigint`\> Gets the allowance of an ERC20 token to Permit2 contract. Flaunch coins automatically have infinite approval for Permit2. this function is for external tokens. Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`bigint`\> Promise - The allowance of the coin to Permit2 ___ ### getETHUSDCPrice ▸ **getETHUSDCPrice**(`drift?`): `Promise`\<`number`\> Gets the current ETH/USDC price Parameters | Name | Type | Description | | :------ | :------ | :------ | | `drift?` | `Drift` | Optional drift instance to get price from Base Mainnet | Returns `Promise`\<`number`\> Promise - The current ETH/USDC price Inherited from ReadFlaunchSDK.getETHUSDCPrice ___ ### getFairLaunch ▸ **getFairLaunch**(`version`): `ReadFairLaunch` \| `ReadFairLaunchV1_1` Gets the fair launch instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the fair launch instance for | Returns `ReadFairLaunch` \| `ReadFairLaunchV1_1` Inherited from ReadFlaunchSDK.getFairLaunch ___ ### getFairLaunchAddress ▸ **getFairLaunchAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` Inherited from ReadFlaunchSDK.getFairLaunchAddress ___ ### getFlaunch ▸ **getFlaunch**(`version`): `ReadFlaunch` \| `ReadAnyFlaunch` \| `ReadFlaunchV1_1` \| `ReadFlaunchV1_2` Gets the flaunch contract instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the flaunch contract instance for | Returns `ReadFlaunch` \| `ReadAnyFlaunch` \| `ReadFlaunchV1_1` \| `ReadFlaunchV1_2` Inherited from ReadFlaunchSDK.getFlaunch ___ ### getFlaunchAddress ▸ **getFlaunchAddress**(`version`): \`0x$\{string}\` Gets the flaunch contract address for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the flaunch contract address for | Returns \`0x$\{string}\` Inherited from ReadFlaunchSDK.getFlaunchAddress ___ ### getFlaunchTokenIdForMemecoin ▸ **getFlaunchTokenIdForMemecoin**(`coinAddress`): `Promise`\<\{ `flaunchAddress`: \`0x$\{string}\` ; `tokenId`: `bigint` }\> Gets the flaunch contract address and token ID for a memecoin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the memecoin | Returns `Promise`\<\{ `flaunchAddress`: \`0x$\{string}\` ; `tokenId`: `bigint` }\> Promise<{ flaunchAddress: Address; tokenId: bigint }> - The flaunch contract address and token ID Inherited from ReadFlaunchSDK.getFlaunchTokenIdForMemecoin ___ ### getFlaunchingFee ▸ **getFlaunchingFee**(`params`): `Promise`\<`bigint`\> Gets the flaunching fee for a given initial price and slippage percent Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | - | | `params.initialMarketCapUSD` | `number` | The initial market cap in USD | | `params.sender` | \`0x$\{string}\` | The address of the sender | | `params.slippagePercent?` | `number` | The slippage percent | Returns `Promise`\<`bigint`\> Promise - The flaunching fee Inherited from ReadFlaunchSDK.getFlaunchingFee ___ ### getImportAndAddLiquidityCalls ▸ **getImportAndAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and add liquidity to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for importing and adding liquidity with market cap constraints | | `params.coinAddress` | \`0x$\{string}\` | - | | `params.coinOrEthInputAmount` | `bigint` | - | | `params.creatorFeeAllocationPercent` | `number` | - | | `params.initialMarketCapUSD` | `number` | - | | `params.inputToken` | ``"coin"`` \| ``"eth"`` | - | | `params.liquidityMode` | `LiquidityMode` | - | | `params.maxMarketCap` | `string` | - | | `params.minMarketCap` | `string` | - | | `params.slippagePercent?` | `number` | - | | `params.verifier?` | `Verifier` | - | | `params.version?` | `FlaunchVersion` | - | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), inputToken: "eth", minMarketCap: "10000", maxMarketCap: "100000", initialMarketCapUSD: 50000 }); ``` ▸ **getImportAndAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and add liquidity to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for importing and adding liquidity with price constraints | | `params.coinAddress` | \`0x$\{string}\` | - | | `params.coinOrEthInputAmount` | `bigint` | - | | `params.creatorFeeAllocationPercent` | `number` | - | | `params.initialPriceUSD` | `number` | - | | `params.inputToken` | ``"coin"`` \| ``"eth"`` | - | | `params.liquidityMode` | `LiquidityMode` | - | | `params.maxPriceUSD` | `string` | - | | `params.minPriceUSD` | `string` | - | | `params.slippagePercent?` | `number` | - | | `params.verifier?` | `Verifier` | - | | `params.version?` | `FlaunchVersion` | - | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, liquidityMode: LiquidityMode.CONCENTRATED, coinOrEthInputAmount: parseEther("1"), inputToken: "eth", minPriceUSD: "0.0001", maxPriceUSD: "0.001", initialPriceUSD: 0.0005 }); ``` ▸ **getImportAndAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and add liquidity to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for importing and adding liquidity with exact amounts | | `params.coinAddress` | \`0x$\{string}\` | - | | `params.coinAmount` | `bigint` | - | | `params.creatorFeeAllocationPercent` | `number` | - | | `params.currentTick?` | `number` | - | | `params.flethAmount` | `bigint` | - | | `params.slippagePercent?` | `number` | - | | `params.tickLower` | `number` | - | | `params.tickUpper` | `number` | - | | `params.verifier?` | `Verifier` | - | | `params.version?` | `FlaunchVersion` | - | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, coinAmount: parseEther("1000"), flethAmount: parseEther("0.5"), tickLower: -887220, tickUpper: 887220, currentTick: 0 }); ``` ___ ### getImportAndSingleSidedCoinAddLiquidityCalls ▸ **getImportAndSingleSidedCoinAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and single-sided liquidity in coin (from current tick to infinity) to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for importing and adding liquidity with initial market cap | | `params.coinAddress` | \`0x$\{string}\` | - | | `params.coinAmount` | `bigint` | - | | `params.creatorFeeAllocationPercent` | `number` | - | | `params.initialMarketCapUSD` | `number` | - | | `params.verifier?` | `Verifier` | - | | `params.version?` | `FlaunchVersion` | - | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, coinAmount: parseEther("1000"), initialMarketCapUSD: 50000 }); ``` ▸ **getImportAndSingleSidedCoinAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and single-sided liquidity in coin (from current tick to infinity) to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | \{ `coinAddress`: \`0x$\{string}\` ; `coinAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialMarketCapUSD`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` } & \{ `tokenSupply`: `bigint` } | Parameters for importing and adding liquidity with initial market cap | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, coinAmount: parseEther("1000"), initialMarketCapUSD: 50000, tokenSupply: 1000000e6 // 1 million tokens (6 decimals) }); ``` ▸ **getImportAndSingleSidedCoinAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and single-sided liquidity in coin (from current tick to infinity) to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for importing and adding liquidity with initial price | | `params.coinAddress` | \`0x$\{string}\` | - | | `params.coinAmount` | `bigint` | - | | `params.creatorFeeAllocationPercent` | `number` | - | | `params.initialPriceUSD` | `number` | - | | `params.verifier?` | `Verifier` | - | | `params.version?` | `FlaunchVersion` | - | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, coinAmount: parseEther("1000"), initialPriceUSD: 0.001 }); ``` ▸ **getImportAndSingleSidedCoinAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to import a memecoin to Flaunch and single-sided liquidity in coin (from current tick to infinity) to AnyPositionManager as a batch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | \{ `coinAddress`: \`0x$\{string}\` ; `coinAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialPriceUSD`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` } & \{ `tokenSupply`: `bigint` } | Parameters for importing and adding liquidity with initial price | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions **`Example`** ```typescript const calls = await sdk.getImportAndSingleSidedCoinAddLiquidityCalls({ coinAddress: "0x...", verifier: Verifier.CLANKER, creatorFeeAllocationPercent: 5, coinAmount: parseEther("1000"), initialPriceUSD: 0.001, tokenSupply: 1000000e6 // 1 million tokens (6 decimals) }); ``` ___ ### getMarketContext ▸ **getMarketContext**(`coinAddress`, `coinDecimals`): `Promise`\<\{ `decimals0`: `number` ; `decimals1`: `number` ; `ethUsdPrice`: `number` ; `isFlethZero`: `boolean` }\> Gets market context information needed for tick calculations Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | | `coinDecimals` | `number` | Returns `Promise`\<\{ `decimals0`: `number` ; `decimals1`: `number` ; `ethUsdPrice`: `number` ; `isFlethZero`: `boolean` }\> Inherited from ReadFlaunchSDK.getMarketContext ___ ### getPermit2AllowanceAndNonce ▸ **getPermit2AllowanceAndNonce**(`coinAddress`): `Promise`\<\{ `allowance`: `bigint` = amount; `nonce`: `number` }\> Gets the current Permit2 allowance and nonce for a coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<\{ `allowance`: `bigint` = amount; `nonce`: `number` }\> Promise<{allowance: bigint, nonce: bigint}> - Current allowance and nonce ___ ### getPermit2TypedData ▸ **getPermit2TypedData**(`coinAddress`, `deadline?`): `Promise`\<\{ `permitSingle`: `PermitSingle` ; `typedData`: \{ `domain`: \{ `chainId`: `number` ; `name`: `string` ; `verifyingContract`: \`0x$\{string}\` } ; `message`: `PermitSingle` ; `primaryType`: `string` ; `types`: \{ `PermitDetails`: \{ `name`: `string` = "token"; `type`: `string` = "address" }[] = PERMIT\_DETAILS; `PermitSingle`: \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] } } }\> Gets the typed data for a Permit2 signature Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to permit | | `deadline?` | `bigint` | Optional deadline for the permit (defaults to 10 years) | Returns `Promise`\<\{ `permitSingle`: `PermitSingle` ; `typedData`: \{ `domain`: \{ `chainId`: `number` ; `name`: `string` ; `verifyingContract`: \`0x$\{string}\` } ; `message`: `PermitSingle` ; `primaryType`: `string` ; `types`: \{ `PermitDetails`: \{ `name`: `string` = "token"; `type`: `string` = "address" }[] = PERMIT\_DETAILS; `PermitSingle`: \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] } } }\> The typed data object for signing ___ ### getPoolCreatedFromTx ▸ **getPoolCreatedFromTx**(`txHash`): `Promise`\<``null`` \| `PoolCreatedEventData`\> Parses a transaction to extract PoolCreated event data Parameters | Name | Type | Description | | :------ | :------ | :------ | | `txHash` | \`0x$\{string}\` | The transaction hash to parse | Returns `Promise`\<``null`` \| `PoolCreatedEventData`\> PoolCreated event parameters or null if not found Inherited from ReadFlaunchSDK.getPoolCreatedFromTx ___ ### getPositionManager ▸ **getPositionManager**(`version`): `ReadFlaunchPositionManager` \| `ReadFlaunchPositionManagerV1_1` \| `ReadFlaunchPositionManagerV1_2` \| `ReadAnyPositionManager` Gets the position manager instance for a given version Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The version to get the position manager instance for | Returns `ReadFlaunchPositionManager` \| `ReadFlaunchPositionManagerV1_1` \| `ReadFlaunchPositionManagerV1_2` \| `ReadAnyPositionManager` Inherited from ReadFlaunchSDK.getPositionManager ___ ### getPositionManagerAddress ▸ **getPositionManagerAddress**(`version`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `version` | `FlaunchVersion` | Returns \`0x$\{string}\` Inherited from ReadFlaunchSDK.getPositionManagerAddress ___ ### getSellQuoteExactInput ▸ **getSellQuoteExactInput**(`«destructured»`): `Promise`\<`bigint`\> Gets a quote for selling an exact amount of tokens for ETH Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amountIn` | `bigint` | | › `coinAddress` | \`0x$\{string}\` | | › `intermediatePoolKey?` | `PoolWithHookData` | | › `version?` | `FlaunchVersion` | Returns `Promise`\<`bigint`\> Promise - The expected amount of ETH to receive Inherited from ReadFlaunchSDK.getSellQuoteExactInput ___ ### getSingleSidedCoinAddLiquidityCalls ▸ **getSingleSidedCoinAddLiquidityCalls**(`params`): `Promise`\<`CallWithDescription`[]\> Gets the calls needed to add single-sided liquidity in coin from current tick to infinity Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `GetSingleSidedCoinAddLiquidityCallsParams` | Parameters for adding single-sided liquidity | Returns `Promise`\<`CallWithDescription`[]\> Array of calls with descriptions ___ ### importMemecoin ▸ **importMemecoin**(`params`): `Promise`\<\`0x$\{string}\`\> Imports a memecoin into the TokenImporter Parameters | Name | Type | | :------ | :------ | | `params` | `ImportMemecoinParams` | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### initialSqrtPriceX96 ▸ **initialSqrtPriceX96**(`params`): `Promise`\<`bigint`\> Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.coinAddress` | \`0x$\{string}\` | | `params.initialMarketCapUSD` | `number` | Returns `Promise`\<`bigint`\> Inherited from ReadFlaunchSDK.initialSqrtPriceX96 ___ ### initialTick ▸ **initialTick**(`coinAddress`, `version?`): `Promise`\<`number`\> Gets the initial tick for a fair launch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`number`\> Promise - The initial tick value Inherited from ReadFlaunchSDK.initialTick ___ ### isFairLaunchActive ▸ **isFairLaunchActive**(`coinAddress`, `version?`): `Promise`\<`boolean`\> Checks if a fair launch is currently active for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will be determined automatically | Returns `Promise`\<`boolean`\> Promise - True if fair launch is active, false otherwise Inherited from ReadFlaunchSDK.isFairLaunchActive ___ ### isFlaunchTokenApprovedForAll ▸ **isFlaunchTokenApprovedForAll**(`version`, `owner`, `operator`): `Promise`\<`boolean`\> Checks if an operator is approved for all flaunch tokens of an owner Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The flaunch version to determine the correct contract address | | `owner` | \`0x$\{string}\` | The owner address to check | | `operator` | \`0x$\{string}\` | The operator address to check | Returns `Promise`\<`boolean`\> Promise - True if operator is approved for all tokens Inherited from ReadFlaunchSDK.isFlaunchTokenApprovedForAll ___ ### isMemecoinImported ▸ **isMemecoinImported**(`memecoin`): `Promise`\<`boolean`\> Checks if an external memecoin has been imported to Flaunch Parameters | Name | Type | Description | | :------ | :------ | :------ | | `memecoin` | \`0x$\{string}\` | The address of the memecoin to check | Returns `Promise`\<`boolean`\> Promise - True if the memecoin has been imported Inherited from ReadFlaunchSDK.isMemecoinImported ___ ### isValidCoin ▸ **isValidCoin**(`coinAddress`): `Promise`\<`boolean`\> Checks if a given coin address is a valid Flaunch coin (supports all versions) Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to check | Returns `Promise`\<`boolean`\> Promise - True if the coin is valid, false otherwise Inherited from ReadFlaunchSDK.isValidCoin ___ ### marketCapToTokenPriceEth ▸ **marketCapToTokenPriceEth**(`marketCapUsd`, `formattedTotalSupplyInDecimals`, `ethUsdPrice`): `number` Converts market cap in USD to token price in ETH Parameters | Name | Type | | :------ | :------ | | `marketCapUsd` | `number` | | `formattedTotalSupplyInDecimals` | `number` | | `ethUsdPrice` | `number` | Returns `number` Inherited from ReadFlaunchSDK.marketCapToTokenPriceEth ___ ### parseSwapTx ▸ **parseSwapTx**\<`T`\>(`params`): `Promise`\<`T` extends `boolean` ? `undefined` \| `GenericBuySwapLog` \| `GenericSellSwapLog` : `undefined` \| `GenericBaseSwapLog`\> Parses a transaction hash to extract PoolSwap events and return parsed swap data Type parameters | Name | Type | | :------ | :------ | | `T` | extends `undefined` \| `boolean` = `undefined` | Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Object containing parsing parameters | | `params.flETHIsCurrencyZero?` | `T` | Whether flETH is currency 0 in the pool (optional) | | `params.txHash` | \`0x$\{string}\` | The transaction hash to parse | | `params.version` | `FlaunchVersion` | The Flaunch version to use for parsing | Returns `Promise`\<`T` extends `boolean` ? `undefined` \| `GenericBuySwapLog` \| `GenericSellSwapLog` : `undefined` \| `GenericBaseSwapLog`\> Parsed swap log or undefined if no PoolSwap event found. If flETHIsCurrencyZero is provided, returns typed swap data with BUY/SELL information. If flETHIsCurrencyZero is undefined, returns basic swap log without parsed delta. Inherited from ReadFlaunchSDK.parseSwapTx ___ ### pollPoolCreatedNow ▸ **pollPoolCreatedNow**(`version?`): `undefined` \| `Promise`\<`void`\> Polls for current pool creation events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `undefined` \| `Promise`\<`void`\> Current pool creation events or undefined if polling is not available Inherited from ReadFlaunchSDK.pollPoolCreatedNow ___ ### pollPoolSwapNow ▸ **pollPoolSwapNow**(`version?`): `undefined` \| `Promise`\<`void`\> Polls for current pool swap events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `undefined` \| `Promise`\<`void`\> Current pool swap events or undefined if polling is not available Inherited from ReadFlaunchSDK.pollPoolSwapNow ___ ### poolId ▸ **poolId**(`coinAddress`, `version?`): `Promise`\<\`0x$\{string}\`\> Gets the pool ID for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin | | `version?` | `FlaunchVersion` | Optional specific version to use | Returns `Promise`\<\`0x$\{string}\`\> Promise - The pool ID Inherited from ReadFlaunchSDK.poolId ___ ### positionInfo ▸ **positionInfo**(`params`): `Promise`\<\{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` } \| \{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` }\> Gets information about a liquidity position Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `PositionInfoParams` | Parameters for querying position info | Returns `Promise`\<\{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` } \| \{ `feeGrowthInside0LastX128`: `bigint` ; `feeGrowthInside1LastX128`: `bigint` ; `liquidity`: `bigint` }\> Position information from the state view contract Inherited from ReadFlaunchSDK.positionInfo ___ ### referralBalance ▸ **referralBalance**(`recipient`, `coinAddress`): `Promise`\<`bigint`\> Gets the balance of a recipient for a given coin Parameters | Name | Type | Description | | :------ | :------ | :------ | | `recipient` | \`0x$\{string}\` | The address of the recipient to check | | `coinAddress` | \`0x$\{string}\` | The address of the coin | Returns `Promise`\<`bigint`\> Promise - The balance of the recipient Inherited from ReadFlaunchSDK.referralBalance ___ ### revenueManagerAllTokensByCreator ▸ **revenueManagerAllTokensByCreator**(`params`): `Promise`\ Gets all tokens created by a specific creator address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for querying tokens by creator | | `params.creator` | \`0x$\{string}\` | The address of the creator to query tokens for | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | | `params.sortByDesc?` | `boolean` | Whether to sort the tokens by descending order | Returns `Promise`\ Promise> - Array of token objects containing flaunch address and token ID Inherited from ReadFlaunchSDK.revenueManagerAllTokensByCreator ___ ### revenueManagerAllTokensInManager ▸ **revenueManagerAllTokensInManager**(`params`): `Promise`\<\{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[]\> Gets all tokens currently managed by a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for querying tokens in manager | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | | `params.sortByDesc?` | `boolean` | Optional boolean to sort tokens in descending order (default: false) | Returns `Promise`\<\{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[]\> Promise> - Array of token objects containing flaunch address and token ID Inherited from ReadFlaunchSDK.revenueManagerAllTokensInManager ___ ### revenueManagerBalance ▸ **revenueManagerBalance**(`params`): `Promise`\<`bigint`\> Gets the claimable balance of ETH for the recipient from a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for checking the balance | | `params.recipient` | \`0x$\{string}\` | The address of the recipient to check | | `params.revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The claimable balance of ETH Inherited from ReadFlaunchSDK.revenueManagerBalance ___ ### revenueManagerCreatorClaim ▸ **revenueManagerCreatorClaim**(`params`): `Promise`\<\`0x$\{string}\`\> Claims the total creator's share of the revenue from a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for claiming the creator's share of the revenue | | `params.revenueManagerAddress` | \`0x$\{string}\` | - | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### revenueManagerCreatorClaimForTokens ▸ **revenueManagerCreatorClaimForTokens**(`params`): `Promise`\<\`0x$\{string}\`\> Claims the creator's share of the revenue from specific flaunch tokens Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for claiming the creator's share of the revenue | | `params.flaunchTokens` | \{ `flaunch`: \`0x$\{string}\` ; `tokenId`: `bigint` }[] | - | | `params.revenueManagerAddress` | \`0x$\{string}\` | - | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### revenueManagerProtocolBalance ▸ **revenueManagerProtocolBalance**(`revenueManagerAddress`): `Promise`\<`bigint`\> Gets the claimable balance of ETH for the protocol from a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The claimable balance of ETH Inherited from ReadFlaunchSDK.revenueManagerProtocolBalance ___ ### revenueManagerProtocolClaim ▸ **revenueManagerProtocolClaim**(`params`): `Promise`\<\`0x$\{string}\`\> Claims the protocol's share of the revenue Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for claiming the protocol's share of the revenue | | `params.revenueManagerAddress` | \`0x$\{string}\` | - | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### revenueManagerTokensCount ▸ **revenueManagerTokensCount**(`revenueManagerAddress`): `Promise`\<`bigint`\> Gets the total number of tokens managed by a revenue manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `revenueManagerAddress` | \`0x$\{string}\` | The address of the revenue manager | Returns `Promise`\<`bigint`\> Promise - The total count of tokens Inherited from ReadFlaunchSDK.revenueManagerTokensCount ___ ### sellCoin ▸ **sellCoin**(`params`, `version?`): `Promise`\<\`0x$\{string}\`\> Sells a coin for ETH Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `SellCoinParams` | Parameters for selling the coin including amount, slippage, permit data, and referrer | | `version?` | `FlaunchVersion` | Optional specific version to use. If not provided, will determine automatically | Returns `Promise`\<\`0x$\{string}\`\> Transaction response for the sell operation ___ ### setERC20AllowanceToPermit2 ▸ **setERC20AllowanceToPermit2**(`coinAddress`, `amount`): `Promise`\<\`0x$\{string}\`\> Sets the allowance of an ERC20 token to Permit2 contract. Flaunch coins automatically have infinite approval for Permit2. this function is for external tokens. Parameters | Name | Type | Description | | :------ | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | The address of the coin to approve | | `amount` | `bigint` | The amount of the token to approve | Returns `Promise`\<\`0x$\{string}\`\> Promise - The transaction hash ___ ### setFlaunchTokenApprovalForAll ▸ **setFlaunchTokenApprovalForAll**(`version`, `operator`, `approved`): `Promise`\<\`0x$\{string}\`\> Sets approval for all flaunch tokens to an operator Parameters | Name | Type | Description | | :------ | :------ | :------ | | `version` | `FlaunchVersion` | The flaunch version to determine the correct contract address | | `operator` | \`0x$\{string}\` | The operator address to approve/revoke | | `approved` | `boolean` | Whether to approve or revoke approval | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### setIPFSResolver ▸ **setIPFSResolver**(`resolverFn`): `void` Sets a custom IPFS resolver function Parameters | Name | Type | Description | | :------ | :------ | :------ | | `resolverFn` | (`ipfsHash`: `string`) => `string` | Custom function to resolve IPFS URIs | Returns `void` **`Dev`** this is used to resolve IPFS hash to a gateway URL eg: input: Qabc, output: https://ipfs.io/ipfs/Qabc Inherited from ReadFlaunchSDK.setIPFSResolver ___ ### tokenImporterVerifyMemecoin ▸ **tokenImporterVerifyMemecoin**(`memecoin`): `Promise`\<\{ `isValid`: `boolean` ; `verifier`: \`0x$\{string}\` }\> Verifies if a memecoin is valid for importing Parameters | Name | Type | Description | | :------ | :------ | :------ | | `memecoin` | \`0x$\{string}\` | The address of the memecoin to import | Returns `Promise`\<\{ `isValid`: `boolean` ; `verifier`: \`0x$\{string}\` }\> Promise<{ isValid: boolean; verifier: Address }> - The result of the verification Inherited from ReadFlaunchSDK.tokenImporterVerifyMemecoin ___ ### treasuryManagerInfo ▸ **treasuryManagerInfo**(`treasuryManagerAddress`): `Promise`\<\{ `managerOwner`: \`0x$\{string}\` ; `permissions`: \`0x$\{string}\` }\> Gets treasury manager information including owner and permissions Parameters | Name | Type | Description | | :------ | :------ | :------ | | `treasuryManagerAddress` | \`0x$\{string}\` | The address of the treasury manager | Returns `Promise`\<\{ `managerOwner`: \`0x$\{string}\` ; `permissions`: \`0x$\{string}\` }\> Promise<{managerOwner: Address, permissions: Address}> - Treasury manager owner and permissions contract addresses Inherited from ReadFlaunchSDK.treasuryManagerInfo ___ ### treasuryManagerSetPermissions ▸ **treasuryManagerSetPermissions**(`treasuryManagerAddress`, `permissions`): `Promise`\<\`0x$\{string}\`\> Sets the permissions contract address for a treasury manager Parameters | Name | Type | Description | | :------ | :------ | :------ | | `treasuryManagerAddress` | \`0x$\{string}\` | The address of the treasury manager | | `permissions` | `Permissions` | The permissions enum value to set | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### treasuryManagerTransferOwnership ▸ **treasuryManagerTransferOwnership**(`treasuryManagerAddress`, `newManagerOwner`): `Promise`\<\`0x$\{string}\`\> Transfers the ownership of a treasury manager to a new address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `treasuryManagerAddress` | \`0x$\{string}\` | The address of the treasury manager | | `newManagerOwner` | \`0x$\{string}\` | The address of the new manager owner | Returns `Promise`\<\`0x$\{string}\`\> Transaction response ___ ### trustedPoolKeySignerStatus ▸ **trustedPoolKeySignerStatus**(`coinAddress`, `version?`): `Promise`\<\{ `fairLaunchEndsAt`: `number` ; `fairLaunchStartsAt`: `number` ; `isCurrentlyEnabled`: `boolean` ; `isFairLaunchActive`: `boolean` ; `signer`: \`0x$\{string}\` ; `trustedSignerEnabled`: `boolean` }\> Parameters | Name | Type | | :------ | :------ | | `coinAddress` | \`0x$\{string}\` | | `version?` | `FlaunchVersion` | Returns `Promise`\<\{ `fairLaunchEndsAt`: `number` ; `fairLaunchStartsAt`: `number` ; `isCurrentlyEnabled`: `boolean` ; `isFairLaunchActive`: `boolean` ; `signer`: \`0x$\{string}\` ; `trustedSignerEnabled`: `boolean` }\> Inherited from ReadFlaunchSDK.trustedPoolKeySignerStatus ___ ### watchPoolCreated ▸ **watchPoolCreated**(`params`, `version?`): `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolCreatedNow`: () => `Promise`\<`void`\> = pollEvents }\> Watches for pool creation events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | `WatchPoolCreatedParams` | `undefined` | Parameters for watching pool creation | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolCreatedNow`: () => `Promise`\<`void`\> = pollEvents }\> Subscription to pool creation events Inherited from ReadFlaunchSDK.watchPoolCreated ___ ### watchPoolSwap ▸ **watchPoolSwap**(`params`, `version?`): `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolSwapNow`: () => `Promise`\<`void`\> = pollEvents }\> Watches for pool swap events Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `params` | `WatchPoolSwapParams` | `undefined` | Parameters for watching pool swaps including optional coin filter | | `version` | `FlaunchVersion` | `FlaunchVersion.V1_1` | Version of Flaunch to use (defaults to V1_1) | Returns `Promise`\<\{ `cleanup`: () => `void` ; `pollPoolSwapNow`: () => `Promise`\<`void`\> = pollEvents }\> Subscription to pool swap events Inherited from ReadFlaunchSDK.watchPoolSwap ___ ### withdrawCreatorRevenue ▸ **withdrawCreatorRevenue**(`params`): `Promise`\<\`0x$\{string}\`\> Withdraws the creator's share of the revenue Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Parameters for withdrawing the creator's share of the revenue | | `params.isV1?` | `boolean` | Optional boolean to withdraw from V1. V1.1 & AnyPositionManager use the same FeeEscrow contract | | `params.recipient?` | \`0x$\{string}\` | The address to withdraw the revenue to. Defaults to the connected wallet | Returns `Promise`\<\`0x$\{string}\`\> Transaction response --- @flaunch/sdk - v0.9.15 / Exports / FlaunchVersion # Enumeration: FlaunchVersion Enumeration of Flaunch contract versions ## Table of contents ### Enumeration Members - ANY - V1 - V1\_1 - V1\_2 ## Enumeration Members ### ANY • **ANY** = ``"ANY"`` ___ ### V1 • **V1** = ``"V1"`` ___ ### V1\_1 • **V1\_1** = ``"V1_1"`` ___ ### V1\_2 • **V1\_2** = ``"V1_2"`` --- @flaunch/sdk - v0.9.15 / Exports / LiquidityMode # Enumeration: LiquidityMode ## Table of contents ### Enumeration Members - CONCENTRATED - FULL\_RANGE ## Enumeration Members ### CONCENTRATED • **CONCENTRATED** = ``"concentrated"`` ___ ### FULL\_RANGE • **FULL\_RANGE** = ``"full-range"`` --- @flaunch/sdk - v0.9.15 / Exports / Permissions # Enumeration: Permissions Enumeration of Permissions for TreasuryManagers. Defaults to OPEN. ## Table of contents ### Enumeration Members - CLOSED - OPEN - WHITELISTED ## Enumeration Members ### CLOSED • **CLOSED** = ``"closed"`` ___ ### OPEN • **OPEN** = ``"open"`` ___ ### WHITELISTED • **WHITELISTED** = ``"whitelisted"`` --- @flaunch/sdk - v0.9.15 / Exports / Verifier # Enumeration: Verifier Enumeration of Verifiers for TokenImporter ## Table of contents ### Enumeration Members - CLANKER - DOPPLER - SOLANA - VIRTUALS - WHITELIST - ZORA ## Enumeration Members ### CLANKER • **CLANKER** = ``"clanker"`` ___ ### DOPPLER • **DOPPLER** = ``"doppler"`` ___ ### SOLANA • **SOLANA** = ``"solana"`` ___ ### VIRTUALS • **VIRTUALS** = ``"virtuals"`` ___ ### WHITELIST • **WHITELIST** = ``"whitelist"`` ___ ### ZORA • **ZORA** = ``"zora"`` --- @flaunch/sdk - v0.9.15 / Exports / Addresses # Interface: Addresses ## Indexable ▪ [chainId: `number`]: `Address` --- @flaunch/sdk - v0.9.15 / Exports / BuySwapData # Interface: BuySwapData ## Table of contents ### Properties - delta - type ## Properties ### delta • **delta**: `Object` Type declaration | Name | Type | | :------ | :------ | | `coinsBought` | `bigint` | | `fees` | `SwapFees` | | `flETHSold` | `bigint` | ___ ### type • **type**: ``"BUY"`` --- @flaunch/sdk - v0.9.15 / Exports / CallData # Interface: CallData ## Table of contents ### Properties - data - to - value ## Properties ### data • **data**: \`0x$\{string}\` ___ ### to • **to**: \`0x$\{string}\` ___ ### value • **value**: `bigint` --- @flaunch/sdk - v0.9.15 / Exports / CoinMetadata # Interface: CoinMetadata ## Table of contents ### Properties - collaborators - description - discordUrl - external\_link - image - name - telegramUrl - twitterUrl ## Properties ### collaborators • **collaborators**: `string`[] ___ ### description • **description**: `string` ___ ### discordUrl • **discordUrl**: `string` ___ ### external\_link • **external\_link**: `string` ___ ### image • **image**: `string` ___ ### name • **name**: `string` ___ ### telegramUrl • **telegramUrl**: `string` ___ ### twitterUrl • **twitterUrl**: `string` --- @flaunch/sdk - v0.9.15 / Exports / IPFSParams # Interface: IPFSParams ## Table of contents ### Properties - metadata - pinataConfig ## Properties ### metadata • **metadata**: `Object` Type declaration | Name | Type | | :------ | :------ | | `base64Image` | `string` | | `description` | `string` | | `discordUrl?` | `string` | | `telegramUrl?` | `string` | | `twitterUrl?` | `string` | | `websiteUrl?` | `string` | ___ ### pinataConfig • `Optional` **pinataConfig**: `PinataConfig` --- @flaunch/sdk - v0.9.15 / Exports / PinataConfig # Interface: PinataConfig ## Table of contents ### Properties - jwt ## Properties ### jwt • **jwt**: `string` --- @flaunch/sdk - v0.9.15 / Exports / PoolKey # Interface: PoolKey ## Hierarchy - **`PoolKey`** ↳ `PoolWithHookData` ## Table of contents ### Properties - currency0 - currency1 - fee - hooks - tickSpacing ## Properties ### currency0 • **currency0**: \`0x$\{string}\` ___ ### currency1 • **currency1**: \`0x$\{string}\` ___ ### fee • **fee**: `number` ___ ### hooks • **hooks**: \`0x$\{string}\` ___ ### tickSpacing • **tickSpacing**: `number` --- @flaunch/sdk - v0.9.15 / Exports / PoolWithHookData # Interface: PoolWithHookData ## Hierarchy - `PoolKey` ↳ **`PoolWithHookData`** ## Table of contents ### Properties - currency0 - currency1 - fee - hookData - hooks - tickSpacing ## Properties ### currency0 • **currency0**: \`0x$\{string}\` Inherited from PoolKey.currency0 ___ ### currency1 • **currency1**: \`0x$\{string}\` Inherited from PoolKey.currency1 ___ ### fee • **fee**: `number` Inherited from PoolKey.fee ___ ### hookData • **hookData**: \`0x$\{string}\` ___ ### hooks • **hooks**: \`0x$\{string}\` Inherited from PoolKey.hooks ___ ### tickSpacing • **tickSpacing**: `number` Inherited from PoolKey.tickSpacing --- @flaunch/sdk - v0.9.15 / Exports / SellSwapData # Interface: SellSwapData ## Table of contents ### Properties - delta - type ## Properties ### delta • **delta**: `Object` Type declaration | Name | Type | | :------ | :------ | | `coinsSold` | `bigint` | | `fees` | `SwapFees` | | `flETHBought` | `bigint` | ___ ### type • **type**: ``"SELL"`` --- @flaunch/sdk - v0.9.15 / Exports / SingleSidedLiquidityInfo # Interface: SingleSidedLiquidityInfo ## Table of contents ### Properties - isSingleSided - shouldHideCoinInput - shouldHideETHInput ## Properties ### isSingleSided • **isSingleSided**: `boolean` ___ ### shouldHideCoinInput • **shouldHideCoinInput**: `boolean` ___ ### shouldHideETHInput • **shouldHideETHInput**: `boolean` --- @flaunch/sdk - v0.9.15 / Exports / SwapFees # Interface: SwapFees ## Table of contents ### Properties - amount - isInFLETH ## Properties ### amount • **amount**: `bigint` ___ ### isInFLETH • **isInFLETH**: `boolean` --- @flaunch/sdk - v0.9.15 / Exports / SwapLogArgs # Interface: SwapLogArgs ## Table of contents ### Properties - flAmount0 - flAmount1 - flFee0 - flFee1 - ispAmount0 - ispAmount1 - ispFee0 - ispFee1 - uniAmount0 - uniAmount1 - uniFee0 - uniFee1 ## Properties ### flAmount0 • **flAmount0**: `bigint` ___ ### flAmount1 • **flAmount1**: `bigint` ___ ### flFee0 • **flFee0**: `bigint` ___ ### flFee1 • **flFee1**: `bigint` ___ ### ispAmount0 • **ispAmount0**: `bigint` ___ ### ispAmount1 • **ispAmount1**: `bigint` ___ ### ispFee0 • **ispFee0**: `bigint` ___ ### ispFee1 • **ispFee1**: `bigint` ___ ### uniAmount0 • **uniAmount0**: `bigint` ___ ### uniAmount1 • **uniAmount1**: `bigint` ___ ### uniFee0 • **uniFee0**: `bigint` ___ ### uniFee1 • **uniFee1**: `bigint` --- @flaunch/sdk - v0.9.15 / Exports # @flaunch/sdk - v0.9.15 ## Table of contents ### Enumerations - FlaunchVersion - LiquidityMode - Permissions - Verifier ### Classes - FlaunchBackend - ReadFlaunchSDK - ReadWriteFlaunchSDK ### Interfaces - Addresses - BuySwapData - CallData - CoinMetadata - IPFSParams - PinataConfig - PoolKey - PoolWithHookData - SellSwapData - SingleSidedLiquidityInfo - SwapFees - SwapLogArgs ### Type Aliases - BaseSwapLog - BuySwapLog - CalculateAddLiquidityAmountsParams - CallDataMethod - CallDataResult - CallWithDescription - CheckSingleSidedAddLiquidityParams - CreateFlaunchCalldataParams - CreateFlaunchParams - GetAddLiquidityCallsParams - GetSingleSidedCoinAddLiquidityCallsParams - ImportAndAddLiquidityParams - ImportAndAddLiquidityWithExactAmounts - ImportAndAddLiquidityWithMarketCap - ImportAndAddLiquidityWithPrice - ImportAndSingleSidedCoinAddLiquidityParams - ImportAndSingleSidedCoinAddLiquidityWithMarketCap - ImportAndSingleSidedCoinAddLiquidityWithPrice - ImportMemecoinParams - ParsedSwapData - PermitDetails - PermitSingle - PoolCreatedEventData - PoolCreatedLogs - PoolSwapLog - SellSwapLog ### Variables - AddressFeeSplitManagerAddress - AnyBidWallAddress - AnyFlaunchAddress - AnyPositionManagerAddress - BidWallAddress - BidWallV1\_1Address - BuyBackManagerAddress - ClankerWorldVerifierAddress - ClosedPermissionsAddress - DopplerVerifierAddress - FLETHAddress - FLETHHooksAddress - FairLaunchAddress - FairLaunchV1\_1Address - FastFlaunchZapAddress - FeeEscrowAddress - FlaunchAddress - FlaunchPositionManagerAddress - FlaunchPositionManagerV1\_1Address - FlaunchPositionManagerV1\_2Address - FlaunchSDK - FlaunchV1\_1Address - FlaunchV1\_2Address - FlaunchZapAddress - PERMIT\_DETAILS - PERMIT\_TYPES - Permit2Address - PoolManagerAddress - Q192 - Q96 - QuoterAddress - ReferralEscrowAddress - RevenueManagerAddress - SolanaVerifierAddress - StakingManagerAddress - StateViewAddress - TICK\_SPACING - TickFinder - TokenImporterAddress - TreasuryManagerFactoryAddress - USDCETHPoolKeys - UniV4PositionManagerAddress - UniversalRouterAddress - VirtualsVerifierAddress - WhitelistVerifierAddress - WhitelistedPermissionsAddress - ZoraVerifierAddress - chainIdToChain - encodedCallAbi ### Functions - buyMemecoin - bytes32ToUint256 - calculateUnderlyingTokenBalances - createCallDataWalletClient - createDrift - createFlaunch - createFlaunchCalldata - decodeCallData - generateTokenUri - getAmountWithSlippage - getAmountsForLiquidity - getLiquidityFromAmounts - getNearestUsableTick - getPermissionsAddress - getPermit2TypedData - getPoolId - getSqrtPriceX96FromTick - getValidTick - maxLiquidityForAmount0Precise - maxLiquidityForAmount1 - orderPoolKey - parseCall - parseSwapData - priceRatioToTick - resolveIPFS - sellMemecoinWithPermit2 - uint256ToBytes32 - uploadFileToIPFS - uploadImageToFlaunchAPI - uploadImageToIPFS - uploadJsonToIPFS - uploadMetadataToFlaunchAPI ## Type Aliases ### BaseSwapLog Ƭ **BaseSwapLog**: `EventLog`\<`FlaunchPositionManagerABI`, ``"PoolSwap"``\> & \{ `timestamp`: `number` } ___ ### BuySwapLog Ƭ **BuySwapLog**: `BaseSwapLog` & \{ `delta`: \{ `coinsBought`: `bigint` ; `fees`: \{ `amount`: `bigint` ; `isInFLETH`: `boolean` } ; `flETHSold`: `bigint` } ; `type`: ``"BUY"`` } ___ ### CalculateAddLiquidityAmountsParams Ƭ **CalculateAddLiquidityAmountsParams**: \{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `currentMarketCap?`: `string` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxMarketCap`: `string` ; `minMarketCap`: `string` ; `version?`: `FlaunchVersion` } \| \{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `currentPriceUSD?`: `number` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxPriceUSD`: `string` ; `minPriceUSD`: `string` ; `version?`: `FlaunchVersion` } ___ ### CallDataMethod Ƭ **CallDataMethod**\<`T`\>: (...`args`: `T`) => `Promise`\<`Hex`\> Type helper for SDK methods that return encoded calldata Type parameters | Name | Type | | :------ | :------ | | `T` | extends `any`[] = `any`[] | Type declaration ▸ (`...args`): `Promise`\<`Hex`\> #Parameters | Name | Type | | :------ | :------ | | `...args` | `T` | #Returns `Promise`\<`Hex`\> ___ ### CallDataResult Ƭ **CallDataResult**: `Promise`\<`CallData`\> Type helper for the result of a calldata operation ___ ### CallWithDescription Ƭ **CallWithDescription**: `Call` & \{ `description?`: `string` } ___ ### CheckSingleSidedAddLiquidityParams Ƭ **CheckSingleSidedAddLiquidityParams**: \{ `coinAddress`: `Address` ; `currentMarketCap?`: `string` ; `liquidityMode`: `LiquidityMode` ; `maxMarketCap`: `string` ; `minMarketCap`: `string` ; `version?`: `FlaunchVersion` } \| \{ `coinAddress`: `Address` ; `currentPriceUSD?`: `number` ; `liquidityMode`: `LiquidityMode` ; `maxPriceUSD`: `string` ; `minPriceUSD`: `string` ; `version?`: `FlaunchVersion` } ___ ### CreateFlaunchCalldataParams Ƭ **CreateFlaunchCalldataParams**: `Object` Type declaration | Name | Type | | :------ | :------ | | `publicClient` | `PublicClient` | | `walletAddress?` | `Address` | ___ ### CreateFlaunchParams Ƭ **CreateFlaunchParams**: `Object` Type declaration | Name | Type | | :------ | :------ | | `publicClient` | `PublicClient` | | `walletClient?` | `WalletClient` | ___ ### GetAddLiquidityCallsParams Ƭ **GetAddLiquidityCallsParams**: \{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `initialMarketCapUSD?`: `number` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxMarketCap`: `string` ; `minMarketCap`: `string` ; `slippagePercent?`: `number` ; `version?`: `FlaunchVersion` } \| \{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `initialPriceUSD?`: `number` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxPriceUSD`: `string` ; `minPriceUSD`: `string` ; `slippagePercent?`: `number` ; `version?`: `FlaunchVersion` } \| \{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `currentTick?`: `number` ; `flethAmount`: `bigint` ; `slippagePercent?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` ; `version?`: `FlaunchVersion` } ___ ### GetSingleSidedCoinAddLiquidityCallsParams Ƭ **GetSingleSidedCoinAddLiquidityCallsParams**: \{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `initialMarketCapUSD?`: `number` ; `slippagePercent?`: `number` ; `tokenSupply?`: `bigint` ; `version?`: `FlaunchVersion` } \| \{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `initialPriceUSD?`: `number` ; `slippagePercent?`: `number` ; `tokenSupply?`: `bigint` ; `version?`: `FlaunchVersion` } ___ ### ImportAndAddLiquidityParams Ƭ **ImportAndAddLiquidityParams**: `ImportAndAddLiquidityWithMarketCap` \| `ImportAndAddLiquidityWithPrice` \| `ImportAndAddLiquidityWithExactAmounts` ___ ### ImportAndAddLiquidityWithExactAmounts Ƭ **ImportAndAddLiquidityWithExactAmounts**: `Flatten`\<\{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `currentTick?`: `number` ; `flethAmount`: `bigint` ; `slippagePercent?`: `number` ; `tickLower`: `number` ; `tickUpper`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` }\> ___ ### ImportAndAddLiquidityWithMarketCap Ƭ **ImportAndAddLiquidityWithMarketCap**: `Flatten`\<\{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialMarketCapUSD`: `number` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxMarketCap`: `string` ; `minMarketCap`: `string` ; `slippagePercent?`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` }\> ___ ### ImportAndAddLiquidityWithPrice Ƭ **ImportAndAddLiquidityWithPrice**: `Flatten`\<\{ `coinAddress`: `Address` ; `coinOrEthInputAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialPriceUSD`: `number` ; `inputToken`: ``"coin"`` \| ``"eth"`` ; `liquidityMode`: `LiquidityMode` ; `maxPriceUSD`: `string` ; `minPriceUSD`: `string` ; `slippagePercent?`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` }\> ___ ### ImportAndSingleSidedCoinAddLiquidityParams Ƭ **ImportAndSingleSidedCoinAddLiquidityParams**: `ImportAndSingleSidedCoinAddLiquidityWithMarketCap` \| `ImportAndSingleSidedCoinAddLiquidityWithPrice` ___ ### ImportAndSingleSidedCoinAddLiquidityWithMarketCap Ƭ **ImportAndSingleSidedCoinAddLiquidityWithMarketCap**: `Flatten`\<\{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialMarketCapUSD`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` }\> ___ ### ImportAndSingleSidedCoinAddLiquidityWithPrice Ƭ **ImportAndSingleSidedCoinAddLiquidityWithPrice**: `Flatten`\<\{ `coinAddress`: `Address` ; `coinAmount`: `bigint` ; `creatorFeeAllocationPercent`: `number` ; `initialPriceUSD`: `number` ; `verifier?`: `Verifier` ; `version?`: `FlaunchVersion` }\> ___ ### ImportMemecoinParams Ƭ **ImportMemecoinParams**: \{ `coinAddress`: `Address` ; `creatorFeeAllocationPercent`: `number` ; `initialMarketCapUSD`: `number` ; `verifier?`: `Verifier` } \| \{ `coinAddress`: `Address` ; `creatorFeeAllocationPercent`: `number` ; `initialPriceUSD`: `number` ; `verifier?`: `Verifier` } ___ ### ParsedSwapData Ƭ **ParsedSwapData**: `BuySwapData` \| `SellSwapData` ___ ### PermitDetails Ƭ **PermitDetails**: `Object` Type declaration | Name | Type | | :------ | :------ | | `amount` | `bigint` | | `expiration` | `number` | | `nonce` | `number` | | `token` | `Address` | ___ ### PermitSingle Ƭ **PermitSingle**: `Object` Type declaration | Name | Type | | :------ | :------ | | `details` | `PermitDetails` | | `sigDeadline` | `bigint` | | `spender` | `Address` | ___ ### PoolCreatedEventData Ƭ **PoolCreatedEventData**: `Object` Parsed data from a PoolCreated event Type declaration | Name | Type | | :------ | :------ | | `currencyFlipped` | `boolean` | | `flaunchFee` | `bigint` | | `memecoin` | `Address` | | `memecoinTreasury` | `Address` | | `params` | \{ `creator`: `Address` ; `creatorFeeAllocation`: `number` ; `fairLaunchDuration?`: `bigint` ; `feeCalculatorParams`: `Hex` ; `flaunchAt`: `bigint` ; `initialPriceParams`: `Hex` ; `initialTokenFairLaunch`: `bigint` ; `name`: `string` ; `premineAmount`: `bigint` ; `symbol`: `string` ; `tokenUri`: `string` } | | `params.creator` | `Address` | | `params.creatorFeeAllocation` | `number` | | `params.fairLaunchDuration?` | `bigint` | | `params.feeCalculatorParams` | `Hex` | | `params.flaunchAt` | `bigint` | | `params.initialPriceParams` | `Hex` | | `params.initialTokenFairLaunch` | `bigint` | | `params.name` | `string` | | `params.premineAmount` | `bigint` | | `params.symbol` | `string` | | `params.tokenUri` | `string` | | `poolId` | `Hex` | | `tokenId` | `bigint` | ___ ### PoolCreatedLogs Ƭ **PoolCreatedLogs**: `PoolCreatedLog`[] ___ ### PoolSwapLog Ƭ **PoolSwapLog**: `BuySwapLog` \| `SellSwapLog` \| `BaseSwapLog` ___ ### SellSwapLog Ƭ **SellSwapLog**: `BaseSwapLog` & \{ `delta`: \{ `coinsSold`: `bigint` ; `fees`: \{ `amount`: `bigint` ; `isInFLETH`: `boolean` } ; `flETHBought`: `bigint` } ; `type`: ``"SELL"`` } ## Variables ### AddressFeeSplitManagerAddress • `Const` **AddressFeeSplitManagerAddress**: `Addresses` ___ ### AnyBidWallAddress • `Const` **AnyBidWallAddress**: `Addresses` ___ ### AnyFlaunchAddress • `Const` **AnyFlaunchAddress**: `Addresses` ___ ### AnyPositionManagerAddress • `Const` **AnyPositionManagerAddress**: `Addresses` ___ ### BidWallAddress • `Const` **BidWallAddress**: `Addresses` ___ ### BidWallV1\_1Address • `Const` **BidWallV1\_1Address**: `Addresses` ___ ### BuyBackManagerAddress • `Const` **BuyBackManagerAddress**: `Addresses` ___ ### ClankerWorldVerifierAddress • `Const` **ClankerWorldVerifierAddress**: `Addresses` ___ ### ClosedPermissionsAddress • `Const` **ClosedPermissionsAddress**: `Addresses` Permissions ___ ### DopplerVerifierAddress • `Const` **DopplerVerifierAddress**: `Addresses` ___ ### FLETHAddress • `Const` **FLETHAddress**: `Addresses` ___ ### FLETHHooksAddress • `Const` **FLETHHooksAddress**: `Addresses` ___ ### FairLaunchAddress • `Const` **FairLaunchAddress**: `Addresses` ___ ### FairLaunchV1\_1Address • `Const` **FairLaunchV1\_1Address**: `Addresses` ___ ### FastFlaunchZapAddress • `Const` **FastFlaunchZapAddress**: `Addresses` ___ ### FeeEscrowAddress • `Const` **FeeEscrowAddress**: `Addresses` =========== ___ ### FlaunchAddress • `Const` **FlaunchAddress**: `Addresses` ___ ### FlaunchPositionManagerAddress • `Const` **FlaunchPositionManagerAddress**: `Addresses` ___ ### FlaunchPositionManagerV1\_1Address • `Const` **FlaunchPositionManagerV1\_1Address**: `Addresses` ___ ### FlaunchPositionManagerV1\_2Address • `Const` **FlaunchPositionManagerV1\_2Address**: `Addresses` ___ ### FlaunchSDK • `Const` **FlaunchSDK**: `Object` Type declaration | Name | Type | | :------ | :------ | | `ReadFlaunchSDK` | typeof `ReadFlaunchSDK` | | `ReadWriteFlaunchSDK` | typeof `ReadWriteFlaunchSDK` | ___ ### FlaunchV1\_1Address • `Const` **FlaunchV1\_1Address**: `Addresses` ___ ### FlaunchV1\_2Address • `Const` **FlaunchV1\_2Address**: `Addresses` ___ ### FlaunchZapAddress • `Const` **FlaunchZapAddress**: `Addresses` ___ ### PERMIT\_DETAILS • `Const` **PERMIT\_DETAILS**: \{ `name`: `string` = "token"; `type`: `string` = "address" }[] ___ ### PERMIT\_TYPES • `Const` **PERMIT\_TYPES**: `Object` Type declaration | Name | Type | | :------ | :------ | | `PermitDetails` | \{ `name`: `string` = "token"; `type`: `string` = "address" }[] | | `PermitSingle` | \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] | ___ ### Permit2Address • `Const` **Permit2Address**: `Addresses` ___ ### PoolManagerAddress • `Const` **PoolManagerAddress**: `Addresses` ___ ### Q192 • `Const` **Q192**: `bigint` ___ ### Q96 • `Const` **Q96**: `bigint` ___ ### QuoterAddress • `Const` **QuoterAddress**: `Addresses` ___ ### ReferralEscrowAddress • `Const` **ReferralEscrowAddress**: `Addresses` ___ ### RevenueManagerAddress • `Const` **RevenueManagerAddress**: `Addresses` ___ ### SolanaVerifierAddress • `Const` **SolanaVerifierAddress**: `Addresses` ___ ### StakingManagerAddress • `Const` **StakingManagerAddress**: `Addresses` ___ ### StateViewAddress • `Const` **StateViewAddress**: `Addresses` ___ ### TICK\_SPACING • `Const` **TICK\_SPACING**: ``60`` ___ ### TickFinder • `Const` **TickFinder**: `Object` Type declaration | Name | Type | | :------ | :------ | | `MAX_TICK` | `number` | | `MIN_TICK` | `number` | ___ ### TokenImporterAddress • `Const` **TokenImporterAddress**: `Addresses` Verifiers ___ ### TreasuryManagerFactoryAddress • `Const` **TreasuryManagerFactoryAddress**: `Addresses` ___ ### USDCETHPoolKeys • `Const` **USDCETHPoolKeys**: `Object` Index signature ▪ [chainId: `number`]: `PoolKey` ___ ### UniV4PositionManagerAddress • `Const` **UniV4PositionManagerAddress**: `Addresses` ___ ### UniversalRouterAddress • `Const` **UniversalRouterAddress**: `Addresses` ___ ### VirtualsVerifierAddress • `Const` **VirtualsVerifierAddress**: `Addresses` ___ ### WhitelistVerifierAddress • `Const` **WhitelistVerifierAddress**: `Addresses` ___ ### WhitelistedPermissionsAddress • `Const` **WhitelistedPermissionsAddress**: `Addresses` ___ ### ZoraVerifierAddress • `Const` **ZoraVerifierAddress**: `Addresses` ___ ### chainIdToChain • `Const` **chainIdToChain**: `Object` Index signature ▪ [key: `number`]: `Chain` ___ ### encodedCallAbi • `Const` **encodedCallAbi**: readonly [{}] ## Functions ### buyMemecoin ▸ **buyMemecoin**(`params`): `Object` Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.amountIn?` | `bigint` | | `params.amountInMax?` | `bigint` | | `params.amountOut?` | `bigint` | | `params.amountOutMin?` | `bigint` | | `params.chainId` | `number` | | `params.hookData?` | \`0x$\{string}\` | | `params.intermediatePoolKey?` | `PoolWithHookData` | | `params.memecoin` | \`0x$\{string}\` | | `params.permitSingle?` | `PermitSingle` | | `params.positionManagerAddress` | \`0x$\{string}\` | | `params.referrer` | ``null`` \| \`0x$\{string}\` | | `params.sender` | \`0x$\{string}\` | | `params.signature?` | \`0x$\{string}\` | | `params.swapType` | ``"EXACT_IN"`` \| ``"EXACT_OUT"`` | Returns `Object` | Name | Type | | :------ | :------ | | `calldata` | \`0x$\{string}\` | | `commands` | \`0x$\{string}\` | | `inputs` | \`0x$\{string}\`[] | ___ ### bytes32ToUint256 ▸ **bytes32ToUint256**(`value`): `bigint` Parameters | Name | Type | | :------ | :------ | | `value` | \`0x$\{string}\` | Returns `bigint` ___ ### calculateUnderlyingTokenBalances ▸ **calculateUnderlyingTokenBalances**(`liquidity`, `tickLower`, `tickUpper`, `tickCurrent`): `Object` Parameters | Name | Type | | :------ | :------ | | `liquidity` | `bigint` | | `tickLower` | `number` | | `tickUpper` | `number` | | `tickCurrent` | `number` | Returns `Object` | Name | Type | | :------ | :------ | | `amount0` | `bigint` | | `amount1` | `bigint` | ___ ### createCallDataWalletClient ▸ **createCallDataWalletClient**(`publicClient`, `walletAddress`): `WalletClient` Creates a custom wallet client that returns encoded calldata instead of broadcasting transactions Parameters | Name | Type | | :------ | :------ | | `publicClient` | `Object` | | `walletAddress` | \`0x$\{string}\` | Returns `WalletClient` ___ ### createDrift ▸ **createDrift**(`params`): `Drift` Creates a read-only Drift instance with only public client Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Omit`\<`CreateDriftParams`, ``"walletClient"``\> | Parameters with only publicClient | Returns `Drift` Drift instance for read-only operations **`Throws`** Error if publicClient.chain is not configured ▸ **createDrift**(`params`): `Drift`\<`ReadWriteAdapter`\> Creates a read-write Drift instance with both public and wallet clients Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Required`\<`CreateDriftParams`\> | Parameters with both publicClient and walletClient | Returns `Drift`\<`ReadWriteAdapter`\> Drift instance for read and write operations **`Throws`** Error if publicClient.chain is not configured ___ ### createFlaunch ▸ **createFlaunch**(`params`): `ReadFlaunchSDK` Creates a read-only Flaunch SDK instance with only public client Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Omit`\<`CreateFlaunchParams`, ``"walletClient"``\> | Parameters with only publicClient | Returns `ReadFlaunchSDK` ReadFlaunchSDK for read-only operations **`Throws`** Error if publicClient.chain is not configured ▸ **createFlaunch**(`params`): `ReadWriteFlaunchSDK` Creates a read-write Flaunch SDK instance with both public and wallet clients Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Required`\<`CreateFlaunchParams`\> | Parameters with both publicClient and walletClient | Returns `ReadWriteFlaunchSDK` ReadWriteFlaunchSDK for read and write operations **`Throws`** Error if publicClient.chain is not configured ___ ### createFlaunchCalldata ▸ **createFlaunchCalldata**(`params`): `ReadFlaunchSDK` Creates a read-only Flaunch SDK instance with only public client Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Omit`\<`CreateFlaunchCalldataParams`, ``"walletAddress"``\> | Parameters with only publicClient | Returns `ReadFlaunchSDK` ReadFlaunchSDK for read-only operations **`Throws`** Error if publicClient.chain is not configured ▸ **createFlaunchCalldata**(`params`): `ReadWriteFlaunchSDK` Creates a read-write Flaunch SDK instance that returns encoded calldata instead of broadcasting transactions Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Required`\<`CreateFlaunchCalldataParams`\> | Parameters containing publicClient and walletAddress | Returns `ReadWriteFlaunchSDK` ReadWriteFlaunchSDK instance configured for calldata generation **`Throws`** Error if publicClient.chain is not configured ___ ### decodeCallData ▸ **decodeCallData**(`encodedCall`): `CallData` Decodes the result from SDK methods into transaction object Parameters | Name | Type | Description | | :------ | :------ | :------ | | `encodedCall` | \`0x$\{string}\` | The result returned by SDK methods | Returns `CallData` Call data containing to, value, and data ___ ### generateTokenUri ▸ **generateTokenUri**(`name`, `symbol`, `params`): `Promise`\<`string`\> Parameters | Name | Type | | :------ | :------ | | `name` | `string` | | `symbol` | `string` | | `params` | `IPFSParams` | Returns `Promise`\<`string`\> ___ ### getAmountWithSlippage ▸ **getAmountWithSlippage**(`«destructured»`): `bigint` Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `amount` | `undefined` \| `bigint` | | › `slippage` | `string` | | › `swapType` | ``"EXACT_IN"`` \| ``"EXACT_OUT"`` | Returns `bigint` **`Dev`** EXACT_OUT adds the slippage, EXACT_IN removes it ___ ### getAmountsForLiquidity ▸ **getAmountsForLiquidity**(`params`): `Object` Calculate the actual amounts needed for a given liquidity This prevents MaximumAmountExceeded errors by ensuring we provide sufficient maximums Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.currentTick` | `number` | | `params.liquidity` | `bigint` | | `params.tickLower` | `number` | | `params.tickUpper` | `number` | Returns `Object` | Name | Type | | :------ | :------ | | `amount0` | `bigint` | | `amount1` | `bigint` | ___ ### getLiquidityFromAmounts ▸ **getLiquidityFromAmounts**(`params`): `bigint` Accurate liquidity calculation using proper Uniswap v3/v4 math Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.amount0` | `bigint` | | `params.amount1` | `bigint` | | `params.currentTick` | `number` | | `params.tickLower` | `number` | | `params.tickUpper` | `number` | Returns `bigint` ___ ### getNearestUsableTick ▸ **getNearestUsableTick**(`«destructured»`): `number` Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `tick` | `number` | | › `tickSpacing` | `number` | Returns `number` ___ ### getPermissionsAddress ▸ **getPermissionsAddress**(`permissions`, `chainId`): `Address` Maps a Permissions enum value to its corresponding contract address Parameters | Name | Type | Description | | :------ | :------ | :------ | | `permissions` | `Permissions` | The permissions enum value | | `chainId` | `number` | The chain ID to get the address for | Returns `Address` The corresponding permissions contract address ___ ### getPermit2TypedData ▸ **getPermit2TypedData**(`«destructured»`): `Object` Parameters | Name | Type | | :------ | :------ | | `«destructured»` | `Object` | | › `chainId` | `number` | | › `coinAddress` | \`0x$\{string}\` | | › `deadline?` | `bigint` | | › `nonce` | `number` | Returns `Object` | Name | Type | | :------ | :------ | | `permitSingle` | `PermitSingle` | | `typedData` | \{ `domain`: \{ `chainId`: `number` ; `name`: `string` ; `verifyingContract`: \`0x$\{string}\` } ; `message`: `PermitSingle` ; `primaryType`: `string` ; `types`: \{ `PermitDetails`: \{ `name`: `string` = "token"; `type`: `string` = "address" }[] = PERMIT\_DETAILS; `PermitSingle`: \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] } } | | `typedData.domain` | \{ `chainId`: `number` ; `name`: `string` ; `verifyingContract`: \`0x$\{string}\` } | | `typedData.domain.chainId` | `number` | | `typedData.domain.name` | `string` | | `typedData.domain.verifyingContract` | \`0x$\{string}\` | | `typedData.message` | `PermitSingle` | | `typedData.primaryType` | `string` | | `typedData.types` | \{ `PermitDetails`: \{ `name`: `string` = "token"; `type`: `string` = "address" }[] = PERMIT\_DETAILS; `PermitSingle`: \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] } | | `typedData.types.PermitDetails` | \{ `name`: `string` = "token"; `type`: `string` = "address" }[] | | `typedData.types.PermitSingle` | \{ `name`: `string` = "details"; `type`: `string` = "PermitDetails" }[] | ___ ### getPoolId ▸ **getPoolId**(`poolKey`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `poolKey` | `PoolKey` | Returns \`0x$\{string}\` ___ ### getSqrtPriceX96FromTick ▸ **getSqrtPriceX96FromTick**(`tick`): `bigint` Parameters | Name | Type | | :------ | :------ | | `tick` | `number` | Returns `bigint` ___ ### getValidTick ▸ **getValidTick**(`«destructured»`): `number` Parameters | Name | Type | Default value | | :------ | :------ | :------ | | `«destructured»` | `Object` | `undefined` | | › `roundDown?` | `boolean` | `true` | | › `tick` | `number` | `undefined` | | › `tickSpacing` | `number` | `undefined` | Returns `number` ___ ### maxLiquidityForAmount0Precise ▸ **maxLiquidityForAmount0Precise**(`sqrtRatioAX96`, `sqrtRatioBX96`, `amount0`): `bigint` Returns a precise maximum amount of liquidity received for a given amount of token 0 by dividing by Q64 instead of Q96 in the intermediate step, and shifting the subtracted ratio left by 32 bits. Parameters | Name | Type | Description | | :------ | :------ | :------ | | `sqrtRatioAX96` | `bigint` | The price at the lower boundary | | `sqrtRatioBX96` | `bigint` | The price at the upper boundary | | `amount0` | `bigint` | The token0 amount | Returns `bigint` liquidity for amount0, precise ___ ### maxLiquidityForAmount1 ▸ **maxLiquidityForAmount1**(`sqrtRatioAX96`, `sqrtRatioBX96`, `amount1`): `bigint` Computes the maximum amount of liquidity received for a given amount of token1 Parameters | Name | Type | Description | | :------ | :------ | :------ | | `sqrtRatioAX96` | `bigint` | The price at the lower tick boundary | | `sqrtRatioBX96` | `bigint` | The price at the upper tick boundary | | `amount1` | `bigint` | The token1 amount | Returns `bigint` liquidity for amount1 ___ ### orderPoolKey ▸ **orderPoolKey**(`poolKey`): `Object` Parameters | Name | Type | | :------ | :------ | | `poolKey` | `PoolKey` | Returns `Object` | Name | Type | | :------ | :------ | | `currency0` | \`0x$\{string}\` | | `currency1` | \`0x$\{string}\` | | `fee` | `number` | | `hooks` | \`0x$\{string}\` | | `tickSpacing` | `number` | ___ ### parseCall ▸ **parseCall**\<`T`\>(`sdkMethod`): `Promise`\<`CallData`\> Convenience function to call an SDK method and automatically parse the result as transaction object Type parameters | Name | Type | | :------ | :------ | | `T` | extends (...`args`: `any`[]) => `Promise`\<\`0x$\{string}\`\> | Parameters | Name | Type | Description | | :------ | :------ | :------ | | `sdkMethod` | `T` | A function that returns a Promise (encoded calldata) | Returns `Promise`\<`CallData`\> Promise with decoded transaction parameters ___ ### parseSwapData ▸ **parseSwapData**(`args`, `flETHIsCurrencyZero`): `ParsedSwapData` Parses raw swap log arguments into structured swap data Parameters | Name | Type | Description | | :------ | :------ | :------ | | `args` | `SwapLogArgs` | The swap log arguments | | `flETHIsCurrencyZero` | `boolean` | Whether flETH is currency 0 in the pool | Returns `ParsedSwapData` Parsed swap data with type and delta information ___ ### priceRatioToTick ▸ **priceRatioToTick**(`«destructured»`): `number` Parameters | Name | Type | Default value | | :------ | :------ | :------ | | `«destructured»` | `Object` | `undefined` | | › `decimals0` | `number` | `undefined` | | › `decimals1` | `number` | `undefined` | | › `isDirection1Per0` | `boolean` | `undefined` | | › `priceInput` | `string` | `undefined` | | › `shouldGetNearestUsableTick?` | `boolean` | `true` | | › `spacing` | `number` | `undefined` | Returns `number` ___ ### resolveIPFS ▸ **resolveIPFS**(`value`): `string` Parameters | Name | Type | | :------ | :------ | | `value` | `string` | Returns `string` ___ ### sellMemecoinWithPermit2 ▸ **sellMemecoinWithPermit2**(`params`): `Object` Parameters | Name | Type | | :------ | :------ | | `params` | `Object` | | `params.amountIn` | `bigint` | | `params.amountOutMin` | `bigint` | | `params.chainId` | `number` | | `params.intermediatePoolKey?` | `PoolWithHookData` | | `params.memecoin` | \`0x$\{string}\` | | `params.permitSingle?` | `PermitSingle` | | `params.positionManagerAddress` | \`0x$\{string}\` | | `params.referrer` | ``null`` \| \`0x$\{string}\` | | `params.signature?` | \`0x$\{string}\` | Returns `Object` | Name | Type | | :------ | :------ | | `calldata` | \`0x$\{string}\` | | `commands` | \`0x$\{string}\` | | `inputs` | \`0x$\{string}\`[] | ___ ### uint256ToBytes32 ▸ **uint256ToBytes32**(`value`): \`0x$\{string}\` Parameters | Name | Type | | :------ | :------ | | `value` | `bigint` | Returns \`0x$\{string}\` ___ ### uploadFileToIPFS ▸ **uploadFileToIPFS**(`params`): `Promise`\<`UploadResponse`\> Uploads a file to IPFS using Pinata Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Configuration and file data | | `params.file` | `File` | - | | `params.metadata?` | `Record`\<`string`, `string`\> | - | | `params.name?` | `string` | - | | `params.pinataConfig` | `PinataConfig` | - | Returns `Promise`\<`UploadResponse`\> Upload response with CID and other details ___ ### uploadImageToFlaunchAPI ▸ **uploadImageToFlaunchAPI**(`base64Image`): `Promise`\<`FlaunchUploadResponse`\> Uploads a base64 image to IPFS using the Flaunch API Parameters | Name | Type | Description | | :------ | :------ | :------ | | `base64Image` | `string` | Base64 encoded image data | Returns `Promise`\<`FlaunchUploadResponse`\> Upload response with IPFS hash ___ ### uploadImageToIPFS ▸ **uploadImageToIPFS**(`params`): `Promise`\<`UploadResponse`\> Uploads a base64 image to IPFS using Pinata Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Configuration and base64 image data | | `params.base64Image` | `string` | - | | `params.metadata?` | `Record`\<`string`, `string`\> | - | | `params.name?` | `string` | - | | `params.pinataConfig` | `PinataConfig` | - | Returns `Promise`\<`UploadResponse`\> Upload response with CID and other details ___ ### uploadJsonToIPFS ▸ **uploadJsonToIPFS**(`params`): `Promise`\<`UploadResponse`\> Uploads JSON data to IPFS using Pinata Parameters | Name | Type | Description | | :------ | :------ | :------ | | `params` | `Object` | Configuration and JSON data | | `params.json` | `Record`\<`string`, `any`\> | - | | `params.metadata?` | `Record`\<`string`, `string`\> | - | | `params.name?` | `string` | - | | `params.pinataConfig` | `PinataConfig` | - | Returns `Promise`\<`UploadResponse`\> Upload response with CID and other details ___ ### uploadMetadataToFlaunchAPI ▸ **uploadMetadataToFlaunchAPI**(`metadata`): `Promise`\<`FlaunchUploadResponse`\> Uploads metadata to IPFS using the Flaunch API Parameters | Name | Type | Description | | :------ | :------ | :------ | | `metadata` | `FlaunchMetadataRequest` | The metadata object to upload | Returns `Promise`\<`FlaunchUploadResponse`\> Upload response with IPFS hash ---