referrerpolicy=no-referrer-when-downgrade

Crate staging_xcm_builder

Source
Expand description

§XCM-Builder

Types and helpers for building XCM configuration.

Modules§

test_utils

Structs§

Account32Hash
AccountId32Aliases
Extracts the AccountId32 from the passed location if the network matches.
AccountKey20Aliases
AliasChildLocation
Alias a descendant location of the original origin.
AliasForeignAccountId32
Alias a Foreign AccountId32 with a local AccountId32 if the foreign AccountId32 matches the Prefix pattern.
AliasOriginRootUsingFilter
Alias a location if it passes Filter and the original origin is root of Origin.
AliasesIntoAccountId32
Conversion implementation which converts from a [u8; 32]-based AccountId into a Location consisting solely of a AccountId32 junction with a fixed value for its network (provided by Network) and the AccountId’s [u8; 32] datum for the id.
AllAssets
Implementation of Get<Vec<AssetFilter>> which accepts every asset. (For example, it can be used with LocationWithAssetFilters).
AllowExplicitUnpaidExecutionFrom
Allows execution from any origin that is contained in T (i.e. T::Contains(origin)) if the message explicitly includes the UnpaidExecution instruction.
AllowHrmpNotificationsFromRelayChain
Allows execution for the Relay Chain origin (represented as Location::parent()) if it is just a straight HrmpNewChannelOpenRequest, HrmpChannelAccepted, or HrmpChannelClosing instruction.
AllowKnownQueryResponses
Allows only messages if the generic ResponseHandler expects them via expecting_response.
AllowSubscriptionsFrom
Allows execution from origin if it is just a straight SubscribeVersion or UnsubscribeVersion instruction.
AllowTopLevelPaidExecutionFrom
Allows execution from origin if it is contained in T (i.e. T::Contains(origin)) taking payments into account.
AllowUnpaidExecutionFrom
Allows execution from any origin that is contained in T (i.e. T::Contains(origin)).
AsPrefixedGeneralIndex
Converter struct implementing AssetIdConversion converting a numeric asset ID (must be TryFrom/TryInto<u128>) into a GeneralIndex junction, prefixed by some Location value. The Location value will typically be a PalletInstance junction.
BackingToPlurality
Convert implementation to convert from some an origin which implements Backing into a corresponding Plurality Location.
BridgeBlobDispatcher
BridgeMessage
Case
Accepts an asset if it is contained in the given T’s Get implementation.
ChildParachainAsNative
ChildParachainConvertsVia
ChildSystemParachainAsSuperuser
ConvertedConcreteId
CurrencyAdapterDeprecated
Simple adapter to use a currency as asset transactor. This type can be used as type AssetTransactor in xcm::Config.
DenyRecursively
Denies execution if the XCM contains instructions not meant to run on this chain, first checking at the top-level and then recursively.
DenyReserveTransferToRelayChain
DenyThenTry
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.
DescribeAccountId32Terminal
DescribeAccountKey20Terminal
DescribeBodyTerminal
DescribeFamily
DescribePalletTerminal
DescribeTerminus
DescribeTreasuryVoiceTerminal
Create a description of the remote treasury location if possible. No two locations should have the same descriptor.
DualMint
Implementation of AssetChecking which subjects a given set of assets L to having their teleportations recorded with a MintLocation::Local and a second set of assets R to having their teleportations recorded with a MintLocation::NonLocal.
EnsureDecodableXcm
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.
EnsureXcmOrigin
EnsureOrigin barrier to convert from dispatch origin to XCM origin, if one exists.
ExternalConsensusLocationsConverterFor
Converts locations from external global consensus systems (e.g., Ethereum, other parachains) into AccountId.
FixedLocation
Adapter struct which implements a conversion from any AssetKind into a LocatableAssetId value using a fixed Location for the location field.
FixedRateOfFungible
Simple fee calculator that requires payment in a single fungible at a fixed rate.
FixedWeightBounds
FrameTransactionalProcessor
Transactional processor implementation using frame transactional layers.
FungibleAdapter
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.
FungibleMutateAdapter
TransactAsset implementation that allows the use of a [fungible] implementation for handling an asset in the XCM executor. Works for everything but transfers.
FungibleTransferAdapter
TransactAsset implementation that allows the use of a [fungible] implementation for handling an asset in the XCM executor. Only works for transfers.
FungiblesAdapter
FungiblesMutateAdapter
FungiblesTransferAdapter
TransactAsset implementation to convert a fungibles implementation to become usable in XCM.
GlobalConsensusConvertsFor
Converts a location which is a top-level relay chain (which provides its own consensus) into a 32-byte AccountId.
GlobalConsensusParachainConvertsFor
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.
HashedDescription
HaulBlobExporter
IsChildSystemParachain
Allows a message only if it is from a system-level child parachain.
IsConcrete
Converts a Asset into balance B if its id is equal to that given by T’s Get.
IsParentsOnly
Matches if the given location contains only the specified amount of parents and no interior junctions.
IsSiblingSystemParachain
Matches if the given location is a system-level sibling parachain.
LocalExporter
Implementation of SendXcm which uses the given ExportXcm implementation in order to forward the message over a bridge.
LocalMint
Implementation of AssetChecking which subjects a given set of assets T to having their teleportations recorded with a MintLocation::Local.
LocalTreasuryVoiceConvertsVia
Returns specified TreasuryAccount as AccountId32 if passed location matches Treasury plurality.
LocatableAssetId
Simple struct which contains both an XCM location and asset_id to identify an asset which exists on some chain.
LocationAsSuperuser
Converter that allows specific Locations to act as a superuser (RuntimeOrigin::root()) if it matches the predefined WhitelistedSuperuserLocations filter and OriginKind::Superuser.
LocationWithAssetFilters
Accepts a tuple (location, assets) if the location is contained in the Contains implementation of the given Location and if every asset from assets matches at least one of the AssetFilter instances provided by the Get implementation of AssetFilters.
MatchedConvertedConcreteId
Matcher
Struct created from calling fn matcher() on a mutable slice of Instructions.
NativeAsset
Accepts an asset iff it is a native asset.
NetworkExportTable
An adapter for the implementation of ExporterFor, which attempts to find the (bridge_location, payment) for the requested network and remote_location in the provided T table containing various exporters.
NetworkExportTableItem
Configuration item representing a single exporter in the NetworkExportTable.
NoChecking
Implementation of AssetChecking which subjects no assets to having their teleportations recorded.
NonFungibleAdapter
TransactAsset implementation that allows the use of a [nonfungible] implementation for handling an asset in the XCM executor. Works for everything.
NonFungibleMutateAdapter
TransactAsset implementation that allows the use of a [nonfungible] implementation for handling an asset in the XCM executor. Works for teleport bookkeeping.
NonFungibleTransferAdapter
TransactAsset implementation that allows the use of a [nonfungible] implementation for handling an asset in the XCM executor. Only works for transfers.
NonFungiblesAdapter
TransactAsset implementation that allows the use of a [nonfungibles] implementation for handling an asset in the XCM executor. Works for everything.
NonFungiblesMutateAdapter
TransactAsset implementation that allows the use of a [nonfungibles] implementation for handling an asset in the XCM executor. Only works for teleport bookkeeping.
NonFungiblesTransferAdapter
TransactAsset implementation that allows the use of a [nonfungibles] implementation for handling an asset in the XCM executor. Only works for transfers.
NonLocalMint
Implementation of AssetChecking which subjects a given set of assets T to having their teleportations recorded with a MintLocation::NonLocal.
OriginToPluralityVoice
Convert implementation to convert from an origin which passes the check of an EnsureOrigin into a voice of a given pluralistic Body.
ParentAsSuperuser
ParentIsPreset
A Location consisting of a single Parent Junction will be converted to the parent AccountId.
PayOverXcm
Implementation of the frame_support::traits::tokens::Pay trait, to allow for XCM-based payments of a given Balance of some asset ID existing on some chain under ownership of some Interior location of the local chain to a particular Beneficiary. The AssetKind value is not itself bounded (to avoid the issue of needing to wrap some preexisting datatype), however a converter type AssetKindToLocatableAsset must be provided in order to translate it into a LocatableAsset, which comprises both an XCM Location describing the XCM endpoint on which the asset to be paid resides and an XCM AssetId to identify the specific asset at that endpoint.
ProcessXcmMessage
A message processor that delegates execution to an XcmExecutor.
RelayChainAsNative
RespectSuspension
Barrier condition that allows for a SuspensionChecker that controls whether or not the XCM executor will be suspended from executing the given XCM.
SendXcmFeeToAccount
A HandleFee implementation that simply deposits the fees into a specific on-chain ReceiverAccount.
SiblingParachainAsNative
SiblingParachainConvertsVia
SiblingSystemParachainAsSuperuser
SignedAccountId32AsNative
SignedAccountKey20AsNative
SignedToAccountId32
Convert implementation to convert from some a Signed (system) Origin into an AccountId32.
SingleAssetExchangeAdapter
An adapter from [pallet_asset_conversion::SwapCredit] and [pallet_asset_conversion::QuotePrice] to xcm_executor::traits::AssetExchange.
SovereignPaidRemoteExporter
Implementation of SendXcm which wraps the message inside an ExportMessage instruction and sends it to a destination known to be able to handle it.
SovereignSignedViaLocation
Sovereign accounts use the system’s Signed origin with an account ID derived from the LocationConverter.
StartsWith
An implementation of Contains that checks for Location or InteriorLocation if starts with the provided type T.
StartsWithExplicitGlobalConsensus
An implementation of Contains that checks for Location or InteriorLocation if starts with expected GlobalConsensus(NetworkId) provided as type T.
TakeWeightCredit
Execution barrier that just takes max_weight from properties.weight_credit.
TrailingSetTopicAsId
Sets the message ID to t using a SetTopic(t) in the last position if present.
UnpaidLocalExporterDeprecated
Implementation of SendXcm which uses the given ExportXcm implementation in order to forward the message over a bridge.
UnpaidRemoteExporter
Implementation of SendXcm which wraps the message inside an ExportMessage instruction and sends it to a destination known to be able to handle it.
UsingComponents
Weight trader which uses the configured WeightToFee to set the right price for weight and then places any weight bought into the right account.
WeightInfoBounds
WithComputedOrigin
A derivative barrier, which scans the first MaxPrefixes instructions for origin-alterers and then evaluates should_execute of the InnerBarrier based on the remaining instructions and the newly computed origin.
WithLatestLocationConverter
An adapter implementation of MaybeEquivalence which can convert between the latest Location and other versions that implement TryInto<Location> and TryFrom<Location>.
WithTopicSource
Wrapper router which, if the message does not already end with a SetTopic instruction, prepends one to the message filled with an ID from TopicSource. This ID is returned from a successful deliver.
WithUniqueTopic
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 successful deliver.
XcmFeeManagerFromComponents
A FeeManager implementation that permits the specified WaivedLocations to not pay for fees and that uses the provided HandleFee implementation otherwise.

Enums§

DispatchBlobError
HaulBlobError
MintLocation
The location which is allowed to mint a particular asset.

Traits§

AssetChecking
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.
Controller
Umbrella trait for all Controller traits.
CreateMatcher
Creates an instruction matcher from an XCM. Since XCM versions differ, we need to make a trait here to unify the interfaces among them.
DescribeLocation
Means of converting a location into a stable and unique descriptive identifier.
DispatchBlob
EnsureDelivery
Trait for a type which ensures all requirements for successful delivery with XCM transport layers.
ExecuteController
Execute an XCM locally, for a given origin.
ExecuteControllerWeightInfo
Weight functions needed for ExecuteController.
ExporterFor
HandleFee
Handles the fees that are taken by certain XCM instructions.
HaulBlob
InspectMessageQueues
Inspects messages in queues. Meant to be used in runtime APIs, not in runtimes.
MatchXcm
API that allows to pattern-match against anything that is contained within an XCM.
QueryController
Query a remote location, from a given origin.
QueryControllerWeightInfo
Weight functions needed for QueryController.
QueryHandler
Provides methods to expect responses from XCMs and query their status.
SendController
Send an XCM from a given origin.
SendControllerWeightInfo
Weight functions needed for SendController.
TakeRevenue
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§

deposit_or_burn_fee
Try to deposit the given fee in the specified account. Burns the fee in case of a failure.
ensure_is_remote
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 at universal_local within the consensus universe. If dest is not a location in remote consensus, then an error is returned.

Type Aliases§

ConvertedConcreteAssetIdDeprecated
DescribeAccountIdTerminal
DescribeAllTerminal
ForeignChainAliasAccountDeprecated
This is deprecated in favor of the more modular HashedDescription converter. If your chain has previously used this, then you can retain backwards compatibility using HashedDescription and a tuple with LegacyDescribeForeignChainAccount as the first element. For example:
PayAccountId32OnChainOverXcm
Specialization of the PayOverXcm trait to allow [u8; 32]-based AccountId values to be paid on a remote chain.