Struct mainnet_lib::wallet::CardanoWallet
source · pub struct CardanoWallet {
catalyst: Wallet,
stake_key: PrivateKey,
payment_key: PrivateKey,
network: NetworkInfo,
stake: u64,
}
Expand description
Represents Cardano mainnet wallet which is able to generate registration transaction metadata
Fields§
§catalyst: Wallet
§stake_key: PrivateKey
§payment_key: PrivateKey
§network: NetworkInfo
§stake: u64
Implementations§
source§impl CardanoWallet
impl CardanoWallet
sourcepub fn new(stake: u64) -> Self
pub fn new(stake: u64) -> Self
Creates new wallet with given ada. Currently wallet is purely used for testing purposes, therefore we treat stake as arbitrary number not connected to any blockchain state.
Panics
Panics on key generation error
sourcepub fn new_with_rng<T: RngCore + CryptoRng>(stake: u64, rng: T) -> Self
pub fn new_with_rng<T: RngCore + CryptoRng>(stake: u64, rng: T) -> Self
Creates new wallet with given ada and rng. Currently wallet is purely used for testing purposes, therefore we treat stake as arbitrary number not connected to any blockchain state.
Panics
Panics on key generation error
sourcepub fn reward_address(&self) -> RewardAddress
pub fn reward_address(&self) -> RewardAddress
Rewards address based on stake public key
sourcepub fn stake_credential(&self) -> StakeCredential
pub fn stake_credential(&self) -> StakeCredential
Stake address based on stake public key
sourcepub fn payment_credential(&self) -> StakeCredential
pub fn payment_credential(&self) -> StakeCredential
Payment address based on stake public key
sourcepub fn stake_public_key(&self) -> PublicKey
pub fn stake_public_key(&self) -> PublicKey
Cardano stake public key
sourcepub fn catalyst_secret_key(&self) -> SecretKey<Ed25519Extended>
pub fn catalyst_secret_key(&self) -> SecretKey<Ed25519Extended>
Catalyst secret key
sourcepub fn catalyst_public_key(&self) -> Identifier
pub fn catalyst_public_key(&self) -> Identifier
Catalyst public key
sourcepub fn catalyst_address(&self) -> Address
pub fn catalyst_address(&self) -> Address
Catalyst address
sourcepub fn generate_voting_registration(
&self,
delegations: Delegations,
slot_no: u64
) -> Transaction
pub fn generate_voting_registration( &self, delegations: Delegations, slot_no: u64 ) -> Transaction
Creates voting registration metadata according to Cip-36 on given absolut slot number
and based on Delegations
object which can be either legacy or delegation.
sourcepub fn generate_delegated_voting_registration(
&self,
delegations: Vec<(Identifier, u32)>,
slot_no: u64
) -> Transaction
pub fn generate_delegated_voting_registration( &self, delegations: Vec<(Identifier, u32)>, slot_no: u64 ) -> Transaction
Creates delegated voting registration metadata according to Cip-36 on given absolut slot number.
sourcepub fn generate_direct_voting_registration(&self, slot_no: u64) -> Transaction
pub fn generate_direct_voting_registration(&self, slot_no: u64) -> Transaction
Creates direct (a.k.a self) voting registration metadata according to Cip-36 on given absolut slot number.
sourcepub fn payment_key(&self) -> &PrivateKey
pub fn payment_key(&self) -> &PrivateKey
private payment key
Trait Implementations§
source§impl MainnetWalletStateBuilder for CardanoWallet
impl MainnetWalletStateBuilder for CardanoWallet
source§fn as_representative(&self) -> MainnetWalletState
fn as_representative(&self) -> MainnetWalletState
source§fn as_direct_voter(&self) -> MainnetWalletState
fn as_direct_voter(&self) -> MainnetWalletState
source§fn as_direct_voter_on_slot_no(&self, slot_no: u64) -> MainnetWalletState
fn as_direct_voter_on_slot_no(&self, slot_no: u64) -> MainnetWalletState
slot_no
source§fn as_delegator(
&self,
delegations: Vec<(&CardanoWallet, u8)>
) -> MainnetWalletState
fn as_delegator( &self, delegations: Vec<(&CardanoWallet, u8)> ) -> MainnetWalletState
source§fn as_delegator_on_slot_no(
&self,
delegations: Vec<(&CardanoWallet, u8)>,
slot_no: u64
) -> MainnetWalletState
fn as_delegator_on_slot_no( &self, delegations: Vec<(&CardanoWallet, u8)>, slot_no: u64 ) -> MainnetWalletState
slot_no
Auto Trait Implementations§
impl RefUnwindSafe for CardanoWallet
impl Send for CardanoWallet
impl Sync for CardanoWallet
impl Unpin for CardanoWallet
impl UnwindSafe for CardanoWallet
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request