four-flap-meme-sdk
Version:
SDK for Flap bonding curve and four.meme TokenManager
120 lines (119 loc) • 3.55 kB
TypeScript
import { BundleStatus } from '../clients/club48.js';
import type { SoulPointSignatureMode, VNormalizationMode } from '../clients/club48.js';
export type FlapBundleConfig = {
rpcUrl: string;
club48Endpoint?: string;
club48ExplorerEndpoint?: string;
spMode?: SoulPointSignatureMode;
spVMode?: VNormalizationMode;
spPrivateKey?: string;
bundleBlockOffset?: number;
noMerge?: boolean;
tipAmountWei?: bigint;
txType?: 0 | 2;
gasLimitMultiplier?: number;
waitTimeoutMs?: number;
slippageBps?: number;
};
export type FlapChainForBundle = 'BSC';
export type FlapCreateWithBundleBuyParams = {
chain: FlapChainForBundle;
privateKeys: string[];
buyAmounts: string[];
tokenInfo: {
name: string;
symbol: string;
meta: string;
};
quoteToken?: string;
tokenAddress: string;
config: FlapBundleConfig;
dexThresh?: number;
migratorType?: number;
taxRate?: number;
salt?: string;
};
export type FlapCreateWithBundleBuyResult = {
bundleUuid: string;
tokenAddress?: string;
status: BundleStatus;
createTx: string;
buyTxs: string[];
};
/**
* Flap Protocol: 创建代币 + 捆绑购买
*/
export declare function createTokenWithBundleBuy(params: FlapCreateWithBundleBuyParams): Promise<FlapCreateWithBundleBuyResult>;
export type FlapBatchBuyParams = {
chain: FlapChainForBundle;
privateKeys: string[];
buyAmounts: string[];
tokenAddress: string;
config: FlapBundleConfig;
};
export type FlapBatchBuyResult = {
bundleUuid: string;
status: BundleStatus;
buyTxs: string[];
};
/**
* Flap Protocol: 批量购买
*/
export declare function batchBuyWithBundle(params: FlapBatchBuyParams): Promise<FlapBatchBuyResult>;
export type FlapBatchSellParams = {
chain: FlapChainForBundle;
privateKeys: string[];
sellAmounts: string[];
tokenAddress: string;
config: FlapBundleConfig;
};
export type FlapBatchSellResult = {
bundleUuid: string;
status: BundleStatus;
sellTxs: string[];
};
/**
* Flap Protocol: 批量卖出
*/
export declare function batchSellWithBundle(params: FlapBatchSellParams): Promise<FlapBatchSellResult>;
export type FlapPrivateBase = {
chain: FlapChainForBundle;
config: FlapBundleConfig;
};
export type FlapPrivateBuyParams = FlapPrivateBase & {
privateKey: string;
tokenAddress: string;
amountIn: string;
to?: string;
spPrivateKey?: string;
};
export type FlapPrivateSellParams = FlapPrivateBase & {
privateKey: string;
tokenAddress: string;
amount: string;
minEth?: bigint;
spPrivateKey?: string;
};
export declare function flapPrivateBuy(params: FlapPrivateBuyParams): Promise<string>;
export declare function flapPrivateSell(params: FlapPrivateSellParams): Promise<string>;
export type FlapBatchPrivateBuyParams = FlapPrivateBase & {
privateKeys: string[];
amountsIn: string[];
tokenAddress: string;
spPrivateKey: string;
};
export type FlapBatchPrivateSellParams = FlapPrivateBase & {
privateKeys: string[];
amounts: string[];
tokenAddress: string;
spPrivateKey?: string;
minEthEach?: bigint;
};
export type FlapBatchPrivateSellResult = {
submitted: boolean;
sellTxs: string[];
bundleUuid?: string;
status?: BundleStatus;
};
export declare function flapBatchPrivateBuy(params: FlapBatchPrivateBuyParams): Promise<boolean>;
export declare function flapBatchPrivateSell(params: FlapBatchPrivateSellParams): Promise<FlapBatchPrivateSellResult>;