Interact with famous Neo N3 smart contracts and build DeFi applications
Interact with Flamingo DEX for token swaps and liquidity provision:
// Get Flamingo exchange rates
const rates = await tools.flamingo_get_exchange_rate({
fromToken: "NEO",
toToken: "GAS",
amount: "10"
});
// Execute token swap on Flamingo
const swapResult = await tools.flamingo_swap_tokens({
fromAddress: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
fromToken: "NEO",
toToken: "GAS",
amount: "10",
minReceived: "45.5", // Minimum amount to receive
password: "wallet_password"
});
console.log("Swap executed:", swapResult);
// Output:
// {
// "txid": "0x1234567890abcdef...",
// "fromAmount": "10.00000000",
// "toAmount": "46.25340000",
// "fee": "0.00234567",
// "success": true
// }
Store and retrieve files using NeoFS distributed storage network:
// Upload file to NeoFS
const uploadResult = await tools.neofs_upload_file({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
filename: "document.pdf",
content: "base64_encoded_file_content",
password: "wallet_password"
});
// Get file information
const fileInfo = await tools.neofs_get_file_info({
fileId: uploadResult.fileId
});
// Download file from NeoFS
const downloadResult = await tools.neofs_download_file({
fileId: uploadResult.fileId,
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj"
});
console.log("File operations:", {
upload: uploadResult,
info: fileInfo,
download: downloadResult
});
// Output:
// {
// "upload": {
// "fileId": "0xabc123def456...",
// "size": 1024,
// "storageCost": "0.5"
// },
// "info": {
// "filename": "document.pdf",
// "size": 1024,
// "owner": "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
// "created": "2024-01-15T10:30:00Z"
// }
// }
Interact with NeoBurger gaming ecosystem and NFT marketplace:
// Get user's NeoBurger NFTs
const userNFTs = await tools.neoburger_get_user_nfts({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj"
});
// Get NeoBurger marketplace listings
const marketplaceItems = await tools.neoburger_get_marketplace({
category: "burgers",
minPrice: "1",
maxPrice: "100"
});
// Purchase NFT from marketplace
const purchaseResult = await tools.neoburger_purchase_nft({
buyerAddress: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
nftId: "burger_001",
price: "25.5",
password: "wallet_password"
});
// Stake NeoBurger for rewards
const stakeResult = await tools.neoburger_stake({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
nftId: "burger_001",
duration: 30, // days
password: "wallet_password"
});
console.log("NeoBurger operations:", {
nfts: userNFTs,
marketplace: marketplaceItems,
purchase: purchaseResult,
stake: stakeResult
});
Lend and borrow assets using NeoCompound DeFi protocol:
// Get current lending rates
const rates = await tools.neocompound_get_rates();
// Supply assets to earn interest
const supplyResult = await tools.neocompound_supply({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
asset: "GAS",
amount: "100",
password: "wallet_password"
});
// Get user's supply balance and earned interest
const supplyBalance = await tools.neocompound_get_supply_balance({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
asset: "GAS"
});
// Borrow against collateral
const borrowResult = await tools.neocompound_borrow({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
asset: "NEO",
amount: "5",
collateralAsset: "GAS",
password: "wallet_password"
});
// Repay borrowed amount
const repayResult = await tools.neocompound_repay({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
asset: "NEO",
amount: "5.25", // Principal + interest
password: "wallet_password"
});
console.log("Lending protocol:", {
rates: rates,
supply: supplyBalance,
borrow: borrowResult,
repay: repayResult
});
Participate in investment pools and receive dividends:
// Get available investment pools
const pools = await tools.grandshare_get_pools();
// Join an investment pool
const joinResult = await tools.grandshare_join_pool({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
poolId: "tech_fund_001",
amount: "50",
password: "wallet_password"
});
// Get user's investment positions
const positions = await tools.grandshare_get_positions({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj"
});
// Claim dividends
const claimResult = await tools.grandshare_claim_dividends({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
poolId: "tech_fund_001",
password: "wallet_password"
});
// Exit investment pool
const exitResult = await tools.grandshare_exit_pool({
address: "NZNos2WqTbu5oCgyfss9kUJgBXJqhuYAaj",
poolId: "tech_fund_001",
shares: "25", // Partial exit
password: "wallet_password"
});
console.log("Investment operations:", {
pools: pools,
positions: positions,
claim: claimResult,
exit: exitResult
});