Struct staging_xcm::v3::XcmBuilder
source · pub struct XcmBuilder<Call, S: XcmBuilderState> {
pub state: PhantomData<S>,
/* private fields */
}
Expand description
Type used to build XCM programs
Fields§
§state: PhantomData<S>
Implementations§
source§impl<Call> XcmBuilder<Call, PaymentRequired>
impl<Call> XcmBuilder<Call, PaymentRequired>
sourcepub fn withdraw_asset(
self,
arg0: impl Into<MultiAssets>,
) -> XcmBuilder<Call, LoadedHolding>
pub fn withdraw_asset( self, arg0: impl Into<MultiAssets>, ) -> XcmBuilder<Call, LoadedHolding>
Withdraw asset(s) (assets
) from the ownership of origin
and place them into the Holding
Register.
assets
: The asset(s) to be withdrawn into holding.
Kind: Command.
Errors:
sourcepub fn reserve_asset_deposited(
self,
arg0: impl Into<MultiAssets>,
) -> XcmBuilder<Call, LoadedHolding>
pub fn reserve_asset_deposited( self, arg0: impl Into<MultiAssets>, ) -> XcmBuilder<Call, LoadedHolding>
Asset(s) (assets
) have been received into the ownership of this system on the origin
system and equivalent derivatives should be placed into the Holding Register.
assets
: The asset(s) that are minted into holding.
Safety: origin
must be trusted to have received and be storing assets
such that they
may later be withdrawn should this system send a corresponding message.
Kind: Trusted Indication.
Errors:
sourcepub fn receive_teleported_asset(
self,
arg0: impl Into<MultiAssets>,
) -> XcmBuilder<Call, LoadedHolding>
pub fn receive_teleported_asset( self, arg0: impl Into<MultiAssets>, ) -> XcmBuilder<Call, LoadedHolding>
Asset(s) (assets
) have been destroyed on the origin
system and equivalent assets should
be created and placed into the Holding Register.
assets
: The asset(s) that are minted into the Holding Register.
Safety: origin
must be trusted to have irrevocably destroyed the corresponding assets
prior as a consequence of sending this message.
Kind: Trusted Indication.
Errors:
sourcepub fn claim_asset(
self,
assets: impl Into<MultiAssets>,
ticket: impl Into<MultiLocation>,
) -> XcmBuilder<Call, LoadedHolding>
pub fn claim_asset( self, assets: impl Into<MultiAssets>, ticket: impl Into<MultiLocation>, ) -> XcmBuilder<Call, LoadedHolding>
Create some assets which are being held on behalf of the origin.
assets
: The assets which are to be claimed. This must match exactly with the assets claimable by the origin of the ticket.ticket
: The ticket of the asset; this is an abstract identifier to help locate the asset.
Kind: Command
Errors:
source§impl<Call> XcmBuilder<Call, LoadedHolding>
impl<Call> XcmBuilder<Call, LoadedHolding>
sourcepub fn clear_origin(self) -> XcmBuilder<Call, LoadedHolding>
pub fn clear_origin(self) -> XcmBuilder<Call, LoadedHolding>
Clear the origin.
This may be used by the XCM author to ensure that later instructions cannot command the
authority of the origin (e.g. if they are being relayed from an untrusted source, as often
the case with ReserveAssetDeposited
).
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn buy_execution(
self,
fees: impl Into<MultiAsset>,
weight_limit: impl Into<WeightLimit>,
) -> XcmBuilder<Call, AnythingGoes>
pub fn buy_execution( self, fees: impl Into<MultiAsset>, weight_limit: impl Into<WeightLimit>, ) -> XcmBuilder<Call, AnythingGoes>
Pay for the execution of some XCM xcm
and orders
with up to weight
picoseconds of execution time, paying for this with up to fees
from the Holding Register.
fees
: The asset(s) to remove from the Holding Register to pay for fees.weight_limit
: The maximum amount of weight to purchase; this must be at least the expected maximum weight of the total XCM to be executed for theAllowTopLevelPaidExecutionFrom
barrier to allow the XCM be executed.
Kind: Command
Errors:
source§impl<Call> XcmBuilder<Call, ExplicitUnpaidRequired>
impl<Call> XcmBuilder<Call, ExplicitUnpaidRequired>
sourcepub fn unpaid_execution(
self,
weight_limit: impl Into<WeightLimit>,
check_origin: impl Into<Option<MultiLocation>>,
) -> XcmBuilder<Call, AnythingGoes>
pub fn unpaid_execution( self, weight_limit: impl Into<WeightLimit>, check_origin: impl Into<Option<MultiLocation>>, ) -> XcmBuilder<Call, AnythingGoes>
A directive to indicate that the origin expects free execution of the message.
At execution time, this instruction just does a check on the Origin register.
However, at the barrier stage messages starting with this instruction can be disregarded if
the origin is not acceptable for free execution or the weight_limit
is Limited
and
insufficient.
Kind: Indication
Errors: If the given origin is Some
and not equal to the current Origin register.
source§impl<Call> XcmBuilder<Call, AnythingGoes>
impl<Call> XcmBuilder<Call, AnythingGoes>
sourcepub fn withdraw_asset(self, arg0: impl Into<MultiAssets>) -> Self
pub fn withdraw_asset(self, arg0: impl Into<MultiAssets>) -> Self
Withdraw asset(s) (assets
) from the ownership of origin
and place them into the Holding
Register.
assets
: The asset(s) to be withdrawn into holding.
Kind: Command.
Errors:
sourcepub fn reserve_asset_deposited(self, arg0: impl Into<MultiAssets>) -> Self
pub fn reserve_asset_deposited(self, arg0: impl Into<MultiAssets>) -> Self
Asset(s) (assets
) have been received into the ownership of this system on the origin
system and equivalent derivatives should be placed into the Holding Register.
assets
: The asset(s) that are minted into holding.
Safety: origin
must be trusted to have received and be storing assets
such that they
may later be withdrawn should this system send a corresponding message.
Kind: Trusted Indication.
Errors:
sourcepub fn receive_teleported_asset(self, arg0: impl Into<MultiAssets>) -> Self
pub fn receive_teleported_asset(self, arg0: impl Into<MultiAssets>) -> Self
Asset(s) (assets
) have been destroyed on the origin
system and equivalent assets should
be created and placed into the Holding Register.
assets
: The asset(s) that are minted into the Holding Register.
Safety: origin
must be trusted to have irrevocably destroyed the corresponding assets
prior as a consequence of sending this message.
Kind: Trusted Indication.
Errors:
sourcepub fn query_response(
self,
query_id: impl Into<QueryId>,
response: impl Into<Response>,
max_weight: impl Into<Weight>,
querier: impl Into<Option<MultiLocation>>,
) -> Self
pub fn query_response( self, query_id: impl Into<QueryId>, response: impl Into<Response>, max_weight: impl Into<Weight>, querier: impl Into<Option<MultiLocation>>, ) -> Self
Respond with information that the local system is expecting.
query_id
: The identifier of the query that resulted in this message being sent.response
: The message content.max_weight
: The maximum weight that handling this response should take.querier
: The location responsible for the initiation of the response, if there is one. In general this will tend to be the same location as the receiver of this message. NOTE: As usual, this is interpreted from the perspective of the receiving consensus system.
Safety: Since this is information only, there are no immediate concerns. However, it should
be remembered that even if the Origin behaves reasonably, it can always be asked to make
a response to a third-party chain who may or may not be expecting the response. Therefore
the querier
should be checked to match the expected value.
Kind: Information.
Errors:
sourcepub fn transfer_asset(
self,
assets: impl Into<MultiAssets>,
beneficiary: impl Into<MultiLocation>,
) -> Self
pub fn transfer_asset( self, assets: impl Into<MultiAssets>, beneficiary: impl Into<MultiLocation>, ) -> Self
Withdraw asset(s) (assets
) from the ownership of origin
and place equivalent assets
under the ownership of beneficiary
.
assets
: The asset(s) to be withdrawn.beneficiary
: The new owner for the assets.
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn transfer_reserve_asset(
self,
assets: impl Into<MultiAssets>,
dest: impl Into<MultiLocation>,
xcm: impl Into<Xcm<()>>,
) -> Self
pub fn transfer_reserve_asset( self, assets: impl Into<MultiAssets>, dest: impl Into<MultiLocation>, xcm: impl Into<Xcm<()>>, ) -> Self
Withdraw asset(s) (assets
) from the ownership of origin
and place equivalent assets
under the ownership of dest
within this consensus system (i.e. its sovereign account).
Send an onward XCM message to dest
of ReserveAssetDeposited
with the given
xcm
.
assets
: The asset(s) to be withdrawn.dest
: The location whose sovereign account will own the assets and thus the effective beneficiary for the assets and the notification target for the reserve asset deposit message.xcm
: The instructions that should follow theReserveAssetDeposited
instruction, which is sent onwards todest
.
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn transact(
self,
origin_kind: impl Into<OriginKind>,
require_weight_at_most: impl Into<Weight>,
call: impl Into<DoubleEncoded<Call>>,
) -> Self
pub fn transact( self, origin_kind: impl Into<OriginKind>, require_weight_at_most: impl Into<Weight>, call: impl Into<DoubleEncoded<Call>>, ) -> Self
Apply the encoded transaction call
, whose dispatch-origin should be origin
as expressed
by the kind of origin origin_kind
.
The Transact Status Register is set according to the result of dispatching the call.
origin_kind
: The means of expressing the message origin as a dispatch origin.require_weight_at_most
: The weight ofcall
; this should be at least the chain’s calculated weight and will be used in the weight determination arithmetic.call
: The encoded transaction to be applied.
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn hrmp_new_channel_open_request(
self,
sender: impl Into<u32>,
max_message_size: impl Into<u32>,
max_capacity: impl Into<u32>,
) -> Self
pub fn hrmp_new_channel_open_request( self, sender: impl Into<u32>, max_message_size: impl Into<u32>, max_capacity: impl Into<u32>, ) -> Self
A message to notify about a new incoming HRMP channel. This message is meant to be sent by the relay-chain to a para.
sender
: The sender in the to-be opened channel. Also, the initiator of the channel opening.max_message_size
: The maximum size of a message proposed by the sender.max_capacity
: The maximum number of messages that can be queued in the channel.
Safety: The message should originate directly from the relay-chain.
Kind: System Notification
sourcepub fn hrmp_channel_accepted(self, recipient: impl Into<u32>) -> Self
pub fn hrmp_channel_accepted(self, recipient: impl Into<u32>) -> Self
A message to notify about that a previously sent open channel request has been accepted by the recipient. That means that the channel will be opened during the next relay-chain session change. This message is meant to be sent by the relay-chain to a para.
Safety: The message should originate directly from the relay-chain.
Kind: System Notification
Errors:
sourcepub fn hrmp_channel_closing(
self,
initiator: impl Into<u32>,
sender: impl Into<u32>,
recipient: impl Into<u32>,
) -> Self
pub fn hrmp_channel_closing( self, initiator: impl Into<u32>, sender: impl Into<u32>, recipient: impl Into<u32>, ) -> Self
A message to notify that the other party in an open channel decided to close it. In
particular, initiator
is going to close the channel opened from sender
to the
recipient
. The close will be enacted at the next relay-chain session change. This message
is meant to be sent by the relay-chain to a para.
Safety: The message should originate directly from the relay-chain.
Kind: System Notification
Errors:
sourcepub fn clear_origin(self) -> Self
pub fn clear_origin(self) -> Self
Clear the origin.
This may be used by the XCM author to ensure that later instructions cannot command the
authority of the origin (e.g. if they are being relayed from an untrusted source, as often
the case with ReserveAssetDeposited
).
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn descend_origin(self, arg0: impl Into<InteriorMultiLocation>) -> Self
pub fn descend_origin(self, arg0: impl Into<InteriorMultiLocation>) -> Self
Mutate the origin to some interior location.
Kind: Command
Errors:
sourcepub fn report_error(self, arg0: impl Into<QueryResponseInfo>) -> Self
pub fn report_error(self, arg0: impl Into<QueryResponseInfo>) -> Self
Immediately report the contents of the Error Register to the given destination via XCM.
A QueryResponse
message of type ExecutionOutcome
is sent to the described destination.
response_info
: Information for making the response.
Kind: Command
Errors:
sourcepub fn deposit_asset(
self,
assets: impl Into<MultiAssetFilter>,
beneficiary: impl Into<MultiLocation>,
) -> Self
pub fn deposit_asset( self, assets: impl Into<MultiAssetFilter>, beneficiary: impl Into<MultiLocation>, ) -> Self
Remove the asset(s) (assets
) from the Holding Register and place equivalent assets under
the ownership of beneficiary
within this consensus system.
assets
: The asset(s) to remove from holding.beneficiary
: The new owner for the assets.
Kind: Command
Errors:
sourcepub fn deposit_reserve_asset(
self,
assets: impl Into<MultiAssetFilter>,
dest: impl Into<MultiLocation>,
xcm: impl Into<Xcm<()>>,
) -> Self
pub fn deposit_reserve_asset( self, assets: impl Into<MultiAssetFilter>, dest: impl Into<MultiLocation>, xcm: impl Into<Xcm<()>>, ) -> Self
Remove the asset(s) (assets
) from the Holding Register and place equivalent assets under
the ownership of dest
within this consensus system (i.e. deposit them into its sovereign
account).
Send an onward XCM message to dest
of ReserveAssetDeposited
with the given effects
.
assets
: The asset(s) to remove from holding.dest
: The location whose sovereign account will own the assets and thus the effective beneficiary for the assets and the notification target for the reserve asset deposit message.xcm
: The orders that should follow theReserveAssetDeposited
instruction which is sent onwards todest
.
Kind: Command
Errors:
sourcepub fn exchange_asset(
self,
give: impl Into<MultiAssetFilter>,
want: impl Into<MultiAssets>,
maximal: impl Into<bool>,
) -> Self
pub fn exchange_asset( self, give: impl Into<MultiAssetFilter>, want: impl Into<MultiAssets>, maximal: impl Into<bool>, ) -> Self
Remove the asset(s) (want
) from the Holding Register and replace them with alternative
assets.
The minimum amount of assets to be received into the Holding Register for the order not to fail may be stated.
give
: The maximum amount of assets to remove from holding.want
: The minimum amount of assets whichgive
should be exchanged for.maximal
: Iftrue
, then prefer to give as much as possible up to the limit ofgive
and receive accordingly more. Iffalse
, then prefer to give as little as possible in order to receive as little as possible while receiving at leastwant
.
Kind: Command
Errors:
sourcepub fn initiate_reserve_withdraw(
self,
assets: impl Into<MultiAssetFilter>,
reserve: impl Into<MultiLocation>,
xcm: impl Into<Xcm<()>>,
) -> Self
pub fn initiate_reserve_withdraw( self, assets: impl Into<MultiAssetFilter>, reserve: impl Into<MultiLocation>, xcm: impl Into<Xcm<()>>, ) -> Self
Remove the asset(s) (assets
) from holding and send a WithdrawAsset
XCM message to a
reserve location.
assets
: The asset(s) to remove from holding.reserve
: A valid location that acts as a reserve for all asset(s) inassets
. The sovereign account of this consensus system on the reserve location will have appropriate assets withdrawn andeffects
will be executed on them. There will typically be only one valid location on any given asset/chain combination.xcm
: The instructions to execute on the assets once withdrawn on the reserve location.
Kind: Command
Errors:
sourcepub fn initiate_teleport(
self,
assets: impl Into<MultiAssetFilter>,
dest: impl Into<MultiLocation>,
xcm: impl Into<Xcm<()>>,
) -> Self
pub fn initiate_teleport( self, assets: impl Into<MultiAssetFilter>, dest: impl Into<MultiLocation>, xcm: impl Into<Xcm<()>>, ) -> Self
Remove the asset(s) (assets
) from holding and send a ReceiveTeleportedAsset
XCM message
to a dest
location.
assets
: The asset(s) to remove from holding.dest
: A valid location that respects teleports coming from this location.xcm
: The instructions to execute on the assets once arrived on the destination location.
NOTE: The dest
location MUST respect this origin as a valid teleportation origin for
all assets
. If it does not, then the assets may be lost.
Kind: Command
Errors:
sourcepub fn report_holding(
self,
response_info: impl Into<QueryResponseInfo>,
assets: impl Into<MultiAssetFilter>,
) -> Self
pub fn report_holding( self, response_info: impl Into<QueryResponseInfo>, assets: impl Into<MultiAssetFilter>, ) -> Self
Report to a given destination the contents of the Holding Register.
A QueryResponse
message of type Assets
is sent to the described destination.
response_info
: Information for making the response.assets
: A filter for the assets that should be reported back. The assets reported back will be, asset-wise, the lesser of this value and the holding register. No wildcards will be used when reporting assets back.
Kind: Command
Errors:
sourcepub fn buy_execution(
self,
fees: impl Into<MultiAsset>,
weight_limit: impl Into<WeightLimit>,
) -> Self
pub fn buy_execution( self, fees: impl Into<MultiAsset>, weight_limit: impl Into<WeightLimit>, ) -> Self
Pay for the execution of some XCM xcm
and orders
with up to weight
picoseconds of execution time, paying for this with up to fees
from the Holding Register.
fees
: The asset(s) to remove from the Holding Register to pay for fees.weight_limit
: The maximum amount of weight to purchase; this must be at least the expected maximum weight of the total XCM to be executed for theAllowTopLevelPaidExecutionFrom
barrier to allow the XCM be executed.
Kind: Command
Errors:
sourcepub fn refund_surplus(self) -> Self
pub fn refund_surplus(self) -> Self
Refund any surplus weight previously bought with BuyExecution
.
Kind: Command
Errors: None.
sourcepub fn set_error_handler(self, arg0: impl Into<Xcm<Call>>) -> Self
pub fn set_error_handler(self, arg0: impl Into<Xcm<Call>>) -> Self
Set the Error Handler Register. This is code that should be called in the case of an error happening.
An error occurring within execution of this code will NOT result in the error register being set, nor will an error handler be called due to it. The error handler and appendix may each still be set.
The apparent weight of this instruction is inclusive of the inner Xcm
; the executing
weight however includes only the difference between the previous handler and the new
handler, which can reasonably be negative, which would result in a surplus.
Kind: Command
Errors: None.
sourcepub fn set_appendix(self, arg0: impl Into<Xcm<Call>>) -> Self
pub fn set_appendix(self, arg0: impl Into<Xcm<Call>>) -> Self
Set the Appendix Register. This is code that should be called after code execution (including the error handler if any) is finished. This will be called regardless of whether an error occurred.
Any error occurring due to execution of this code will result in the error register being set, and the error handler (if set) firing.
The apparent weight of this instruction is inclusive of the inner Xcm
; the executing
weight however includes only the difference between the previous appendix and the new
appendix, which can reasonably be negative, which would result in a surplus.
Kind: Command
Errors: None.
sourcepub fn clear_error(self) -> Self
pub fn clear_error(self) -> Self
Clear the Error Register.
Kind: Command
Errors: None.
sourcepub fn claim_asset(
self,
assets: impl Into<MultiAssets>,
ticket: impl Into<MultiLocation>,
) -> Self
pub fn claim_asset( self, assets: impl Into<MultiAssets>, ticket: impl Into<MultiLocation>, ) -> Self
Create some assets which are being held on behalf of the origin.
assets
: The assets which are to be claimed. This must match exactly with the assets claimable by the origin of the ticket.ticket
: The ticket of the asset; this is an abstract identifier to help locate the asset.
Kind: Command
Errors:
sourcepub fn trap(self, arg0: impl Into<u64>) -> Self
pub fn trap(self, arg0: impl Into<u64>) -> Self
Always throws an error of type Trap
.
Kind: Command
Errors:
Trap
: All circumstances, whose inner value is the same as this item’s inner value.
sourcepub fn subscribe_version(
self,
query_id: impl Into<QueryId>,
max_response_weight: impl Into<Weight>,
) -> Self
pub fn subscribe_version( self, query_id: impl Into<QueryId>, max_response_weight: impl Into<Weight>, ) -> Self
Ask the destination system to respond with the most recent version of XCM that they
support in a QueryResponse
instruction. Any changes to this should also elicit similar
responses when they happen.
query_id
: An identifier that will be replicated into the returned XCM message.max_response_weight
: The maximum amount of weight that theQueryResponse
item which is sent as a reply may take to execute. NOTE: If this is unexpectedly large then the response may not execute at all.
Kind: Command
Errors: Fallible
sourcepub fn unsubscribe_version(self) -> Self
pub fn unsubscribe_version(self) -> Self
Cancel the effect of a previous SubscribeVersion
instruction.
Kind: Command
Errors: Fallible
sourcepub fn burn_asset(self, arg0: impl Into<MultiAssets>) -> Self
pub fn burn_asset(self, arg0: impl Into<MultiAssets>) -> Self
Reduce Holding by up to the given assets.
Holding is reduced by as much as possible up to the assets in the parameter. It is not an
error if the Holding does not contain the assets (to make this an error, use ExpectAsset
prior).
Kind: Command
Errors: Infallible
sourcepub fn expect_asset(self, arg0: impl Into<MultiAssets>) -> Self
pub fn expect_asset(self, arg0: impl Into<MultiAssets>) -> Self
Throw an error if Holding does not contain at least the given assets.
Kind: Command
Errors:
ExpectationFalse
: If Holding Register does not contain the assets in the parameter.
sourcepub fn expect_origin(self, arg0: impl Into<Option<MultiLocation>>) -> Self
pub fn expect_origin(self, arg0: impl Into<Option<MultiLocation>>) -> Self
Ensure that the Origin Register equals some given value and throw an error if not.
Kind: Command
Errors:
ExpectationFalse
: If Origin Register is not equal to the parameter.
sourcepub fn expect_error(self, arg0: impl Into<Option<(u32, Error)>>) -> Self
pub fn expect_error(self, arg0: impl Into<Option<(u32, Error)>>) -> Self
Ensure that the Error Register equals some given value and throw an error if not.
Kind: Command
Errors:
ExpectationFalse
: If the value of the Error Register is not equal to the parameter.
sourcepub fn expect_transact_status(self, arg0: impl Into<MaybeErrorCode>) -> Self
pub fn expect_transact_status(self, arg0: impl Into<MaybeErrorCode>) -> Self
Ensure that the Transact Status Register equals some given value and throw an error if not.
Kind: Command
Errors:
ExpectationFalse
: If the value of the Transact Status Register is not equal to the parameter.
sourcepub fn query_pallet(
self,
module_name: impl Into<Vec<u8>>,
response_info: impl Into<QueryResponseInfo>,
) -> Self
pub fn query_pallet( self, module_name: impl Into<Vec<u8>>, response_info: impl Into<QueryResponseInfo>, ) -> Self
Query the existence of a particular pallet type.
module_name
: The module name of the pallet to query.response_info
: Information for making the response.
Sends a QueryResponse
to Origin whose data field PalletsInfo
containing the information
of all pallets on the local chain whose name is equal to name
. This is empty in the case
that the local chain is not based on Substrate Frame.
Safety: No concerns.
Kind: Command
Errors: Fallible.
sourcepub fn expect_pallet(
self,
index: impl Into<u32>,
name: impl Into<Vec<u8>>,
module_name: impl Into<Vec<u8>>,
crate_major: impl Into<u32>,
min_crate_minor: impl Into<u32>,
) -> Self
pub fn expect_pallet( self, index: impl Into<u32>, name: impl Into<Vec<u8>>, module_name: impl Into<Vec<u8>>, crate_major: impl Into<u32>, min_crate_minor: impl Into<u32>, ) -> Self
Ensure that a particular pallet with a particular version exists.
index: Compact
: The index which identifies the pallet. An error if no pallet exists at this index.name: Vec<u8>
: Name which must be equal to the name of the pallet.module_name: Vec<u8>
: Module name which must be equal to the name of the module in which the pallet exists.crate_major: Compact
: Version number which must be equal to the major version of the crate which implements the pallet.min_crate_minor: Compact
: Version number which must be at most the minor version of the crate which implements the pallet.
Safety: No concerns.
Kind: Command
Errors:
ExpectationFalse
: In case any of the expectations are broken.
sourcepub fn report_transact_status(self, arg0: impl Into<QueryResponseInfo>) -> Self
pub fn report_transact_status(self, arg0: impl Into<QueryResponseInfo>) -> Self
Send a QueryResponse
message containing the value of the Transact Status Register to some
destination.
query_response_info
: The information needed for constructing and sending theQueryResponse
message.
Safety: No concerns.
Kind: Command
Errors: Fallible.
sourcepub fn clear_transact_status(self) -> Self
pub fn clear_transact_status(self) -> Self
Set the Transact Status Register to its default, cleared, value.
Safety: No concerns.
Kind: Command
Errors: Infallible.
sourcepub fn universal_origin(self, arg0: impl Into<Junction>) -> Self
pub fn universal_origin(self, arg0: impl Into<Junction>) -> Self
Set the Origin Register to be some child of the Universal Ancestor.
Safety: Should only be usable if the Origin is trusted to represent the Universal Ancestor child in general. In general, no Origin should be able to represent the Universal Ancestor child which is the root of the local consensus system since it would by extension allow it to act as any location within the local consensus.
The Junction
parameter should generally be a GlobalConsensus
variant since it is only
these which are children of the Universal Ancestor.
Kind: Command
Errors: Fallible.
sourcepub fn export_message(
self,
network: impl Into<NetworkId>,
destination: impl Into<InteriorMultiLocation>,
xcm: impl Into<Xcm<()>>,
) -> Self
pub fn export_message( self, network: impl Into<NetworkId>, destination: impl Into<InteriorMultiLocation>, xcm: impl Into<Xcm<()>>, ) -> Self
Send a message on to Non-Local Consensus system.
This will tend to utilize some extra-consensus mechanism, the obvious one being a bridge.
A fee may be charged; this may be determined based on the contents of xcm
. It will be
taken from the Holding register.
network
: The remote consensus system to which the message should be exported.destination
: The location relative to the remote consensus system to which the message should be sent on arrival.xcm
: The message to be exported.
As an example, to export a message for execution on Asset Hub (parachain #1000 in the
Kusama network), you would call with network: NetworkId::Kusama
and
destination: X1(Parachain(1000))
. Alternatively, to export a message for execution on
Polkadot, you would call with network: NetworkId:: Polkadot
and destination: Here
.
Kind: Command
Errors: Fallible.
sourcepub fn lock_asset(
self,
asset: impl Into<MultiAsset>,
unlocker: impl Into<MultiLocation>,
) -> Self
pub fn lock_asset( self, asset: impl Into<MultiAsset>, unlocker: impl Into<MultiLocation>, ) -> Self
Lock the locally held asset and prevent further transfer or withdrawal.
This restriction may be removed by the UnlockAsset
instruction being called with an
Origin of unlocker
and a target
equal to the current Origin
.
If the locking is successful, then a NoteUnlockable
instruction is sent to unlocker
.
asset
: The asset(s) which should be locked.unlocker
: The value which the Origin must be for a correspondingUnlockAsset
instruction to work.
Kind: Command.
Errors:
sourcepub fn unlock_asset(
self,
asset: impl Into<MultiAsset>,
target: impl Into<MultiLocation>,
) -> Self
pub fn unlock_asset( self, asset: impl Into<MultiAsset>, target: impl Into<MultiLocation>, ) -> Self
Remove the lock over asset
on this chain and (if nothing else is preventing it) allow the
asset to be transferred.
asset
: The asset to be unlocked.target
: The owner of the asset on the local chain.
Safety: No concerns.
Kind: Command.
Errors:
sourcepub fn note_unlockable(
self,
asset: impl Into<MultiAsset>,
owner: impl Into<MultiLocation>,
) -> Self
pub fn note_unlockable( self, asset: impl Into<MultiAsset>, owner: impl Into<MultiLocation>, ) -> Self
Asset (asset
) has been locked on the origin
system and may not be transferred. It may
only be unlocked with the receipt of the UnlockAsset
instruction from this chain.
asset
: The asset(s) which are now unlockable from this origin.owner
: The owner of the asset on the chain in which it was locked. This may be a location specific to the origin network.
Safety: origin
must be trusted to have locked the corresponding asset
prior as a consequence of sending this message.
Kind: Trusted Indication.
Errors:
sourcepub fn request_unlock(
self,
asset: impl Into<MultiAsset>,
locker: impl Into<MultiLocation>,
) -> Self
pub fn request_unlock( self, asset: impl Into<MultiAsset>, locker: impl Into<MultiLocation>, ) -> Self
Send an UnlockAsset
instruction to the locker
for the given asset
.
This may fail if the local system is making use of the fact that the asset is locked or, of course, if there is no record that the asset actually is locked.
asset
: The asset(s) to be unlocked.locker
: The location from which a previousNoteUnlockable
was sent and to which anUnlockAsset
should be sent.
Kind: Command.
Errors:
sourcepub fn set_fees_mode(self, jit_withdraw: impl Into<bool>) -> Self
pub fn set_fees_mode(self, jit_withdraw: impl Into<bool>) -> Self
Sets the Fees Mode Register.
jit_withdraw
: The fees mode item; if set totrue
then fees for any instructions are withdrawn as needed using the same mechanism asWithdrawAssets
.
Kind: Command.
Errors:
sourcepub fn set_topic(self, arg0: impl Into<[u8; 32]>) -> Self
pub fn set_topic(self, arg0: impl Into<[u8; 32]>) -> Self
Set the Topic Register.
The 32-byte array identifier in the parameter is not guaranteed to be unique; if such a property is desired, it is up to the code author to enforce uniqueness.
Safety: No concerns.
Kind: Command
Errors:
sourcepub fn clear_topic(self) -> Self
pub fn clear_topic(self) -> Self
Clear the Topic Register.
Kind: Command
Errors: None.
sourcepub fn alias_origin(self, arg0: impl Into<MultiLocation>) -> Self
pub fn alias_origin(self, arg0: impl Into<MultiLocation>) -> Self
Alter the current Origin to another given origin.
Kind: Command
Errors: If the existing state would not allow such a change.
sourcepub fn unpaid_execution(
self,
weight_limit: impl Into<WeightLimit>,
check_origin: impl Into<Option<MultiLocation>>,
) -> Self
pub fn unpaid_execution( self, weight_limit: impl Into<WeightLimit>, check_origin: impl Into<Option<MultiLocation>>, ) -> Self
A directive to indicate that the origin expects free execution of the message.
At execution time, this instruction just does a check on the Origin register.
However, at the barrier stage messages starting with this instruction can be disregarded if
the origin is not acceptable for free execution or the weight_limit
is Limited
and
insufficient.
Kind: Indication
Errors: If the given origin is Some
and not equal to the current Origin register.
pub fn build(self) -> Xcm<Call>
Auto Trait Implementations§
impl<Call, S> Freeze for XcmBuilder<Call, S>
impl<Call, S> RefUnwindSafe for XcmBuilder<Call, S>where
S: RefUnwindSafe,
Call: RefUnwindSafe,
impl<Call, S> Send for XcmBuilder<Call, S>
impl<Call, S> Sync for XcmBuilder<Call, S>
impl<Call, S> Unpin for XcmBuilder<Call, S>
impl<Call, S> UnwindSafe for XcmBuilder<Call, S>where
S: UnwindSafe,
Call: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.