Skip to content

Commit 2c88325

Browse files
authored
chore: bump paraspell version (#62)
+ Paraspell bump version + Integration tests ✌️
1 parent e8aac88 commit 2c88325

File tree

5 files changed

+63
-44
lines changed

5 files changed

+63
-44
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"test:watch": "vitest"
3636
},
3737
"dependencies": {
38-
"@paraspell/sdk": "^10.5.2",
38+
"@paraspell/sdk": "^10.10.1",
3939
"@polkadot-agent-kit/common": "workspace:*",
4040
"@subsquid/ss58": "^2.0.2",
4141
"polkadot-api": "^1.9.13",

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"dependencies": {
4040
"@langchain/core": "^0.3.40",
4141
"@noble/curves": "^1.6.0",
42-
"@paraspell/sdk": "^10.5.2",
42+
"@paraspell/sdk": "^10.10.1",
4343
"@polkadot-agent-kit/common": "workspace:*",
4444
"@polkadot-agent-kit/core": "workspace:*",
4545
"@polkadot-agent-kit/llm": "workspace:*",

packages/sdk/src/api.ts

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,19 @@ export class PolkadotAgentKit implements IPolkadotApi, IPolkadotAgentApi {
7474
* Get Native Transfer Tool
7575
* Creates a tool for transferring native tokens to an address
7676
*
77-
* @param to - The recipient address as string
78-
* @param amount - The amount to transfer as bigint
7977
* @returns DynamicStructuredTool for transferring native tokens
8078
*
8179
* @example
8280
* ```typescript
8381
* // Create a transfer tool
84-
* const transferTool = agent.transferNativeTool(
85-
* "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
86-
* BigInt(1000000000000) // 1 DOT in planck
87-
* );
82+
* const transferTool = agent.transferNativeTool();
8883
*
8984
* // Tool can be used with LangChain
90-
* const result = await transferTool.call(\{
91-
* address: to,
92-
* amount: amount
93-
* \});
85+
* const result = await transferTool.call({
86+
* amount: "1",
87+
* to: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
88+
* chain: "polkadot"
89+
* });
9490
* ```
9591
*
9692
* @throws \{Error\} If the transfer fails or parameters are invalid
@@ -99,9 +95,32 @@ export class PolkadotAgentKit implements IPolkadotApi, IPolkadotAgentApi {
9995
return this.agentApi.transferNativeTool(this.getSigner())
10096
}
10197

98+
/**
99+
* Get XCM Transfer Native Tool
100+
* Creates a tool for transferring native tokens across chains using XCM (Cross-Consensus Messaging)
101+
*
102+
* @returns DynamicStructuredTool for cross-chain native token transfers
103+
*
104+
* @example
105+
* ```typescript
106+
* // Create an XCM transfer tool
107+
* const xcmTransferTool = agent.xcmTransferNativeTool();
108+
*
109+
* // Tool can be used with LangChain for cross-chain transfers
110+
* const result = await xcmTransferTool.call(\{
111+
* amount: "1",
112+
* to: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
113+
* sourceChain: "polkadot",
114+
* destChain: "polkadot_asset_hub"
115+
* \});
116+
* ```
117+
*
118+
* @throws \{Error\} If the XCM transfer fails or parameters are invalid
119+
*/
102120
xcmTransferNativeTool(): XcmTransferNativeAssetTool {
103121
return this.agentApi.xcmTransferNativeTool(this.getSigner(), this.getCurrentAddress())
104122
}
123+
105124
/**
106125
* Get Address
107126
*

packages/sdk/tests/integration-tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const RECIPIENT = '5D7jcv6aYbhbYGVY8k65oemM6FVNoyBfoVkuJ5cbFvbefftr';
44
// Test purpose only - DOnt use in production
55
export const AGENT_PRIVATE_KEY = '0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a';
66

7-
const SYSTEM_PROMPT = `I am a Telegram bot powered by PolkadotAgentKit. I can assist you with:
7+
export const SYSTEM_PROMPT = `I am a Telegram bot powered by PolkadotAgentKit. I can assist you with:
88
- Transferring native tokens on specific chain (e.g., "transfer 1 WND to 5CSox4ZSN4SGLKUG9NYPtfVK9sByXLtxP4hmoF4UgkM4jgDJ on westend_asset_hub")
99
- Checking WND balance on Westend (e.g., "check balance")
1010
- Checking proxies (e.g., "check proxies on westend" or "check proxies")

pnpm-lock.yaml

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)