Skip to content

Commit

Permalink
fix: update go wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Kodylow committed Oct 9, 2024
1 parent eef0b65 commit 8fac0b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions wrappers/fedimint-go/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions wrappers/fedimint-go/pkg/fedimint/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 0 additions & 4 deletions wrappers/fedimint-go/pkg/fedimint/types/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,4 @@ type JoinResponse struct {
FederationIds []string `json:"federationIds"`
}

type DiscoverVersionRequest struct {
Threshold uint16 `json:"threshold"`
}

type FedimintResponse map[string]interface{}
5 changes: 1 addition & 4 deletions wrappers/fedimint-go/pkg/fedimint/types/modules/onchain.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 8fac0b6

Please sign in to comment.