
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@meme-sdk/trade
Advanced tools
A focused Node.js library for core trading functions on Four.meme platform
A focused Node.js library for core trading functions on Four.meme platform with automatic migration detection and dual exchange support.
npm install @meme-sdk/trade
import { FourMemeTrader } from '@meme-sdk/trade';
// Initialize trader
const trader = new FourMemeTrader({
rpcUrl: 'https://bsc-dataseed.binance.org',
privateKey: 'your-private-key-here'
});
// Check migration status
const migrationStatus = await trader.getMigrationStatus('0x...');
if (migrationStatus.migrated) {
// Token migrated to PancakeSwap
const buyResult = await trader.buyPancakeToken('0x...', 0.01); // Buy with 0.01 BNB
console.log(`Bought tokens: ${buyResult.estimatedTokens}`);
const sellResult = await trader.sellPancakeToken('0x...', 1000); // Sell 1000 tokens
console.log(`Sold tokens: ${sellResult.txHash}`);
} else {
// Token still on Four.meme
const buyResult = await trader.buyToken('0x...', 0.01); // Buy with 0.01 BNB
console.log(`Bought tokens: ${buyResult.estimatedTokens}`);
const sellResult = await trader.sellToken('0x...', 1000); // Sell 1000 tokens
console.log(`Sold tokens: ${sellResult.txHash}`);
}
Main trading class for Four.meme platform operations.
new FourMemeTrader(config: TraderConfig)
TraderConfig:
rpcUrl: string - BSC RPC endpointprivateKey: string - Your wallet private keytokenManagerAddress?: string - Four.meme TokenManager contract (optional)helper3Address?: string - Four.meme Helper3 contract (optional)pancakeRouterAddress?: string - PancakeSwap Router contract (optional)wbnbAddress?: string - WBNB token address (optional)getMigrationStatus(tokenAddress: string): Promise<MigrationStatus>Check if a token has migrated to PancakeSwap.
Returns:
{
migrated: boolean;
timestamp: number;
}
buyToken(tokenAddress: string, bnbAmount: number): Promise<BuyResult>Buy tokens using Four.meme (before migration).
Returns:
{
estimatedTokens: string;
realTokenBalance: bigint;
txHash: string;
gasUsed: string;
duration: number;
}
sellToken(tokenAddress: string, tokenAmount: number): Promise<SellResult>Sell tokens using Four.meme (before migration).
Returns:
{
txHash: string;
gasUsed: string;
}
buyPancakeToken(tokenAddress: string, bnbAmount: number): Promise<BuyResult>Buy tokens using PancakeSwap (after migration).
sellPancakeToken(tokenAddress: string, tokenAmount: number): Promise<SellResult>Sell tokens using PancakeSwap (after migration).
getWalletAddress(): stringGet the current wallet address.
import { formatBNB, parseBNB, isValidAddress, sleep } from '@meme-sdk/trade';
// Format BNB amount
const formatted = formatBNB(ethers.parseEther('1.0')); // "1.0"
// Parse BNB string
const parsed = parseBNB('1.0'); // 1000000000000000000n
// Validate address
const isValid = isValidAddress('0x...'); // boolean
// Sleep
await sleep(1000); // Wait 1 second
import { DEFAULT_ADDRESSES, DEFAULT_RPC_URLS } from '@meme-sdk/trade';
// Default contract addresses
DEFAULT_ADDRESSES.TOKEN_MANAGER
DEFAULT_ADDRESSES.HELPER3
DEFAULT_ADDRESSES.PANCAKE_ROUTER
DEFAULT_ADDRESSES.WBNB
// Default RPC URLs
DEFAULT_RPC_URLS.BSC_MAINNET
DEFAULT_RPC_URLS.BSC_TESTNET
The library automatically detects the migration status of any Four.meme token:
The library checks the liquidityAdded status from the Helper3 contract:
false = Token still on Four.meme (use Four.meme contracts)true = Token migrated to PancakeSwap (use PancakeRouter)buyToken and sellTokenbuyPancakeToken and sellPancakeTokenThe library throws descriptive errors for common issues:
MIT
For issues and questions, please visit: https://github.com/meme-sdk/fourmeme-trading/issues
FAQs
A focused Node.js library for core trading functions on Four.meme platform
We found that @meme-sdk/trade demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.