| 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(); |
| 1295 | let possible_utxos = utxos |
| 1296 | .into_iter() |
| 1297 | .filter(|utxo| utxo.value == amount) |
| 1298 | .collect::<Vec<_>>(); |
| 1299 | if !possible_utxos.is_empty() { |
| 1300 | Some(possible_utxos) |
| 1301 | } else { |
| 1302 | None |
| 1303 | } |
| 1304 | } |
| 1305 | |
| 1306 | pub fn get_operator_address(&self) -> Address { |
| 1307 | if let Some(ref context) = self.operator_context { |