Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@paraspell/sdk": "^10.5.2",
"@paraspell/sdk": "^10.10.1",
"@polkadot-agent-kit/common": "workspace:*",
"@subsquid/ss58": "^2.0.2",
"polkadot-api": "^1.9.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@langchain/core": "^0.3.40",
"@noble/curves": "^1.6.0",
"@paraspell/sdk": "^10.5.2",
"@paraspell/sdk": "^10.10.1",
"@polkadot-agent-kit/common": "workspace:*",
"@polkadot-agent-kit/core": "workspace:*",
"@polkadot-agent-kit/llm": "workspace:*",
Expand Down
39 changes: 29 additions & 10 deletions packages/sdk/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,19 @@ export class PolkadotAgentKit implements IPolkadotApi, IPolkadotAgentApi {
* Get Native Transfer Tool
* Creates a tool for transferring native tokens to an address
*
* @param to - The recipient address as string
* @param amount - The amount to transfer as bigint
* @returns DynamicStructuredTool for transferring native tokens
*
* @example
* ```typescript
* // Create a transfer tool
* const transferTool = agent.transferNativeTool(
* "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
* BigInt(1000000000000) // 1 DOT in planck
* );
* const transferTool = agent.transferNativeTool();
*
* // Tool can be used with LangChain
* const result = await transferTool.call(\{
* address: to,
* amount: amount
* \});
* const result = await transferTool.call({
* amount: "1",
* to: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
* chain: "polkadot"
* });
* ```
*
* @throws \{Error\} If the transfer fails or parameters are invalid
Expand All @@ -99,9 +95,32 @@ export class PolkadotAgentKit implements IPolkadotApi, IPolkadotAgentApi {
return this.agentApi.transferNativeTool(this.getSigner())
}

/**
* Get XCM Transfer Native Tool
* Creates a tool for transferring native tokens across chains using XCM (Cross-Consensus Messaging)
*
* @returns DynamicStructuredTool for cross-chain native token transfers
*
* @example
* ```typescript
* // Create an XCM transfer tool
* const xcmTransferTool = agent.xcmTransferNativeTool();
*
* // Tool can be used with LangChain for cross-chain transfers
* const result = await xcmTransferTool.call(\{
* amount: "1",
* to: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
* sourceChain: "polkadot",
* destChain: "polkadot_asset_hub"
* \});
* ```
*
* @throws \{Error\} If the XCM transfer fails or parameters are invalid
*/
xcmTransferNativeTool(): XcmTransferNativeAssetTool {
return this.agentApi.xcmTransferNativeTool(this.getSigner(), this.getCurrentAddress())
}

/**
* Get Address
*
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/tests/integration-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const RECIPIENT = '5D7jcv6aYbhbYGVY8k65oemM6FVNoyBfoVkuJ5cbFvbefftr';
// Test purpose only - DOnt use in production
export const AGENT_PRIVATE_KEY = '0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a';

const SYSTEM_PROMPT = `I am a Telegram bot powered by PolkadotAgentKit. I can assist you with:
export const SYSTEM_PROMPT = `I am a Telegram bot powered by PolkadotAgentKit. I can assist you with:
- Transferring native tokens on specific chain (e.g., "transfer 1 WND to 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ on westend_asset_hub")
- Checking WND balance on Westend (e.g., "check balance")
- Checking proxies (e.g., "check proxies on westend" or "check proxies")
Expand Down
62 changes: 31 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.