Function miden_lib::notes::create_p2idr_note
source · pub fn create_p2idr_note<R: FeltRng>(
sender: AccountId,
target: AccountId,
assets: Vec<Asset>,
note_type: NoteType,
aux: Felt,
recall_height: u32,
rng: &mut R,
) -> Result<Note, NoteError>Expand description
Generates a P2IDR note - pay to id with recall after a certain block height.
This script enables the transfer of assets from the sender sender account to the target
account by specifying the target’s account ID. Additionally it adds the possibility for the
sender to reclaiming the assets if the note has not been consumed by the target within the
specified timeframe.
The passed-in rng is used to generate a serial number for the note. The returned note’s tag
is set to the target’s account ID.
§Errors
Returns an error if deserialization or compilation of the P2IDR script fails.