@shogun-sdk/money-legos
Version:
Shogun Money Legos: clients and types for quotes, memes, prices, balances, fees, validations, etc.
83 lines • 2.59 kB
TypeScript
import { ethers } from 'ethers';
export type FourMemeTokenInfo = {
version: bigint;
tokenManager: string;
quote: string;
lastPrice: bigint;
tradingFeeRate: bigint;
minTradingFee: bigint;
launchTime: bigint;
offers: bigint;
maxOffers: bigint;
funds: bigint;
maxFunds: bigint;
liquidityAdded: boolean;
};
export type FourMemeTryBuyResponse = {
tokenManager: string;
quote: string;
estimatedAmount: bigint;
estimatedCost: bigint;
estimatedFee: bigint;
amountMsgValue: bigint;
amountApproval: bigint;
amountFunds: bigint;
};
export type FourMemeTryBuyParams = {
tokenAddress: string;
tokenAmount?: bigint;
nativeAmount?: bigint;
};
export type FourMemeTrySellParams = {
tokenAddress: string;
amount: bigint;
};
export type FourMemeTrySellResponse = {
tokenManager: string;
quote: string;
funds: bigint;
fee: bigint;
};
export declare class FourMeme {
tokenManagerV2Contract: ethers.Contract;
tokenManagerHelperV3: TokenManagerHelperV3;
private _initialized;
private _initializing;
static create(): Promise<FourMeme>;
connect(): Promise<void>;
private initialize;
}
export declare class TokenManagerHelperV3 {
private provider;
private bscTokenManagerHelper3Contract;
constructor(provider: ethers.JsonRpcProvider);
/**
* Get information about the token.
*
* @param tokenAddress The address of your token
*/
getTokenInfo(tokenAddress: string): Promise<FourMemeTokenInfo | null>;
/**
* Simulate a buy and get estimated results.
*
* @param tokenAddress The address of the token to purchase
* @param tokenAmount The amount of the token the user wants to purchase
* @param nativeAmount The amount of money the user wants to spend (in the quote currency)
*
* @example
* - If the user wants to buy 10_000 tokens:
* - Call with param 'tokenAmount' set to 10000*1e18
*
* - If the user wants to spend 10 BNB to purchase tokens:
* - Call with param 'nativeAmount' set to 10*1e18
*/
tryBuy(params: FourMemeTryBuyParams): Promise<FourMemeTryBuyResponse | null>;
/**
* Just pre-calculate the result if the user sells a specified amount of tokens if needed.
*
* @param tokenAddress The address of the token to purchase
* @param amount The amount of token that the user wants to sell
*/
trySell(params: FourMemeTrySellParams): Promise<FourMemeTrySellResponse | null>;
}
//# sourceMappingURL=fourMeme.d.ts.map