github.com/iotexproject/iotex-core@v1.14.1-rc1/ioctl/newcmd/contract/contractinvoke.go (about) 1 // Copyright (c) 2022 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, 3 // merchantability or fitness for purpose and, to the extent permitted by law, 4 // all liability for your use of the code is disclaimed. This source code is governed by Apache 5 // License 2.0 that can be found in the LICENSE file. 6 7 package contract 8 9 import ( 10 "github.com/spf13/cobra" 11 12 "github.com/iotexproject/iotex-core/ioctl" 13 "github.com/iotexproject/iotex-core/ioctl/config" 14 ) 15 16 // Multi-language support 17 var ( 18 _invokeCmdShorts = map[config.Language]string{ 19 config.English: "Invoke smart contract on IoTeX blockchain", 20 config.Chinese: "调用IoTeX区块链上的智能合约", 21 } 22 ) 23 24 // NewContractInvokeCmd represents the contract invoke command 25 func NewContractInvokeCmd(client ioctl.Client) *cobra.Command { 26 short, _ := client.SelectTranslation(_invokeCmdShorts) 27 28 cmd := &cobra.Command{ 29 Use: "invoke", 30 Short: short, 31 } 32 33 // TODO add sub commands 34 // cmd.AddCommand(NewContractInvokeFunctionCmd) 35 // cmd.AddCommand(NewContractInvokeBytecodeCmd) 36 // action.RegisterWriteCommand(NewContractInvokeFunctionCmd) 37 // action.RegisterWriteCommand(NewContractInvokeBytecodeCmd) 38 return cmd 39 }