MCPcopy Create free account
hub / github.com/bwt-dev/bwt / get_wallet_script_info

Method get_wallet_script_info

src/query.rs:492–506  ·  view source on GitHub ↗

get the ScriptInfo entry of a child key, without it necessarily having indexed history

(&self, checksum: &Checksum, index: u32)

Source from the content-addressed store, hash-verified

490
491 // get the ScriptInfo entry of a child key, without it necessarily having indexed history
492 pub fn get_wallet_script_info(&self, checksum: &Checksum, index: u32) -> Option<ScriptInfo> {
493 let indexer = self.indexer.read().unwrap();
494 let wallet = indexer.watcher().get(checksum)?;
495
496 if wallet.is_valid_index(index) {
497 Some(ScriptInfo::from_desc(
498 KeyOrigin::Descriptor(checksum.clone(), index),
499 wallet.derive_address(index),
500 wallet.derive_desc(index),
501 wallet.bip32_origins(index),
502 ))
503 } else {
504 None
505 }
506 }
507
508 pub fn find_wallet_gap(&self, checksum: &Checksum) -> Option<usize> {
509 let indexer = self.indexer.read().unwrap();

Callers 1

setupFunction · 0.80

Calls 6

getMethod · 0.80
watcherMethod · 0.80
is_valid_indexMethod · 0.80
derive_addressMethod · 0.80
derive_descMethod · 0.80
bip32_originsMethod · 0.80

Tested by

no test coverage detected