Skip to main content

Check Unlock Conditions

Outputs may have multiple UnlockConditions, which may require returning some or all of the transferred amount. The outputs could also expire if not claimed in time, or may not be unlockable for a predefined period.

Code Example

The following example will:

  1. Create an account manager.
  2. Get Alice's account which was created in the first guide.
  3. Check if an output has only an address unlock condition and that the address is from the account.
Dotenv

This example uses dotenv, which is not safe for use in production environments.

wallet/examples/17_check_unlock_conditions.rs
loading...

Run the example by running the following command:

cargo run --example check_unlock_conditions --release

Expected Output

The output has only an address unlock condition and the address is from the account: true