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 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.

§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.