multi: add IsBlinded to lnrpc.Invoice for nicer UX

The BlindedPathConfig struct is nice for invoice creation but when we
use the Invoice message for viewing an invoice, it would be nicer to see
an "is_blinded" field.
This commit is contained in:
Elle Mouton
2024-08-08 14:18:07 +02:00
parent 5a84ca8032
commit 5e84ba92af
9 changed files with 1226 additions and 1175 deletions

View File

@@ -607,9 +607,13 @@
"description": "Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the\ngiven set ID. This field is always populated for AMP invoices, and can be\nused along side LookupInvoice to obtain the HTLC information related to a\ngiven sub-invoice.\nNote: Output only, don't specify for creating an invoice.",
"title": "[EXPERIMENTAL]:"
},
"is_blinded": {
"type": "boolean",
"description": "Signals that the invoice should include blinded paths to hide the true\nidentity of the recipient."
},
"blinded_path_config": {
"$ref": "#/definitions/lnrpcBlindedPathConfig",
"description": "Signals that the invoice should include blinded paths to hide the true\nidentity of the recipient."
"description": "Config values to use when creating blinded paths for this invoice. These\ncan be used to override the defaults config values provided in by the\nglobal config. This field is only used if is_blinded is true."
}
}
},

View File

@@ -176,6 +176,7 @@ func CreateRPCInvoice(invoice *invoices.Invoice,
IsKeysend: invoice.IsKeysend(),
PaymentAddr: invoice.Terms.PaymentAddr[:],
IsAmp: invoice.IsAMP(),
IsBlinded: invoice.IsBlinded(),
}
rpcInvoice.AmpInvoiceState = make(map[string]*lnrpc.AMPInvoiceState)