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 to dest to mint and deposit reserve-based
assets to beneficiary.
TransferType::DestinationReserve: burn local assets and forward a notification to
dest chain to withdraw the reserve assets from this chain's sovereign account and
deposit them to beneficiary.
TransferType::RemoteReserve(reserve): burn local assets, forward XCM to reserve
chain to move reserves from this chain's SA to dest chain's SA, and forward another
XCM to dest to mint and deposit reserve-based assets to beneficiary. Typically
the remote reserve is Asset Hub.
TransferType::Teleport: burn local assets and forward XCM to dest chain to
mint/teleport assets and deposit them to beneficiary.
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 the assets and 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 the dest (and possibly reserve) chains.
assets_transfer_type: The XCM TransferType used to transfer the assets.
remote_fees_id: One of the included assets to be used to pay fees.
fees_transfer_type: The XCM TransferType used to transfer the fees assets.
custom_xcm_on_dest: The XCM to be executed on dest chain 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.
Transfer assets from the local chain to the destination chain using explicit transfer types for assets and fees.
assetsmust have same reserve location or may be teleportable todest. Caller must provide theassets_transfer_typeto be used forassets: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,
BuyExecutionis used to buy execution using transferredassetsidentified byremote_fees_id. Make sure enough of the specifiedremote_fees_idasset is included in the given list ofassets.remote_fees_idshould be enough to pay forweight_limit. If more weight is needed thanweight_limit, then the operation will fail and the sent assets may be at risk.remote_fees_idmay use different transfer type than rest ofassetsand can be specified throughfees_transfer_type.The caller needs to specify what should happen to the transferred assets once they reach the
destchain. This is done through thecustom_xcm_on_destparameter, which contains the instructions to execute ondestas 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 theassetseven 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.