Function create_p2ide_note

Source
pub fn create_p2ide_note<R: FeltRng>(
    sender: AccountId,
    target: AccountId,
    assets: Vec<Asset>,
    reclaim_height: Option<BlockNumber>,
    timelock_height: Option<BlockNumber>,
    note_type: NoteType,
    aux: Felt,
    rng: &mut R,
) -> Result<Note, NoteError>
Expand description

Generates a P2IDE note - Pay-to-ID note with optional reclaim after a certain block height and optional timelock.

This script enables the transfer of assets from the sender account to the target account by specifying the target’s account ID. It adds the optional possibility for the sender to reclaiming the assets if the note has not been consumed by the target within the specified timeframe and the optional possibility to add a timelock to the asset transfer.

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 P2ID script fails.