Skip to main content

Installation

Install the package:
go get github.com/tradewatch-io/go-sdk
Add the following import to your code:
import tradewatch "github.com/tradewatch-io/go-sdk"

Usage

package main

import (
	"context"
	"fmt"
	"os"
	tradewatch "github.com/tradewatch-io/go-sdk"
)

func main() {
	limit := int32(56) // int32 |  (optional)
	interval := *tradewatch.NewAccountUsageStatisticsInterval() // AccountUsageStatisticsInterval |  (optional)

	configuration := tradewatch.NewConfiguration()
	apiClient := tradewatch.NewAPIClient(configuration)
	resp, r, err := apiClient.AccountAPI.GetUsage(context.Background()).Limit(limit).Interval(interval).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AccountAPI.GetUsage``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetUsage`: AccountUsageStatistics
	fmt.Fprintf(os.Stdout, "Response from `AccountAPI.GetUsage`: %v\n", resp)
}

More Examples

Find more examples in our GitHub repository.