(
&self,
peer_id: &PublicKey,
amount: &Msat,
)
| 60 | #[async_trait] |
| 61 | impl LightningProvider for ClnApiRpc { |
| 62 | async fn fund_jit_channel( |
| 63 | &self, |
| 64 | peer_id: &PublicKey, |
| 65 | amount: &Msat, |
| 66 | ) -> AnyResult<(Sha256, String)> { |
| 67 | let mut rpc = self.create_rpc().await?; |
| 68 | let res = rpc |
| 69 | .call_typed(&FundchannelRequest { |
| 70 | announce: Some(false), |
| 71 | close_to: None, |
| 72 | compact_lease: None, |
| 73 | feerate: None, |
| 74 | minconf: None, |
| 75 | mindepth: Some(0), |
| 76 | push_msat: None, |
| 77 | request_amt: None, |
| 78 | reserve: None, |
| 79 | channel_type: Some(vec![12, 46, 50]), |
| 80 | utxos: None, |
| 81 | amount: AmountOrAll::Amount(Amount::from_msat(amount.msat())), |
| 82 | id: peer_id.to_owned(), |
| 83 | }) |
| 84 | .await |
| 85 | .with_context(|| "calling fundchannel")?; |
| 86 | Ok((res.channel_id, res.txid)) |
| 87 | } |
| 88 | |
| 89 | async fn is_channel_ready(&self, peer_id: &PublicKey, channel_id: &Sha256) -> AnyResult<bool> { |
| 90 | let mut rpc = self.create_rpc().await?; |
no test coverage detected