MCPcopy Index your code
hub / github.com/BitVM/BitVM / get_initial_utxo

Method get_initial_utxo

bridge/src/client/client.rs:1279–1291  ·  view source on GitHub ↗
(&self, address: Address, amount: Amount)

Source from the content-addressed store, hash-verified

1277 }
1278
1279 pub async fn get_initial_utxo(&self, address: Address, amount: Amount) -> Option<Utxo> {
1280 let utxos = self.esplora.get_address_utxo(address).await.unwrap();
1281
1282 let possible_utxos = utxos
1283 .into_iter()
1284 .filter(|utxo| utxo.value == amount)
1285 .collect::<Vec<_>>();
1286 if !possible_utxos.is_empty() {
1287 Some(possible_utxos[0].clone())
1288 } else {
1289 None
1290 }
1291 }
1292
1293 pub async fn get_initial_utxos(&self, address: Address, amount: Amount) -> Option<Vec<Utxo>> {
1294 let utxos: Vec<Utxo> = self.esplora.get_address_utxo(address).await.unwrap();

Callers 3

generate_stub_outpointFunction · 0.80
verify_funding_inputsFunction · 0.80

Calls 2

is_emptyMethod · 0.80
cloneMethod · 0.80

Tested by 2

generate_stub_outpointFunction · 0.64
verify_funding_inputsFunction · 0.64