bbgo_origin/examples/kucoin/subaccounts.go

32 lines
591 B
Go
Raw Normal View History

2021-12-10 16:29:02 +00:00
package main
import (
"context"
2021-12-10 16:29:02 +00:00
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
func init() {
rootCmd.AddCommand(subAccountsCmd)
}
2021-12-10 16:29:02 +00:00
var subAccountsCmd = &cobra.Command{
Use: "subaccounts",
Short: "subaccounts",
// SilenceUsage is an option to silence usage when an error occurs.
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
2021-12-31 18:04:20 +00:00
req := client.AccountService.NewListSubAccountsRequest()
subAccounts, err := req.Do(context.Background())
2021-12-10 16:29:02 +00:00
if err != nil {
return err
}
logrus.Infof("subAccounts: %+v", subAccounts)
return nil
},
}