Cross-chain token transfer support.
orml-xtokens assumes other parachains also use xtoken protocol, and their impl is trustworthy (or exactly orml-xtokens).
Chains using orml-xtokens might need to whitelist para_id's to ensure this.
Basic data structure
/// To identify different chain
enum ChainId {
RelayChain,
ParaChain(ParaId)
}
/// To identify currency type and it's 'owner' chain
struct XCurrencyId {
/// The owner chain
chain_id: ChainId,
currency_id: Vec<u8>, // more flexible compared to int
}
enum XCMPMessage {
Transfer {
currency_id: XCurrencyId,
dest: AccountId,
amount: Balance,
}
}
Dispatchable calls
transfer
- Prerequisite: must be aware of self
para_id
- do transfer
- To relaychain
- To parachain
- Relaychain tokens.
- Owned parachain tokens.
- Non-owned known parachain tokens.
- Non-owned unknown parachain tokens.
Message handling
Bookkeeping
- Impl
DownwardMessageHandler
- Impl
XCMPMessageHandler
Cross-chain token transfer support.
orml-xtokensassumes other parachains also use xtoken protocol, and their impl is trustworthy (or exactlyorml-xtokens).Chains using
orml-xtokensmight need to whitelistpara_id's to ensure this.Basic data structure
Dispatchable calls
transfer
para_idMessage handling
Bookkeeping
DownwardMessageHandlerXCMPMessageHandler