pub struct MiningBridge { /* private fields */ }Expand description
Mining Bridge - connects wallet, ledger, and teleport
Implementations§
Source§impl MiningBridge
impl MiningBridge
Sourcepub async fn with_wallet(wallet: MiningWallet) -> Result<Self, BridgeError>
pub async fn with_wallet(wallet: MiningWallet) -> Result<Self, BridgeError>
Initialize with an existing wallet
Sourcepub async fn generate_new(
security_level: SecurityLevel,
) -> Result<Self, BridgeError>
pub async fn generate_new( security_level: SecurityLevel, ) -> Result<Self, BridgeError>
Generate a new quantum-safe wallet and initialize the bridge
Sourcepub async fn import_wallet(
encrypted_data: &[u8],
passphrase: &str,
) -> Result<Self, BridgeError>
pub async fn import_wallet( encrypted_data: &[u8], passphrase: &str, ) -> Result<Self, BridgeError>
Import wallet from encrypted data
Sourcepub async fn connect_ledger(
&self,
ledger: MiningLedger,
) -> Result<(), BridgeError>
pub async fn connect_ledger( &self, ledger: MiningLedger, ) -> Result<(), BridgeError>
Connect to the Lux consensus ledger
Sourcepub async fn account(&self) -> Option<MiningAccount>
pub async fn account(&self) -> Option<MiningAccount>
Get the current account state
Sourcepub async fn public_key(&self) -> Option<Vec<u8>>
pub async fn public_key(&self) -> Option<Vec<u8>>
Get wallet’s public key for verification
Sourcepub async fn register_miner(
&self,
capabilities: &[u8],
stats: &PerformanceStats,
) -> Result<String, BridgeError>
pub async fn register_miner( &self, capabilities: &[u8], stats: &PerformanceStats, ) -> Result<String, BridgeError>
Register as a miner on the ledger
Sourcepub async fn submit_mining_proof(
&self,
reward_type: MiningRewardType,
proof: &[u8],
) -> Result<String, BridgeError>
pub async fn submit_mining_proof( &self, reward_type: MiningRewardType, proof: &[u8], ) -> Result<String, BridgeError>
Submit mining proof for rewards
Sourcepub async fn claim_rewards(&self, amount: u128) -> Result<String, BridgeError>
pub async fn claim_rewards(&self, amount: u128) -> Result<String, BridgeError>
Claim pending rewards from the ledger
Sourcepub async fn teleport_to_evm(
&self,
destination: TeleportDestination,
amount: u128,
recipient: Option<String>,
) -> Result<TeleportTransfer, BridgeError>
pub async fn teleport_to_evm( &self, destination: TeleportDestination, amount: u128, recipient: Option<String>, ) -> Result<TeleportTransfer, BridgeError>
Teleport mining rewards to an EVM chain
This creates a cross-chain transfer from the AI protocol to a supported EVM:
- Lux C-Chain (96369)
- Zoo EVM (200200)
- Hanzo EVM (36963)
Sourcepub async fn get_teleport_status(
&self,
teleport_id: &str,
) -> Option<TeleportTransfer>
pub async fn get_teleport_status( &self, teleport_id: &str, ) -> Option<TeleportTransfer>
Get teleport transfer status
Sourcepub async fn pending_teleports(&self) -> Vec<TeleportTransfer>
pub async fn pending_teleports(&self) -> Vec<TeleportTransfer>
List all pending teleport transfers
Sourcepub async fn verify_teleport_completion(
&self,
teleport_id: &str,
) -> Result<bool, BridgeError>
pub async fn verify_teleport_completion( &self, teleport_id: &str, ) -> Result<bool, BridgeError>
Verify a teleport completed on the destination EVM chain
Sourcepub async fn export_wallet(
&self,
passphrase: &str,
) -> Result<Vec<u8>, BridgeError>
pub async fn export_wallet( &self, passphrase: &str, ) -> Result<Vec<u8>, BridgeError>
Export wallet for backup
Sourcepub async fn get_stats(&self) -> BridgeStats
pub async fn get_stats(&self) -> BridgeStats
Get mining statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MiningBridge
impl !RefUnwindSafe for MiningBridge
impl Send for MiningBridge
impl Sync for MiningBridge
impl Unpin for MiningBridge
impl UnsafeUnpin for MiningBridge
impl !UnwindSafe for MiningBridge
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