As far as I know, there is no way to construct an XCM message that can transfer both a Reserve and Non-Reserve asset in a single message.
The primary reason is that the XCM message pallets typically built for Reserve Assets are comprised of the following instructions:
-
TransferReserveAsset- Executed in the Reserve Chain, this transfers XYZ tokens to the destination chain’s sovereign account. It appendsReserveAssetDepositedandClearOrigin. As a result, only theReserveAssetDepositedinstruction can be executed before the origin information is cleared in the Non-Reserve chain (destination chain). -
ReserveAssetDeposited- This typically mints a representation of the asset deposited in the sovereign account. -
ClearOrigin- This wipes out all origin info, so the subsequent instructions that can be executed cannot require specific origins. -
BuyExecution(with whatever asset you specify here) andDepositAsset
This combination of instructions is limited to handling only Reserve assets out of the Reserve Chain. When transferring Non-Reserve assets, the process is somewhat similar but with InitiateReserveWithdraw, which prepends WithdrawAsset and ClearOrigin to the XCM message that will be executed by the (in this case) Reserve Chain. Therefore you are limiting that combination to handle only Non-Reserve asset transfers back to the Reserve Chain.
Is it possible to create a call that combines both processes? Let’s say we have Chain A with Reserve Asset A, and Chain B with Reserve Asset B. Alice wants to send an XCM Message from Chain A to Chain B, which includes instructions to transfer both tokens in one go. In this case, the XCM message executed in Chain B should include:
-
ReserveAssetDeposited- To mint the representation of Reserve Asset A on Chain B. -
WithdrawAsset- To withdraw Reserve Asset B tokens from Chain A’s sovereign account. -
ClearOrigin- To clear all origin info. BuyExecutionDepositAsset
Is this flow feasible?
Thanks in advance!