Skip to content

File: src/Xcm/v5/Instruction/Instruction.sol

Instruction

Kind: source

Structs

struct WithdrawAssetParams

Params for WithdrawAsset.

FieldTypeDescription
assetsstruct AssetsThe asset(s) to be withdrawn into holding.

struct ReserveAssetDepositedParams

Params for ReserveAssetDeposited.

FieldTypeDescription
assetsstruct AssetsThe asset(s) that are minted into holding.

struct ReceiveTeleportedAssetParams

Params for ReceiveTeleportedAsset.

FieldTypeDescription
assetsstruct AssetsThe asset(s) minted into the Holding Register.

struct QueryResponseParams

Params for QueryResponse.

FieldTypeDescription
queryIdQueryIdThe identifier of the query that resulted in this response.
responsestruct ResponseThe message content.
maxWeightstruct WeightThe maximum weight that handling this response should take.
hasQuerierboolWhether `querier` is present.
querierstruct LocationThe location responsible for initiating the response, when present.

struct TransferAssetParams

Params for TransferAsset.

FieldTypeDescription
assetsstruct AssetsThe asset(s) to be withdrawn.
beneficiarystruct LocationThe new owner for the assets.

struct TransferReserveAssetParams

Params for TransferReserveAsset.

FieldTypeDescription
assetsstruct AssetsThe asset(s) to be withdrawn.
deststruct LocationThe location whose sovereign account will own the assets.
xcmbytesInstructions that follow `ReserveAssetDeposited`. SCALE-encoded Xcm<()>.

struct TransactParams

Params for Transact.

FieldTypeDescription
originKindenum OriginKindThe means of expressing message origin as dispatch origin.
hasFallbackMaxWeightboolWhether `fallbackMaxWeight` is present.
fallbackMaxWeightstruct WeightCompatibility fallback weight, corresponding to v4 `require_weight_at_most`.
callbytesThe raw encoded call bytes (`DoubleEncoded<Call>.encoded`, equivalent to Rust `Vec<u8>`). The `Transact` factory SCALE-encodes this as `Vec<u8>` (Compact length + bytes).

struct HrmpNewChannelOpenRequestParams

Params for HrmpNewChannelOpenRequest.

FieldTypeDescription
senderuint32The sender in the to-be-opened channel.
maxMessageSizeuint32The maximum size of a message proposed by the sender.
maxCapacityuint32The maximum number of messages that can be queued in the channel.

struct HrmpChannelAcceptedParams

Params for HrmpChannelAccepted.

FieldTypeDescription
recipientuint32The recipient whose open-channel request was accepted.

struct HrmpChannelClosingParams

Params for HrmpChannelClosing.

FieldTypeDescription
initiatoruint32The party initiating the channel closure.
senderuint32The channel sender.
recipientuint32The channel recipient.

struct DescendOriginParams

Params for DescendOrigin.

FieldTypeDescription
interiorstruct JunctionsInterior location to descend origin into.

struct ReportErrorParams

Params for ReportError.

FieldTypeDescription
responseInfostruct QueryResponseInfoInformation for constructing and sending the query response.

struct DepositAssetParams

Params for DepositAsset.

FieldTypeDescription
assetsstruct AssetFilterAsset filter selecting assets removed from holding.
beneficiarystruct LocationThe new owner for the assets.

struct DepositReserveAssetParams

Params for DepositReserveAsset.

FieldTypeDescription
assetsstruct AssetFilterAsset filter selecting assets removed from holding.
deststruct LocationThe location whose sovereign account will own the assets.
xcmbytesOrders that follow `ReserveAssetDeposited`. SCALE-encoded Xcm<()>.

struct ExchangeAssetParams

Params for ExchangeAsset.

FieldTypeDescription
givestruct AssetFilterMaximum assets to remove from holding.
wantstruct AssetsMinimum assets expected in exchange.
maximalboolIf true, prefer maximal exchange up to `give`; otherwise minimal exchange satisfying `want`.

struct InitiateReserveWithdrawParams

Params for InitiateReserveWithdraw.

FieldTypeDescription
assetsstruct AssetFilterAsset filter selecting assets removed from holding.
reservestruct LocationReserve location for all selected assets.
xcmbytesInstructions to execute once withdrawn on reserve. SCALE-encoded Xcm<()>.

struct InitiateTeleportParams

Params for InitiateTeleport.

FieldTypeDescription
assetsstruct AssetFilterAsset filter selecting assets removed from holding.
deststruct LocationDestination location that accepts teleports from this origin.
xcmbytesInstructions to execute on destination. SCALE-encoded Xcm<()>.

struct ReportHoldingParams

Params for ReportHolding.

FieldTypeDescription
responseInfostruct QueryResponseInfoInformation for constructing and sending the query response.
assetsstruct AssetFilterFilter over holdings to be reported.

struct BuyExecutionParams

Params for BuyExecution.

FieldTypeDescription
feesstruct AssetThe asset(s) used to pay fees.
weightLimitstruct WeightLimitThe maximum amount of weight to purchase.

struct SetErrorHandlerParams

Params for SetErrorHandler.

FieldTypeDescription
xcmbytesError handler code. SCALE-encoded Xcm<Call>.

struct SetAppendixParams

Params for SetAppendix.

FieldTypeDescription
xcmbytesAppendix code executed after program completion. SCALE-encoded Xcm<Call>.

struct ClaimAssetParams

Params for ClaimAsset.

FieldTypeDescription
assetsstruct AssetsAssets to claim; must exactly match claimable assets for ticket origin.
ticketstruct LocationTicket identifier used to locate the claimable asset.

struct TrapParams

Params for Trap.

FieldTypeDescription
codeuint64Trap code used as the inner value of the `Trap` error.

struct SubscribeVersionParams

Params for SubscribeVersion.

FieldTypeDescription
queryIdQueryIdQuery identifier replicated into the response message.
maxResponseWeightstruct WeightMaximum weight allowed for the responding `QueryResponse` execution.

struct BurnAssetParams

Params for BurnAsset.

FieldTypeDescription
assetsstruct AssetsAssets to burn from holding up to the provided amount.

struct ExpectAssetParams

Params for ExpectAsset.

FieldTypeDescription
assetsstruct AssetsAssets that must be present in holding.

struct ExpectOriginParams

Params for ExpectOrigin.

FieldTypeDescription
hasOriginboolWhether an expected origin is provided.
originstruct LocationExpected origin location when `hasOrigin` is true.

struct ExpectErrorParams

Params for ExpectError.

FieldTypeDescription
hasErrorboolWhether an expected error tuple is provided.
indexuint32Expected instruction index when `hasError` is true.
errstruct XcmErrorExpected XCM error when `hasError` is true.

struct ExpectTransactStatusParams

Params for ExpectTransactStatus.

FieldTypeDescription
transactStatusstruct MaybeErrorCodeExpected transact status register value.

struct QueryPalletParams

Params for QueryPallet.

FieldTypeDescription
moduleNamebytesPallet module name to query.
responseInfostruct QueryResponseInfoInformation for constructing and sending the query response.

struct ExpectPalletParams

Params for ExpectPallet.

FieldTypeDescription
indexuint32Expected pallet index.
namebytesExpected pallet name.
moduleNamebytesExpected pallet module name.
crateMajoruint32Expected crate major version.
minCrateMinoruint32Minimum acceptable crate minor version.

struct ReportTransactStatusParams

Params for ReportTransactStatus.

FieldTypeDescription
responseInfostruct QueryResponseInfoInformation for constructing and sending the query response.

struct UniversalOriginParams

Params for UniversalOrigin.

FieldTypeDescription
junctionstruct JunctionChild junction of the Universal Ancestor to set as origin.

struct ExportMessageParams

Params for ExportMessage.

FieldTypeDescription
networkstruct NetworkIdRemote consensus system to export to.
destinationstruct JunctionsDestination interior location relative to the remote consensus system.
xcmbytesMessage to export. SCALE-encoded Xcm<()>.

struct LockAssetParams

Params for LockAsset.

FieldTypeDescription
assetstruct AssetAsset to lock.
unlockerstruct LocationOrigin required to unlock via a corresponding `UnlockAsset`.

struct UnlockAssetParams

Params for UnlockAsset.

FieldTypeDescription
assetstruct AssetAsset to unlock.
targetstruct LocationAsset owner on the local chain.

struct NoteUnlockableParams

Params for NoteUnlockable.

FieldTypeDescription
assetstruct AssetAsset that is now unlockable from this origin.
ownerstruct LocationOwner of the asset on the chain where it was locked.

struct RequestUnlockParams

Params for RequestUnlock.

FieldTypeDescription
assetstruct AssetAsset requested for unlock.
lockerstruct LocationLocation of the locker from prior `NoteUnlockable`.

struct SetFeesModeParams

Params for SetFeesMode.

FieldTypeDescription
jitWithdrawboolIf true, fees are withdrawn just-in-time for instructions.

struct SetTopicParams

Params for SetTopic.

FieldTypeDescription
topicbytes3232-byte topic identifier.

struct AliasOriginParams

Params for AliasOrigin.

FieldTypeDescription
locationstruct LocationNew origin to alias to.

struct UnpaidExecutionParams

Params for UnpaidExecution.

FieldTypeDescription
weightLimitstruct WeightLimitFree-execution weight limit.
hasCheckOriginboolWhether a specific origin check is required.
checkOriginstruct LocationExpected origin when `hasCheckOrigin` is true.

struct PayFeesParams

Params for PayFees.

FieldTypeDescription
assetstruct AssetAsset used to pay execution fees.

struct InitiateTransferParams

Params for InitiateTransfer.

FieldTypeDescription
destinationstruct LocationLocation of the program next hop.
hasRemoteFeesboolWhether `remoteFees` is provided.
remoteFeesstruct AssetTransferFilterOptional fee-reserved transfer filter used first on remote side.
preserveOriginboolWhether to preserve origin (`AliasOrigin`) instead of clearing it.
assetsstruct AssetTransferFilter\[\]Transfer filters matched against holding assets for this leg.
remoteXcmbytesCustom instructions to run on destination. SCALE-encoded Xcm<()>.

struct ExecuteWithOriginParams

Params for ExecuteWithOrigin.

FieldTypeDescription
hasDescendantOriginboolWhether `descendantOrigin` is provided.
descendantOriginstruct JunctionsOptional descendant origin for executing inner XCM.
xcmbytesInner instructions executed under the derived origin. SCALE-encoded Xcm<Call>.

struct SetHintsParams

Params for SetHints.

FieldTypeDescription
hintsstruct Hint\[\]A bounded vector of execution hints.

struct Instruction

Cross-Consensus Message: A message from one consensus system to another.

FieldTypeDescription
variantenum InstructionVariantThe type of the instruction. See `InstructionVariant` enum for possible values.
payloadbytesSCALE-encoded instruction parameters. The type of the parameters depends on the instruction type; see the corresponding `Params` struct for each variant.

Enums

enum InstructionVariant

Discriminant for the Instruction enum, representing the type of instruction being executed.

VariantDescription
WithdrawAssetWithdraw asset(s) from the ownership of `origin` and place them into the Holding Register.
ReserveAssetDepositedAsset(s) have been received into the ownership of this system on the `origin` system and equivalent derivatives should be placed into the Holding Register.
ReceiveTeleportedAssetAsset(s) have been destroyed on the `origin` system and equivalent assets should be created and placed into the Holding Register.
QueryResponseRespond with information that the local system is expecting.
TransferAssetWithdraw asset(s) from the ownership of `origin` and place equivalent assets under the ownership of `beneficiary`.
TransferReserveAssetWithdraw asset(s) from the ownership of `origin` and place equivalent assets under the ownership of `dest` within this consensus system.
TransactApply the encoded transaction `call`, whose dispatch-origin should be `origin` as expressed by the kind of origin `origin_kind`.
HrmpNewChannelOpenRequestA message to notify about a new incoming HRMP channel.
HrmpChannelAcceptedA message to notify about that a previously sent open channel request has been accepted by the recipient.
HrmpChannelClosingA message to notify that the other party in an open channel decided to close it.
ClearOriginClear the origin.
DescendOriginMutate the origin to some interior location.
ReportErrorImmediately report the contents of the Error Register to the given destination via XCM.
DepositAssetRemove the asset(s) from the Holding Register and place equivalent assets under the ownership of `beneficiary`.
DepositReserveAssetRemove the asset(s) from the Holding Register and place equivalent assets under the ownership of `dest`, then send a `ReserveAssetDeposited` onward message.
ExchangeAssetRemove the asset(s) from the Holding Register and replace them with alternative assets.
InitiateReserveWithdrawRemove the asset(s) from holding and send a `WithdrawAsset` XCM message to a reserve location.
InitiateTeleportRemove the asset(s) from holding and send a `ReceiveTeleportedAsset` XCM message to a `dest` location.
ReportHoldingReport to a given destination the contents of the Holding Register.
BuyExecutionPay for the execution of some XCM with up to `weight` picoseconds of execution time, paying with up to `fees` from the Holding Register.
RefundSurplusRefund any surplus weight previously bought with `BuyExecution`.
SetErrorHandlerSet the Error Handler Register to code that should be called in the case of an error.
SetAppendixSet the Appendix Register to code that should be called after execution (including error handler) is finished.
ClearErrorClear the Error Register.
ClaimAssetCreate some assets which are being held on behalf of the origin.
TrapAlways throws an error of type `Trap`.
SubscribeVersionAsk the destination system to respond with the most recent version of XCM that they support.
UnsubscribeVersionCancel the effect of a previous `SubscribeVersion` instruction.
BurnAssetReduce Holding by up to the given assets.
ExpectAssetThrow an error if Holding does not contain at least the given assets.
ExpectOriginEnsure that the Origin Register equals some given value and throw an error if not.
ExpectErrorEnsure that the Error Register equals some given value and throw an error if not.
ExpectTransactStatusEnsure that the Transact Status Register equals some given value and throw an error if not.
QueryPalletQuery the existence of a particular pallet type.
ExpectPalletEnsure that a particular pallet with a particular version exists.
ReportTransactStatusSend a `QueryResponse` message containing the value of the Transact Status Register to some destination.
ClearTransactStatusSet the Transact Status Register to its default, cleared, value.
UniversalOriginSet the Origin Register to be some child of the Universal Ancestor.
ExportMessageSend a message on to Non-Local Consensus system.
LockAssetLock the locally held asset and prevent further transfer or withdrawal.
UnlockAssetRemove the lock over `asset` on this chain and allow the asset to be transferred.
NoteUnlockableAsset has been locked on the `origin` system and may not be transferred.
RequestUnlockSend an `UnlockAsset` instruction to the `locker` for the given `asset`.
SetFeesModeSets the Fees Mode Register.
SetTopicSet the Topic Register.
ClearTopicClear the Topic Register.
AliasOriginAlter the current Origin to another given origin.
UnpaidExecutionA directive to indicate that the origin expects free execution of the message.
PayFeesTakes an asset, uses it to pay for execution and puts the rest in the fees register. Successor to `BuyExecution`.
InitiateTransferInitiates cross-chain transfer of assets in the holding register using specified asset transfer filters.
ExecuteWithOriginExecutes inner `xcm` with origin set to the provided `descendant_origin`, then restores the original origin.
SetHintsSet hints for XCM execution, changing the behaviour of the XCM program.

Top-Level Functions

  • function withdrawAsset(struct WithdrawAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the WithdrawAsset variant with the provided params.
  • function reserveAssetDeposited(struct ReserveAssetDepositedParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ReserveAssetDeposited variant with the provided params.
  • function receiveTeleportedAsset(struct ReceiveTeleportedAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ReceiveTeleportedAsset variant with the provided params.
  • function queryResponse(struct QueryResponseParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the QueryResponse variant with the provided params.
  • function transferAsset(struct TransferAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the TransferAsset variant with the provided params.
  • function transferReserveAsset(struct TransferReserveAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the TransferReserveAsset variant with the provided params.
  • function transact(struct TransactParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the Transact variant with the provided params.
  • function hrmpNewChannelOpenRequest(struct HrmpNewChannelOpenRequestParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the HrmpNewChannelOpenRequest variant with the provided params.
  • function hrmpChannelAccepted(struct HrmpChannelAcceptedParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the HrmpChannelAccepted variant with the provided params.
  • function hrmpChannelClosing(struct HrmpChannelClosingParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the HrmpChannelClosing variant with the provided params.
  • function clearOrigin() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ClearOrigin variant.
  • function descendOrigin(struct DescendOriginParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the DescendOrigin variant with the provided params.
  • function reportError(struct ReportErrorParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ReportError variant with the provided params.
  • function depositAsset(struct DepositAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the DepositAsset variant with the provided params.
  • function depositReserveAsset(struct DepositReserveAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the DepositReserveAsset variant with the provided params.
  • function exchangeAsset(struct ExchangeAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExchangeAsset variant with the provided params.
  • function initiateReserveWithdraw(struct InitiateReserveWithdrawParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the InitiateReserveWithdraw variant with the provided params.
  • function initiateTeleport(struct InitiateTeleportParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the InitiateTeleport variant with the provided params.
  • function reportHolding(struct ReportHoldingParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ReportHolding variant with the provided params.
  • function buyExecution(struct BuyExecutionParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the BuyExecution variant with the provided params.
  • function refundSurplus() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the RefundSurplus variant.
  • function setErrorHandler(struct SetErrorHandlerParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SetErrorHandler variant with the provided params.
  • function setAppendix(struct SetAppendixParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SetAppendix variant with the provided params.
  • function clearError() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ClearError variant.
  • function claimAsset(struct ClaimAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ClaimAsset variant with the provided params.
  • function trap(struct TrapParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the Trap variant with the provided params.
  • function subscribeVersion(struct SubscribeVersionParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SubscribeVersion variant with the provided params.
  • function unsubscribeVersion() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the UnsubscribeVersion variant.
  • function burnAsset(struct BurnAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the BurnAsset variant with the provided params.
  • function expectAsset(struct ExpectAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExpectAsset variant with the provided params.
  • function expectOrigin(struct ExpectOriginParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExpectOrigin variant with the provided params.
  • function expectError(struct ExpectErrorParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExpectError variant with the provided params.
  • function expectTransactStatus(struct ExpectTransactStatusParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExpectTransactStatus variant with the provided params.
  • function queryPallet(struct QueryPalletParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the QueryPallet variant with the provided params.
  • function expectPallet(struct ExpectPalletParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExpectPallet variant with the provided params.
  • function reportTransactStatus(struct ReportTransactStatusParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ReportTransactStatus variant with the provided params.
  • function clearTransactStatus() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ClearTransactStatus variant.
  • function universalOrigin(struct UniversalOriginParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the UniversalOrigin variant with the provided params.
  • function exportMessage(struct ExportMessageParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExportMessage variant with the provided params.
  • function lockAsset(struct LockAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the LockAsset variant with the provided params.
  • function unlockAsset(struct UnlockAssetParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the UnlockAsset variant with the provided params.
  • function noteUnlockable(struct NoteUnlockableParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the NoteUnlockable variant with the provided params.
  • function requestUnlock(struct RequestUnlockParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the RequestUnlock variant with the provided params.
  • function setFeesMode(struct SetFeesModeParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SetFeesMode variant with the provided params.
  • function setTopic(struct SetTopicParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SetTopic variant with the provided params.
  • function clearTopic() internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ClearTopic variant.
  • function aliasOrigin(struct AliasOriginParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the AliasOrigin variant with the provided params.
  • function unpaidExecution(struct UnpaidExecutionParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the UnpaidExecution variant with the provided params.
  • function payFees(struct PayFeesParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the PayFees variant with the provided params.
  • function initiateTransfer(struct InitiateTransferParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the InitiateTransfer variant with the provided params.
  • function executeWithOrigin(struct ExecuteWithOriginParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the ExecuteWithOrigin variant with the provided params.
  • function setHints(struct SetHintsParams params) internal pure returns (struct Instruction)
    • Creates an Instruction struct representing the SetHints variant with the provided params.

Created with solidity-doc-generator