Describe the enhancement
The Wallet.is_mine(&self, script: &[Script]) function currently returns a bool representing "whether or not a script is part of this wallet (either internal or external)". It would be more useful to know which KeychainKind the script was found for, or None if not one of my scripts:
pub fn is_mine(&self, script: &[Script]) -> Option<KeychainKind>
Use case
A request came up on discord about how to figure out which output is the change. Having is_mine() tell you which chain a script is for would make this easy to figure out.
Describe the enhancement
The
Wallet.is_mine(&self, script: &[Script])function currently returns aboolrepresenting "whether or not a script is part of this wallet (either internal or external)". It would be more useful to know whichKeychainKindthe script was found for, orNoneif not one of my scripts:Use case
A request came up on discord about how to figure out which output is the change. Having
is_mine()tell you which chain a script is for would make this easy to figure out.