bybit.go.api/examples/account/transaction_log.go

23 lines
517 B
Go
Raw Normal View History

2023-11-06 00:55:41 +02:00
package main
import (
"context"
"fmt"
bybit "github.com/wuhewuhe/bybit.go.api"
)
func main() {
PlaceTrade()
}
func PlaceTrade() {
2023-11-06 18:29:28 +02:00
client := bybit.NewBybitHttpClient("YOUR_API_KEY", "YOUR_API_SECRET", bybit.WithBaseURL(bybit.TESTNET))
2023-11-06 01:16:08 +02:00
params := map[string]interface{}{"accountType": "UNIFIED", "category": "linear"}
accountResult, err := client.NewAccountService(params).GetTransactionLog(context.Background())
2023-11-06 00:55:41 +02:00
if err != nil {
fmt.Println(err)
return
}
2023-11-06 01:16:08 +02:00
fmt.Println(bybit.PrettyPrint(accountResult))
2023-11-06 00:55:41 +02:00
}