Function std::outputs::output_amount
pub fn output_amount(index: u64) -> Option<u64>
Expand description
The amount of coins to send to the output at index
.
Additional Information
This method is only meaningful if the Output
type has the amount
field,
specifically: Output::Coin
, Output::Change
& Output::Variable
.
For now, output changes are always guaranteed to have an amount of
zero since they’re only set after execution terminates.
Arguments
index
: [u64] - The index of the output to get the amount of.
Returns
- [Option] - The amount of coins to send to the output at
index
.
Examples
use std::outputs::output_amount;
fn foo() {
let output_amount = output_amount(0);
log(output_amount);
}