taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[feature]: persist payment+invoice HTLC custom wire records and return them in RPCs

Open lukegao209 opened this issue 6 months ago • 8 comments

[Maintainer edit: Depends on lightningnetwork/lnd/issues/8769] [Maintainer edit]: TODO

  • [ ] extend itests in litd to ensure this property holds

Is your feature request related to a problem? Please describe. When using stable-coins to pay a regular BTC invoice, the user is effectively selling stable-coins and buying BTC. However, the current sendPayment interface does not return the amount of stable-coins sold, making it difficult for the Edge Node to maintain its balance and perform reconciliation. This is nearly the final step required for the Edge Node to operate normally. hope this can be addressed with high priority by:

  1. Having the sendPayment API return SendPaymentResponse_AcceptedSellOrder, and
  2. Providing an query api to retrieve historical information
type SendPaymentResponse struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// Types that are assignable to Result:
	//
	//	*SendPaymentResponse_AcceptedSellOrder
	//	*SendPaymentResponse_PaymentResult
	Result isSendPaymentResponse_Result `protobuf_oneof:"result"`
}
for {
		select {
		case <-ctx.Done():
			return ctx.Err()

		case <-r.quit:
			return fmt.Errorf("server shutting down")

		default:
		}

		update, err := updateStream.Recv()
		if err != nil {
			return err
		}

		err = stream.Send(&tchrpc.SendPaymentResponse{
			Result: &tchrpc.SendPaymentResponse_PaymentResult{
				PaymentResult: update,
			},
		})
		if err != nil {
			return err
		}
	}

lukegao209 avatar Aug 19 '24 07:08 lukegao209