From 6089c1609478617b5641324eb0a3605ddcb23e6a Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Wed, 9 Oct 2024 13:12:45 -0700 Subject: [PATCH] fix: update go wrapper --- wrappers/fedimint-go/cmd/main.go | 4 ++-- wrappers/fedimint-go/pkg/fedimint/client.go | 10 ++++------ wrappers/fedimint-go/pkg/fedimint/types/common.go | 4 ---- .../fedimint-go/pkg/fedimint/types/modules/onchain.go | 5 +---- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/wrappers/fedimint-go/cmd/main.go b/wrappers/fedimint-go/cmd/main.go index 25fba0f..2c8b7aa 100644 --- a/wrappers/fedimint-go/cmd/main.go +++ b/wrappers/fedimint-go/cmd/main.go @@ -87,7 +87,7 @@ func main() { // `/v2/admin/discover-version` logMethod("/v2/admin/discover-version") - discoverResponseData, err := fc.DiscoverVersion(1) + discoverResponseData, err := fc.DiscoverVersion(nil) if err != nil { fmt.Println("Error calling VERSION: ", err) return @@ -529,7 +529,7 @@ func main() { // `/v2/onchain/deposit-address` logMethod("/v2/onchain/deposit-address") - addr, err := fc.Onchain.CreateDepositAddress(1000, nil) + addr, err := fc.Onchain.CreateDepositAddress(nil) if err != nil { fmt.Println("Error calling CREATE_DEPOSIT_ADDRESS: ", err) return diff --git a/wrappers/fedimint-go/pkg/fedimint/client.go b/wrappers/fedimint-go/pkg/fedimint/client.go index 13d1f79..85b0ff9 100644 --- a/wrappers/fedimint-go/pkg/fedimint/client.go +++ b/wrappers/fedimint-go/pkg/fedimint/client.go @@ -239,9 +239,8 @@ func (fc *FedimintClient) Backup(metadata *types.BackupRequest, federationId *st return err } -func (fc *FedimintClient) DiscoverVersion(threshold uint16) (*types.FedimintResponse, error) { - request := types.DiscoverVersionRequest{Threshold: threshold} - resp, err := fc.post("/admin/discover-version", request) +func (fc *FedimintClient) DiscoverVersion(federationId *string) (*types.FedimintResponse, error) { + resp, err := fc.postWithFederationId("/admin/discover-version", nil, federationId) if err != nil { return nil, err } @@ -306,9 +305,8 @@ func (fc *FedimintClient) Join(inviteCode string, setActiveFederationId bool, us // Onchain // //////////// -func (onchain *OnchainModule) CreateDepositAddress(timeout int, federationId *string) (*modules.OnchainDepositAddressResponse, error) { - request := modules.OnchainDepositAddressRequest{Timeout: timeout} - resp, err := onchain.Client.postWithFederationId("/onchain/deposit-address", request, federationId) +func (onchain *OnchainModule) CreateDepositAddress(federationId *string) (*modules.OnchainDepositAddressResponse, error) { + resp, err := onchain.Client.postWithFederationId("/onchain/deposit-address", nil, federationId) if err != nil { return nil, err } diff --git a/wrappers/fedimint-go/pkg/fedimint/types/common.go b/wrappers/fedimint-go/pkg/fedimint/types/common.go index 2220db6..e135513 100644 --- a/wrappers/fedimint-go/pkg/fedimint/types/common.go +++ b/wrappers/fedimint-go/pkg/fedimint/types/common.go @@ -53,8 +53,4 @@ type JoinResponse struct { FederationIds []string `json:"federationIds"` } -type DiscoverVersionRequest struct { - Threshold uint16 `json:"threshold"` -} - type FedimintResponse map[string]interface{} diff --git a/wrappers/fedimint-go/pkg/fedimint/types/modules/onchain.go b/wrappers/fedimint-go/pkg/fedimint/types/modules/onchain.go index 6c64512..fb17428 100644 --- a/wrappers/fedimint-go/pkg/fedimint/types/modules/onchain.go +++ b/wrappers/fedimint-go/pkg/fedimint/types/modules/onchain.go @@ -1,12 +1,9 @@ package modules -type OnchainDepositAddressRequest struct { - Timeout int `json:"timeout"` -} - type OnchainDepositAddressResponse struct { OperationId string `json:"operationId"` Address string `json:"address"` + TweakIdx int `json:"tweakIdx"` } type OnchainAwaitDepositRequest struct {