pub struct Wallet {
pub public_key: SaitoPublicKey,
pub private_key: SaitoPrivateKey,
pub slips: AHashMap<SaitoUTXOSetKey, WalletSlip>,
pub unspent_slips: AHashSet<SaitoUTXOSetKey>,
pub staking_slips: AHashSet<SaitoUTXOSetKey>,
pub filename: String,
pub filepass: String,
pub pending_txs: AHashMap<SaitoHash, Transaction>,
pub wallet_version: Version,
pub core_version: Version,
pub key_list: Vec<SaitoPublicKey>,
pub nfts: Vec<NFT>,
/* private fields */
}
Expand description
The Wallet
manages the public and private keypair of the node and holds the
slips that are used to form transactions on the network.
Fields§
§public_key: SaitoPublicKey
§private_key: SaitoPrivateKey
§slips: AHashMap<SaitoUTXOSetKey, WalletSlip>
§unspent_slips: AHashSet<SaitoUTXOSetKey>
§staking_slips: AHashSet<SaitoUTXOSetKey>
§filename: String
§filepass: String
§pending_txs: AHashMap<SaitoHash, Transaction>
§wallet_version: Version
§core_version: Version
§key_list: Vec<SaitoPublicKey>
§nfts: Vec<NFT>
Implementations§
Source§impl Wallet
impl Wallet
pub fn new(private_key: SaitoPrivateKey, public_key: SaitoPublicKey) -> Wallet
pub async fn load(wallet: &mut Wallet, io: &(dyn InterfaceIO + Send + Sync))
pub async fn save(wallet: &mut Wallet, io: &(dyn InterfaceIO + Send + Sync))
pub async fn reset( &mut self, _storage: &mut Storage, network: Option<&Network>, keep_keys: bool, )
Sourcepub fn serialize_for_disk(&self) -> Vec<u8> ⓘ
pub fn serialize_for_disk(&self) -> Vec<u8> ⓘ
[private_key - 32 bytes] [public_key - 33 bytes]
Sourcepub fn deserialize_from_disk(&mut self, bytes: &[u8])
pub fn deserialize_from_disk(&mut self, bytes: &[u8])
[private_key - 32 bytes] [public_key - 33 bytes]
pub fn on_chain_reorganization( &mut self, block: &Block, lc: bool, genesis_period: BlockId, ) -> WalletUpdateStatus
pub fn delete_block(&mut self, block: &Block) -> WalletUpdateStatus
pub fn remove_old_slips(&mut self, block_id: BlockId)
pub fn add_slip( &mut self, block_id: u64, tx_index: u64, slip: &Slip, lc: bool, network: Option<&Network>, )
pub fn delete_slip(&mut self, slip: &Slip, network: Option<&Network>)
pub fn get_available_balance(&self) -> Currency
pub fn get_unspent_slip_count(&self) -> u64
pub fn generate_slips( &mut self, nolan_requested: Currency, network: Option<&Network>, latest_block_id: u64, genesis_period: u64, ) -> (Vec<Slip>, Vec<Slip>)
pub fn sign(&self, message_bytes: &[u8]) -> SaitoSignature
pub async fn create_bound_transaction( &mut self, nft_input_amount: Currency, nft_uuid_block_id: u64, nft_uuid_transaction_id: u64, nft_uuid_slip_id: u64, nft_create_deposit_amt: Currency, nft_data: Vec<u32>, recipient: &SaitoPublicKey, network: Option<&Network>, latest_block_id: u64, genesis_period: u64, nft_type: String, ) -> Result<Transaction, Error>
pub async fn create_send_bound_transaction( &mut self, nft_amount: Currency, nft_id: Vec<u8>, nft_data: Vec<u32>, recipient_public_key: &SaitoPublicKey, ) -> Result<Transaction, Error>
pub fn create_nft_uuid(input_slip: &Slip, nft_type: &str) -> [u8; 33]
pub async fn create_golden_ticket_transaction( golden_ticket: GoldenTicket, public_key: &SaitoPublicKey, private_key: &SaitoPrivateKey, ) -> Transaction
pub fn add_to_pending(&mut self, tx: Transaction)
pub fn delete_pending_transaction(&mut self, tx: &Transaction) -> bool
pub fn update_from_balance_snapshot( &mut self, snapshot: BalanceSnapshot, network: Option<&Network>, )
pub fn set_key_list(&mut self, key_list: Vec<SaitoPublicKey>)
pub fn create_staking_transaction( &mut self, staking_amount: Currency, latest_unlocked_block_id: BlockId, last_valid_slips_in_block_id: BlockId, ) -> Result<Transaction, Error>
pub fn get_nft_list(&self) -> &[NFT]
Trait Implementations§
impl StructuralPartialEq for Wallet
Auto Trait Implementations§
impl Freeze for Wallet
impl RefUnwindSafe for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnwindSafe for Wallet
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
Mutably borrows from an owned value. Read more