From d6f1a594f52ac2c6b428d68ae1230575e7655cfa Mon Sep 17 00:00:00 2001 From: Krzysztof Tomecki <152964795+chris-4chain@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:45:13 +0100 Subject: [PATCH 1/2] feat(BUX-641): AdminGetSharedConfig --- transports/http_admin.go | 12 ++++++++++++ transports/interface.go | 1 + 2 files changed, 13 insertions(+) diff --git a/transports/http_admin.go b/transports/http_admin.go index 9942c64..ecfd0cd 100644 --- a/transports/http_admin.go +++ b/transports/http_admin.go @@ -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 +} diff --git a/transports/interface.go b/transports/interface.go index c3127a2..4add341 100644 --- a/transports/interface.go +++ b/transports/interface.go @@ -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 From fece60668ec26231a9f1e45cae70cbeeee8c2fdf Mon Sep 17 00:00:00 2001 From: Krzysztof Tomecki <152964795+chris-4chain@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:57:07 +0100 Subject: [PATCH 2/2] feat(BUX-641): update to new version of models --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 77cc259..c03ad97 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/bitcoin-sv/spv-wallet-go-client go 1.21 require ( - github.com/bitcoin-sv/spv-wallet/models v0.15.0 + github.com/bitcoin-sv/spv-wallet/models v0.20.0 github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 github.com/libsv/go-bk v0.1.6 github.com/libsv/go-bt/v2 v2.2.5 diff --git a/go.sum b/go.sum index c533668..e712f6a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/bitcoin-sv/spv-wallet/models v0.15.0 h1:qMp5mqmfaPpstNmltZ22uAtJrqjhHd+I0h/InaWHo0w= -github.com/bitcoin-sv/spv-wallet/models v0.15.0/go.mod h1:P8vXF1mPg1Zh3xSvB9yqwuPJfOR8Tt/SAG2FYztwENI= +github.com/bitcoin-sv/spv-wallet/models v0.20.0 h1:rBVsmtrE7bmP7ieaAXowRWhvptQVU/R/DMS5F70qRX4= +github.com/bitcoin-sv/spv-wallet/models v0.20.0/go.mod h1:P8vXF1mPg1Zh3xSvB9yqwuPJfOR8Tt/SAG2FYztwENI= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5/go.mod h1:JjO1ivfZv6vhK0uAXzyH08AAHlzNMAfnyK1Fiv9r4ZA= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo=