Commit 8ca7f491 authored by linj's avatar linj Committed by vipwzw

兼容老版本, token 作为 资产的默认值

parent 39d35cae
......@@ -465,6 +465,7 @@ func addTokenSellFlags(cmd *cobra.Command) {
cmd.Flags().Float64P("total", "t", 0, "total tokens to be sold")
cmd.MarkFlagRequired("total")
cmd.Flags().StringP("asset_exec", "e", "", "asset exec, default: token")
cmd.Flags().StringP("price_exec", "", "", "price exec")
cmd.Flags().StringP("price_symbol", "", "", "price symbol")
}
......@@ -478,6 +479,10 @@ func tokenSell(cmd *cobra.Command, args []string) {
total, _ := cmd.Flags().GetFloat64("total")
priceExec, _ := cmd.Flags().GetString("price_exec")
priceSymbol, _ := cmd.Flags().GetString("price_symbol")
exec, _ := cmd.Flags().GetString("asset_exec")
if exec == "" {
exec = "token"
}
priceInt64 := int64(price * 1e4)
feeInt64 := int64(fee * 1e4)
......@@ -489,7 +494,7 @@ func tokenSell(cmd *cobra.Command, args []string) {
PricePerBoardlot: priceInt64 * 1e4,
TotalBoardlot: totalInt64,
Fee: feeInt64 * 1e4,
AssetExec: "token",
AssetExec: exec,
PriceExec: priceExec,
PriceSymbol: priceSymbol,
}
......
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