qbtrade/pkg/datasource/wise
2024-06-27 22:42:38 +08:00
..
client.go first commit 2024-06-27 22:42:38 +08:00
group.go first commit 2024-06-27 22:42:38 +08:00
rate_request_requestgen.go first commit 2024-06-27 22:42:38 +08:00
rate_request.go first commit 2024-06-27 22:42:38 +08:00
rate.go first commit 2024-06-27 22:42:38 +08:00
README.md first commit 2024-06-27 22:42:38 +08:00
time.go first commit 2024-06-27 22:42:38 +08:00

Wise

Wise API Docs

c := wise.NewClient()
c.Auth(os.Getenv("WISE_TOKEN"))

ctx := context.Background()
rates, err := c.QueryRate(ctx, "USD", "TWD")
if err != nil {
    panic(err)
}
fmt.Printf("%+v\n", rates)

// or
now := time.Now()
rates, err = c.QueryRateHistory(ctx, "USD", "TWD", now.Add(-time.Hour*24*7), now, types.Interval1h)
if err != nil {
    panic(err)
}
for _, rate := range rates {
    fmt.Printf("%+v\n", rate)
}