Crate staging_xcm_builder
source ·Expand description
§XCM-Builder
Types and helpers for building XCM configuration.
Modules§
Structs§
- Extracts the
AccountId32
from the passedlocation
if the network matches. - Alias a descendant location of the original origin.
- Alias a Foreign
AccountId32
with a localAccountId32
if the foreignAccountId32
matches thePrefix
pattern. - Alias a location if it passes
Filter
and the original origin is root ofOrigin
. - Conversion implementation which converts from a
[u8; 32]
-basedAccountId
into aLocation
consisting solely of aAccountId32
junction with a fixed value for its network (provided byNetwork
) and theAccountId
’s[u8; 32]
datum for theid
. - Implementation of
Get<Vec<AssetFilter>>
which accepts every asset. (For example, it can be used withLocationWithAssetFilters
). - Allows execution from any origin that is contained in
T
(i.e.T::Contains(origin)
) if the message begins with the instructionUnpaidExecution
. - Allows execution for the Relay Chain origin (represented as
Location::parent()
) if it is just a straightHrmpNewChannelOpenRequest
,HrmpChannelAccepted
, orHrmpChannelClosing
instruction. - Allows only messages if the generic
ResponseHandler
expects them viaexpecting_response
. - Allows execution from
origin
if it is just a straightSubscribeVersion
orUnsubscribeVersion
instruction. - Allows execution from
origin
if it is contained inT
(i.e.T::Contains(origin)
) taking payments into account. - Allows execution from any origin that is contained in
T
(i.e.T::Contains(origin)
). - Converter struct implementing
AssetIdConversion
converting a numeric asset ID (must beTryFrom/TryInto<u128>
) into aGeneralIndex
junction, prefixed by someLocation
value. TheLocation
value will typically be aPalletInstance
junction. Convert
implementation to convert from some an origin which implementsBacking
into a correspondingPlurality
Location
.- Accepts an asset if it is contained in the given
T
’sGet
implementation. - CurrencyAdapterDeprecatedSimple adapter to use a currency as asset transactor. This type can be used as
type AssetTransactor
inxcm::Config
. - Deny executing the XCM if it matches any of the Deny filter regardless of anything else. If it passes the Deny, and matches one of the Allow cases then it is let through.
- Create a description of the remote treasury
location
if possible. No two locations should have the same descriptor. - Implementation of
AssetChecking
which subjects a given set of assetsL
to having their teleportations recorded with aMintLocation::Local
and a second set of assetsR
to having their teleportations recorded with aMintLocation::NonLocal
. - A wrapper router that attempts to encode and decode passed XCM
message
to ensure that the receiving side will be able to decode, at least with the same XCM version. EnsureOrigin
barrier to convert from dispatch origin to XCM origin, if one exists.- Adapter
struct
which implements a conversion from anyAssetKind
into aLocatableAssetId
value using a fixedLocation
for thelocation
field. - Simple fee calculator that requires payment in a single fungible at a fixed rate.
- Transactional processor implementation using frame transactional layers.
TransactAsset
implementation that allows the use of a [fungible
] implementation for handling an asset in the XCM executor. Works for everything, transfers and teleport bookkeeping.TransactAsset
implementation that allows the use of a [fungible
] implementation for handling an asset in the XCM executor. Works for everything but transfers.TransactAsset
implementation that allows the use of a [fungible
] implementation for handling an asset in the XCM executor. Only works for transfers.TransactAsset
implementation to convert afungibles
implementation to become usable in XCM.- Converts a location which is a top-level relay chain (which provides its own consensus) into a 32-byte
AccountId
. - Converts a location which is a top-level parachain (i.e. a parachain held on a Relay-chain which provides its own consensus) into a 32-byte
AccountId
. - Allows a message only if it is from a system-level child parachain.
- Converts a
Asset
into balanceB
if its id is equal to that given byT
’sGet
. - Matches if the given location contains only the specified amount of parents and no interior junctions.
- Matches if the given location is a system-level sibling parachain.
- Implementation of
AssetChecking
which subjects a given set of assetsT
to having their teleportations recorded with aMintLocation::Local
. - Returns specified
TreasuryAccount
asAccountId32
if passedlocation
matches Treasury plurality. - Simple struct which contains both an XCM
location
andasset_id
to identify an asset which exists on some chain. - Accepts a tuple
(location, assets)
if thelocation
is contained in theContains
implementation of the givenLocation
and if every asset fromassets
matches at least one of theAssetFilter
instances provided by theGet
implementation ofAssetFilters
. - Struct created from calling
fn matcher()
on a mutable slice ofInstruction
s. - Accepts an asset iff it is a native asset.
- An adapter for the implementation of
ExporterFor
, which attempts to find the(bridge_location, payment)
for the requestednetwork
andremote_location
in the providedT
table containing various exporters. - Configuration item representing a single exporter in the
NetworkExportTable
. - Implementation of
AssetChecking
which subjects no assets to having their teleportations recorded. TransactAsset
implementation that allows the use of a [nonfungible
] implementation for handling an asset in the XCM executor. Works for everything.TransactAsset
implementation that allows the use of a [nonfungible
] implementation for handling an asset in the XCM executor. Works for teleport bookkeeping.TransactAsset
implementation that allows the use of a [nonfungible
] implementation for handling an asset in the XCM executor. Only works for transfers.TransactAsset
implementation that allows the use of a [nonfungibles
] implementation for handling an asset in the XCM executor. Works for everything.TransactAsset
implementation that allows the use of a [nonfungibles
] implementation for handling an asset in the XCM executor. Only works for teleport bookkeeping.TransactAsset
implementation that allows the use of a [nonfungibles
] implementation for handling an asset in the XCM executor. Only works for transfers.- Implementation of
AssetChecking
which subjects a given set of assetsT
to having their teleportations recorded with aMintLocation::NonLocal
. Convert
implementation to convert from an origin which passes the check of anEnsureOrigin
into a voice of a given pluralisticBody
.- Implementation of the
frame_support::traits::tokens::Pay
trait, to allow for XCM-based payments of a givenBalance
of some asset ID existing on some chain under ownership of someInterior
location of the local chain to a particularBeneficiary
. TheAssetKind
value is not itself bounded (to avoid the issue of needing to wrap some preexisting datatype), however a converter typeAssetKindToLocatableAsset
must be provided in order to translate it into aLocatableAsset
, which comprises both an XCMLocation
describing the XCM endpoint on which the asset to be paid resides and an XCMAssetId
to identify the specific asset at that endpoint. - A message processor that delegates execution to an
XcmExecutor
. - Barrier condition that allows for a
SuspensionChecker
that controls whether or not the XCM executor will be suspended from executing the given XCM. - A
HandleFee
implementation that simply deposits the fees into a specific on-chainReceiverAccount
. Convert
implementation to convert from some aSigned
(system)Origin
into anAccountId32
.- An adapter from [
pallet_asset_conversion::SwapCredit
] and [pallet_asset_conversion::QuotePrice
] toxcm_executor::traits::AssetExchange
. - Implementation of
SendXcm
which wraps the message inside anExportMessage
instruction and sends it to a destination known to be able to handle it. - Sovereign accounts use the system’s
Signed
origin with an account ID derived from theLocationConverter
. - An implementation of
Contains
that checks forLocation
orInteriorLocation
if starts with the provided typeT
. - An implementation of
Contains
that checks forLocation
orInteriorLocation
if starts with expectedGlobalConsensus(NetworkId)
provided as typeT
. - Execution barrier that just takes
max_weight
fromproperties.weight_credit
. - Sets the message ID to
t
using aSetTopic(t)
in the last position if present. - Implementation of
SendXcm
which uses the givenExportXcm
implementation in order to forward the message over a bridge. - Implementation of
SendXcm
which wraps the message inside anExportMessage
instruction and sends it to a destination known to be able to handle it. - Weight trader which uses the configured
WeightToFee
to set the right price for weight and then places any weight bought into the right account. - A derivative barrier, which scans the first
MaxPrefixes
instructions for origin-alterers and then evaluatesshould_execute
of theInnerBarrier
based on the remaining instructions and the newly computed origin. - An adapter implementation of
MaybeEquivalence
which can convert between the latestLocation
and other versions that implementTryInto<Location>
andTryFrom<Location>
. - Wrapper router which, if the message does not already end with a
SetTopic
instruction, prepends one to the message filled with an ID fromTopicSource
. This ID is returned from a successfuldeliver
. - Wrapper router which, if the message does not already end with a
SetTopic
instruction, appends one to the message filled with a universally unique ID. This ID is returned from a successfuldeliver
. - A
FeeManager
implementation that permits the specifiedWaivedLocations
to not pay for fees and that uses the providedHandleFee
implementation otherwise.
Enums§
- The location which is allowed to mint a particular asset.
Traits§
- Simple trait to indicate whether an asset is subject to having its teleportation into and out of this chain recorded and if so in what
MintLocation
. - Umbrella trait for all Controller traits.
- Creates an instruction matcher from an XCM. Since XCM versions differ, we need to make a trait here to unify the interfaces among them.
- Means of converting a location into a stable and unique descriptive identifier.
- Trait for a type which ensures all requirements for successful delivery with XCM transport layers.
- Execute an XCM locally, for a given origin.
- Weight functions needed for
ExecuteController
. - Handles the fees that are taken by certain XCM instructions.
- Inspects messages in queues. Meant to be used in runtime APIs, not in runtimes.
- API that allows to pattern-match against anything that is contained within an XCM.
- Query a remote location, from a given origin.
- Weight functions needed for
QueryController
. - Provides methods to expect responses from XCMs and query their status.
- Send an XCM from a given origin.
- Weight functions needed for
SendController
. - Function trait for handling some revenue. Similar to a negative imbalance (credit) handler, but for a
Asset
. Sensible implementations will deposit the asset in some known treasury or block-author account.
Functions§
- Try to deposit the given fee in the specified account. Burns the fee in case of a failure.
- Returns the network ID and consensus location within that network of the remote location
dest
which is itself specified as a location relative to the local chain, itself situated atuniversal_local
within the consensus universe. Ifdest
is not a location in remote consensus, then an error is returned.
Type Aliases§
- ConvertedConcreteAssetIdDeprecated
- ForeignChainAliasAccountDeprecatedThis is deprecated in favor of the more modular
HashedDescription
converter. If your chain has previously used this, then you can retain backwards compatibility usingHashedDescription
and a tuple withLegacyDescribeForeignChainAccount
as the first element. For example: - Specialization of the
PayOverXcm
trait to allow[u8; 32]
-basedAccountId
values to be paid on a remote chain.