provider.makeInvoice
CoreCreate a Fiber invoice that another node can pay.
Signature
function makeInvoice(args: MakeInvoiceArgs): Promise<MakeInvoiceResult>PERMISSION
Requires enable(). Current reference providers do not show a second confirmation prompt for invoice creation.
Parameters
NameTypeDescription
args.amountrequiredHexAmount in the asset's smallest unit, encoded as 0x-prefixed hex.
args.currency"Fibb" | "Fibt" | "Fibd"Fiber invoice network tag. Defaults to Fibt in the reference providers.
args.descriptionstringHuman-readable payment description embedded in the invoice.
args.expiryHexInvoice expiry value accepted by the underlying Fiber node.
Response
NameTypeDescription
invoicerequiredstringEncoded Fiber invoice address.
paymentHashrequiredHexHash associated with the provider-generated payment preimage.
Example
const created = await fiber.makeInvoice({
amount: "0x5f5e100", // 1 CKB in shannons
currency: "Fibt",
description: "Coffee"
});
console.log(created.invoice);Provider behavior
W
WASM node
Generates a random preimage and maps the request to fiber-js newInvoice().
R
Remote fnn
Generates a random preimage in the extension and calls fnn new_invoice over JSON-RPC.
Notes
- The current public arguments model native invoice currency; richer UDT invoice typing is still evolving.