Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SPV-807): shared config #229

Merged
merged 4 commits into from
May 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,18 @@ func (wc *WalletClient) UpsertContactForPaymail(ctx context.Context, paymail, fu
return &result, nil
}

// GetSharedConfig gets the shared config
func (wc *WalletClient) GetSharedConfig(ctx context.Context) (*models.SharedConfig, ResponseError) {
var model *models.SharedConfig
if err := wc.doHTTPRequest(
ctx, http.MethodGet, "/shared-config", nil, wc.xPriv, true, &model,
); err != nil {
return nil, err
}
chris-4chain marked this conversation as resolved.
Show resolved Hide resolved

return model, nil
}

// AdminNewXpub will register an xPub
func (wc *WalletClient) AdminNewXpub(ctx context.Context, rawXPub string, metadata *models.Metadata) ResponseError {
// Adding a xpub needs to be signed by an admin key
Expand Down Expand Up @@ -1012,18 +1024,6 @@ func (wc *WalletClient) AdminRecordTransaction(ctx context.Context, hex string)
return &transaction, nil
}

// AdminGetSharedConfig gets the shared config
func (wc *WalletClient) AdminGetSharedConfig(ctx context.Context) (*models.SharedConfig, ResponseError) {
var model *models.SharedConfig
if err := wc.doHTTPRequest(
ctx, http.MethodGet, "/admin/shared-config", nil, wc.adminXPriv, true, &model,
); err != nil {
return nil, err
}

return model, nil
}

// AdminGetContacts executes an HTTP POST request to search for contacts based on specified conditions, metadata, and query parameters.
func (wc *WalletClient) AdminGetContacts(ctx context.Context, conditions map[string]interface{}, metadata *models.Metadata, queryParams *QueryParams) (*models.SearchContactsResponse, ResponseError) {
jsonStr, err := json.Marshal(map[string]interface{}{
Expand Down
Loading