Skip to content

Commit

Permalink
feat(SPV-807): changes shared config url
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazarii-4chain committed May 23, 2024
1 parent 474ab3e commit 75f27cc
Showing 1 changed file with 12 additions and 12 deletions.
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
}

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.Contact, ResponseError) {
jsonStr, err := json.Marshal(map[string]interface{}{
Expand Down

0 comments on commit 75f27cc

Please sign in to comment.