There are several examples for including custom Rust types declared in a runtime module that can be applied Polkadot Apps interface here. However I am not sure how to encode tuples. This would also be the case for anyone else planning on using Tuples in their code and runtime API for use in polkadot-js.
Here's how it is declared in a Substrate Runtime module:
// tuple (struct)
pub type Code = u16;
pub type Type = u16;
pub struct Tuple(Code, Type);
// Complex struct using tuple
pub struct Record<T::AccountId,Tuple> {
pub address: T::AccountId,
pub tuple_values: Tuple,
}
// Storage
Record get(record):
map T::AccountId => Option<Record<T::AccountId,Tuple>>;
I am presuming I would add something like this to the Developer
tab in the Polkadot Apps settings, but I don't know if this is the correct syntax to use.
{
"Code": "u16",
"Type": "u16",
"Tuple": ["Code", "Type"],
"Record": {
"address": "AccountId",
"tuple_values": "Tuple"
}
}