@flaunch/sdk
Version:
Flaunch SDK to easily interact with the Flaunch protocol
251 lines • 6.82 kB
TypeScript
import { Address, Call, Hex } from "viem";
import { PinataConfig } from "helpers/ipfs";
type Flatten<T> = {
[K in keyof T]: T[K];
} & {};
export interface Addresses {
[chainId: number]: Address;
}
export interface PoolKey {
currency0: Address;
currency1: Address;
fee: number;
tickSpacing: number;
hooks: Address;
}
export interface PoolWithHookData extends PoolKey {
hookData: Hex;
}
export interface CoinMetadata {
name: string;
description: string;
image: string;
external_link: string;
collaborators: string[];
discordUrl: string;
twitterUrl: string;
telegramUrl: string;
}
export interface IPFSParams {
metadata: {
base64Image: string;
description: string;
websiteUrl?: string;
discordUrl?: string;
twitterUrl?: string;
telegramUrl?: string;
};
pinataConfig?: PinataConfig;
}
/**
* Enumeration of Flaunch contract versions
*/
export declare enum FlaunchVersion {
V1 = "V1",
V1_1 = "V1_1",
V1_2 = "V1_2",
ANY = "ANY"
}
/**
* Enumeration of Verifiers for TokenImporter
*/
export declare enum Verifier {
CLANKER = "clanker",
DOPPLER = "doppler",
SOLANA = "solana",
VIRTUALS = "virtuals",
WHITELIST = "whitelist",
ZORA = "zora"
}
export declare enum LiquidityMode {
FULL_RANGE = "full-range",
CONCENTRATED = "concentrated"
}
export type CallWithDescription = Call & {
description?: string;
};
/**
* Enumeration of Permissions for TreasuryManagers. Defaults to OPEN.
*/
export declare enum Permissions {
OPEN = "open",
CLOSED = "closed",
WHITELISTED = "whitelisted"
}
export type ImportMemecoinParams = {
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
initialMarketCapUSD: number;
} | {
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
initialPriceUSD: number;
};
export type CalculateAddLiquidityAmountsParams = {
coinAddress: Address;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minMarketCap: string;
maxMarketCap: string;
currentMarketCap?: string;
version?: FlaunchVersion;
} | {
coinAddress: Address;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minPriceUSD: string;
maxPriceUSD: string;
currentPriceUSD?: number;
version?: FlaunchVersion;
};
export type GetAddLiquidityCallsParams = {
coinAddress: Address;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minMarketCap: string;
maxMarketCap: string;
initialMarketCapUSD?: number;
version?: FlaunchVersion;
slippagePercent?: number;
} | {
coinAddress: Address;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minPriceUSD: string;
maxPriceUSD: string;
initialPriceUSD?: number;
version?: FlaunchVersion;
slippagePercent?: number;
} | {
coinAddress: Address;
coinAmount: bigint;
flethAmount: bigint;
tickLower: number;
tickUpper: number;
currentTick?: number;
version?: FlaunchVersion;
slippagePercent?: number;
};
export type GetSingleSidedCoinAddLiquidityCallsParams = {
coinAddress: Address;
coinAmount: bigint;
initialMarketCapUSD?: number;
version?: FlaunchVersion;
tokenSupply?: bigint;
slippagePercent?: number;
} | {
coinAddress: Address;
coinAmount: bigint;
initialPriceUSD?: number;
version?: FlaunchVersion;
tokenSupply?: bigint;
slippagePercent?: number;
};
export type CheckSingleSidedAddLiquidityParams = {
coinAddress: Address;
liquidityMode: LiquidityMode;
minMarketCap: string;
maxMarketCap: string;
currentMarketCap?: string;
version?: FlaunchVersion;
} | {
coinAddress: Address;
liquidityMode: LiquidityMode;
minPriceUSD: string;
maxPriceUSD: string;
currentPriceUSD?: number;
version?: FlaunchVersion;
};
export interface SingleSidedLiquidityInfo {
isSingleSided: boolean;
shouldHideCoinInput: boolean;
shouldHideETHInput: boolean;
}
export type ImportAndAddLiquidityWithMarketCap = Flatten<{
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minMarketCap: string;
maxMarketCap: string;
initialMarketCapUSD: number;
version?: FlaunchVersion;
slippagePercent?: number;
}>;
export type ImportAndAddLiquidityWithPrice = Flatten<{
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
liquidityMode: LiquidityMode;
coinOrEthInputAmount: bigint;
inputToken: "coin" | "eth";
minPriceUSD: string;
maxPriceUSD: string;
initialPriceUSD: number;
version?: FlaunchVersion;
slippagePercent?: number;
}>;
export type ImportAndAddLiquidityWithExactAmounts = Flatten<{
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
coinAmount: bigint;
flethAmount: bigint;
tickLower: number;
tickUpper: number;
currentTick?: number;
version?: FlaunchVersion;
slippagePercent?: number;
}>;
export type ImportAndAddLiquidityParams = ImportAndAddLiquidityWithMarketCap | ImportAndAddLiquidityWithPrice | ImportAndAddLiquidityWithExactAmounts;
export type ImportAndSingleSidedCoinAddLiquidityWithMarketCap = Flatten<{
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
coinAmount: bigint;
initialMarketCapUSD: number;
version?: FlaunchVersion;
}>;
export type ImportAndSingleSidedCoinAddLiquidityWithPrice = Flatten<{
coinAddress: Address;
verifier?: Verifier;
creatorFeeAllocationPercent: number;
coinAmount: bigint;
initialPriceUSD: number;
version?: FlaunchVersion;
}>;
export type ImportAndSingleSidedCoinAddLiquidityParams = ImportAndSingleSidedCoinAddLiquidityWithMarketCap | ImportAndSingleSidedCoinAddLiquidityWithPrice;
/**
* Parsed data from a PoolCreated event
*/
export type PoolCreatedEventData = {
poolId: Hex;
memecoin: Address;
memecoinTreasury: Address;
tokenId: bigint;
currencyFlipped: boolean;
flaunchFee: bigint;
params: {
name: string;
symbol: string;
tokenUri: string;
initialTokenFairLaunch: bigint;
fairLaunchDuration?: bigint;
premineAmount: bigint;
creator: Address;
creatorFeeAllocation: number;
flaunchAt: bigint;
initialPriceParams: Hex;
feeCalculatorParams: Hex;
};
};
export {};
//# sourceMappingURL=types.d.ts.map