MCPcopy Create free account
hub / github.com/BitVM/BitVM / handle_initiate_peg_in_command

Method handle_initiate_peg_in_command

bridge/src/client/cli/client_command.rs:238–262  ·  view source on GitHub ↗
(
        &mut self,
        sub_matches: &ArgMatches,
    )

Source from the content-addressed store, hash-verified

236 }
237
238 pub async fn handle_initiate_peg_in_command(
239 &mut self,
240 sub_matches: &ArgMatches,
241 ) -> io::Result<()> {
242 self.client.sync().await;
243
244 let evm_address = sub_matches
245 .get_one::<String>("destination_address")
246 .unwrap();
247 let input = self
248 .get_funding_utxo_input(sub_matches.get_one::<String>("utxo"))
249 .await?;
250 let peg_in_id = self.client.create_peg_in_graph(input, evm_address).await;
251
252 self.client.flush().await;
253
254 println!("Created peg-in graph with ID: {peg_in_id}");
255 println!("Broadcasting deposit...");
256
257 if let Err(e) = self.client.broadcast_peg_in_deposit(&peg_in_id).await {
258 eprintln!("Failed to broadcast peg-in deposit: {e}");
259 }
260
261 Ok(())
262 }
263
264 pub fn get_create_peg_out_graph_command() -> Command {
265 Command::new("create-peg-out")

Callers 2

mainFunction · 0.80

Calls 5

create_peg_in_graphMethod · 0.80
syncMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected