Expand description
@title XCM Precompile Interface
@notice A low-level interface for interacting with pallet_xcm
.
It forwards calls directly to the corresponding dispatchable functions,
providing access to XCM execution and message passing.
@dev Documentation:
@dev - XCM: https://docs.polkadot.com/develop/interoperability
@dev - SCALE codec: https://docs.polkadot.com/polkadot-protocol/parachain-basics/data-encoding
@dev - Weights: https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#transactions-weights-and-fees
interface IXcm {
struct Weight { uint64 refTime; uint64 proofSize; }
function execute(bytes calldata message, Weight calldata weight) external;
function send(bytes calldata destination, bytes calldata message) external;
function weighMessage(bytes calldata message) external view returns (Weight memory weight);
}
Structs§
- Weight
- @notice Weight v2 used for measurement for an XCM execution
- execute
Call - @notice Executes an XCM message locally on the current chain with the caller’s origin.
@dev Internally calls
pallet_xcm::execute
. @param message A SCALE-encoded Versioned XCM message. @param weight The maximum allowedWeight
for execution. @dev Call @custom:function weighMessage(message) to ensure sufficient weight allocation. Function with signatureexecute(bytes,(uint64,uint64))
and selector0xd3b7e04d
. - execute
Return - @notice Executes an XCM message locally on the current chain with the caller’s origin.
@dev Internally calls
pallet_xcm::execute
. @param message A SCALE-encoded Versioned XCM message. @param weight The maximum allowedWeight
for execution. @dev Call @custom:function weighMessage(message) to ensure sufficient weight allocation. Container type for the return parameters of theexecute(bytes,(uint64,uint64))
function. - send
Call - @notice Sends an XCM message to another parachain or consensus system.
@dev Internally calls
pallet_xcm::send
. @param destination SCALE-encoded destination MultiLocation. @param message SCALE-encoded Versioned XCM message. Function with signaturesend(bytes,bytes)
and selector0x7f0a3bf9
. - send
Return - @notice Sends an XCM message to another parachain or consensus system.
@dev Internally calls
pallet_xcm::send
. @param destination SCALE-encoded destination MultiLocation. @param message SCALE-encoded Versioned XCM message. Container type for the return parameters of thesend(bytes,bytes)
function. - weigh
Message Call - @notice Estimates the
Weight
required to execute a given XCM message. @param message SCALE-encoded Versioned XCM message to analyze. @return weight Struct containing estimatedrefTime
andproofSize
. Function with signatureweighMessage(bytes)
and selector0x47400c23
. - weigh
Message Return - @notice Estimates the
Weight
required to execute a given XCM message. @param message SCALE-encoded Versioned XCM message to analyze. @return weight Struct containing estimatedrefTime
andproofSize
. Container type for the return parameters of theweighMessage(bytes)
function.