pub fn output_type(index: u64) -> Option<Output> 
Expand description

Get the type of an output at index.

Arguments

  • index: [u64] - The index of the output to get the type of.

Returns

  • [Option] - The type of the output at index.

Examples

use std::outputs::output_type;

fn foo() {
    let output_type = output_type(0).unwrap();
    match output_type {
        Output::Coin => { log("The output is a coin") },
        Output::Contract => { log("The output is a contract") },
        Output::Change => { log("The output is change") },
        Output::Variable => { log("The output is a variable") },
        Output::ContractCreated => { log("The output is a contract creation") },
    };
}