-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathllms-full.txt
More file actions
2333 lines (1953 loc) · 68.3 KB
/
Copy pathllms-full.txt
File metadata and controls
2333 lines (1953 loc) · 68.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# BNB Chain MCP - Complete Reference
> Comprehensive documentation for the BNB Chain MCP Server - enabling AI agents to interact with BNB Chain and EVM-compatible blockchains.
---
## Table of Contents
1. [Project Overview](#1-project-overview)
2. [Installation & Configuration](#2-installation--configuration)
3. [Supported Networks](#3-supported-networks)
4. [Complete Tool Reference](#4-complete-tool-reference)
5. [Data Provider Integrations](#5-data-provider-integrations)
6. [Environment Variables](#6-environment-variables)
7. [Server Modes](#7-server-modes)
8. [Error Handling](#8-error-handling)
9. [Examples & Use Cases](#9-examples--use-cases)
---
## 1. Project Overview
### Description
BNB Chain MCP is a TypeScript-based Model Context Protocol (MCP) server that enables AI agents to interact with BNB Chain and EVM-compatible blockchains through natural language commands. Built on the MCP SDK, it provides a standardized interface for blockchain operations, market data, security analysis, and DeFi interactions.
### Target Users
- **AI Agents**: Claude, ChatGPT, and other LLM-powered assistants
- **Developers**: Building blockchain-aware AI applications
- **Traders**: Automated analysis and execution
- **Researchers**: On-chain data analysis and monitoring
### Key Features
- 🔄 **175+ Tools** across 22 functional categories
- 🌐 **8+ Networks** supported (mainnets + testnets)
- 🔒 **Security-First** with GoPlus integration
- 📊 **Rich Analytics** via DefiLlama, CoinGecko, LunarCrush
- ⚡ **Multiple Transport Modes** (stdio, HTTP, SSE)
### Architecture
```
┌─────────────────────────────────────────────────────────┐
│ MCP Server │
├─────────────────────────────────────────────────────────┤
│ Transport Layer (stdio / HTTP / SSE) │
├─────────────────────────────────────────────────────────┤
│ Tool Registration & Routing │
├──────────────┬──────────────┬──────────────┬───────────┤
│ EVM Modules │ Data Modules │ Analytics │ Utilities │
│ - Network │ - News │ - Market │ - Logger │
│ - Tokens │ - Social │ - DeFi │ - Helper │
│ - Swap │ - Governance │ - DEX │ │
│ - Bridge │ │ │ │
│ - Security │ │ │ │
│ - Staking │ │ │ │
│ - Lending │ │ │ │
│ - NFT │ │ │ │
│ - ... │ │ │ │
├──────────────┴──────────────┴──────────────┴───────────┤
│ viem (Ethereum Client) + External APIs │
└─────────────────────────────────────────────────────────┘
```
---
## 2. Installation & Configuration
### NPX (Recommended)
```bash
npx @nirholas/bnbchain-mcp@latest
```
### Local Development
```bash
git clone https://github.com/nirholas/bnb-chain-mcp
cd bnb-chain-mcp
bun install
bun dev # stdio mode
bun dev:http # HTTP mode
bun dev:sse # SSE mode
```
### Claude Desktop Configuration
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"bnb-chain-mcp": {
"command": "npx",
"args": ["-y", "@nirholas/bnbchain-mcp@latest"],
"env": {
"PRIVATE_KEY": "0x...",
"COINGECKO_API_KEY": "CG-xxx",
"LUNARCRUSH_API_KEY": "xxx"
}
}
}
}
```
### Cursor Configuration
Add to MCP settings:
```json
{
"mcpServers": {
"bnb-chain-mcp": {
"command": "npx",
"args": ["-y", "@nirholas/bnbchain-mcp@latest"],
"env": {
"PRIVATE_KEY": "0x..."
}
}
}
}
```
### ChatGPT Developer Mode
1. Enable Developer Mode in ChatGPT settings
2. Start HTTP server: `npx @nirholas/bnbchain-mcp@latest --http`
3. Add app URL in ChatGPT: `http://localhost:3001/mcp`
---
## 3. Supported Networks
### Mainnets
| Network | Chain ID | Native Token | RPC Default |
|---------|----------|--------------|-------------|
| Ethereum | 1 | ETH | eth.llamarpc.com |
| BNB Smart Chain | 56 | BNB | bsc-dataseed.binance.org |
| Arbitrum One | 42161 | ETH | arb1.arbitrum.io/rpc |
| Polygon | 137 | MATIC | polygon-rpc.com |
| Base | 8453 | ETH | mainnet.base.org |
| Optimism | 10 | ETH | mainnet.optimism.io |
| opBNB | 204 | BNB | opbnb-mainnet-rpc.bnbchain.org |
| IoTeX | 4689 | IOTX | babel-api.mainnet.iotex.io |
### Testnets
| Network | Chain ID | Mainnet Equivalent |
|---------|----------|-------------------|
| Sepolia | 11155111 | Ethereum |
| BSC Testnet | 97 | BNB Smart Chain |
| Arbitrum Sepolia | 421614 | Arbitrum One |
| Base Sepolia | 84532 | Base |
| Polygon Amoy | 80002 | Polygon |
| Optimism Sepolia | 11155420 | Optimism |
| opBNB Testnet | 5611 | opBNB |
| IoTeX Testnet | 4690 | IoTeX |
### Network Aliases
You can use friendly names instead of chain IDs:
- `ethereum`, `mainnet`, `eth` → Chain ID 1
- `bsc`, `binance` → Chain ID 56
- `arbitrum`, `arb` → Chain ID 42161
- `polygon`, `matic` → Chain ID 137
- `base` → Chain ID 8453
- `optimism`, `op` → Chain ID 10
---
## 4. Complete Tool Reference
### 4.1 Network Module (8 tools)
#### `get_chain_info`
Get chain information for a specific network.
- **Parameters:**
- `network` (string, optional): Network name or chain ID. Default: "ethereum"
- **Returns:** Chain ID, name, native currency, block explorer, RPC URL
#### `get_supported_networks`
Get list of all supported networks with metadata.
- **Parameters:** None
- **Returns:** Array of network objects with chain ID, name, aliases
#### `estimate_block_time`
Estimate average block time for a network.
- **Parameters:**
- `network` (string, optional): Network identifier
- `sampleSize` (number, optional): Blocks to sample. Default: 100
- **Returns:** Average block time in seconds
#### `get_finality_status`
Get finality status for a block or transaction.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number, optional): Block to check
- `txHash` (string, optional): Transaction hash
- **Returns:** Finality status, confirmations, safe/finalized flags
#### `get_pending_transactions_info`
Get mempool information and pending transaction count.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Pending count, gas price trends
#### `get_network_metadata`
Get comprehensive network metadata.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Full chain config, explorers, contracts, tokens
#### `get_gas_oracle`
Get comprehensive gas price recommendations.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Safe/standard/fast gas prices, base fee, priority fees
#### `get_network_health`
Check network synchronization and health status.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Sync status, block height, peer count
---
### 4.2 Blocks Module (9 tools)
#### `get_block_by_hash`
Get a block by its hash.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockHash` (string): Block hash (0x...)
- `includeTransactions` (boolean, optional): Include full tx data
- **Returns:** Block object with header and transactions
#### `get_block_by_number`
Get a block by number.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number): Block number
- `includeTransactions` (boolean, optional): Include full tx data
- **Returns:** Block object
#### `get_latest_block`
Get the most recent block.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Latest block with full details
#### `get_block_with_transactions`
Get block with full transaction details.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number): Block number
- **Returns:** Block with expanded transaction objects
#### `get_uncle_blocks`
Get uncle/ommer blocks for a specific block.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number): Block number
- **Returns:** Array of uncle block headers
#### `get_block_receipts`
Get all transaction receipts for a block.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number): Block number
- **Returns:** Array of transaction receipts with logs
#### `get_block_range`
Get summary information for a range of blocks.
- **Parameters:**
- `network` (string, optional): Network identifier
- `startBlock` (number): Start block number
- `endBlock` (number): End block number
- **Returns:** Array of block summaries
#### `get_block_rewards`
Estimate block rewards for miners/validators.
- **Parameters:**
- `network` (string, optional): Network identifier
- `blockNumber` (number): Block number
- **Returns:** Base reward, transaction fees, total reward
#### `get_blocks_by_miner`
Find recent blocks produced by a specific miner/validator.
- **Parameters:**
- `network` (string, optional): Network identifier
- `minerAddress` (string): Miner/validator address
- `limit` (number, optional): Max blocks to return. Default: 10
- **Returns:** Array of blocks produced by the address
---
### 4.3 Transactions Module (6 tools)
#### `get_transaction`
Get detailed information about a transaction.
- **Parameters:**
- `network` (string, optional): Network identifier
- `txHash` (string): Transaction hash
- **Returns:** Full transaction details including receipt
#### `estimate_gas`
Estimate gas cost for a transaction.
- **Parameters:**
- `network` (string, optional): Network identifier
- `to` (string): Recipient address
- `value` (string, optional): Value in wei
- `data` (string, optional): Call data
- **Returns:** Estimated gas units
#### `speed_up_transaction`
Speed up a pending transaction with higher gas.
- **Parameters:**
- `network` (string, optional): Network identifier
- `txHash` (string): Original transaction hash
- `privateKey` (string): Wallet private key
- `gasPriceMultiplier` (number, optional): Multiplier. Default: 1.5
- **Returns:** New transaction hash
#### `cancel_transaction`
Cancel a pending transaction.
- **Parameters:**
- `network` (string, optional): Network identifier
- `nonce` (number): Transaction nonce to cancel
- `privateKey` (string): Wallet private key
- **Returns:** Cancellation transaction hash
#### `get_pending_transaction_count`
Get count of pending transactions for an address.
- **Parameters:**
- `network` (string, optional): Network identifier
- `address` (string): Wallet address
- **Returns:** Pending nonce vs confirmed nonce
#### `simulate_transaction`
Simulate transaction execution.
- **Parameters:**
- `network` (string, optional): Network identifier
- `to` (string): Recipient address
- `value` (string, optional): Value in wei
- `data` (string, optional): Call data
- `from` (string, optional): Sender address
- **Returns:** Simulation result, gas used, return data
---
### 4.4 Tokens Module (14 tools)
#### `get_erc20_token_info`
Get ERC20 token information.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `network` (string, optional): Network identifier
- **Returns:** Name, symbol, decimals, total supply
#### `get_native_balance`
Get native token balance for an address.
- **Parameters:**
- `network` (string, optional): Network identifier
- `address` (string, optional): Address to check
- `privateKey` (string, optional): Derive address from key
- **Returns:** Balance in native units and wei
#### `get_erc20_balance`
Get ERC20 token balance.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `address` (string): Address to check
- `network` (string, optional): Network identifier
- **Returns:** Balance with token info
#### `create_erc20_token`
Deploy a new ERC20 token.
- **Parameters:**
- `name` (string): Token name
- `symbol` (string): Token symbol
- `network` (string, optional): Network identifier
- `privateKey` (string): Deployer private key
- **Returns:** Deployed token address, transaction hash
#### `wrap_native_token`
Wrap native tokens (ETH→WETH, BNB→WBNB).
- **Parameters:**
- `amount` (string): Amount to wrap (e.g., "1.5")
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash, wrapped token address
#### `unwrap_native_token`
Unwrap wrapped tokens (WETH→ETH, WBNB→BNB).
- **Parameters:**
- `amount` (string): Amount to unwrap
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash
#### `get_wrapped_native_balance`
Get wrapped native token balance.
- **Parameters:**
- `address` (string): Address to check
- `network` (string, optional): Network identifier
- **Returns:** WETH/WBNB/WMATIC balance
#### `batch_transfer_erc20`
Transfer tokens to multiple recipients.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `recipients` (array): [{address, amount}] pairs
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Array of transaction results
#### `burn_erc20_tokens`
Burn ERC20 tokens.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `amount` (string): Amount to burn
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Burn transaction hash
#### `get_token_holder_count`
Estimate token holder count from events.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `network` (string, optional): Network identifier
- **Returns:** Estimated holder count
#### `check_token_allowance`
Check ERC20 allowance for a spender.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `owner` (string): Token owner address
- `spender` (string): Spender address
- `network` (string, optional): Network identifier
- **Returns:** Allowance amount
#### `approve_token_spending`
Approve spender to use tokens.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `spender` (string): Spender address
- `amount` (string): Amount to approve
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Approval transaction hash
#### `revoke_token_approval`
Revoke token spending approval.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `spender` (string): Spender address
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Revocation transaction hash
#### `get_token_supply_info`
Get comprehensive token supply info.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `network` (string, optional): Network identifier
- **Returns:** Total, burned, circulating supply
---
### 4.5 Wallet Module (13 tools)
#### `get_address_from_private_key`
Derive EVM address from private key.
- **Parameters:**
- `privateKey` (string): Private key (0x...)
- **Returns:** Derived address
#### `generate_mnemonic`
Generate BIP-39 mnemonic phrase.
- **Parameters:**
- `wordCount` (number, optional): 12 or 24. Default: 12
- **Returns:** Mnemonic phrase
#### `derive_addresses_from_mnemonic`
Derive multiple addresses from mnemonic.
- **Parameters:**
- `mnemonic` (string): BIP-39 mnemonic
- `count` (number, optional): Addresses to derive. Default: 5
- `startIndex` (number, optional): Starting index. Default: 0
- **Returns:** Array of address/path pairs
#### `create_wallet`
Create a new random wallet.
- **Parameters:** None
- **Returns:** Address, private key, mnemonic
#### `import_wallet_from_mnemonic`
Import wallet from mnemonic.
- **Parameters:**
- `mnemonic` (string): BIP-39 mnemonic
- `index` (number, optional): Derivation index. Default: 0
- **Returns:** Address, private key
#### `transfer_native_token`
Transfer native tokens (ETH, BNB, MATIC).
- **Parameters:**
- `to` (string): Recipient address
- `amount` (string): Amount in native units
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash
#### `approve_token_spending`
Approve ERC20 spending.
- **Parameters:**
- `tokenAddress` (string): Token contract
- `spender` (string): Spender address
- `amount` (string): Amount to approve
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Approval transaction hash
#### `transfer_erc20`
Transfer ERC20 tokens.
- **Parameters:**
- `tokenAddress` (string): Token contract
- `to` (string): Recipient address
- `amount` (string): Amount to transfer
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash
#### `get_token_approvals`
Get list of token approvals.
- **Parameters:**
- `address` (string): Wallet address
- `tokenAddresses` (array): Tokens to check
- `network` (string, optional): Network identifier
- **Returns:** Array of approval details
#### `revoke_token_approval`
Revoke token approval.
- **Parameters:**
- `tokenAddress` (string): Token contract
- `spender` (string): Spender to revoke
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Revocation transaction hash
#### `sign_message`
Sign a message with private key.
- **Parameters:**
- `message` (string): Message to sign
- `privateKey` (string): Wallet private key
- **Returns:** Signature
#### `verify_message`
Verify signed message and recover signer.
- **Parameters:**
- `message` (string): Original message
- `signature` (string): Signature to verify
- **Returns:** Recovered signer address
#### `get_wallet_portfolio`
Get comprehensive portfolio summary.
- **Parameters:**
- `address` (string): Wallet address
- `network` (string, optional): Network identifier
- **Returns:** Native balance, token balances, total value
---
### 4.6 Swap Module (12 tools)
#### `get_swap_quote`
Get swap quote for token exchange.
- **Parameters:**
- `tokenIn` (string): Token to sell address
- `tokenOut` (string): Token to buy address
- `amountIn` (string): Input amount in wei
- `network` (string, optional): Network identifier
- `dex` (string, optional): Specific DEX (uniswap, pancakeswap)
- **Returns:** Expected output, price impact, router address
#### `execute_swap`
Execute a token swap.
- **Parameters:**
- `tokenIn` (string): Token to sell
- `tokenOut` (string): Token to buy
- `amountIn` (string): Input amount in wei
- `minAmountOut` (string): Minimum output (slippage protection)
- `network` (string, optional): Network identifier
- `privateKey` (string): Wallet private key
- `dex` (string, optional): Specific DEX
- `deadline` (number, optional): Deadline in seconds. Default: 1200
- **Returns:** Transaction hash, amounts swapped
#### `get_best_route`
Find optimal swap route across DEXs.
- **Parameters:**
- `tokenIn` (string): Token to sell
- `tokenOut` (string): Token to buy
- `amountIn` (string): Input amount
- `network` (string, optional): Network identifier
- **Returns:** Best route with amounts from each DEX
#### `get_dex_liquidity`
Get liquidity for a trading pair.
- **Parameters:**
- `tokenA` (string): First token address
- `tokenB` (string): Second token address
- `network` (string, optional): Network identifier
- `dex` (string, optional): Specific DEX
- **Returns:** Pool reserves, liquidity depth
#### `get_price_impact`
Calculate price impact for trade size.
- **Parameters:**
- `tokenIn` (string): Token to sell
- `tokenOut` (string): Token to buy
- `amountIn` (string): Trade size in wei
- `network` (string, optional): Network identifier
- **Returns:** Price impact percentage
#### `get_supported_dexs`
List supported DEXs on a network.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Array of DEX names and router addresses
#### `add_liquidity`
Add liquidity to a DEX pair.
- **Parameters:**
- `tokenA` (string): First token address
- `tokenB` (string): Second token address
- `amountA` (string): Amount of token A
- `amountB` (string): Amount of token B
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- `dex` (string, optional): Specific DEX
- **Returns:** Transaction hash, LP tokens received
#### `add_liquidity_native`
Add liquidity with native token.
- **Parameters:**
- `token` (string): Token address to pair with native
- `amountToken` (string): Token amount
- `amountNative` (string): Native token amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash, LP tokens received
#### `remove_liquidity`
Remove liquidity from a DEX pair.
- **Parameters:**
- `tokenA` (string): First token address
- `tokenB` (string): Second token address
- `liquidity` (string): LP tokens to burn
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- `dex` (string, optional): Specific DEX
- **Returns:** Transaction hash, tokens received
#### `get_lp_balance`
Get LP token balance.
- **Parameters:**
- `tokenA` (string): First token address
- `tokenB` (string): Second token address
- `address` (string): Wallet address
- `network` (string, optional): Network identifier
- **Returns:** LP balance, share of pool
#### `get_pool_reserves`
Get pool reserves.
- **Parameters:**
- `tokenA` (string): First token address
- `tokenB` (string): Second token address
- `network` (string, optional): Network identifier
- **Returns:** Reserve0, reserve1, total supply
#### `calculate_arbitrage`
Calculate arbitrage opportunity.
- **Parameters:**
- `tokenA` (string): First token
- `tokenB` (string): Second token
- `amount` (string): Trade amount
- `network` (string, optional): Network identifier
- **Returns:** Arbitrage profit potential across DEXs
---
### 4.7 Security Module (20 tools)
#### `analyze_token_security`
Analyze token for security risks.
- **Parameters:**
- `tokenAddress` (string): Token contract address
- `network` (string, optional): Network identifier
- **Returns:** Risk score, risk level, detected issues
#### `check_approval_risks`
Check wallet approvals for risks.
- **Parameters:**
- `walletAddress` (string): Wallet to check
- `tokenAddresses` (array, optional): Specific tokens
- `network` (string, optional): Network identifier
- **Returns:** Risky unlimited approvals
#### `verify_contract`
Check contract verification status.
- **Parameters:**
- `contractAddress` (string): Contract address
- `network` (string, optional): Network identifier
- **Returns:** Verification status, code size, proxy detection
#### `simulate_transaction`
Simulate transaction for safety.
- **Parameters:**
- `to` (string): Target address
- `value` (string, optional): Value in wei
- `data` (string, optional): Call data
- `network` (string, optional): Network identifier
- **Returns:** Simulation result, warnings
#### `check_address_type`
Determine address type (EOA, contract, known entity).
- **Parameters:**
- `address` (string): Address to check
- `network` (string, optional): Network identifier
- **Returns:** Address type classification
#### `decode_transaction_data`
Decode transaction input data.
- **Parameters:**
- `data` (string): Transaction input data
- `abi` (array, optional): Contract ABI
- **Returns:** Decoded function call
#### `detect_rug_pull_risk`
Analyze token for rug pull indicators.
- **Parameters:**
- `tokenAddress` (string): Token to analyze
- `network` (string, optional): Network identifier
- **Returns:** Risk indicators (hidden mint, honeypot, etc.)
#### `get_holder_distribution`
Analyze token holder distribution.
- **Parameters:**
- `tokenAddress` (string): Token address
- `network` (string, optional): Network identifier
- **Returns:** Top holders, concentration metrics
#### `check_contract_ownership`
Verify contract ownership status.
- **Parameters:**
- `contractAddress` (string): Contract address
- `network` (string, optional): Network identifier
- **Returns:** Owner address, renounced status
#### `detect_honeypot`
Check if token is a honeypot.
- **Parameters:**
- `tokenAddress` (string): Token address
- `network` (string, optional): Network identifier
- **Returns:** Honeypot status, buy/sell taxes
#### `analyze_contract_permissions`
Analyze contract for dangerous permissions.
- **Parameters:**
- `contractAddress` (string): Contract address
- `network` (string, optional): Network identifier
- **Returns:** Dangerous functions detected
#### `verify_contract_source`
Check source verification on explorers.
- **Parameters:**
- `contractAddress` (string): Contract address
- `network` (string, optional): Network identifier
- **Returns:** Verification status per explorer
#### `goplus_token_security`
GoPlus token security analysis.
- **Parameters:**
- `tokenAddress` (string): Token address
- `chainId` (number, optional): Chain ID
- **Returns:** Comprehensive GoPlus security report
#### `goplus_address_security`
GoPlus address security check.
- **Parameters:**
- `address` (string): Address to check
- **Returns:** Malicious activity associations
#### `goplus_approval_security`
GoPlus approval security analysis.
- **Parameters:**
- `tokenAddress` (string): Token address
- `ownerAddress` (string): Owner address
- `chainId` (number, optional): Chain ID
- **Returns:** Approval security assessment
#### `goplus_nft_security`
GoPlus NFT collection security.
- **Parameters:**
- `contractAddress` (string): NFT contract
- `chainId` (number, optional): Chain ID
- **Returns:** NFT security analysis
#### `goplus_dapp_security`
GoPlus dApp/website security.
- **Parameters:**
- `url` (string): dApp URL
- **Returns:** Phishing detection results
#### `goplus_signature_decode`
GoPlus signature/permit decode.
- **Parameters:**
- `data` (string): Signature data
- **Returns:** Decoded signature explanation
#### `goplus_supported_chains`
Get GoPlus supported chains.
- **Parameters:** None
- **Returns:** List of supported chain IDs
#### `goplus_rugpull_detection`
Comprehensive GoPlus rug pull detection.
- **Parameters:**
- `tokenAddress` (string): Token address
- `chainId` (number, optional): Chain ID
- **Returns:** Rug pull risk assessment
---
### 4.8 Staking Module (14 tools)
#### `get_staking_position`
Get staking position and rewards.
- **Parameters:**
- `stakingContract` (string): Staking contract address
- `address` (string): User address
- `network` (string, optional): Network identifier
- **Returns:** Staked amount, pending rewards
#### `stake_tokens`
Stake tokens in a staking contract.
- **Parameters:**
- `stakingContract` (string): Staking contract
- `amount` (string): Amount to stake
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Stake transaction hash
#### `unstake_tokens`
Unstake/withdraw tokens.
- **Parameters:**
- `stakingContract` (string): Staking contract
- `amount` (string): Amount to unstake
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Unstake transaction hash
#### `claim_staking_rewards`
Claim pending staking rewards.
- **Parameters:**
- `stakingContract` (string): Staking contract
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Claim transaction hash, rewards amount
#### `get_staking_apr`
Calculate staking APR.
- **Parameters:**
- `stakingContract` (string): Staking contract
- `network` (string, optional): Network identifier
- **Returns:** Estimated APR percentage
#### `get_staking_protocols`
List popular staking protocols.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Protocol addresses and APRs
#### `stake_eth_lido`
Stake ETH with Lido for stETH.
- **Parameters:**
- `amount` (string): ETH amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network (ethereum)
- **Returns:** Transaction hash, stETH received
#### `wrap_steth`
Wrap stETH to wstETH.
- **Parameters:**
- `amount` (string): stETH amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash, wstETH received
#### `unwrap_wsteth`
Unwrap wstETH to stETH.
- **Parameters:**
- `amount` (string): wstETH amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Transaction hash, stETH received
#### `get_lido_stats`
Get Lido staking statistics.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Total staked, APR, exchange rate
#### `stake_lp_tokens`
Stake LP tokens in a farm.
- **Parameters:**
- `farmContract` (string): MasterChef contract
- `poolId` (number): Pool ID
- `amount` (string): LP amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Stake transaction hash
#### `withdraw_lp_tokens`
Withdraw LP tokens from farm.
- **Parameters:**
- `farmContract` (string): MasterChef contract
- `poolId` (number): Pool ID
- `amount` (string): LP amount
- `privateKey` (string): Wallet private key
- `network` (string, optional): Network identifier
- **Returns:** Withdraw transaction hash
#### `get_farming_position`
Get LP farming position.
- **Parameters:**
- `farmContract` (string): MasterChef contract
- `poolId` (number): Pool ID
- `address` (string): User address
- `network` (string, optional): Network identifier
- **Returns:** Staked amount, pending rewards
#### `get_liquid_staking_info`
Get liquid staking token addresses.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** stETH, wstETH, rETH addresses
---
### 4.9 Lending Module (10 tools)
#### `get_lending_position`
Get user's lending/borrowing position.
- **Parameters:**
- `protocol` (string): Protocol name (aave, compound)
- `address` (string): User address
- `network` (string, optional): Network identifier
- **Returns:** Supplied, borrowed, health factor
#### `get_lending_rates`
Get supply and borrow rates.
- **Parameters:**
- `protocol` (string): Protocol name
- `asset` (string): Asset address
- `network` (string, optional): Network identifier
- **Returns:** Supply APY, borrow APY, utilization
#### `get_lending_protocols`
List supported lending protocols.
- **Parameters:**
- `network` (string, optional): Network identifier
- **Returns:** Protocol names and addresses
#### `calculate_health_factor`
Calculate health factor after action.
- **Parameters:**
- `protocol` (string): Protocol name
- `address` (string): User address
- `action` (string): supply/borrow/withdraw/repay
- `asset` (string): Asset address
- `amount` (string): Action amount
- `network` (string, optional): Network identifier
- **Returns:** New health factor
#### `get_flash_loan_info`
Get flash loan fees and limits.
- **Parameters:**
- `protocol` (string): Protocol name
- `asset` (string): Asset address
- `network` (string, optional): Network identifier
- **Returns:** Fee percentage, max available
#### `get_liquidatable_positions`
Find liquidatable positions.
- **Parameters:**
- `protocol` (string): Protocol name