Documentation ¶
Index ¶
- Constants
- Variables
- func Address(in string) (string, error)
- func AliasIsHdwalletKey(addressOrAlias string) bool
- func CheckArgs(validNum ...int) cobra.PositionalArgs
- func CompileSolidity(solc string, sourcefiles ...string) (map[string]*compiler.Contract, error)
- func CompileSolidityString(solc, source string) (map[string]*compiler.Contract, error)
- func ConnectToEndpoint(secure bool) (*grpc.ClientConn, error)
- func Decrypt(data, key []byte) ([]byte, error)
- func Encrypt(data, key []byte) ([]byte, error)
- func ExecuteCmd(cmd *cobra.Command, args ...string) (string, error)
- func GetAddress(in string) (string, error)
- func HashSHA256(input []byte) []byte
- func JwtAuth() (jwt metadata.MD, err error)
- func ParseHdwPath(addressOrAlias string) (uint32, uint32, uint32, error)
- func RauToString(amount *big.Int, numDecimals int) string
- func ReadSecretFromStdin() (string, error)
- func StringToIOTX(amount string) (string, error)
- func StringToRau(amount string, numDecimals int) (*big.Int, error)
- func To32Bytes(v interface{}) ([32]byte, error)
- func ToByteSlice(v interface{}) ([]byte, error)
- func TrimHexPrefix(s string) string
- type Solidity
Constants ¶
const ( // IotxDecimalNum defines the number of decimal digits for IoTeX IotxDecimalNum = 18 // GasPriceDecimalNum defines the number of decimal digits for gas price GasPriceDecimalNum = 12 )
Variables ¶
var (
ErrWrongType = errors.New("wrong data type held by interface{}")
)
vars
Functions ¶
func Address ¶
Address returns the address corresponding to alias. if 'in' is an IoTeX address, returns 'in'
func AliasIsHdwalletKey ¶ added in v1.1.3
AliasIsHdwalletKey check whether to use hdwallet key
func CheckArgs ¶ added in v1.1.0
func CheckArgs(validNum ...int) cobra.PositionalArgs
CheckArgs used for check ioctl cmd arg(s)'s num
func CompileSolidity ¶ added in v1.9.0
CompileSolidity compiles all given Solidity source files.
func CompileSolidityString ¶ added in v1.9.0
CompileSolidityString builds and returns all the contracts contained within a source string.
func ConnectToEndpoint ¶
func ConnectToEndpoint(secure bool) (*grpc.ClientConn, error)
ConnectToEndpoint starts a new connection
func Decrypt ¶ added in v1.1.3
Decrypt Takes two strings, data and key. data is the text to be decrypted and the key is the key to use for the decryption. The function will output the resulting plain text string with an error variable.
func Encrypt ¶ added in v1.1.3
Encrypt Takes two string, data and key. data is the text that needs to be encrypted by key. The function will output the resulting crypto text and an error variable.
func ExecuteCmd ¶ added in v0.11.0
ExecuteCmd executes cmd with args, and return system output, e.g., help info, and error
func GetAddress ¶
GetAddress get address from address or alias or context
func HashSHA256 ¶ added in v1.1.3
HashSHA256 will compute a cryptographically useful hash of the input string.
func ParseHdwPath ¶ added in v1.1.3
ParseHdwPath parse hdwallet path
func RauToString ¶
RauToString converts Rau big int into Iotx string
func ReadSecretFromStdin ¶
ReadSecretFromStdin used to safely get password input
func StringToIOTX ¶
StringToIOTX converts Rau string to Iotx string
func StringToRau ¶
StringToRau converts different unit string into Rau big int
func ToByteSlice ¶ added in v1.3.0
ToByteSlice asserts/converts interface{} to []byte
func TrimHexPrefix ¶ added in v1.1.0
TrimHexPrefix removes 0x prefix from a string if it has
Types ¶
type Solidity ¶ added in v1.9.0
type Solidity struct {
Path, Version, FullVersion string
Major, Minor, Patch int
ExtraAllowedPath []string
}
Solidity contains information about the solidity compiler.
func SolidityVersion ¶ added in v1.9.0
SolidityVersion runs solc and parses its version output.
func (*Solidity) CompileFiles ¶ added in v1.9.0
CompileFiles compiles all given Solidity source files.