MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fund_jit_channel

Method fund_jit_channel

plugins/lsps-plugin/src/core/lsps2/handler.rs:62–87  ·  view source on GitHub ↗
(
        &self,
        peer_id: &PublicKey,
        amount: &Msat,
    )

Source from the content-addressed store, hash-verified

60#[async_trait]
61impl 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?;

Callers 1

handleMethod · 0.45

Calls 5

AmountClass · 0.85
call_typedMethod · 0.80
create_rpcMethod · 0.45
msatMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected