feature: return custom records

This commit is contained in:
kiwiidb
2022-12-28 11:35:00 +01:00
parent 4771e17302
commit be8c129293

View File

@@ -46,6 +46,7 @@ type KeySendResponseBody struct {
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
DescriptionHash string `json:"description_hash,omitempty"` DescriptionHash string `json:"description_hash,omitempty"`
Destination string `json:"destination,omitempty"` Destination string `json:"destination,omitempty"`
CustomRecords map[string]string `json:"customRecords" validate:"omitempty"`
PaymentPreimage string `json:"payment_preimage,omitempty"` PaymentPreimage string `json:"payment_preimage,omitempty"`
PaymentHash string `json:"payment_hash,omitempty"` PaymentHash string `json:"payment_hash,omitempty"`
} }
@@ -118,6 +119,7 @@ func (controller *KeySendController) MultiKeySend(c echo.Context) error {
result.Keysends = append(result.Keysends, KeySendResult{ result.Keysends = append(result.Keysends, KeySendResult{
Keysend: &KeySendResponseBody{ Keysend: &KeySendResponseBody{
Destination: keysend.Destination, Destination: keysend.Destination,
CustomRecords: keysend.CustomRecords,
}, },
Error: err, Error: err,
}) })
@@ -186,6 +188,7 @@ func (controller *KeySendController) SingleKeySend(c echo.Context, reqBody *KeyS
responseBody := &KeySendResponseBody{ responseBody := &KeySendResponseBody{
Amount: sendPaymentResponse.PaymentRoute.TotalAmt, Amount: sendPaymentResponse.PaymentRoute.TotalAmt,
Fee: sendPaymentResponse.PaymentRoute.TotalFees, Fee: sendPaymentResponse.PaymentRoute.TotalFees,
CustomRecords: reqBody.CustomRecords,
Description: reqBody.Memo, Description: reqBody.Memo,
Destination: reqBody.Destination, Destination: reqBody.Destination,
PaymentPreimage: sendPaymentResponse.PaymentPreimageStr, PaymentPreimage: sendPaymentResponse.PaymentPreimageStr,