|
|
@@ -11,6 +11,7 @@ use sqlx::{
|
|
|
|
|
|
use crate::{
|
|
|
crypto::{
|
|
|
+ address::Address,
|
|
|
coin::Coin,
|
|
|
keypair::{Keypair, PublicKey, SecretKey},
|
|
|
merkle_node::MerkleNode,
|
|
|
@@ -161,6 +162,13 @@ impl WalletDb {
|
|
|
|
|
|
Ok(Keypair { secret, public })
|
|
|
}
|
|
|
+
|
|
|
+ pub async fn get_default_address(&self) -> Result<Address> {
|
|
|
+ debug!("Returning default address");
|
|
|
+ let keypair = self.get_default_keypair().await?;
|
|
|
+
|
|
|
+ Ok(Address::from(keypair.public))
|
|
|
+ }
|
|
|
|
|
|
pub async fn get_keypairs(&self) -> Result<Vec<Keypair>> {
|
|
|
debug!("Returning keypairs");
|