mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-03 12:06:17 -04:00
Add functionality to open monero wallet through rpc
This commit is contained in:
parent
62605a318a
commit
dac4443bbd
3 changed files with 47 additions and 2 deletions
|
@ -207,6 +207,11 @@ pub trait CreateWalletForOutput {
|
|||
) -> anyhow::Result<()>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait OpenWallet {
|
||||
async fn open_wallet(&self, file_name: &str) -> anyhow::Result<()>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait CreateWallet {
|
||||
async fn create_wallet(&self, file_name: &str) -> anyhow::Result<()>;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::monero::{
|
||||
Amount, CreateWallet, CreateWalletForOutput, InsufficientFunds, PrivateViewKey, PublicViewKey,
|
||||
Transfer, TransferProof, TxHash, WatchForTransfer,
|
||||
Amount, CreateWallet, CreateWalletForOutput, InsufficientFunds, OpenWallet, PrivateViewKey,
|
||||
PublicViewKey, Transfer, TransferProof, TxHash, WatchForTransfer,
|
||||
};
|
||||
use ::monero::{Address, Network, PrivateKey, PublicKey};
|
||||
use anyhow::Result;
|
||||
|
@ -94,6 +94,14 @@ impl CreateWalletForOutput for Wallet {
|
|||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl OpenWallet for Wallet {
|
||||
async fn open_wallet(&self, file_name: &str) -> Result<()> {
|
||||
self.inner.open_wallet(file_name).await?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl CreateWallet for Wallet {
|
||||
async fn create_wallet(&self, file_name: &str) -> Result<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue