paritytech / paritytech/polkadot-cli

feat: first-class XCM transfer helper command

Open
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
10
Forks
2
Avg merge
12h 35m
Merged PRs (30d)
4

Description

Summary

Add a dot xcm transfer command that abstracts away the complexity of constructing XCM messages for common cross-chain transfer scenarios.

Motivation

Currently, sending an XCM transfer requires manually constructing VersionedLocation, VersionedAssets, and other complex nested types as CLI arguments. This is the #1 source of friction for users doing cross-chain operations.

Example

Instead of:

dot tx XcmPallet.limited_reserve_transfer_assets \
  'V4({parents:1,interior:X1([Parachain(1000)])})' \
  'V4({parents:0,interior:X1([AccountId32({network:null,id:0xd435...})])})' \
  'V4([{id:{parents:0,interior:Here},fun:Fungible(10000000000)}])' \
  0 Unlimited \
  --chain polkadot

Users could write:

dot xcm transfer --from alice --to 5GrwvaEF... --dest asset-hub --amount 10DOT --chain polkadot

Proposed Changes

  • New src/commands/xcm.ts: CLI command with ergonomic flags
  • New src/core/xcm.ts: Route resolution, type construction for XCM messages
    • Map chain names to parachain IDs
    • Build VersionedLocation from simple chain/account params
    • Build VersionedAssets from human-readable amount strings
    • Support common patterns: relay→parachain, parachain→relay, parachain→parachain
  • Tests for type construction and route resolution

Dependencies

  • #75 (parachain name resolution) — needed for --dest asset-hub to resolve to Parachain(1000)
  • Inspect calls listing — for discovering available XCM pallets/calls per chain
  • dot convert — for address format handling

Related Issues

  • #13 (RFC: XCM file format) — complementary. The helper is for simple transfers; XCM files are for complex programs.

Priority

P3 — Large feature, defer until foundation is strong. Size L.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the proposed src/commands/xcm.ts and src/core/xcm.ts entry points, then review dependency #75, inspect calls listing, and compare address handling with dot convert. Done means supporting the stated common transfer routes and human-readable arguments, with tests covering XCM type construction and route resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.