Skip to content

Commit

Permalink
Merge pull request #202 from bitcoin-sv/feat-641-shared-config
Browse files Browse the repository at this point in the history
feat(BUX-641): AdminGetSharedConfig
  • Loading branch information
chris-4chain authored Mar 13, 2024
2 parents 8591852 + fece606 commit 7f45633
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions transports/http_admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,15 @@ func (h *TransportHTTP) AdminRecordTransaction(ctx context.Context, hex string)

return &transaction, nil
}

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

return model, nil
}
1 change: 1 addition & 0 deletions transports/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type AdminService interface {
AdminGetXPubs(ctx context.Context, conditions map[string]interface{}, metadata *models.Metadata, queryParams *QueryParams) ([]*models.Xpub, ResponseError)
AdminGetXPubsCount(ctx context.Context, conditions map[string]interface{}, metadata *models.Metadata) (int64, ResponseError)
AdminRecordTransaction(ctx context.Context, hex string) (*models.Transaction, ResponseError)
AdminGetSharedConfig(ctx context.Context) (*models.SharedConfig, ResponseError)
}

// TransportService the transport service interface
Expand Down

0 comments on commit 7f45633

Please sign in to comment.