mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
added 'deposit' to rpc
This commit is contained in:
@@ -64,6 +64,12 @@ impl RpcAdapter {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn deposit(&self) -> Result<()> {
|
||||
debug!(target: "deposit", "deposit: START");
|
||||
let (public, private) = self.wallet.key_gen();
|
||||
self.wallet.put_keypair(public, private)?;
|
||||
Ok(())
|
||||
}
|
||||
//pub async fn walletdb(&self) -> WalletPtr {
|
||||
// self.wallet.clone();
|
||||
//}
|
||||
|
||||
@@ -238,6 +238,14 @@ impl RpcInterface {
|
||||
}
|
||||
});
|
||||
|
||||
let self1 = self.clone();
|
||||
io.add_method("deposit", move |_| {
|
||||
let self2 = self1.clone();
|
||||
async move {
|
||||
Ok(jsonrpc_core::Value::String("Initiating deposit... ".into()))
|
||||
}
|
||||
});
|
||||
|
||||
io.add_method("transfer", |params: jsonrpc_core::Params| async move {
|
||||
let parsed: TransferParams = params.parse().unwrap();
|
||||
println!("test transfer params: {:?}", parsed);
|
||||
|
||||
Reference in New Issue
Block a user