1 Star 0 Fork 0

艾鸥科技 / go-aiou

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
transfer.go 970 Bytes
一键复制 编辑 原始数据 按行查看 历史
张卓 提交于 2020-05-10 14:55 . init
package iwallet
import (
"gitee.com/aiou-official/go-aiou/core/global"
"github.com/spf13/cobra"
)
var memo string
var transferCmd = &cobra.Command{
Use: "transfer receiver amount",
Aliases: []string{"trans"},
Short: "Transfer AIOU",
Long: `Transfer AIOU`,
Example: ` iwallet transfer test1 100 --account test0
iwallet transfer test1 100 --account test0 --memo "just for test :D\n中文测试\n😏"`,
Args: func(cmd *cobra.Command, args []string) error {
if err := checkArgsNumber(cmd, args, "receiver", "amount"); err != nil {
return err
}
if err := checkFloat(cmd, args[1], "amount"); err != nil {
return err
}
return checkAccount(cmd)
},
RunE: func(cmd *cobra.Command, args []string) error {
return saveOrSendAction("token.aiou", "transfer", global.Token, accountName, args[0], args[1], memo)
},
}
func init() {
rootCmd.AddCommand(transferCmd)
transferCmd.Flags().StringVarP(&memo, "memo", "", "", "memo of transfer")
}
1
https://gitee.com/aiou-official/go-aiou.git
git@gitee.com:aiou-official/go-aiou.git
aiou-official
go-aiou
go-aiou
376a44096468

搜索帮助