VCMinerWalletChanged
Skip to content
mnscript
VCMinerWalletChanged(VCMiner, string, bool) 

Description ​

Invoked when a connected VCMiner's wallet address changes.

Arguments ​

VCMiner - The VCMiner which changed wallet.
string - The new wallet address
bool - Whether the new wallet is valid or not

Example ​

msc
using Console;
using Event;
using Peripheral;

// Registers an event listener for when a VCMiner's wallet changes.

function OnVCMinerWalletChanged(VCMiner miner, string newWallet, bool isWalletValid){
    Console.WriteLine("A VCMiner wallet changed to "..wallet);

    if(isWalletValid){
        Console.WriteLine("The new wallet is valid!");
    }else{
        Console.WriteLine("The new wallet is NOT valid!");
    }
}

Event.AddListener("VCMinerWalletChanged", "vcminer_stopped", "OnVCMinerWalletChanged");