four-flap-meme-sdk
Version:
SDK for Flap bonding curve and four.meme TokenManager
37 lines (36 loc) • 2.11 kB
TypeScript
import { JsonRpcProvider, Wallet } from 'ethers';
type Providerish = JsonRpcProvider;
type Signerish = Wallet;
export declare class Helper3 {
readonly address: string;
readonly provider: Providerish;
protected constructor(address: string, provider: Providerish);
static connectByChain(chain: 'BSC' | 'BASE' | 'ARBITRUM_ONE', rpcUrl: string): Helper3;
private get contract();
getTokenInfo(token: string): Promise<any>;
tryBuy(token: string, amount: bigint, funds: bigint): Promise<any>;
trySell(token: string, amount: bigint): Promise<any>;
calcInitialPrice(maxRaising: bigint, totalSupply: bigint, offers: bigint, reserves: bigint): Promise<any>;
calcBuyAmount(ti: any, funds: bigint): Promise<any>;
calcBuyCost(ti: any, amount: bigint): Promise<any>;
calcSellCost(ti: any, amount: bigint): Promise<any>;
calcTradingFee(ti: any, funds: bigint): Promise<any>;
getPancakePair(token: string): Promise<any>;
WETH(): Promise<any>;
WHITE_LIST(): Promise<any>;
calcEthIn(token: string, amount: bigint): Promise<any>;
calcEthOut(token: string, amount: bigint): Promise<any>;
calcTokenIn(token: string, amountEth: bigint): Promise<any>;
calcTokenOut(token: string, amountEth: bigint): Promise<any>;
}
export declare class Helper3Writer extends Helper3 {
readonly signer: Signerish;
protected constructor(address: string, signer: Signerish);
static fromPrivateKeyByChain(chain: 'BSC' | 'BASE' | 'ARBITRUM_ONE', rpcUrl: string, privateKey: string): Helper3Writer;
private get writeContract();
buyWithEth(origin: bigint, token: string, to: string, funds: bigint, minAmount: bigint): Promise<any>;
sellForEth(origin: bigint, token: string, amount: bigint, minFunds: bigint, feeRate: bigint, feeRecipient: string): Promise<any>;
sellForEthFrom(origin: bigint, token: string, from: string, amount: bigint, minFunds: bigint, feeRate: bigint, feeRecipient: string): Promise<any>;
sellForEthTo(origin: bigint, token: string, from: string, to: string, amount: bigint, minFunds: bigint): Promise<any>;
}
export {};