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

Method handle_pegin_refund_tx_command

bridge/src/client/cli/query_command.rs:100–128  ·  view source on GitHub ↗
(
        &self,
        depositor_public_key: &PublicKey,
        sub_matches: &ArgMatches,
    )

Source from the content-addressed store, hash-verified

98 }
99
100 pub async fn handle_pegin_refund_tx_command(
101 &self,
102 depositor_public_key: &PublicKey,
103 sub_matches: &ArgMatches,
104 ) -> Response {
105 let amount = sub_matches.get_one::<String>("AMOUNT").unwrap();
106 let recipient_address = sub_matches.get_one::<String>("RECIPIENT_ADDRESS").unwrap();
107 let depositor_taproot_key = XOnlyPublicKey::from(*depositor_public_key);
108 let amount: Amount = Amount::from_sat(amount.parse::<u64>().unwrap());
109 let taproot_address = self.client.generate_connector_z_taproot_address(
110 self.network,
111 recipient_address,
112 &depositor_taproot_key,
113 );
114 let outpoint = self
115 .generate_stub_outpoint(&self.client, &taproot_address, amount)
116 .await;
117 let result = self.client.generate_presign_pegin_refund_tx(
118 self.network,
119 amount,
120 recipient_address,
121 depositor_public_key,
122 outpoint,
123 );
124 Response::new(
125 ResponseStatus::OK,
126 Some(serde_json::to_value(result).unwrap()),
127 )
128 }
129
130 pub async fn handle_pegin_deposit_tx_command(
131 &self,

Callers 1

handle_depositorMethod · 0.80

Tested by

no test coverage detected