mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Introduce a subaddress capable scanner type
This commit is contained in:
@@ -4,15 +4,10 @@ use thiserror::Error;
|
||||
|
||||
use zeroize::Zeroize;
|
||||
|
||||
use curve25519_dalek::{
|
||||
constants::ED25519_BASEPOINT_TABLE,
|
||||
edwards::{EdwardsPoint, CompressedEdwardsY},
|
||||
};
|
||||
use curve25519_dalek::edwards::{EdwardsPoint, CompressedEdwardsY};
|
||||
|
||||
use base58_monero::base58::{encode_check, decode_check};
|
||||
|
||||
use crate::wallet::ViewPair;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Zeroize)]
|
||||
pub enum Network {
|
||||
Mainnet,
|
||||
@@ -130,16 +125,6 @@ pub struct Address {
|
||||
pub view: EdwardsPoint,
|
||||
}
|
||||
|
||||
impl ViewPair {
|
||||
pub fn address(&self, network: Network, kind: AddressType) -> Address {
|
||||
Address {
|
||||
meta: AddressMeta { network, kind },
|
||||
spend: self.spend,
|
||||
view: &self.view * &ED25519_BASEPOINT_TABLE,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for Address {
|
||||
fn to_string(&self) -> String {
|
||||
let mut data = vec![self.meta.to_byte()];
|
||||
|
||||
Reference in New Issue
Block a user