From 75f27cc03cae6cc1e3ec662dbb39258e17b41c90 Mon Sep 17 00:00:00 2001 From: Nazarii-4chain Date: Thu, 23 May 2024 12:24:02 +0300 Subject: [PATCH] feat(SPV-807): changes shared config url --- http.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/http.go b/http.go index 7f12cfb..fdde06a 100644 --- a/http.go +++ b/http.go @@ -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 @@ -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{}{