Commit 39d35cae authored by linj's avatar linj Committed by vipwzw

price: update cli

parent bf912b3d
...@@ -464,6 +464,9 @@ func addTokenSellFlags(cmd *cobra.Command) { ...@@ -464,6 +464,9 @@ func addTokenSellFlags(cmd *cobra.Command) {
cmd.Flags().Float64P("total", "t", 0, "total tokens to be sold") cmd.Flags().Float64P("total", "t", 0, "total tokens to be sold")
cmd.MarkFlagRequired("total") cmd.MarkFlagRequired("total")
cmd.Flags().StringP("price_exec", "", "", "price exec")
cmd.Flags().StringP("price_symbol", "", "", "price symbol")
} }
func tokenSell(cmd *cobra.Command, args []string) { func tokenSell(cmd *cobra.Command, args []string) {
...@@ -473,6 +476,8 @@ func tokenSell(cmd *cobra.Command, args []string) { ...@@ -473,6 +476,8 @@ func tokenSell(cmd *cobra.Command, args []string) {
price, _ := cmd.Flags().GetFloat64("price") price, _ := cmd.Flags().GetFloat64("price")
fee, _ := cmd.Flags().GetFloat64("fee") fee, _ := cmd.Flags().GetFloat64("fee")
total, _ := cmd.Flags().GetFloat64("total") total, _ := cmd.Flags().GetFloat64("total")
priceExec, _ := cmd.Flags().GetString("price_exec")
priceSymbol, _ := cmd.Flags().GetString("price_symbol")
priceInt64 := int64(price * 1e4) priceInt64 := int64(price * 1e4)
feeInt64 := int64(fee * 1e4) feeInt64 := int64(fee * 1e4)
...@@ -485,6 +490,8 @@ func tokenSell(cmd *cobra.Command, args []string) { ...@@ -485,6 +490,8 @@ func tokenSell(cmd *cobra.Command, args []string) {
TotalBoardlot: totalInt64, TotalBoardlot: totalInt64,
Fee: feeInt64 * 1e4, Fee: feeInt64 * 1e4,
AssetExec: "token", AssetExec: "token",
PriceExec: priceExec,
PriceSymbol: priceSymbol,
} }
ctx := jsonrpc.NewRPCCtx(rpcLaddr, "trade.CreateRawTradeSellTx", params, nil) ctx := jsonrpc.NewRPCCtx(rpcLaddr, "trade.CreateRawTradeSellTx", params, nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment