pub fn transfer_assets_using_type_and_then<T: Config>(
dest: Box<VersionedLocation>,
assets: Box<VersionedAssets>,
assets_transfer_type: Box<TransferType>,
remote_fees_id: Box<VersionedAssetId>,
fees_transfer_type: Box<TransferType>,
custom_xcm_on_dest: Box<VersionedXcm<()>>,
weight_limit: WeightLimit,
)Expand description
Transfer assets from the local chain to the destination chain using explicit transfer types for assets and fees.
assets must have same reserve location or may be teleportable to dest. Caller must
provide the assets_transfer_type to be used for assets:
TransferType::LocalReserve: transfer assets to sovereign account of destination chain and forward a notification XCM todestto mint and deposit reserve-based assets tobeneficiary.TransferType::DestinationReserve: burn local assets and forward a notification todestchain to withdraw the reserve assets from this chain’s sovereign account and deposit them tobeneficiary.TransferType::RemoteReserve(reserve): burn local assets, forward XCM toreservechain to move reserves from this chain’s SA todestchain’s SA, and forward another XCM todestto mint and deposit reserve-based assets tobeneficiary. Typically the remotereserveis Asset Hub.TransferType::Teleport: burn local assets and forward XCM todestchain to mint/teleport assets and deposit them tobeneficiary.
On the destination chain, as well as any intermediary hops, BuyExecution is used to
buy execution using transferred assets identified by remote_fees_id.
Make sure enough of the specified remote_fees_id asset is included in the given list
of assets. remote_fees_id should be enough to pay for weight_limit. If more weight
is needed than weight_limit, then the operation will fail and the sent assets may be
at risk.
remote_fees_id may use different transfer type than rest of assets and can be
specified through fees_transfer_type.
The caller needs to specify what should happen to the transferred assets once they reach
the dest chain. This is done through the custom_xcm_on_dest parameter, which
contains the instructions to execute on dest as a final step.
This is usually as simple as:
Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }]),
but could be something more exotic like sending the assets even further.
origin: Must be capable of withdrawing theassetsand executing XCM.dest: Destination context for the assets. Will typically be[Parent, Parachain(..)]to send from parachain to parachain, or[Parachain(..)]to send from relay to parachain, or(parents: 2, (GlobalConsensus(..), ..))to send from parachain across a bridge to another ecosystem destination.assets: The assets to be withdrawn. This should include the assets used to pay the fee on thedest(and possibly reserve) chains.assets_transfer_type: The XCMTransferTypeused to transfer theassets.remote_fees_id: One of the includedassetsto be used to pay fees.fees_transfer_type: The XCMTransferTypeused to transfer thefeesassets.custom_xcm_on_dest: The XCM to be executed ondestchain as the last step of the transfer, which also determines what happens to the assets on the destination chain.weight_limit: The remote-side weight limit, if any, for the XCM fee purchase.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::transfer_assets_using_type_and_then.