Function createInvoice

Creates a new invoice with the given properties, and shares the secret with the caller.

agora.flash.Invoice.InvoicePair createInvoice (
  in ref const(agora.crypto.ECC.Point) destination,
  in const(Amount) amount,
  in const(long) expiry,
  in const(string) description = null
) nothrow @nogc @safe;

Parameters

NameDescription
secret will contain the secret on return
amount the amount to pay
expiry the expiry time
description optional description

Returns

the Invoice

Example

const pair = createInvoice(Point.init, Amount(100), 1611121934, "desc");
assert(pair.secret.hashFull() == pair.invoice.payment_hash);