If i understood correctly keypairs should be serialised in order as defined by BIP 174 and in [here].(https://github.com/ElementsProject/elements/blob/master/doc/pset.mediawiki)
Currently this is not the case for output serialisation as script is serialised before amount in here.
As per BIP 174 it should be opposite.
I can see @achow101, in PSBT2 branch, follows order defined in BIP 174/370, check here.
If i understood correctly keypairs should be serialised in order as defined by BIP 174 and in [here].(https://github.com/ElementsProject/elements/blob/master/doc/pset.mediawiki)
Currently this is not the case for output serialisation as script is serialised before amount in here.
As per BIP 174 it should be opposite.
I can see @achow101, in PSBT2 branch, follows order defined in BIP 174/370, check here.