Module xcm

Module xcm 

Source
Expand description

XCM (Cross-Consensus Messaging) support for cross-chain transfers

This module provides functionality for sending XCM messages across parachains and relay chains in the Polkadot ecosystem.

§Features

  • Reserve transfers (transfer assets via reserve chain)
  • Teleport transfers (burn and mint across chains)
  • Multi-location address handling
  • XCM v3/v4 support
  • Parachain-to-parachain transfers
  • Parachain-to-relay transfers

§Example

use apex_sdk_substrate::xcm::{XcmExecutor, XcmTransferType, MultiLocation};

let executor = XcmExecutor::new(client);

// Transfer from parachain to relay chain
let tx_hash = executor
    .transfer(
        beneficiary,
        amount,
        XcmTransferType::ReserveTransfer,
        MultiLocation::parent(),
    )
    .await?;

Structs§

MultiLocation
Multi-location representation for XCM addressing
XcmAsset
XCM asset representation
XcmConfig
Configuration for XCM transfers
XcmExecutor
XCM executor for sending cross-chain messages

Enums§

AssetId
Asset identifier for XCM
Fungibility
Fungibility of an asset
Junction
Interior junction types for multi-location
NetworkId
Network identifier for cross-consensus messaging
WeightLimit
Weight limit for XCM execution
XcmTransferType
Type of XCM transfer to perform
XcmVersion
XCM version to use for message construction