mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-27 09:15:15 +00:00
cmd: fix transfer-history command initialization
This commit is contained in:
parent
6591ffad60
commit
99e1cfc873
|
@ -47,19 +47,9 @@ var TransferHistoryCmd = &cobra.Command{
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
configFile, err := cmd.Flags().GetString("config")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
userConfig, err := bbgo.Load(configFile, false)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
environ := bbgo.NewEnvironment()
|
environ := bbgo.NewEnvironment()
|
||||||
if err := bbgo.BootstrapEnvironment(ctx, environ, userConfig); err != nil {
|
|
||||||
|
if err := environ.ConfigureExchangeSessions(userConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,10 +97,13 @@ var TransferHistoryCmd = &cobra.Command{
|
||||||
return fmt.Errorf("exchange session %s does not implement transfer service", sessionName)
|
return fmt.Errorf("exchange session %s does not implement transfer service", sessionName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logrus.Infof("querying deposit history...")
|
||||||
|
|
||||||
deposits, err := exchange.QueryDepositHistory(ctx, asset, since, until)
|
deposits, err := exchange.QueryDepositHistory(ctx, asset, since, until)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, d := range deposits {
|
for _, d := range deposits {
|
||||||
records = append(records, timeRecord{
|
records = append(records, timeRecord{
|
||||||
Record: d,
|
Record: d,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user