Skip to content

Commit

Permalink
feat(SPV-1225): add admin confirmation for contacts (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmkowalski authored Dec 11, 2024
1 parent 027902f commit 3d7a6f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,20 @@ func (wc *WalletClient) AdminRejectContact(ctx context.Context, id string) (*mod
return &contact, WrapError(err)
}

// AdminConfirmContacts executes an HTTP POST request to confirm a contact using their xPubs IDs and paymails.
func (wc *WalletClient) AdminConfirmContacts(ctx context.Context, paymailA, paymailB string) error {
jsonStr, err := json.Marshal(map[string]interface{}{
"paymailA": paymailA,
"paymailB": paymailB,
})
if err != nil {
return WrapError(err)
}

err = wc.doHTTPRequest(ctx, http.MethodPost, "/admin/contacts/confirmations", jsonStr, wc.adminXPriv, true, nil)
return WrapError(err)
}

// FinalizeTransaction will finalize the transaction
func (wc *WalletClient) FinalizeTransaction(draft *models.DraftTransaction) (string, error) {
res, err := GetSignedHex(draft, wc.xPriv)
Expand Down

0 comments on commit 3d7a6f8

Please sign in to comment.