(
&self,
depositor_public_key: &PublicKey,
sub_matches: &ArgMatches,
)
| 128 | } |
| 129 | |
| 130 | pub async fn handle_pegin_deposit_tx_command( |
| 131 | &self, |
| 132 | depositor_public_key: &PublicKey, |
| 133 | sub_matches: &ArgMatches, |
| 134 | ) -> Response { |
| 135 | let amount = sub_matches.get_one::<String>("AMOUNT").unwrap(); |
| 136 | let recipient_address = sub_matches.get_one::<String>("RECIPIENT_ADDRESS").unwrap(); |
| 137 | let amount: Amount = Amount::from_sat(amount.parse::<u64>().unwrap()); |
| 138 | let outpoint = self |
| 139 | .generate_stub_outpoint( |
| 140 | &self.client, |
| 141 | &generate_pay_to_pubkey_script_address(self.network, depositor_public_key), |
| 142 | amount, |
| 143 | ) |
| 144 | .await; |
| 145 | let result = self.client.generate_presign_pegin_deposit_tx( |
| 146 | self.network, |
| 147 | amount, |
| 148 | recipient_address, |
| 149 | depositor_public_key, |
| 150 | outpoint, |
| 151 | ); |
| 152 | Response::new( |
| 153 | ResponseStatus::OK, |
| 154 | Some(serde_json::to_value(result).unwrap()), |
| 155 | ) |
| 156 | } |
| 157 | |
| 158 | pub fn depositor_command() -> Command { |
| 159 | Command::new("depositor") |
no test coverage detected