Skip to main content

MiningWallet

Struct MiningWallet 

Source
pub struct MiningWallet { /* private fields */ }
Expand description

Quantum-safe mining wallet

Implementations§

Source§

impl MiningWallet

Source

pub async fn generate(level: SecurityLevel) -> Result<Self, WalletError>

Generate a new quantum-safe wallet

Source

pub async fn generate_default() -> Result<Self, WalletError>

Generate with default security level (Level 3)

Source

pub fn from_secret_key( secret_key: &[u8], level: SecurityLevel, ) -> Result<Self, WalletError>

Import wallet from secret key

Source

pub async fn import_encrypted( path: &Path, passphrase: &str, ) -> Result<Self, WalletError>

Import wallet from encrypted file

Source

pub fn import_from_bytes( encrypted_data: &[u8], passphrase: &str, ) -> Result<Self, WalletError>

Import wallet from encrypted bytes (in-memory)

Source

pub fn address(&self) -> &str

Get wallet address (0x-prefixed)

Source

pub fn public_key(&self) -> &[u8]

Get public key bytes

Source

pub fn security_level(&self) -> SecurityLevel

Get security level

Source

pub fn set_label(&mut self, label: impl Into<String>)

Set wallet label

Source

pub fn label(&self) -> Option<&str>

Get wallet label

Source

pub async fn sign(&self, message: &[u8]) -> Result<Vec<u8>, WalletError>

Sign a message with ML-DSA

Source

pub async fn sign_transaction( &self, tx_hash: &[u8; 32], ) -> Result<Vec<u8>, WalletError>

Sign a transaction hash

Source

pub fn export_encrypted( &self, path: &Path, passphrase: &str, ) -> Result<(), WalletError>

Export encrypted wallet to file

Source

pub fn export_to_bytes(&self, passphrase: &str) -> Result<Vec<u8>, WalletError>

Export wallet to encrypted bytes (in-memory)

Source

pub async fn register_miner( &self, ledger: &MiningLedger, capabilities: &[u8], stats: &PerformanceStats, ) -> Result<String, WalletError>

Register as a miner on the ledger

Source

pub async fn submit_proof( &self, ledger: &MiningLedger, reward_type: MiningRewardType, proof: &[u8], ) -> Result<String, WalletError>

Submit a mining proof

Source

pub async fn claim_rewards( &self, ledger: &MiningLedger, amount: u128, recipient: Option<&str>, ) -> Result<String, WalletError>

Claim mining rewards

Source

pub async fn teleport_to_evm( &self, ledger: &MiningLedger, destination: TeleportDestination, amount: u128, to_address: Option<&str>, ) -> Result<TeleportTransfer, WalletError>

Teleport AI coins to an EVM chain

Source

pub async fn get_pending_rewards( &self, ledger: &MiningLedger, ) -> Result<u128, WalletError>

Get pending rewards from ledger

Source

pub async fn get_evm_balance( &self, chain: TeleportDestination, ) -> Result<u128, WalletError>

Get EVM balance (after teleport)

Source

pub fn verify( public_key: &[u8], message: &[u8], signature: &[u8], level: SecurityLevel, ) -> Result<bool, WalletError>

Verify a signature

Trait Implementations§

Source§

impl Drop for MiningWallet

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,