Skip to main content

shielded_sent_output_recipient

Function shielded_sent_output_recipient 

Source
pub fn shielded_sent_output_recipient<P, Output, E>(
    params: &P,
    output: &Output,
    funding_account: Option<Output::AccountId>,
    select_receiving_address: impl FnOnce(Output::AccountId, &Receiver) -> Result<Option<ZcashAddress>, E>,
) -> Result<Option<SentOutput<Output::AccountId>>, E>
where P: Parameters, Output: ReceivedShieldedOutput, Output::AccountId: Copy,
Expand description

Returns the account to record as having sent a decrypted shielded output, the recipient to record against it, and its value; or None where the wallet has no send to record.

An output recovered with an outgoing viewing key is a send from the account holding that key to an external recipient. One decrypted with an account’s internal key is a transfer within that account. One decrypted with an account’s external key is a send only when a wallet account is known to have funded the transaction, and is then recorded as a transfer to the receiving account, carrying the address it paid even though that address is external.

A recipient outside the wallet is reported at the wallet address containing the paid receiver where select_receiving_address finds one, and at the receiver’s own encoding otherwise. select_receiving_address is consulted only for an output that names a recipient address: an outgoing output, and an incoming output of a transaction with a known funding account.

§Panics

Panics if output reports TransferType::WalletInternal, which is produced only for transparent outputs.