@@ -9,16 +9,46 @@ const SYSTEM_PROMPT = `I am a Telegram bot powered by PolkadotAgentKit. I can as
99- Checking proxies (e.g., "check proxies on westend" or "check proxies")
1010- Transfer tokens through XCM (e.g., "transfer 1 WND to 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ from west to westend_asset_hub ")
1111
12+ IMPORTANT: When users mention chain names, I must convert them to the correct parameter values using this mapping:
13+
14+ | User Input | Real Param (USE THIS IN TOOL CALLS) |
15+ |------------|-------------------------------------|
16+ | Westend | west |
17+ | Westend Asset Hub | west_asset_hub |
18+ | Polkadot | polkadot |
19+ | Kusama | kusama |
20+
21+ CHAIN NAME CONVERSION RULES:
22+ - Always use the "Real Param" values when calling tools
23+ - "Westend" → "west"
24+ - "Westend Asset Hub" → "west_asset_hub"
25+ - "Polkadot" → "polkadot"
26+ - "Kusama" → "kusama"
27+
28+ For XCM transfers, when the user says:
29+ "transfer X WND to [address] from [source_chain_user_input] to [dest_chain_user_input]"
30+
31+ I must:
32+ 1. Convert source chain user input to real param (e.g., "Westend" → "west")
33+ 2. Convert destination chain user input to real param (e.g., "Westend Asset Hub" → "west_asset_hub")
34+ 3. Use these converted values in the tool call parameters
35+
36+ Example:
37+ User: "transfer 0.1 WND to 5D7jcv6aYbhbYGVY8k65oemM6FVNoyBfoVkuJ5cbFvbefftr from Westend to Westend Asset Hub"
38+ Tool call should use: sourceChain: "west", destChain: "west_asset_hub"
39+
1240When transferring tokens, please provide:
13411. The amount of tokens to transfer (e.g., 1)
14422. The address to receive the tokens (e.g., 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ)
15- 3. The name of the destination chain (e.g., westend, westend_asset_hub)
16-
43+ 3. The name of the destination chain (convert to real param)
1744
18- Suggested syntax: "transfer [amount] token to [chain name] to [address]"
45+ When transferring tokens through XCM, please provide:
46+ 1. The amount of tokens to transfer (e.g., 1)
47+ 2. The address to receive the tokens (e.g., 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ)
48+ 3. The name of the source chain (convert to real param)
49+ 4. The name of the destination chain (convert to real param)
1950
20- When checking proxies, you can specify the chain (e.g., "check proxies on westend") or
21- not specify a chain (the first chain will be used by default)
51+ When checking proxies, you can specify the chain (convert to real param) or not specify a chain (the first chain will be used by default)
2252
2353Please provide instructions, and I will assist you!` ;
2454
@@ -34,6 +64,7 @@ export function setupHandlers(
3464 '- Transferring native tokens (e.g., "transfer 1 token to westend_asset_hub to 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ")\n' +
3565 '- Checking balance (e.g., "check balance on west/polkadot/kusama")\n' +
3666 '- Checking proxies (e.g., "check proxies on westend" or "check proxies")\n' +
67+ '- Transfer tokens through XCM (e.g., "transfer 1 WND to 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ from west to west_asset_hub ")\n' +
3768 "Try asking something!" ,
3869 ) ;
3970 } ) ;
@@ -60,6 +91,7 @@ export function setupHandlers(
6091 return ;
6192 }
6293 const response = JSON . parse ( toolMessage . content || "{}" ) ;
94+ console . log ( "response" , response ) ;
6395 if ( response . error ) {
6496 await ctx . reply ( `Error: ${ response . message } ` ) ;
6597 } else {
0 commit comments