How do I convert a WalletUnlocked type to an Address or Identity?

Below are examples showing how to convert an unlocked wallet into an Address or Identity type:

use fuels::prelude::*;

// turn an unlocked wallet to an Address
let wallet_address: Address = wallet_unlocked.clone().address().into();

// turn an address into an Identity
let wallet_identity = Identity::Address(wallet_address);

// turn an unlocked wallet into an Identity
let wallet_identity_copy = Identity::Address(wallet_unlocked.address().into());
1 Like