Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuyCMD = &cobra.Command{ Use: "buy", Short: "Buy order", Run: func(cmd *cobra.Command, args []string) { symbol, _ := cmd.Flags().GetString("symbol") quantity, _ := cmd.Flags().GetString("quantity") price, _ := cmd.Flags().GetString("price") order, err := order.Buy(context.Background(), symbol, quantity, price) if err != nil { fmt.Print(err) } utils.OPrint(order) }, }
listCmd represents the list command
View Source
var GetCmd = &cobra.Command{ Use: "get", Short: "Get order details", Run: func(cmd *cobra.Command, args []string) { symbol, _ := cmd.Flags().GetString("symbol") orderId, _ := cmd.Flags().GetInt64("orderId") order, err := order.Get(context.Background(), symbol, orderId) if err != nil { fmt.Print(err) } utils.OPrint(order) }, }
listCmd represents the list command
View Source
var ListCmd = &cobra.Command{ Use: "list", Short: "List orders", Run: func(cmd *cobra.Command, args []string) { symbol, _ := cmd.Flags().GetString("symbol") all, _ := cmd.Flags().GetBool("all") var orders []*binance.Order var err error if all == true { orders, err = order.List(context.Background(), symbol) } else { orders, err = order.ListOpen(context.Background(), symbol) } if err != nil { fmt.Print(err) } utils.OPrint(orders) }, }
listCmd represents the list command
View Source
var OrderCmd = &cobra.Command{ Use: "order", Short: "Orders operations", Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, }
listCmd represents the list command
View Source
var SellCMD = &cobra.Command{ Use: "sell", Short: "Sell order", Run: func(cmd *cobra.Command, args []string) { symbol, _ := cmd.Flags().GetString("symbol") quantity, _ := cmd.Flags().GetString("quantity") price, _ := cmd.Flags().GetString("price") order, err := order.Sell(context.Background(), symbol, quantity, price) if err != nil { fmt.Print(err) } utils.OPrint(order) }, }
listCmd represents the list command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.