open-runtime-module-library
open-runtime-module-library copied to clipboard
propose xcm-transact module in the case parachain send `Transact` to relaychain
Alghough we have send_as_sovereign in xcm module. but sometimes parachain want to relaychain execute something by Transact, as the internal call of Transact can do anything that parachain expected, the most common scene is staking related operation. As I discovered some projects, they all have similar implementation.
- construct relaychain related
Callobject and also have to specify parameters. - use
utility batch_allif they're multiple xcm message needs to be executed - use
utility as_derivativeif they want using derivate account
those implemenation including: Acala | bifrost | parallel | moonbeam |...
also there're some distinctive design points:
- moonbeam
xcm-transactorhasaccount_indexregister process, as they may have many derivate account - pint
xcm-callsuse a more dynamic way to constructCall.
we could offer a common implemenation like xTokens did before. of cause this module should abide by design rules like:
- dependency as less as possible
- extensible, that's parachain can self-custom as easy as possible